The basis delivery of Datakit SDK (DatakitLibsAndSampleProject_...) contains :
./SampleSources : Sample source code ./Lib_Include : CrossCAD / Ware SDK includes ./Libs : CrossCAD / Ware SDK libraries ./InputImages : Images for pdf and writers generation ./SampleFiles : CAD / BIM Sample files (Full zip with sample files can be downloaded separately) ./bin : Binaries directory for Cadds Reader
This delivery file adds following files to support conversion to Opencascade Brep Object :
./SampleSources/AllReadersToOccBinaryObject : Sample to fill 3dShape according to the Occ version you use ./Lib_Include/DKOC : Usefull includes for conversion from Dtk_Body to TopoDSShape ./Libs/LibUtilOCC : Additionnal lib LibUtilOCC (independent from occ version ) with depending so files ./Libs/LibSdkOcc : Additionnal lib dependent on the Occ version you use
This archive is meant to link with occ7.7.0. If you use another version of OpenCascad, please download associated LibSdkOcc archive on our website
CMake is required to build the example projects.
You can download the CMake tools from https://cmake.org/download/
Each example must be generated into separate folders. You must set the path of your occ installation directory as en environment variable for linkage and execution :
You can use the CMake GUI or the following command lines to configure projects :
You can build projects :
The executable is created in ./bin directory. Note that you have to use your own Opencascad dll files.
The following command lines can be used to configure projects :
You can build projects :
The built executables are copied to the ./bin directory and must be run from there.
Note that you have to use your own Opencascad so files (using for example export LD_LIBRARY_PATH=MyOCCVersionPath
).
A class DKOC_BodyToOCCBRep is provided to convert a Dtk_Body to a TopoDS_Shape of a target version of OpenCascade. It is based on (1) the conversion tool provided by CrossCADWare (in LibUtilOCC), (2) a function which copies the result to the final TopoDS_Shape.
So this class wraps and enchains :
This object allows the caller to drive the call to ShapeFix. By default, ShapeFix is called, it is the one embedded in the OCC version used in the Datakit libraries. It can be switched on/off, hence the user can call for instance the ShapeFix of the target OCC version, etc.
WARNING : in practice, it is necessary to call ShapeFix to have a TopoDS_Shape ready to use.
MAPPING : this object keeps the mapping between the initial items of the Dtk_Body (for instance Dtk_Face, etc) and the resulting TopoDS_Shape's of OpenCascade.
The Root Shape is the final result of the whole conversion of the Dtk_Body Each sub-shape is attached to an internal ID, specific of this conversion (by the object DKOC_BodyToOCCBRep) This ID is mapped to the ID coming from the CAD model (recorded in the Dtk_Info of the item of the Dtk_Body) Hence, it is possible to query the Dtk_Body to get the corresponding entity and read its attributes (name, color, etc)
Calls to methods of DKOC_BodyToOCCBRep
If not called, the default mode is 1.
res is NULL if ConvertBody has failed (see return status not null).
for a sub-shape, its ID of conversion :
For an ID of conversion, get the ID if the CAD model :
dtk_id can be 0 if this TopoDS_Shape has been added (not in the initial model, example : degenerated edge, seam edge, etc) then the Dtk_Body can be queried with this ID to get the Dtk_Entity it comes from and query this Dtk_Entity (for color, etc)