  | 
  
    DATAKIT API
    V2025.4
    
   
   | 
           
 | 
 
 
 
 
Set of sample functions to write specific data into a .stp file.  
More...
 | 
| Dtk_AxisSystemPtr  | CreateAxisSystem () | 
|   | 
| Dtk_LayerInfosSetPtr  | CreateLayerInfosSet () | 
|   | 
| void  | CreateTransforms (Dtk_transfo &outFirst, Dtk_transfo &outSecond, Dtk_transfo &outThird) | 
|   | 
| DtkErrorStatus  | WriteAssembly (const Dtk_string &inRootAssemblyName) | 
|   | 
| DtkErrorStatus  | WriteAssembly_BasicExternalReference_DimensionFDT (const Dtk_string &inRootAssemblyName) | 
|   | 
| DtkErrorStatus  | WriteAssembly_BasicExternalReferences (const Dtk_string &inRootAssemblyName) | 
|   | 
| DtkErrorStatus  | WriteAssembly_DimensionFDT (const Dtk_string &inRootAssemblyName) | 
|   | 
| DtkErrorStatus  | WriteAssembly_InstanceAttributes (const Dtk_string &inRootAssemblyName) | 
|   | 
| DtkErrorStatus  | WriteAssembly_NestedExternalReferences (const Dtk_string &inRootAssemblyName) | 
|   | 
| DtkErrorStatus  | WriteAssembly_WithProperties (const Dtk_string &inRootAssemblyName) | 
|   | 
| DtkErrorStatus  | WritePart_BodyAndMeshFromTessellation (const Dtk_string &inPartName, int &outPartID) | 
|   | 
| DtkErrorStatus  | WritePart_BodyInNamedLayer (const Dtk_string &inPartName, int &outPartID) | 
|   | 
| DtkErrorStatus  | WritePart_BodyOnly (const Dtk_string &inPartName, int &outPartID) | 
|   | 
| DtkErrorStatus  | WritePart_BodyWithAxisSystem (const Dtk_string &inPartName, int &outPartID) | 
|   | 
| DtkErrorStatus  | WritePart_Datum (const Dtk_string &inPartName, int &outPartID) | 
|   | 
| DtkErrorStatus  | WritePart_GeometricalTolerance (const Dtk_string &inPartName, int &outPartID) | 
|   | 
| DtkErrorStatus  | WritePart_MeshOnly (const Dtk_string &inPartName, int &outPartID) | 
|   | 
| DtkErrorStatus  | WritePart_MeshWithFaceColors (const Dtk_string &inPartName, int &outPartID) | 
|   | 
| DtkErrorStatus  | WritePart_UsedByExternalAssembly (const Dtk_string &inPartName, int &outPartID) | 
|   | 
| DtkErrorStatus  | WritePart_WireframeOnly (const Dtk_string &inPartName, int &outPartID) | 
|   | 
| DtkErrorStatus  | WritePart_WithProperties (const Dtk_string &inPartName, int &outPartID) | 
|   | 
Set of sample functions to write specific data into a .stp file. 
 
◆ CreateAxisSystem()
   28                axis->SetMatrix( trsf );
 
   29                axis->SetName( 
"Axis_System" );
 
 
 
 
◆ CreateLayerInfosSet()
   45                layerInfosSet->SetLayerID(0, 42);
 
   46                layerInfosSet->SetLayerID(1, 1900);
 
   47                layerInfosSet->SetLayerID(2, 0);
 
   48                layerInfosSet->SetLayerName(0, 
"MyFirstLayer");
 
   49                layerInfosSet->SetLayerName(1, 
"MySecondLayer");
 
   50                layerInfosSet->SetLayerName(2, 
"Faces");
 
 
 
 
◆ CreateTransforms()
◆ WriteAssembly()
  374                int assignedID_leafPart = 0;
 
  377                int assignedID_subProduct = 0;
 
  389                     int assignedID_rootProduct = 0;
 
 
 
 
◆ WriteAssembly_BasicExternalReference_DimensionFDT()
      
        
          | DtkErrorStatus stepw::sample::WriteAssembly_BasicExternalReference_DimensionFDT  | 
          ( | 
          const Dtk_string &  | 
          inRootAssemblyName | ) | 
           | 
        
      
 
  677                int assignedID_leafPart;
 
  678                Dtk_string uniqueNameForLeafProduct = L
"ExternalPartWithBody_ReferencedByFDT";
 
  682                int assignedID_instance1 = 0, assignedID_instance2 = 0, assignedID_instance3 = 0, assignedID_instance4 = 0;
 
  683                int userID_instance1 = 101, userID_instance2 = 102, userID_instance3 = 103, userID_instance4 = 104;
 
  684                int assignedID_subProduct = 0;
 
  696                     int assignedID_rootProduct = 0;
 
  706                     int userDefinedID_dimensionNode = 42;
 
  713                          int targetedFaceID_1 = 73; 
 
  723                          int targetedFaceID_2 = 105; 
 
 
 
 
