DATAKIT API  V2025.3
testlibstepwrite.cpp File Reference

Functions

void close_file_to_read ()
 
Dtk_AxisSystemPtr CreateAxisSystem ()
 
Dtk_ModelDisplayPtr CreateView ()
 
int init_file_to_read (char *filename)
 
int StepWriteSample (const Dtk_string &inResultDirectory)
 
void WriteAsm ()
 
void WriteAsmExt (const int level, const int asm_only)
 
void WriteAsmFdt (const int level)
 
int WritePart (const Dtk_string &inReferenceName, const int ifdt)
 
int WritePartCyl (const Dtk_string &inReferenceName, const int itessel)
 

Function Documentation

◆ close_file_to_read()

void close_file_to_read ( )

◆ CreateAxisSystem()

Dtk_AxisSystemPtr CreateAxisSystem ( )
81 {
83  Dtk_transfo trsf;
84  trsf.setOrigin( Dtk_pnt( 100., 100., 100. ) );
85  axis->SetMatrix( trsf );
86  axis->SetName( "Axis_System" );
87  return axis;
88 }

◆ CreateView()

Dtk_ModelDisplayPtr CreateView ( )
40 {
42 
43  Dtk_string name( "SampleView:1" );
44  Dtk_transfo axes;
45  Dtk_pnt projpoint( 0., 0., 50. );
46  Dtk_pnt location( 0., 0., 0. );
47  Dtk_dir AY = axes.getYdir();
48  Dtk_dir target = axes.getZdir();
49  double scale = 1.;
50  double angle = 45.;
51  double viewdist = 50.;
52  // creation
54  Dtk_CameraPtr Camera = Dtk_Camera::Create( projpoint, location, AY, angle, viewdist, scale, ProjType );
55  Dtk_PlaneSurfacePtr section_plane = NULL;
56  /* Section Plane ?
57  fscanf(F,"%s",ligne);
58  if (ligne[0] == 'S') { // Section (1 plan)
59  Dtk_transfo trsf_plan = Dtk_StepFdt_TestIn_TRSF(F,ligne);
60  section_plane = Dtk_PlaneSurface::Create(trsf_plan.getOrigin(),trsf_plan.getZdir(),trsf_plan.getXdir());
61 
62  fscanf(F,"%s",ligne);
63  }
64  */
65  Dtk_EntityPtr section_ent = Dtk_EntityPtr::DtkDynamicCast( section_plane );
66  view = Dtk_ModelDisplay::Create( Camera, section_ent, DTK_TRUE );
67  // Dtk_FdtCapturePtr capture = Dtk_FdtCapture::Create(Camera, section_plane);
68  Dtk_InfoPtr& viewinfo = view->info();
69  if( viewinfo.IsNULL() ) viewinfo = Dtk_Info::create();
70  viewinfo->SetName( name );
71 
72  // Links to FDTs : when writing the STEP file
73 
74  return view;
75 }

◆ init_file_to_read()

int init_file_to_read ( char *  filename)

◆ StepWriteSample()

