DATAKIT API  V2025.1
Step Write Sample
#ifdef WIN32
#include <windows.h>
#endif
#include "testwriters.h"
//DATAKIT headers needed
#include "datakit.h"
#include "stepw/stepw.hpp"
// For tessellation
#include "tess/tess.h"
/******************************************/
/****
Creation of data : topological data (a Body and its content), FDT, etc
****/
/*********************************************************/
/****
Writing a Product : a Part or an Assembly
Also with example of writing ATTRIBUTES attached at level of the Product , Part or Assembly
In particular, VALIDATION PROPERTIES
****/
extern int init_file_to_read( char *filename );
extern void close_file_to_read();
/****
Creation of a Sample View
****/
{
Dtk_string name( "SampleView:1" );
Dtk_pnt projpoint( 0., 0., 50. );
Dtk_pnt location( 0., 0., 0. );
Dtk_dir AY = axes.getYdir();
Dtk_dir target = axes.getZdir();
double scale = 1.;
double angle = 45.;
double viewdist = 50.;
// creation
Dtk_CameraPtr Camera = Dtk_Camera::Create( projpoint, location, AY, angle, viewdist, scale, ProjType );
Dtk_PlaneSurfacePtr section_plane = NULL;
/* Section Plane ?
fscanf(F,"%s",ligne);
if (ligne[0] == 'S') { // Section (1 plan)
Dtk_transfo trsf_plan = Dtk_StepFdt_TestIn_TRSF(F,ligne);
section_plane = Dtk_PlaneSurface::Create(trsf_plan.getOrigin(),trsf_plan.getZdir(),trsf_plan.getXdir());
fscanf(F,"%s",ligne);
}
*/
Dtk_EntityPtr section_ent = Dtk_EntityPtr::DtkDynamicCast( section_plane );
view = Dtk_ModelDisplay::Create( Camera, section_ent, DTK_TRUE );
// Dtk_FdtCapturePtr capture = Dtk_FdtCapture::Create(Camera, section_plane);
Dtk_InfoPtr& viewinfo = view->info();
if( viewinfo.IsNULL() ) viewinfo = Dtk_Info::create();
viewinfo->SetName( name );
// Links to FDTs : when writing the STEP file
return view;
}
/****
Creation of an Axis System (on the cube)
****/
{
trsf.setOrigin( Dtk_pnt( 100., 100., 100. ) );
axis->SetMatrix( trsf );
axis->SetName( "Axis_System" );
return axis;
}
//start_of_mainstepwrite
//This sample show you how to write a body with an unbounded surface and wireframe entity.
// IFDT = 1 to also write FDT, View, etc - 0 none
// IFDT = 2 to use this Part by a FDT in Assembly (needs to declare ANCHOR entities)
int WritePart( const Dtk_string& inReferenceName, const int ifdt )
{
// We construct a body
// TEST : adding wireframe
//You init the Part writer
int PartID;
return PartID;
// Following is required for writing of FDT with geometric links - either inside the Part or external designating anchors
// To be called before starting the part
stepw_SetAnchorProduct( PartID, PartID );
// IFDT = 2 : declaring some entities as ANCHOR for a FDT in Assembly
// This is needed where the Assembly is written in several files
if( ifdt == 2 )
{
int geomid1 = 73;
Dtk_string anchor1( "73" );
stepw_AddAnchorItem( geomid1, PartID, anchor1 );
int geomid2 = 33;
Dtk_string anchor2( "33" );
stepw_AddAnchorItem( geomid2, PartID, anchor2 );
}
// test : properties defined as Metadata (at part level)
stepw_Init3DPart( PartID );
stepw_Add3DPartProperty( metadata_1 );
stepw_Add3DPartProperty( metadata_2 );
// test : properties at part level - on the product_definition_shape
// test : validation properties - AP242 form (no intermediate name)
Dtk_Val valprop_area( "1234 mm2" );
part_info->AddAttribute( "geometric validation property : : surface area measure", valprop_area );
Dtk_Val valprop_volume( "5678 mm3" );
part_info->AddAttribute( "geometric validation property : : volume measure", valprop_volume );
Dtk_Val valprop_CG( Dtk_pnt( 12., 34., 56. ) );
part_info->AddAttribute( "geometric validation property : : centre point", valprop_CG );
stepw_SetPartProperties( part_info, 1 );
// test : properties at part level - on the product_definition
Dtk_Val mat_name( "Steel YC38" );
prod_info->AddAttribute( "material property : material name : Steel", mat_name );
Dtk_Val mat_density( "7.89 g/cm3" );
prod_info->AddAttribute( "material property : density : density measure", mat_density );
stepw_SetPartProperties( prod_info, 2 );
// And we write body in the step file
stepw_Write3DPartBody( sbody ); // test wire frame
// IFDT = 1 : writing a FDT within the Part (here, a Datum)
if( ifdt == 1 )
{
// Test Write FDT
int nodeid_Fdt1 = 1001;
stepw_InitNodeContext( nodeid_Fdt1 );
// Then write the geometrical links : within the same Part
int geomid1 = 73;
stepw_ER ElementReference_1;
stepw_CreateReference( ElementReference_1, geomid1 );
stepw_AddReference( ElementReference_1 );
// Test Write View
int nodeid_View1 = 2001;
stepw_InitNodeContext( nodeid_View1 );
stepw_ER ElementReference_Fdt1;
stepw_CreateReferenceToNode( ElementReference_Fdt1, nodeid_Fdt1, PartID );
stepw_AddReference( ElementReference_Fdt1 );
// Test Construction Geometries & Axis System
stepw_Write3DAxisSystem( AxisSystem );
}
// Close the current part
stepw_EndProduct( PartID );
return PartID;
}
// Another Part, to test other data - with colors and tessellation
// itessel = 0 or 1 : body only
// itessel = 2 : tessellation only
// itessel = 3 : body + tessellation
int WritePartCyl( const Dtk_string& inReferenceName, const int itessel )
{
// We construct a body : a cylinder
//You init the Part writer
int PartID;
return PartID;
// Following is required for writing of FDT with geometric links
// To be called before starting the part
stepw_SetAnchorProduct( PartID, PartID );
stepw_Init3DPart( PartID );
// test : properties at part level - on the product_definition_shape
// test : validation properties - AP242 form (no intermediate name)
Dtk_Val valprop_area( "1234 mm2" );
part_info->AddAttribute( "geometric validation property : : surface area measure", valprop_area );
Dtk_Val valprop_volume( "5678 mm3" );
part_info->AddAttribute( "geometric validation property : : volume measure", valprop_volume );
Dtk_Val valprop_CG( Dtk_pnt( 12., 34., 56. ) );
part_info->AddAttribute( "geometric validation property : : centre point", valprop_CG );
stepw_SetPartProperties( part_info, 1 );
// test : properties at part level - on the product_definition
stepw_SetPartProperties( prod_info, 2 );
// Standard use : write a Body : the cylinder
/*
// Test of Tessellation - NOT RECOMMENDED ON VERSIONS STEP BEFORE AP242
// To get the functions of tessellation : tess/tess.h
Dtk_MeshPtr mesh;
Dtk_tab<Dtk_MeshPtr> listMesh;
Dtk_tab<Dtk_Int32> IsSolid;
Dtk_bool TessWireframe=false;
tess_InitTesselation("../../SampleFiles/dtk/",0.2);
tess_BodyToMeshes (body,listMesh,IsSolid,TessWireframe);
int nbmesh = listMesh.size();
if (nbmesh >= 1)
mesh = listMesh[0];
// Writing Tessellation
// Option 1 : Tessellation "alone" i.e. not linked to the body
// we write body in the step file, then the tessellation separately
if (itessel <= 1) stepw_Write3DPartBody (body);
if (itessel == 2) stepw_Write3DPartMesh (mesh);
if (itessel == 3) stepw_Write3DPartBodyWithMesh(body,mesh);
*/
// Close the current part
stepw_EndProduct( PartID );
return PartID;
}
/*
Variants of writing an assembly
All write an assembly the same way, but the variants focus on a specific capability (not all together for more clarity)
WriteAsm is the basic variant, completed with validation properties and user attributes on the assembly or items of it
*/
void WriteAsm()
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
TransformationMatrix1.setOrigin( orig1 );
TransformationMatrix2.setOrigin( orig2 );
//The ProcessPart is an user implemented function to create a part
int PartID = WritePart( L"essaiPart", 0 );
int ProdID, ProdID2;
//we init a product context in STEP : sub-assembly ...
status = stepw_InitProduct( L"SubProduct", ProdID2 );
//...to insert a Part instance of "essaiPart"
status = stepw_AddInstance( ProdID2, PartID, TransformationMatrix0, "PartInstance" );
// test : validation properties - AP242 form (no intermediate name)
stepw_SetPartProperties( part_info, 1 );
Dtk_Val valprop_notional_CG( Dtk_pnt( 10., 20., 30. ) );
part_info->AddAttribute( "assembly validation property : : centre point", valprop_notional_CG );
stepw_SetPartProperties( part_info, 1 );
Dtk_Val valprop_nbchildren( 3 );
prod_info->AddAttribute( "assembly validation property : : number of children", valprop_nbchildren );
stepw_SetPartProperties( prod_info, 2 );
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID2 );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID2 );
//we create another assembly node (main assembly)
status = stepw_InitProduct( L"RootProduct", ProdID );
//and we insert another time the a part instance - multinstancing management -
// test : instance with property
Dtk_InfoPtr instance_info = Dtk_Info::create();
Dtk_Val instance_kind( "first" );
instance_info->AddAttribute( "user defined attribute : : instance kind", instance_kind );
Dtk_Val instance_valprop( 1 );
instance_info->AddAttribute( "attribute validation property : : text user attributes", instance_valprop );
// status = stepw_AddInstance(ProdID, PartID, TransformationMatrix0,"PartInstance");
status = stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0, "PartInstance", instance_info );
//and two instances to the first sub-assembly
status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1, "PartInstance1" );
status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2, "PartInstance2" );
//finally we close the second assembly (root) ...
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID );
}
/****
Variant to write the different products in several files
Similar to WriteAsm (just duplicated), with differences of external files : calls to stepw_AddExternalReference
level = 0 : monolithic file (so, like WriteAsm)
level = 1 : basic external references, only the leaf parts are written separately
level = 2 : nested external references, each component is written separately
Warning : these are the only allowed combinations, others may be not or bad supported by readers
asm_only = 0 : complete mode, all components (assemblies and leaf part) are written - monolithic writing is always complete
asm_only = 1 : only assemblies are written, part are declared as external products but not written
****/
void WriteAsmExt( const int level, const int asm_only )
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
TransformationMatrix1.setOrigin( orig1 );
TransformationMatrix2.setOrigin( orig2 );
//The ProcessPart is an user implemented function to create a part
// Option to write the Part as external file
int PartID;
if( level ) stepw_AddExternalReference( L"essaiPart", L"RootPart.step", PartID );
//with external references, it is possible to declare parts as external products but not write them
// Each product is identified by its NAME - there is a unique equivalence between Product Name and returned vale of ProdID
if( !asm_only || level == 0 )
PartID = WritePart( L"essaiPart", 0 );
int ProdID, ProdID2;
//we init a product context in STEP : sub-assembly ...
// Option to write the sub-assembly as external file
if( level > 1 ) stepw_AddExternalReference( L"SubProduct", L"RootSubAssy.step", ProdID2 );
status = stepw_InitProduct( L"SubProduct", ProdID2 );
//...to insert a Part instance of "essaiPart"
status = stepw_AddInstance( ProdID2, PartID, TransformationMatrix0, "PartInstance" );
// test : validation properties - AP242 form (no intermediate name)
stepw_SetPartProperties( part_info, 1 );
Dtk_Val valprop_notional_CG( Dtk_pnt( 10., 20., 30. ) );
part_info->AddAttribute( "assembly validation property : : centre point", valprop_notional_CG );
stepw_SetPartProperties( part_info, 1 );
Dtk_Val valprop_nbchildren( 3 );
prod_info->AddAttribute( "assembly validation property : : number of children", valprop_nbchildren );
stepw_SetPartProperties( prod_info, 2 );
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID2 );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID2 );
//we create another assembly node (main assembly)
status = stepw_InitProduct( L"RootProduct", ProdID );
//and we insert another time the a part instance - multinstancing management -
// test : instance with property
Dtk_InfoPtr instance_info = Dtk_Info::create();
Dtk_Val instance_kind( "first" );
instance_info->AddAttribute( "user defined attribute : : instance kind", instance_kind );
Dtk_Val instance_valprop( 1 );
instance_info->AddAttribute( "attribute validation property : : text user attributes", instance_valprop );
// status = stepw_AddInstance(ProdID, PartID, TransformationMatrix0,"PartInstance");
status = stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0, "PartInstance", instance_info );
//and two instances to the first sub-assembly
status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1, "PartInstance1" );
status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2, "PartInstance2" );
//finally we close the second assembly (root) ...
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID );
}
/****
Variant to write an assembly with a FDT at assembly level - monolithic or with external references
Similar to WriteAsmExt (just duplicated),including external files, but with a FDT in more, and validation properties in less
level = 0 : monolithic file (so, like WriteAsm)
level = 1 : basic external references, only the leaf parts are written separately
level = 2 : nested external references, each component is written separately
Warning : these are the only allowed combinations, others may be not or bad supported by readers
****/
void WriteAsmFdt( const int level )
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
TransformationMatrix1.setOrigin( orig1 );
TransformationMatrix2.setOrigin( orig2 );
//The ProcessPart is an user implemented function to create a part
// Option to write the Part as external file, with anchors entities for the FDT
int PartID;
if( level ) stepw_AddExternalReference( L"essaiPart", L"RootPart.step", PartID );
PartID = WritePart( L"essaiPart", 2 );
int ProdID, ProdID2;
//we init a product context in STEP : sub-assembly ...
// Option to write the sub-assembly as external file
// To write FDT, Instances must have a user identifier
Dtk_InfoPtr instance_info = Dtk_Info::create();
if( level > 1 ) stepw_AddExternalReference( L"SubProduct", L"RootSubAssy.step", ProdID2 );
status = stepw_InitProduct( L"SubProduct", ProdID2 );
//...to insert a Part instance of "essaiPart"
int InstID1, InstID2, InstID3, InstID4;
int UserInstID1 = 1, UserInstID2 = 2, UserInstID3 = 3, UserInstID4 = 4;
status = stepw_AddInstanceWithInfo( ProdID2, PartID, TransformationMatrix0, "PartInstance", instance_info, InstID1, UserInstID1, "RD1" );
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID2 );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID2 );
//we create another assembly node (main assembly)
status = stepw_InitProduct( L"RootProduct", ProdID );
//and we insert another time the a part instance - multinstancing management -
// status = stepw_AddInstance(ProdID, PartID, TransformationMatrix0,"PartInstance");
status = stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0, "PartInstance", instance_info, InstID2, UserInstID2, "RD2" );
//and two instances to the first sub-assembly
status = stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix1, "PartInstance1", instance_info, InstID3, UserInstID3, "RD3" );
status = stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix2, "PartInstance2", instance_info, InstID4, UserInstID4, "RD4" );
//finally we close the second assembly (root) ...
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID );
// Here is the specifics of this variant : writing a FDT at assembly level
int nodeid_fdtasm = 1002;
stepw_InitNodeContext( nodeid_fdtasm );
stepw_Add3DPartFDT( fdtasm );
// Then write the geometrical links : within the same Part
int geomid1 = 73;
stepw_ER ElementReference_1;
stepw_ERP ElementReferencePath_1;
stepw_CreateInstancePath( ElementReferencePath_1 );
stepw_AddInstanceToPath( ElementReferencePath_1, UserInstID2 );
stepw_CreateReference( ElementReference_1, geomid1, PartID );
stepw_SetReferencePath( ElementReference_1, ElementReferencePath_1 );
stepw_AddReference( ElementReference_1 );
int geomid2 = 33;
stepw_ER ElementReference_2;
stepw_ERP ElementReferencePath_2;
stepw_CreateInstancePath( ElementReferencePath_2 );
stepw_AddInstanceToPath( ElementReferencePath_2, UserInstID4 );
stepw_AddInstanceToPath( ElementReferencePath_2, UserInstID1 );
stepw_CreateReference( ElementReference_2, geomid2, PartID );
stepw_SetReferencePath( ElementReference_2, ElementReferencePath_2 );
stepw_AddReference( ElementReference_2 );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID );
}
/****
Main routine of writing a STEP file
- Opening and Closing of the File
- (writing of content between the 2)
- Global Settings
****/
/**** mainstep0 : writing all in one file ****/
int
StepWriteSample( const Dtk_string &inResultDirectory )
{
Dtk_string outputFileName, outputDirectory;
cout << endl << "----------------------------------------------" << endl;
cout << "Step Write start" << endl;
// Choosing output directory and file name
outputDirectory = inResultDirectory + L"dtk/Step/";
outputDirectory.FixPathSeparator();
outputDirectory.mkdir();
outputFileName = outputDirectory + L"RootProduct.step";
// First we initialize writing with name of files and protection function
// First you have to initialize the Step writer
// StepVersion 4 is for AP242
int status = stepw_InitFile( outputFileName, " sample ", 4 );
if( status )
{
cout << "erreur : " << dtkTypeError( status ).c_str() << endl;
return status;
}
// Test :
// WritePartCyl for just one part (cylinder) with tessellation
// WritePart for just one part (cube) with properties, with or without FDT (2nd argument = 1 to have FDT, 0 none)
// WriteAsm for an assembly (all in one file)
// WriteAsmExt for an assembly in several files - complete or assembly only
// WriteAsmFdt for an assembly with FDT at assembly level - monolithic or in several files
// WritePartCyl("CylPart",2);
// WritePart("onlyonePart",1); // 1 : with FDT
// WriteAsm();
WriteAsmExt( 2, 0 ); // level=2 : nested external references - asm_only=0 : complete writing including leaf parts
// WriteAsmFdt(2);
//...and the Main writer
cout << "=> " << outputFileName.c_str() << endl;
cout << "Step Write end" << endl;
return 0;
}
//end_of_mainstepwrite
//start_of_mainstepwrite
//This sample show you how to write a body with an unbounded surface and wireframe entity.
// IFDT = 1 to also write FDT, View, etc - 0 none
// IFDT = 2 to use this Part by a FDT in Assembly (needs to declare ANCHOR entities)
int WritePart( const Dtk_string& inReferenceName, const int ifdt )
{
// We construct a body
// TEST : adding wireframe
//You init the Part writer
int PartID;
return PartID;
// Following is required for writing of FDT with geometric links - either inside the Part or external designating anchors
// To be called before starting the part
stepw_SetAnchorProduct( PartID, PartID );
// IFDT = 2 : declaring some entities as ANCHOR for a FDT in Assembly
// This is needed where the Assembly is written in several files
if( ifdt == 2 )
{
int geomid1 = 73;
Dtk_string anchor1( "73" );
stepw_AddAnchorItem( geomid1, PartID, anchor1 );
int geomid2 = 33;
Dtk_string anchor2( "33" );
stepw_AddAnchorItem( geomid2, PartID, anchor2 );
}
// test : properties defined as Metadata (at part level)
stepw_Init3DPart( PartID );
stepw_Add3DPartProperty( metadata_1 );
stepw_Add3DPartProperty( metadata_2 );
// test : properties at part level - on the product_definition_shape
// test : validation properties - AP242 form (no intermediate name)
Dtk_Val valprop_area( "1234 mm2" );
part_info->AddAttribute( "geometric validation property : : surface area measure", valprop_area );
Dtk_Val valprop_volume( "5678 mm3" );
part_info->AddAttribute( "geometric validation property : : volume measure", valprop_volume );
Dtk_Val valprop_CG( Dtk_pnt( 12., 34., 56. ) );
part_info->AddAttribute( "geometric validation property : : centre point", valprop_CG );
stepw_SetPartProperties( part_info, 1 );
// test : properties at part level - on the product_definition
Dtk_Val mat_name( "Steel YC38" );
prod_info->AddAttribute( "material property : material name : Steel", mat_name );
Dtk_Val mat_density( "7.89 g/cm3" );
prod_info->AddAttribute( "material property : density : density measure", mat_density );
stepw_SetPartProperties( prod_info, 2 );
// And we write body in the step file
stepw_Write3DPartBody( sbody ); // test wire frame
// IFDT = 1 : writing a FDT within the Part (here, a Datum)
if( ifdt == 1 )
{
// Test Write FDT
int nodeid_Fdt1 = 1001;
stepw_InitNodeContext( nodeid_Fdt1 );
// Then write the geometrical links : within the same Part
int geomid1 = 73;
stepw_ER ElementReference_1;
stepw_CreateReference( ElementReference_1, geomid1 );
stepw_AddReference( ElementReference_1 );
// Test Write View
int nodeid_View1 = 2001;
stepw_InitNodeContext( nodeid_View1 );
stepw_ER ElementReference_Fdt1;
stepw_CreateReferenceToNode( ElementReference_Fdt1, nodeid_Fdt1, PartID );
stepw_AddReference( ElementReference_Fdt1 );
// Test Construction Geometries & Axis System
stepw_Write3DAxisSystem( AxisSystem );
}
// Close the current part
stepw_EndProduct( PartID );
return PartID;
}
// Another Part, to test other data - with colors and tessellation
// itessel = 0 or 1 : body only
// itessel = 2 : tessellation only
// itessel = 3 : body + tessellation
int WritePartCyl( const Dtk_string& inReferenceName, const int itessel )
{
// We construct a body : a cylinder
//You init the Part writer
int PartID;
return PartID;
// Following is required for writing of FDT with geometric links
// To be called before starting the part
stepw_SetAnchorProduct( PartID, PartID );
stepw_Init3DPart( PartID );
// test : properties at part level - on the product_definition_shape
// test : validation properties - AP242 form (no intermediate name)
Dtk_Val valprop_area( "1234 mm2" );
part_info->AddAttribute( "geometric validation property : : surface area measure", valprop_area );
Dtk_Val valprop_volume( "5678 mm3" );
part_info->AddAttribute( "geometric validation property : : volume measure", valprop_volume );
Dtk_Val valprop_CG( Dtk_pnt( 12., 34., 56. ) );
part_info->AddAttribute( "geometric validation property : : centre point", valprop_CG );
stepw_SetPartProperties( part_info, 1 );
// test : properties at part level - on the product_definition
stepw_SetPartProperties( prod_info, 2 );
// Standard use : write a Body : the cylinder
/*
// Test of Tessellation - NOT RECOMMENDED ON VERSIONS STEP BEFORE AP242
// To get the functions of tessellation : tess/tess.h
Dtk_MeshPtr mesh;
Dtk_tab<Dtk_MeshPtr> listMesh;
Dtk_tab<Dtk_Int32> IsSolid;
Dtk_bool TessWireframe=false;
tess_InitTesselation("../../SampleFiles/dtk/",0.2);
tess_BodyToMeshes (body,listMesh,IsSolid,TessWireframe);
int nbmesh = listMesh.size();
if (nbmesh >= 1)
mesh = listMesh[0];
// Writing Tessellation
// Option 1 : Tessellation "alone" i.e. not linked to the body
// we write body in the step file, then the tessellation separately
if (itessel <= 1) stepw_Write3DPartBody (body);
if (itessel == 2) stepw_Write3DPartMesh (mesh);
if (itessel == 3) stepw_Write3DPartBodyWithMesh(body,mesh);
*/
// Close the current part
stepw_EndProduct( PartID );
return PartID;
}
/*
Variants of writing an assembly
All write an assembly the same way, but the variants focus on a specific capability (not all together for more clarity)
WriteAsm is the basic variant, completed with validation properties and user attributes on the assembly or items of it
*/
void WriteAsm()
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
TransformationMatrix1.setOrigin( orig1 );
TransformationMatrix2.setOrigin( orig2 );
//The ProcessPart is an user implemented function to create a part
int PartID = WritePart( L"essaiPart", 0 );
int ProdID, ProdID2;
//we init a product context in STEP : sub-assembly ...
status = stepw_InitProduct( L"SubProduct", ProdID2 );
//...to insert a Part instance of "essaiPart"
status = stepw_AddInstance( ProdID2, PartID, TransformationMatrix0, "PartInstance" );
// test : validation properties - AP242 form (no intermediate name)
stepw_SetPartProperties( part_info, 1 );
Dtk_Val valprop_notional_CG( Dtk_pnt( 10., 20., 30. ) );
part_info->AddAttribute( "assembly validation property : : centre point", valprop_notional_CG );
stepw_SetPartProperties( part_info, 1 );
Dtk_Val valprop_nbchildren( 3 );
prod_info->AddAttribute( "assembly validation property : : number of children", valprop_nbchildren );
stepw_SetPartProperties( prod_info, 2 );
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID2 );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID2 );
//we create another assembly node (main assembly)
status = stepw_InitProduct( L"RootProduct", ProdID );
//and we insert another time the a part instance - multinstancing management -
// test : instance with property
Dtk_InfoPtr instance_info = Dtk_Info::create();
Dtk_Val instance_kind( "first" );
instance_info->AddAttribute( "user defined attribute : : instance kind", instance_kind );
Dtk_Val instance_valprop( 1 );
instance_info->AddAttribute( "attribute validation property : : text user attributes", instance_valprop );
// status = stepw_AddInstance(ProdID, PartID, TransformationMatrix0,"PartInstance");
status = stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0, "PartInstance", instance_info );
//and two instances to the first sub-assembly
status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1, "PartInstance1" );
status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2, "PartInstance2" );
//finally we close the second assembly (root) ...
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID );
}
/****
Variant to write the different products in several files
Similar to WriteAsm (just duplicated), with differences of external files : calls to stepw_AddExternalReference
level = 0 : monolithic file (so, like WriteAsm)
level = 1 : basic external references, only the leaf parts are written separately
level = 2 : nested external references, each component is written separately
Warning : these are the only allowed combinations, others may be not or bad supported by readers
asm_only = 0 : complete mode, all components (assemblies and leaf part) are written - monolithic writing is always complete
asm_only = 1 : only assemblies are written, part are declared as external products but not written
****/
void WriteAsmExt( const int level, const int asm_only )
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
TransformationMatrix1.setOrigin( orig1 );
TransformationMatrix2.setOrigin( orig2 );
//The ProcessPart is an user implemented function to create a part
// Option to write the Part as external file
int PartID;
if( level ) stepw_AddExternalReference( L"essaiPart", L"RootPart.step", PartID );
//with external references, it is possible to declare parts as external products but not write them
// Each product is identified by its NAME - there is a unique equivalence between Product Name and returned vale of ProdID
if( !asm_only || level == 0 )
PartID = WritePart( L"essaiPart", 0 );
int ProdID, ProdID2;
//we init a product context in STEP : sub-assembly ...
// Option to write the sub-assembly as external file
if( level > 1 ) stepw_AddExternalReference( L"SubProduct", L"RootSubAssy.step", ProdID2 );
status = stepw_InitProduct( L"SubProduct", ProdID2 );
//...to insert a Part instance of "essaiPart"
status = stepw_AddInstance( ProdID2, PartID, TransformationMatrix0, "PartInstance" );
// test : validation properties - AP242 form (no intermediate name)
stepw_SetPartProperties( part_info, 1 );
Dtk_Val valprop_notional_CG( Dtk_pnt( 10., 20., 30. ) );
part_info->AddAttribute( "assembly validation property : : centre point", valprop_notional_CG );
stepw_SetPartProperties( part_info, 1 );
Dtk_Val valprop_nbchildren( 3 );
prod_info->AddAttribute( "assembly validation property : : number of children", valprop_nbchildren );
stepw_SetPartProperties( prod_info, 2 );
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID2 );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID2 );
//we create another assembly node (main assembly)
status = stepw_InitProduct( L"RootProduct", ProdID );
//and we insert another time the a part instance - multinstancing management -
// test : instance with property
Dtk_InfoPtr instance_info = Dtk_Info::create();
Dtk_Val instance_kind( "first" );
instance_info->AddAttribute( "user defined attribute : : instance kind", instance_kind );
Dtk_Val instance_valprop( 1 );
instance_info->AddAttribute( "attribute validation property : : text user attributes", instance_valprop );
// status = stepw_AddInstance(ProdID, PartID, TransformationMatrix0,"PartInstance");
status = stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0, "PartInstance", instance_info );
//and two instances to the first sub-assembly
status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1, "PartInstance1" );
status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2, "PartInstance2" );
//finally we close the second assembly (root) ...
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID );
}
/****
Variant to write an assembly with a FDT at assembly level - monolithic or with external references
Similar to WriteAsmExt (just duplicated),including external files, but with a FDT in more, and validation properties in less
level = 0 : monolithic file (so, like WriteAsm)
level = 1 : basic external references, only the leaf parts are written separately
level = 2 : nested external references, each component is written separately
Warning : these are the only allowed combinations, others may be not or bad supported by readers
****/
void WriteAsmFdt( const int level )
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
TransformationMatrix1.setOrigin( orig1 );
TransformationMatrix2.setOrigin( orig2 );
//The ProcessPart is an user implemented function to create a part
// Option to write the Part as external file, with anchors entities for the FDT
int PartID;
if( level ) stepw_AddExternalReference( L"essaiPart", L"RootPart.step", PartID );
PartID = WritePart( L"essaiPart", 2 );
int ProdID, ProdID2;
//we init a product context in STEP : sub-assembly ...
// Option to write the sub-assembly as external file
// To write FDT, Instances must have a user identifier
Dtk_InfoPtr instance_info = Dtk_Info::create();
if( level > 1 ) stepw_AddExternalReference( L"SubProduct", L"RootSubAssy.step", ProdID2 );
status = stepw_InitProduct( L"SubProduct", ProdID2 );
//...to insert a Part instance of "essaiPart"
int InstID1, InstID2, InstID3, InstID4;
int UserInstID1 = 1, UserInstID2 = 2, UserInstID3 = 3, UserInstID4 = 4;
status = stepw_AddInstanceWithInfo( ProdID2, PartID, TransformationMatrix0, "PartInstance", instance_info, InstID1, UserInstID1, "RD1" );
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID2 );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID2 );
//we create another assembly node (main assembly)
status = stepw_InitProduct( L"RootProduct", ProdID );
//and we insert another time the a part instance - multinstancing management -
// status = stepw_AddInstance(ProdID, PartID, TransformationMatrix0,"PartInstance");
status = stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0, "PartInstance", instance_info, InstID2, UserInstID2, "RD2" );
//and two instances to the first sub-assembly
status = stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix1, "PartInstance1", instance_info, InstID3, UserInstID3, "RD3" );
status = stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix2, "PartInstance2", instance_info, InstID4, UserInstID4, "RD4" );
//finally we close the second assembly (root) ...
// the part for the sub-assembly is REQUIRED - assembly node : created empty
status = stepw_Init3DPart( ProdID );
// Here is the specifics of this variant : writing a FDT at assembly level
int nodeid_fdtasm = 1002;
stepw_InitNodeContext( nodeid_fdtasm );
stepw_Add3DPartFDT( fdtasm );
// Then write the geometrical links : within the same Part
int geomid1 = 73;
stepw_ER ElementReference_1;
stepw_ERP ElementReferencePath_1;
stepw_CreateInstancePath( ElementReferencePath_1 );
stepw_AddInstanceToPath( ElementReferencePath_1, UserInstID2 );
stepw_CreateReference( ElementReference_1, geomid1, PartID );
stepw_SetReferencePath( ElementReference_1, ElementReferencePath_1 );
stepw_AddReference( ElementReference_1 );
int geomid2 = 33;
stepw_ER ElementReference_2;
stepw_ERP ElementReferencePath_2;
stepw_CreateInstancePath( ElementReferencePath_2 );
stepw_AddInstanceToPath( ElementReferencePath_2, UserInstID4 );
stepw_AddInstanceToPath( ElementReferencePath_2, UserInstID1 );
stepw_CreateReference( ElementReference_2, geomid2, PartID );
stepw_SetReferencePath( ElementReference_2, ElementReferencePath_2 );
stepw_AddReference( ElementReference_2 );
status = stepw_End3DPart();
//we close the CATProduct context and retrieve the resulting DocID
status = stepw_EndProduct( ProdID );
}
/****
Main routine of writing a STEP file
- Opening and Closing of the File
- (writing of content between the 2)
- Global Settings
****/
/**** mainstep0 : writing all in one file ****/
int
StepWriteSample( const Dtk_string &inResultDirectory )
{
Dtk_string outputFileName, outputDirectory;
cout << endl << "----------------------------------------------" << endl;
cout << "Step Write start" << endl;
// Choosing output directory and file name
outputDirectory = inResultDirectory + L"dtk/Step/";
outputDirectory.FixPathSeparator();
outputDirectory.mkdir();
outputFileName = outputDirectory + L"RootProduct.step";
// First we initialize writing with name of files and protection function
// First you have to initialize the Step writer
// StepVersion 4 is for AP242
int status = stepw_InitFile( outputFileName, " sample ", 4 );
if( status )
{
cout << "erreur : " << dtkTypeError( status ).c_str() << endl;
return status;
}
// Test :
// WritePartCyl for just one part (cylinder) with tessellation
// WritePart for just one part (cube) with properties, with or without FDT (2nd argument = 1 to have FDT, 0 none)
// WriteAsm for an assembly (all in one file)
// WriteAsmExt for an assembly in several files - complete or assembly only
// WriteAsmFdt for an assembly with FDT at assembly level - monolithic or in several files
// WritePartCyl("CylPart",2);
// WritePart("onlyonePart",1); // 1 : with FDT
// WriteAsm();
WriteAsmExt( 2, 0 ); // level=2 : nested external references - asm_only=0 : complete writing including leaf parts
// WriteAsmFdt(2);
//...and the Main writer
cout << "=> " << outputFileName.c_str() << endl;
cout << "Step Write end" << endl;
return 0;
}
//end_of_mainstepwrite
Dtk_ModelDisplay::Create
static Dtk_ModelDisplayPtr Create(const Dtk_CameraPtr &inCamera, const Dtk_EntityPtr &inClippingEntity, const Dtk_bool inIsActivated)
Full featured constructor.
stepw_AddInstanceWithInfo
DtkErrorStatus stepw_AddInstanceWithInfo(const int inIDfather, const int inIDchild, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName, const Dtk_InfoPtr &inInstanceInfo)
Adds an instance of a sub-component (child) in a product (father : assembly node)
sampleWriter::CreateCube_2
Dtk_BodyPtr CreateCube_2()
Definition: testcreatecylfdt.cpp:1092
testcreatefdt.hpp
stepw_CreateReference
DtkErrorStatus stepw_CreateReference(stepw_ER &ER, const int inEntityID)
init_file_to_read
int init_file_to_read(char *filename)
stepw_AddInstance
DtkErrorStatus stepw_AddInstance(const int inIDfather, const int inIDchild, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName)
Adds an instance of a sub-component (child) in a product (father : assembly node)
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
sampleWriter::CreateCurves_2
Dtk_BodyPtr CreateCurves_2()
Definition: testcreatecylfdt.cpp:1138
Dtk_Info::AddAttribute
Dtk_ErrorStatus AddAttribute(Dtk_string name, Dtk_Val val)
Dtk_Info::SetName
Dtk_ErrorStatus SetName(Dtk_string inName)
stepw_Init3DPart
DtkErrorStatus stepw_Init3DPart(const int inID)
Initialise the writing of a 3D part : the own 3D part of a product (NOT its sub-components if any !...
stepw_SetReferencePath
DtkErrorStatus stepw_SetReferencePath(stepw_ER &ER, stepw_ERP &ERP)
Dtk_transfo::setOrigin
void setOrigin(const Dtk_pnt &O)
Set a new O center point.
Dtk_Camera::ProjectionTypeEnum
ProjectionTypeEnum
Definition: util_draw_dtk.hpp:7866
DTK_TRUE
#define DTK_TRUE
Definition: define.h:727
stepw_Write3DConstructionGeometry
DtkErrorStatus stepw_Write3DConstructionGeometry(const Dtk_BodyPtr &inBody)
Writes a Body as a Construction Geometry of a 3D part, of any kind (solid, shell / faces,...
stepw_ERP
Definition: stepw.hpp:394
stepw_SetModeFdt
DtkErrorStatus stepw_SetModeFdt(const int inMode, const int inPolyline=0)
Activates/Deactivates writing of FDT (ignored if product Step3dWriteFdt is not present)
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
Dtk_AxisSystem::create
static Dtk_SmartPtr< Dtk_AxisSystem > create()
stepw_InitProduct
DtkErrorStatus stepw_InitProduct(const Dtk_string &inProductName, int &outID, Dtk_ID inCompID=0)
Initialise the writing of a product (assembly node and/or part with 3D bodies)
WritePartCyl
int WritePartCyl(const Dtk_string &inReferenceName, const int itessel)
Definition: testlibstepwrite.cpp:204
stepw_AddReference
DtkErrorStatus stepw_AddReference(stepw_ER &ER)
stepw_Write3DPartBody
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,...
stepw_SetAnchorProduct
DtkErrorStatus stepw_SetAnchorProduct(const int stepw_ID, const int user_ID)
stepw_EndProduct
DtkErrorStatus stepw_EndProduct(const int inID)
Ends the writing of a product - calls WriteAssemblyInstances if not yet done.
stepw_SetModeProp
DtkErrorStatus stepw_SetModeProp(const int inMode)
Activates/Deactivates writing of Properties : User Attributes, Product Data.
Dtk_transfo::getZdir
const Dtk_dir & getZdir() const
Return the Z vector.
Dtk_Val
Definition: dtk_val.hpp:67
stepw_Add3DPartProperty
Dtk_ErrorStatus stepw_Add3DPartProperty(const Dtk_MetaDataPtr &inProperty)
Commands to write a Property to a Part (at the level of the whole Part) by default,...
catiav5w::inReferenceName
const Dtk_string & inReferenceName
Definition: catiav5w.hpp:456
stepw_CreateInstancePath
DtkErrorStatus stepw_CreateInstancePath(stepw_ERP &ERP)
sampleWriter::CreateFdtDimAssy
Dtk_FdtPtr CreateFdtDimAssy()
PMI in Assembly : a dimension between faces of different instances.
Definition: testcreatefdt.cpp:118
stepw_AddExternalReference
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 external reference.
stepw.hpp
sampleWriter::CreateFdtDatum
Dtk_FdtPtr CreateFdtDatum()
Create Simple Datum.
Definition: testcreatefdt.cpp:19
Dtk_MetaData::TypeConfigurationProperty
@ TypeConfigurationProperty
Definition: dtk_metadata.hpp:30
stepw_CreateReferenceToNode
DtkErrorStatus stepw_CreateReferenceToNode(stepw_ER &ER, const int inNodeID, const int inProductID, const char *inRefKind="")
Dtk_MetaData::TypeProperty
@ TypeProperty
Definition: dtk_metadata.hpp:28
stepw_Add3DPartFDT
DtkErrorStatus stepw_Add3DPartFDT(const Dtk_FdtPtr &inFDT)
Commands to write a FDT of a 3D Part.
close_file_to_read
void close_file_to_read()
Dtk_SmartPtr< Dtk_Entity >::DtkDynamicCast
static Dtk_SmartPtr< Dtk_Entity > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
Dtk_SmartPtr::IsNULL
Dtk_bool IsNULL() const
Definition: util_ptr_dtk.hpp:118
sampleWriter::CreateConstructionPlane
Dtk_BodyPtr CreateConstructionPlane()
Definition: testcreatecylfdt.cpp:1185
Dtk_Camera::ProjectionTypeParallel
@ ProjectionTypeParallel
Definition: util_draw_dtk.hpp:7868
stepw_SetPartProperties
DtkErrorStatus stepw_SetPartProperties(const Dtk_InfoPtr &inInfo, const int inItem)
Defines properties to be attached directly to the component : considers the list of Dtk_Val in the Dt...
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
stepw_EndFile
DtkErrorStatus stepw_EndFile()
Ends the writing of the STEP file.
dtkTypeError
Dtk_string dtkTypeError(Dtk_Int32 errNumero)
stepw_End3DPart
DtkErrorStatus stepw_End3DPart()
Ends the writing of a part : the own 3D part of a product + product definition.
stepw_Write3DAxisSystem
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_string::c_str
const char * c_str() const
Retrieve the ASCII conversion string.
CreateAxisSystem
Dtk_AxisSystemPtr CreateAxisSystem()
Definition: testlibstepwrite.cpp:80
tess.h
WritePart
int WritePart(const Dtk_string &inReferenceName, const int ifdt)
Definition: testlibstepwrite.cpp:95
Dtk_string::mkdir
int mkdir() const
File Utility : Create a Directory.
Dtk_pnt
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
stepw_Add3DModelDisplay
Dtk_ErrorStatus stepw_Add3DModelDisplay(const Dtk_ModelDisplayPtr &inModelDisplay, const int inMode)
Commands to write a Model Display (type Dtk_ModelDisplay) in a 3d Part.
stepw_AddAnchorItem
Dtk_ErrorStatus stepw_AddAnchorItem(const int inEntityID, const int inProductID, const Dtk_string &inGUID)
Dtk_string::FixPathSeparator
void FixPathSeparator()
File Utility : Fixes path separator consistency. It lets you replace the '\' or '/' by the OS needed ...
stepw_InitFile
DtkErrorStatus stepw_InitFile(const Dtk_string &inFileOut, const char *Origin=" user ", const int StepSchema=0)
Initialise a file to be written.
datakit.h
Dtk_Camera::Create
static Dtk_CameraPtr Create()
Base constructor.
stepw_ER
Definition: stepw.hpp:387
stepw_AddInstanceToPath
DtkErrorStatus stepw_AddInstanceToPath(stepw_ERP &ERP, const int inInstanceID)
Dtk_transfo::getYdir
const Dtk_dir & getYdir() const
Return the Y vector.
CreateView
Dtk_ModelDisplayPtr CreateView()
Definition: testlibstepwrite.cpp:39
testcreatecylfdt.hpp
sampleWriter::CreateCylinder
Dtk_BodyPtr CreateCylinder()
Definition: testcreatecylfdt.cpp:1211
WriteAsm
void WriteAsm()
Definition: testlibstepwrite.cpp:270
WriteAsmExt
void WriteAsmExt(const int level, const int asm_only)
Definition: testlibstepwrite.cpp:346
StepWriteSample
int StepWriteSample(const Dtk_string &inResultDirectory)
Definition: testlibstepwrite.cpp:528
testwriters.h
Dtk_Info::create
static Dtk_SmartPtr< Dtk_Info > create()
stepw_InitNodeContext
void stepw_InitNodeContext(const int inNodeID)
Initialises the context to write items in a node of the model (internal model tree,...
Dtk_dir
This is a mathematical direction class.
Definition: dtk_dir.hpp:15
stepw_EndNodeContext
void stepw_EndNodeContext(const int inNodeID=0)
WriteAsmFdt
void WriteAsmFdt(const int level)
Definition: testlibstepwrite.cpp:429
Dtk_MetaData::CreateMetaData
static Dtk_MetaDataPtr CreateMetaData(const MetaDataTypeEnum &inEnumType, Dtk_string inTitle, Dtk_string inValue, Dtk_string inValueType=Dtk_string(L"STRING"))
Create a Dtk_MetaDataPtr .