◆ WriteAssembly_BasicExternalReferences()
  596                int assignedID_leafPart = 0;
 
  597                Dtk_string uniqueNameForProduct = L
"ExternalPartWithBody";
 
  601                int assignedID_subProduct = 0;
 
  612                     int assignedID_rootProduct = 0;
 
 
 
 
◆ WriteAssembly_DimensionFDT()
  413                int assignedID_leafPart = 0;
 
  416                int assignedID_instance1 = 0, assignedID_instance2 = 0, assignedID_instance3 = 0;
 
  417                int assignedID_subProduct = 0;
 
  429                     int assignedID_rootProduct = 0;
 
  440                          dimension->TransformationMatrix().setXdir( 
Dtk_dir( 0., 1., 0. ) );
 
  441                          dimension->TransformationMatrix().setYdir( 
Dtk_dir( -1., 0., 0. ) );
 
  442                          dimension->TransformationMatrix().setZdir( 
Dtk_dir( 0., 0., 1. ) );
 
  443                          dimension->TransformationMatrix().setOrigin( 
Dtk_pnt( 0., 0., -50. ) );
 
  445                          int userDefinedID_dimensionNode = 1002;
 
  449                               int targetedFaceID_1 = 10;
 
  459                               int targetedFaceID_2 = 10;
 
  481                          int viewModeThatReferencesAllFDTs = 1;
 
 
 
 
◆ WriteAssembly_InstanceAttributes()
  554                int assignedID_leafPart = 0;
 
  557                int assignedID_subProduct = 0;
 
  568                     int assignedID_rootProduct = 0;
 
 
 
 
◆ WriteAssembly_NestedExternalReferences()
  635                int assignedID_leafPart = 0;
 
  636                Dtk_string uniqueNameForLeafProduct = L
"NestedExternalPartWithBody";
 
  640                int assignedID_subProduct = 0;
 
  642                     Dtk_string uniqueNameForSubProduct = L
"NestedExternalSubProduct";
 
  654                     int assignedID_rootProduct = 0;
 
 
 
 
◆ WriteAssembly_WithProperties()
  500                int assignedID_leafPart = 0;
 
  503                int assignedID_subProduct = 0;
 
  511                          part_info->
AddAttribute( 
"assembly validation property :  : centre point", valprop_notional_CG );
 
  515                          Dtk_Val valprop_nbchildren( 3 );
 
  516                          prod_info->
AddAttribute( 
"assembly validation property :  : number of children", valprop_nbchildren );
 
  526                     int assignedID_rootProduct = 0;
 
  530                     Dtk_Val instance_kind( 
"first" );
 
  531                     instance_info->
AddAttribute( 
"user defined attribute : : instance kind", instance_kind );
 
  533                     instance_info->
AddAttribute( 
"attribute validation property :  : text user attributes", instance_valprop );
 
 
 
 
◆ WritePart_BodyAndMeshFromTessellation()
  163                     mesh = listMesh[ 0 ];
 
 
 
 
◆ WritePart_BodyInNamedLayer()
  339                body1->get_info()->SetLayer(42);
 
  340                body1->GetEntity( 10 )->info()->SetLayer( 0 );
 
  341                body1->GetEntity( 20 )->info()->SetLayer( 0 );
 
  342                body1->GetEntity( 30 )->info()->SetLayer( 0 );
 
  345                body2->get_info()->SetLayer(1900);
 
  347                body3->get_info()->SetLayer(1900);
 
 
 
 
◆ WritePart_BodyOnly()
◆ WritePart_BodyWithAxisSystem()
◆ WritePart_Datum()
  221                     int nodeid_Fdt1 = 42;
 
  233                     int userDefinedID_viewNode = 4242;
 
 
 
 
◆ WritePart_GeometricalTolerance()
  269                     int datum_node_id = 42;
 
  283                     geometricalTolerance->Transform( fdt_transf );
 
  285                     int geometrical_tolerance_node_id = 43;
 
  297                     int viewModeThatReferencesAllFDTs = 1;
 
 
 
 
◆ WritePart_MeshOnly()
◆ WritePart_MeshWithFaceColors()
◆ WritePart_UsedByExternalAssembly()
  315                int userDefinedID_product = 42;
 
 
 
 
◆ WritePart_WireframeOnly()
◆ WritePart_WithProperties()
  185                     Dtk_Val valprop_area( 
"1234 mm2" );
 
  186                     part_info->
AddAttribute( 
"geometric validation property :  : surface area measure", valprop_area );
 
  187                     Dtk_Val valprop_volume( 
"5678 mm3" );
 
  188                     part_info->