int StepWriteSample ( const Dtk_string inResultDirectory)
531 {
532  Dtk_string outputFileName, outputDirectory;
533 
534  cout << endl << "----------------------------------------------" << endl;
535  cout << "Step Write start" << endl;
536 
537  // Choosing output directory and file name
538  outputDirectory = inResultDirectory + L"Step/";
539  outputDirectory.FixPathSeparator();
540  outputDirectory.mkdir();
541  outputFileName = outputDirectory + L"RootProduct.step";
542 
543  // First we initialize writing with name of files and protection function
544  // First you have to initialize the Step writer
545  // StepVersion 4 is for AP242
546  int status = stepw_InitFile( outputFileName, " sample ", 4 );
547  if( status )
548  {
549  cout << "erreur : " << dtkTypeError( status ).c_str() << endl;
550  return status;
551  }
552 
553  stepw_SetModeProp( 2 );
554 
555  stepw_SetModeFdt( 1 );
556 
557  // Test :
558  // WritePartCyl for just one part (cylinder) with tessellation
559  // WritePart for just one part (cube) with properties, with or without FDT (2nd argument = 1 to have FDT, 0 none)
560  // WriteAsm for an assembly (all in one file)
561  // WriteAsmExt for an assembly in several files - complete or assembly only
562  // WriteAsmFdt for an assembly with FDT at assembly level - monolithic or in several files
563  // WritePartCyl("CylPart",2);
564  // WritePart("onlyonePart",1); // 1 : with FDT
565  //WriteAsm();
566  WriteAsmExt( 2, 0 ); // level=2 : nested external references - asm_only=0 : complete writing including leaf parts
567  //WriteAsmFdt(2);
568 
569  //...and the Main writer
570  stepw_EndFile();
571  cout << "=> " << outputFileName.c_str() << endl;
572  cout << "Step Write end" << endl;
573 
574  return 0;
575 }

◆ WriteAsm()

void WriteAsm ( )
272 {
273  int status = 0;
274  Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
275  Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
276  Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
277  TransformationMatrix1.setOrigin( orig1 );
278  TransformationMatrix2.setOrigin( orig2 );
279 
280  //The ProcessPart is an user implemented function to create a part
281  int PartID = WritePart( L"essaiPart", 0 );
282 
283  int ProdID, ProdID2;
284 
285  //we init a product context in STEP : sub-assembly ...
286  status = stepw_InitProduct( L"SubProduct", ProdID2 );
287 
288  //...to insert a Part instance of "essaiPart"
289  status = stepw_AddInstance( ProdID2, PartID, TransformationMatrix0, "PartInstance" );
290 
291  // test : validation properties - AP242 form (no intermediate name)
292  Dtk_InfoPtr part_info = Dtk_Info::create();
293  stepw_SetPartProperties( part_info, 1 );
294  Dtk_Val valprop_notional_CG( Dtk_pnt( 10., 20., 30. ) );
295  part_info->AddAttribute( "assembly validation property : : centre point", valprop_notional_CG );
296  stepw_SetPartProperties( part_info, 1 );
297  Dtk_InfoPtr prod_info = Dtk_Info::create();
298  Dtk_Val valprop_nbchildren( 3 );
299  prod_info->AddAttribute( "assembly validation property : : number of children", valprop_nbchildren );
300  stepw_SetPartProperties( prod_info, 2 );
301 
302  // the part for the sub-assembly is REQUIRED - assembly node : created empty
303  status = stepw_Init3DPart( ProdID2 );
304  status = stepw_End3DPart();
305 
306  //we close the product context
307  status = stepw_EndProduct( ProdID2 );
308 
309 
310  //we create another assembly node (main assembly)
311  status = stepw_InitProduct( L"RootProduct", ProdID );
312  //and we insert another time the a part instance - multinstancing management -
313  // test : instance with property
314  Dtk_InfoPtr instance_info = Dtk_Info::create();
315  Dtk_Val instance_kind( "first" );
316  instance_info->AddAttribute( "user defined attribute : : instance kind", instance_kind );
317  Dtk_Val instance_valprop( 1 );
318  instance_info->AddAttribute( "attribute validation property : : text user attributes", instance_valprop );
319 
320  //and two instances to the first sub-assembly
321  status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1, "PartInstance1" );
322  status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2, "PartInstance2" );
323 
324  // status = stepw_AddInstance(ProdID, PartID, TransformationMatrix0,"PartInstance");
325  status = stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0, "PartInstance", instance_info );
326 
327  //finally we close the second assembly (root) ...
328  // the part for the sub-assembly is REQUIRED - assembly node : created empty
329  status = stepw_Init3DPart( ProdID );
330  status = stepw_End3DPart();
331 
332  //we close the CATProduct context and retrieve the resulting DocID
333  status = stepw_EndProduct( ProdID );
334 
335 }

◆ WriteAsmExt()

