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

◆ 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 CATProduct context and retrieve the resulting DocID
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  // status = stepw_AddInstance(ProdID, PartID, TransformationMatrix0,"PartInstance");
320  status = stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0, "PartInstance", instance_info );
321 
322  //and two instances to the first sub-assembly
323  status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1, "PartInstance1" );
324  status = stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2, "PartInstance2" );
325 
326  //finally we close the second assembly (root) ...
327  // the part for the sub-assembly is REQUIRED - assembly node : created empty
328  status = stepw_Init3DPart( ProdID );
329  status = stepw_End3DPart();
330 
331  //we close the CATProduct context and retrieve the resulting DocID
332  status = stepw_EndProduct( ProdID );
333 
334 }

◆ WriteAsmExt()

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

◆ WriteAsmFdt()

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

◆ 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:7881
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:7883
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:347
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 .