AddAttribute( 
"geometric validation property :  : volume measure", valprop_volume );
 
  190                     part_info->
AddAttribute( 
"geometric validation property :  : centre point", valprop_CG );
 
  195                     Dtk_Val mat_name( 
"Steel YC38" );
 
  196                     prod_info->
AddAttribute( 
"material property : material name : Steel", mat_name );
 
  197                     Dtk_Val mat_density( 
"7.89 g/cm3" );
 
  198                     prod_info->
AddAttribute( 
"material property : density : density measure", mat_density );
 
 
 
 
 
 
Dtk_BodyPtr CreateCube_2()
Definition: testcreatecylfdt.cpp:1070
 
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
 
Dtk_BodyPtr CreateCurves_2()
Definition: testcreatecylfdt.cpp:1114
 
Dtk_ErrorStatus AddAttribute(Dtk_string name, Dtk_Val val)
 
Dtk_MeshPtr CreateMeshCube()
Mesh Cube sample.
Definition: testcreatemesh.cpp:209
 
void setOrigin(const Dtk_pnt &O)
Set a new O center point.
 
DtkErrorStatus stepw_InitProduct(const Dtk_string &inProductName, int &outAssignedID, Dtk_ID inProductUserID=0)
Initializes the definition context of a product.
 
DtkErrorStatus stepw_AddInstanceToPath(stepw_ERP &inOutElementReferencePath, const int inInstanceID)
Appends an instance identifier to the element reference path. The instance identifier is provided by ...
 
DtkErrorStatus stepw_SetProductLayerInfosSet(const Dtk_LayerInfosSetPtr inLayerInfoSet)
Sets the LayerInfosSet to refer to when writing the current product. It uses its mapping between laye...
 