void WriteAsmExt ( const int  level,
const int  asm_only 
)
349 {
350  int status = 0;
351  Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
352  Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
353  Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
354  TransformationMatrix1.setOrigin( orig1 );
355  TransformationMatrix2.setOrigin( orig2 );
356 
357  //The ProcessPart is an user implemented function to create a part
358  // Option to write the Part as external file
359  int PartID = 0;
360  if( level ) stepw_AddExternalReference( L"essaiPart", L"RootPart.step", PartID );
361 
362  //with external references, it is possible to declare parts as external products but not write them
363  // Each product is identified by its NAME - there is a unique equivalence between Product Name and returned vale of ProdID
364  if( !asm_only || level == 0 )
365  PartID = WritePart( L"essaiPart", 0 );
366 
367  int ProdID, ProdID2;
368 
369  //we init a product context in STEP : sub-assembly ...
370  // Option to write the sub-assembly as external file
371  if( level > 1 ) stepw_AddExternalReference( L"SubProduct", L"RootSubAssy.step", ProdID2 );
372  status = stepw_InitProduct( L"SubProduct", ProdID2 );
373 
374  //...to insert a Part instance of "essaiPart"
375  status = stepw_AddInstance( ProdID2, PartID, TransformationMatrix0, "PartInstance" );
376 
377  // test : validation properties - AP242 form (no intermediate name)
378  Dtk_InfoPtr part_info = Dtk_Info::create();
379  stepw_SetPartProperties( part_info, 1 );
380  Dtk_Val valprop_notional_CG( Dtk_pnt( 10., 20., 30. ) );
381  part_info->AddAttribute( "assembly validation property : : centre point", valprop_notional_CG );
382  stepw_SetPartProperties( part_info, 1 );
383  Dtk_InfoPtr prod_info = Dtk_Info::create();
384  Dtk_Val valprop_nbchildren( 3 );
385  prod_info->AddAttribute( "assembly validation property : : number of children", valprop_nbchildren );
386  stepw_SetPartProperties( prod_info, 2 );
387 
388  // the part for the sub-assembly is REQUIRED - assembly node : created empty
389  status = stepw_Init3DPart( ProdID2 );
390  status = stepw_End3DPart();
391 
392  //we close the CATProduct context and retrieve the resulting DocID
393  status = stepw_EndProduct( ProdID2 );
394 
395 
396  //we create another assembly node (main assembly)
397  status = stepw_InitProduct( L"RootProduct", ProdID );
398  //and we insert another time the a part instance - multinstancing management -
399  // test : instance with property
400  Dtk_InfoPtr instance_info = Dtk_Info::create();
401  Dtk_Val instance_kind( "first" );
402  instance_info->AddAttribute( "user defined attribute : : instance kind", instance_kind );
403  Dtk_Val instance_valprop( 1 );
404  instance_info->AddAttribute( "attribute validation property : : text user attributes", instance_valprop );
405  // status = stepw_AddInstance(ProdID, PartID, TransformationMatrix0,"PartInstance");
406 
407  //and two instances to the first sub-assembly
408  status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1, "PartInstance1" );
409  status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2, "PartInstance2" );
410 
411  status = stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0, "PartInstance", instance_info );
412  //finally we close the second assembly (root) ...
413  // the part for the sub-assembly is REQUIRED - assembly node : created empty
414  status = stepw_Init3DPart( ProdID );
415  status = stepw_End3DPart();
416 
417  //we close the CATProduct context and retrieve the resulting DocID
418  status = stepw_EndProduct( ProdID );
419 
420 }

◆ WriteAsmFdt()

