First version of OCCT without WOK and CDL

Hello,

We are steadily progressing in the refactoring tasks, and now have the first version of OCCT without WOK and CDL ready for review: see Git branch CR0_noCDL. Note that this is the first experimental version, thus please do not try to use it in your project!

Here is some detail on the changes made in this branch.

Removal of generic classes

TCollection instances have been converted to NCollection templates, except a few instances found in nested generic classes -- these are to be converted manually later.

Note that this led to revision of implementation of both collections to have them synchronized, and STL-like iterators have been added in NCollection classes. These changes, as well as removal of many non-collection generics, are already in OCCT master and will be included in 6.8.0

Refactored type system

OCCT type system has been changed to use templates instead of plain C functions defined by macros. The implementation follows the same approach as before: we still use static instances of Standard_Type class to provide meta-data for a class. It is also still necessary to use macro DEFINE_STANDARD_RTTI within the class declaration to have its base class and non-mangled name known to the type system.

Removal of CDLs

CDL files have been removed. The files generated by WOK from CDL (headers and some cxx) have been moved to relevant packages in src. Sub-folders .adm, inc, and drv created by WOK will not be used any more.

Note that header files are now included with package prefix, e.g.:

#include <gp/gp_Pnt.hxx>

Build system

Tools for building with Visual Studio projects is ready. To generate project files, run

genproj.bat

This command does the same job as wgenproj command in WOK. Note that you still need to have file custom.bat to define version of Visual Studio and other build options.

The build time on my machine has decreased to 30 min from 37 min in master branch (yet not accounting additional time needed for WOK extraction).

Further steps

The targets we are going to address during August are:

  • Implement new build system based on CMake
  • Clean up old OCCT persistence -- either remove it completely, or at least get rid of the code generated by WOK, replacing it by more compact and maintainable code
  • Finalize revamping of Handle classes by converting them to templates
  • Prepare guide and tools for migration to the new OCCT

You are welcome to share your opinion and comment on this

Andrey