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

◆ WriteAsm()

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

◆ WriteAsmExt()

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

◆ WriteAsmFdt()

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

◆ 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  // Test of Tessellation - NOT RECOMMENDED ON VERSIONS STEP BEFORE AP242
239  // To get the functions of tessellation : tess/tess.h
240  Dtk_MeshPtr mesh;
241  Dtk_tab<Dtk_MeshPtr> listMesh;
242  Dtk_tab<Dtk_Int32> IsSolid;
243  Dtk_bool TessWireframe=false;
244  tess_InitTesselation("../../SampleFiles/dtk/",0.2);
245  tess_BodyToMeshes (body,listMesh,IsSolid,TessWireframe);
246  int nbmesh = listMesh.size();
247  if (nbmesh >= 1)
248  mesh = listMesh[0];
249  // Writing Tessellation
250  // Option 1 : Tessellation "alone" i.e. not linked to the body
251  // we write body in the step file, then the tessellation separately
252  if (itessel <= 1) stepw_Write3DPartBody (body);
253  if (itessel == 2) stepw_Write3DPartMesh (mesh);
254  if (itessel == 3) stepw_Write3DPartBodyWithMesh(body,mesh);
255  */
256  // Close the current part
257  stepw_End3DPart();
258 
259  stepw_EndProduct( PartID );
260 
261  return PartID;
262 }
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: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)
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: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
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: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
sampleWriter::CreateCylinder
Dtk_BodyPtr CreateCylinder()
Definition: testcreatecylfdt.cpp:1211
WriteAsmExt
void WriteAsmExt(const int level, const int asm_only)
Definition: testlibstepwrite.cpp:346
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)
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 .