void WriteAsmFdt ( const int  level)
432 {
433  int status = 0;
434  Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
435  Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
436  Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
437  TransformationMatrix1.setOrigin( orig1 );
438  TransformationMatrix2.setOrigin( orig2 );
439 
440  //The ProcessPart is an user implemented function to create a part
441  // Option to write the Part as external file, with anchors entities for the FDT
442  int PartID;
443  if( level ) stepw_AddExternalReference( L"essaiPart", L"RootPart.step", PartID );
444  PartID = WritePart( L"essaiPart", 2 );
445 
446  int ProdID, ProdID2;
447 
448  //we init a product context in STEP : sub-assembly ...
449  // Option to write the sub-assembly as external file
450 
451  // To write FDT, Instances must have a user identifier
452  Dtk_InfoPtr instance_info = Dtk_Info::create();
453 
454  if( level > 1 ) stepw_AddExternalReference( L"SubProduct", L"RootSubAssy.step", ProdID2 );
455  status = stepw_InitProduct( L"SubProduct", ProdID2 );
456 
457  //...to insert a Part instance of "essaiPart"
458  int InstID1, InstID2, InstID3, InstID4;
459  int UserInstID1 = 1, UserInstID2 = 2, UserInstID3 = 3, UserInstID4 = 4;
460  status = stepw_AddInstanceWithInfo( ProdID2, PartID, TransformationMatrix0, "PartInstance", instance_info, InstID1, UserInstID1, "RD1" );
461 
462  // the part for the sub-assembly is REQUIRED - assembly node : created empty
463  status = stepw_Init3DPart( ProdID2 );
464  status = stepw_End3DPart();
465 
466  //we close the CATProduct context and retrieve the resulting DocID
467  status = stepw_EndProduct( ProdID2 );
468 
469  //we create another assembly node (main assembly)
470  status = stepw_InitProduct( L"RootProduct", ProdID );
471  //and we insert another time the a part instance - multinstancing management -
472 
473  //and two instances to the first sub-assembly
474  status = stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix1, "PartInstance1", instance_info, InstID3, UserInstID3, "RD3" );
475  status = stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix2, "PartInstance2", instance_info, InstID4, UserInstID4, "RD4" );
476 
477  // status = stepw_AddInstance(ProdID, PartID, TransformationMatrix0,"PartInstance");
478  status = stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0, "PartInstance", instance_info, InstID2, UserInstID2, "RD2" );
479 
480  //finally we close the second assembly (root) ...
481  // the part for the sub-assembly is REQUIRED - assembly node : created empty
482  status = stepw_Init3DPart( ProdID );
483 
484  // Here is the specifics of this variant : writing a FDT at assembly level
486  int nodeid_fdtasm = 1002;
487  stepw_InitNodeContext( nodeid_fdtasm );
488 
489  stepw_Add3DPartFDT( fdtasm );
490  // Then write the geometrical links : within the same Part
491  int geomid1 = 73;
492  stepw_ER ElementReference_1;
493  stepw_ERP ElementReferencePath_1;
494  stepw_CreateInstancePath( ElementReferencePath_1 );
495  stepw_AddInstanceToPath( ElementReferencePath_1, UserInstID2 );
496  stepw_CreateReference( ElementReference_1, geomid1, PartID );
497  stepw_SetReferencePath( ElementReference_1, ElementReferencePath_1 );
498  stepw_AddReference( ElementReference_1 );
499 
500  int geomid2 = 33;
501  stepw_ER ElementReference_2;
502  stepw_ERP ElementReferencePath_2;
503  stepw_CreateInstancePath( ElementReferencePath_2 );
504  stepw_AddInstanceToPath( ElementReferencePath_2, UserInstID4 );
505  stepw_AddInstanceToPath( ElementReferencePath_2, UserInstID1 );
506  stepw_CreateReference( ElementReference_2, geomid2, PartID );
507  stepw_SetReferencePath( ElementReference_2, ElementReferencePath_2 );
508  stepw_AddReference( ElementReference_2 );
509 
511 
512  status = stepw_End3DPart();
513 
514  //we close the CATProduct context and retrieve the resulting DocID
515  status = stepw_EndProduct( ProdID );
516 
517 }

◆ WritePart()