DtkErrorStatus stepw_Write3DConstructionGeometry(const Dtk_BodyPtr &inBody)
Writes a body as a construction geometry of a 3D part, of any kind (solid, shell / faces,...
 
Definition: stepw.hpp:443
 
DtkErrorStatus stepw_Write3DPartMesh(const Dtk_MeshPtr &inMesh)
Writes a mesh of a 3D part (3D content of a product).
 
This is a high level string class.
Definition: dtk_string.hpp:58
 
size_t Dtk_Size_t
Definition: define.h:714
 
static Dtk_SmartPtr< Dtk_AxisSystem > create()
Calls default constructor to allocate a new object.
 
#define PRINT_ERROR(inStatus)
Definition: testwriters.h:10
 
char Dtk_bool
Definition: define.h:727
 
DtkErrorStatus stepw_Write3DPartBody(const Dtk_BodyPtr &inBody)
Writes a body of a 3D part (3D content of a product), of any kind (solid, shell / faces,...
 
DtkErrorStatus stepw_Write3DPartBodyWithMesh(const Dtk_BodyPtr &inBody, const Dtk_MeshPtr &inMesh, const int inMode=0)
Writes a body of a 3D part (3D content of a product), associated with a mesh.
 
int tess_InitTesselation(Dtk_string inWorkingDirectory, double inTolerance)
Init the tesselation library.
 
void FillFacesColors(Dtk_MeshPtr &inoutCubeMesh)
Filling mesh faces with colors.
Definition: testcreatemesh.cpp:246
 
DtkErrorStatus stepw_EndProduct(const int inProductID)
Ends the writing of a product - calls WriteAssemblyInstances if not yet done.
 
Dtk_ErrorStatus SetBlankedStatus(const Dtk_Int32 &inBlankedStatus)
 
Definition: dtk_val.hpp:67
 
Dtk_ErrorStatus stepw_Add3DPartProperty(const Dtk_MetaDataPtr &inProperty)
Adds a roperty to a part (default), or to an entity, according to InitPropertySet mode.
 
DtkErrorStatus stepw_SetReferencePath(stepw_ER &inOutElementReference, stepw_ERP &inElementReferencePath)
Assigns the element reference path to the element reference.
 
DtkErrorStatus stepw_CreateReference(stepw_ER &inOutElementReference, const int inEntityID, const int inProductID=0, const char *inReferenceKind="")
Creates a reference to an entity located in the designated Product/Part context, or current context i...
 
DtkErrorStatus WritePart_BodyOnly(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:56
 
Dtk_ErrorStatus stepw_AddExternalReference(const Dtk_string &inProductName, const Dtk_string &inFileName, int &outID, Dtk_ID inInstCompId=0)
Declares a product to be written as an external reference (separated file).
 
DtkErrorStatus stepw_Init3DPart(const int inProductID)
Initializes the writing of a 3D part for the designated product.
 
DtkErrorStatus stepw_AddInstanceWithInfo(const int inFatherProductID, const int inChildProductID, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName, const Dtk_InfoPtr &inInstanceInfo)
Adds an instance of a product ( child ) in an assembly product ( father ), with provided attributes.
 
Dtk_FdtPtr CreateFdtDatum()
Creates simple Datum.
Definition: testcreatefdt.cpp:19
 
DtkErrorStatus stepw_AddInstance(const int inFatherProductID, const int inChildProductID, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName)
Adds an instance of a product ( child ) in an assembly product ( father ).
 
DtkErrorStatus stepw_Add3DPartFDT(const Dtk_FdtPtr &inFDT)
Adds a FDT in the current part context.
 
static Dtk_SmartPtr< T > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
 
Dtk_BodyPtr CreateConstructionPlane()
Definition: testcreatecylfdt.cpp:1161
 
DtkErrorStatus stepw_SetPartProperties(const Dtk_InfoPtr &inInfo, const int inItem)
Defines properties to be attached directly to the product : considers the list of Dtk_Val in the Dtk_...
 
DtkErrorStatus stepw_SetAnchorProduct(const int inProductID, const int inUserID)
Declares the product as having an ANCHOR section. If the designated product is already declared as su...
 
Definition: util_ptr_dtk.hpp:37
 
DtkErrorStatus stepw_End3DPart()
Ends the writing of a product 3D part.
 
DtkErrorStatus stepw_Write3DAxisSystem(const Dtk_AxisSystemPtr &inAxis)
Writes an axis system of a 3D part, in STEP, it is a construction geometry based on an axis placement...
 
Dtk_AxisSystemPtr CreateAxisSystem()
Definition: testlibstepwrite.cpp:23
 
DtkErrorStatus stepw_AddReference(stepw_ER &inElementReference)
Registers the previously created element reference in the writer.
 
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
 
Dtk_ErrorStatus stepw_Add3DModelDisplay(const Dtk_ModelDisplayPtr &inModelDisplay, const int inMode)
Adds a view ( Dtk_ModelDisplay ) in the current part context.
 
DtkErrorStatus WritePart_UsedByExternalAssembly(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:309
 
Dtk_ErrorStatus tess_BodyToMeshes(const Dtk_BodyPtr &inBodyToWrite, Dtk_tab< Dtk_MeshPtr > &outMeshes, Dtk_tab< Dtk_Int32 > &outIsSolid, Dtk_bool inTessWireframe=DTK_FALSE, Dtk_bool inApplyRenderInfos=DTK_FALSE)
: Make Tesselation from a Dtk_body and create a Set of Dtk_mesh if available
 
Dtk_ModelDisplayPtr CreateModelDisplayActivated()
Definition: testcreatefdt.cpp:324
 
This is a high level array class.
Definition: util_stl_dtk.hpp:85
 
Definition: stepw.hpp:436
 
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:504
 
DtkErrorStatus stepw_CreateInstancePath(stepw_ERP &inOutElementReferencePath)
Initializes a path for the element reference, identifying the sequence of instances to pass through.
 
DtkErrorStatus stepw_CreateReferenceToNode(stepw_ER &inOutElementReference, const int inNodeID, const int inProductID=0, const char *inReferenceKind="")
Creates a reference to a whole node (Dtk_Node), located in the designated Product/Part context.
 
Dtk_BodyPtr CreateCylinder()
Definition: testcreatecylfdt.cpp:1185
 
void stepw_EndNodeContext(const int unused=0)
Ends current node context.
 
Dtk_FdtPtr CreateDimension()
Definition: testcreatefdt.cpp:116
 
static Dtk_LayerInfosSetPtr Create(const Dtk_Size_t inNumLayers)
Calls a constructor to allocate a new object.
 
@ dtkNoError
Definition: error_dtk.hpp:144
 
Dtk_LayerInfosSetPtr CreateLayerInfosSet()
Definition: testlibstepwrite.cpp:42
 
Definition: dtk_rgb.hpp:7
 
Dtk_ErrorStatus SetColor(const int &R, const int &G, const int &B)
 
void CreateTransforms(Dtk_transfo &outFirst, Dtk_transfo &outSecond, Dtk_transfo &outThird)
Definition: testlibstepwrite.cpp:33
 
static Dtk_SmartPtr< Dtk_Info > create()
Calls default constructor to allocate a new object.
 
void stepw_InitNodeContext(const int inNodeID)
Initializes the context to write entities in a node.
 
Dtk_ErrorStatus stepw_AddAnchorItem(const int inEntityID, const int inProductID, const Dtk_string &inGUID)
Registers an entity in the ANCHOR section, with an assigned GUID (optional).
 
This is a mathematical direction class.
Definition: dtk_dir.hpp:15
 
Dtk_FdtPtr CreateGeometricalTolerance()
Definition: testcreatefdt.cpp:229