int WritePart ( const Dtk_string inReferenceName,
const int  ifdt 
)
96 {
97  // We construct a body
99 
100  // TEST : adding wireframe
102 
103  //You init the Part writer
104  int PartID;
105  if( stepw_InitProduct( inReferenceName, PartID ) )
106  return PartID;
107 
108  // Following is required for writing of FDT with geometric links - either inside the Part or external designating anchors
109  // To be called before starting the part
110  stepw_SetAnchorProduct( PartID, PartID );
111 
112  // IFDT = 2 : declaring some entities as ANCHOR for a FDT in Assembly
113  // This is needed where the Assembly is written in several files
114  if( ifdt == 2 )
115  {
116  int geomid1 = 73;
117  Dtk_string anchor1( "73" );
118  stepw_AddAnchorItem( geomid1, PartID, anchor1 );
119  int geomid2 = 33;
120  Dtk_string anchor2( "33" );
121  stepw_AddAnchorItem( geomid2, PartID, anchor2 );
122  }
123 
124  // test : properties defined as Metadata (at part level)
125  stepw_SetModeProp( 2 );
126  Dtk_MetaDataPtr metadata_1 = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeConfigurationProperty, "Revision", "test_revision_4" );
127 
129 
130  stepw_Init3DPart( PartID );
131  stepw_Add3DPartProperty( metadata_1 );
132  stepw_Add3DPartProperty( metadata_2 );
133 
134  // test : properties at part level - on the product_definition_shape
135  // test : validation properties - AP242 form (no intermediate name)
136  Dtk_InfoPtr part_info = Dtk_Info::create();
137  Dtk_Val valprop_area( "1234 mm2" );
138  part_info->AddAttribute( "geometric validation property : : surface area measure", valprop_area );
139  Dtk_Val valprop_volume( "5678 mm3" );
140  part_info->AddAttribute( "geometric validation property : : volume measure", valprop_volume );
141  Dtk_Val valprop_CG( Dtk_pnt( 12., 34., 56. ) );
142  part_info->AddAttribute( "geometric validation property : : centre point", valprop_CG );
143  stepw_SetPartProperties( part_info, 1 );
144  // test : properties at part level - on the product_definition
145  Dtk_InfoPtr prod_info = Dtk_Info::create();
146  Dtk_Val mat_name( "Steel YC38" );
147  prod_info->AddAttribute( "material property : material name : Steel", mat_name );
148  Dtk_Val mat_density( "7.89 g/cm3" );
149  prod_info->AddAttribute( "material property : density : density measure", mat_density );
150  stepw_SetPartProperties( prod_info, 2 );
151 
152  // And we write body in the step file
153  stepw_Write3DPartBody( body );
154 
155  stepw_Write3DPartBody( sbody ); // test wire frame
156 
157  // IFDT = 1 : writing a FDT within the Part (here, a Datum)
158  if( ifdt == 1 )
159  {
160 
161  // Test Write FDT
163  int nodeid_Fdt1 = 1001;
164  stepw_InitNodeContext( nodeid_Fdt1 );
165  stepw_Add3DPartFDT( Fdt1 );
166  // Then write the geometrical links : within the same Part
167  int geomid1 = 73;
168  stepw_ER ElementReference_1;
169  stepw_CreateReference( ElementReference_1, geomid1 );
170  stepw_AddReference( ElementReference_1 );
172 
173  // Test Write View
175  int nodeid_View1 = 2001;
176  stepw_InitNodeContext( nodeid_View1 );
177  stepw_Add3DModelDisplay( View1, 0 );
178  stepw_ER ElementReference_Fdt1;
179  stepw_CreateReferenceToNode( ElementReference_Fdt1, nodeid_Fdt1, PartID );
180  stepw_AddReference( ElementReference_Fdt1 );
182 
183  // Test Construction Geometries & Axis System
184  Dtk_AxisSystemPtr AxisSystem = CreateAxisSystem();
185  stepw_Write3DAxisSystem( AxisSystem );
187  stepw_Write3DConstructionGeometry( constr_plane );
188 
189  }
190 
191  // Close the current part
192  stepw_End3DPart();
193 
194  stepw_EndProduct( PartID );
195 
196  return PartID;
197 }

◆ WritePartCyl()

int WritePartCyl ( const Dtk_string inReferenceName,
const int  itessel 
)
205 {
206  // We construct a body : a cylinder
208 
209 
210  //You init the Part writer
211  int PartID;
212  if( stepw_InitProduct( inReferenceName, PartID ) )
213  return PartID;
214 
215  // Following is required for writing of FDT with geometric links
216  // To be called before starting the part
217  stepw_SetAnchorProduct( PartID, PartID );
218 
219  stepw_Init3DPart( PartID );
220 
221  // test : properties at part level - on the product_definition_shape
222  // test : validation properties - AP242 form (no intermediate name)
223  Dtk_InfoPtr part_info = Dtk_Info::create();
224  Dtk_Val valprop_area( "1234 mm2" );
225  part_info->AddAttribute( "geometric validation property : : surface area measure", valprop_area );
226  Dtk_Val valprop_volume( "5678 mm3" );
227  part_info->AddAttribute( "geometric validation property : : volume measure", valprop_volume );
228  Dtk_Val valprop_CG( Dtk_pnt( 12., 34., 56. ) );
229  part_info->AddAttribute( "geometric validation property : : centre point", valprop_CG );
230  stepw_SetPartProperties( part_info, 1 );
231  // test : properties at part level - on the product_definition
232  Dtk_InfoPtr prod_info = Dtk_Info::create();
233 
234  stepw_SetPartProperties( prod_info, 2 );
235  // Standard use : write a Body : the cylinder
236  stepw_Write3DPartBody( body );
237 
238  DTK_UNUSED( itessel );
241  //Dtk_MeshPtr mesh;
242  //Dtk_tab<Dtk_MeshPtr> listMesh;
243  //Dtk_tab<Dtk_Int32> IsSolid;
244  //Dtk_bool TessWireframe=false;
245  //tess_InitTesselation("../../SampleFiles/dtk/",0.2);
246  //tess_BodyToMeshes (body,listMesh,IsSolid,TessWireframe);
247  //int nbmesh = listMesh.size();
248  //if (nbmesh >= 1)
249  //mesh = listMesh[0];
253  //if (itessel <= 1) stepw_Write3DPartBody (body);
254  //if (itessel == 2) stepw_Write3DPartMesh (mesh);
255  //if (itessel == 3) stepw_Write3DPartBodyWithMesh(body,mesh);
256 
257  // Close the current part
258  stepw_End3DPart();
259 
260  stepw_EndProduct( PartID );
261 
262  return PartID;
263 }
Dtk_ModelDisplay::Create
static Dtk_ModelDisplayPtr Create(const Dtk_CameraPtr &inCamera, const Dtk_EntityPtr &inClippingEntity, const Dtk_bool inIsActivated)
Full featured constructor.
sampleWriter::CreateCube_2
Dtk_BodyPtr CreateCube_2()
Definition: testcreatecylfdt.cpp:1092
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)
stepw_CreateReference
DtkErrorStatus stepw_CreateReference(stepw_ER &ER, const int inEntityID)
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:7905
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:395
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)
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.
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.
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:7907
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
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.
Dtk_Camera::Create
static Dtk_CameraPtr Create()
Base constructor.
stepw_ER
Definition: stepw.hpp:388
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
sampleWriter::CreateCylinder
Dtk_BodyPtr CreateCylinder()
Definition: testcreatecylfdt.cpp:1211
WriteAsmExt
void WriteAsmExt(const int level, const int asm_only)
Definition: testlibstepwrite.cpp:348
Dtk_Info::create
static Dtk_SmartPtr< Dtk_Info > create()
DTK_UNUSED
#define DTK_UNUSED(a)
Definition: define.h:730
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)
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 .