DATAKIT SDK  V2026.4
testwriters.h File Reference

Go to the source code of this file.

Macros

#define CHECK_OK(X)   {Dtk_ErrorStatus res;if ((res=X)!=dtkNoError) {std::cout << "error : " << dtkTypeError(res).c_str() << std::endl;return res;}}
 
#define PRINT_ERROR(inStatus)
 

Functions

DtkErrorStatus _3dxmlWriteSample (const Dtk_string &inResultDirectory)
 Entry point: creates a cube and cylinder mesh then writes them into a sample.3dxml file. More...
 
DtkErrorStatus _3mfWriteSample (const Dtk_string &inResultDirectory)
 Entry point: writes a cube and a cylinder mesh into a sample.3mf file. More...
 
DtkErrorStatus CatiaV5WriteSample (const Dtk_string &inResultDirectory, const Dtk_string &inInputFilesDirectory)
 
DtkErrorStatus CgrWriteSample (const Dtk_string &inResultDirectory)
 Entry point: builds an assembly tree with cube, cylinder, and wire meshes and writes it to sample.cgr. More...
 
DtkErrorStatus ColladaWriteSample (const Dtk_string &inResultDirectory)
 Entry point: writes cube, cylinder, wireframe meshes with render infos and model display views into sample.dae. More...
 
DtkErrorStatus FbxWriteSample (const Dtk_string &inResultDirectory)
 
DtkErrorStatus GltfWriteSample (const Dtk_string &inResultDirectory)
 
DtkErrorStatus IfcWriteSample (const Dtk_string &inResultDirectory)
 Entry point: orchestrates all IFC sample functions and writes the results into a sample.ifc file. More...
 
DtkErrorStatus IgesWriteSample (const Dtk_string &inResultDirectory)
 
DtkErrorStatus JtWriteSample (const Dtk_string &inResultDirectory)
 
DtkErrorStatus ObjWriteSample (const Dtk_string &inResultDirectory)
 
DtkErrorStatus ParasolidWriteSample (const Dtk_string &inResultDirectory)
 Sample to start using Parasolid Writer Library. More...
 
DtkErrorStatus PdfWriteSample (const Dtk_string &inResultDirectory)
 
DtkErrorStatus PlmxmlWriteSample (const Dtk_string &inResultDirectory)
 
DtkErrorStatus SatWriteSample (const Dtk_string &inResultDirectory)
 Entry point: writes a solid cube and an open shell BRep body into a sample.sat (ACIS) file. More...
 
DtkErrorStatus StepWriteSample (const Dtk_string &inResultDirectory)
 
DtkErrorStatus SwWriteSample (Dtk_API *inDtkAPI, const Dtk_string &inResultDirectory)
 Entry point: writes BRep parts with face colors and a SolidWorks assembly into .sldprt / .sldasm files. More...
 
DtkErrorStatus UgWriteSample (const Dtk_string &inResultDirectory)
 
DtkErrorStatus UsdWriteSample (const Dtk_string &inResultDirectory)
 

Macro Definition Documentation

◆ CHECK_OK

#define CHECK_OK (   X)    {Dtk_ErrorStatus res;if ((res=X)!=dtkNoError) {std::cout << "error : " << dtkTypeError(res).c_str() << std::endl;return res;}}

◆ PRINT_ERROR

#define PRINT_ERROR (   inStatus)
Value:
{ \
if ( ( inStatus ) != dtkNoError) \
std::cout << __FUNCTION__ << " encountered an error at line " << __LINE__ << " : " << dtkTypeError(inStatus).c_str() << std::endl; \
}

Function Documentation

◆ _3dxmlWriteSample()

DtkErrorStatus _3dxmlWriteSample ( const Dtk_string &  inResultDirectory)

Entry point: creates a cube and cylinder mesh then writes them into a sample.3dxml file.

232 {
233  Dtk_MeshPtr CubeMesh;
234  Dtk_MeshPtr CylinderMesh;
235  Dtk_string outputFileName, outputDirectory;
236 
237  std::cout << std::endl << "----------------------------------------------" << std::endl;
238  std::cout << "3dxml Write start" << std::endl;
239 
240  //Choosing output directory and file name
241  outputDirectory = inResultDirectory + L"CatiaV6/";
242  outputDirectory.FixPathSeparator();
243  outputDirectory.mkdir();
244  outputFileName = outputDirectory + L"sample.3dxml";
245 
246  //Creating sample cube meshes
247  CubeMesh = sampleWriter::CreateMeshCube();
248 
249  //Applying render infos (texture + lightmap) to the cube mesh
251 
252  //Creating sample cylinder meshes
253  CylinderMesh = sampleWriter::CreateMeshCylinder( 30 );
254 
255  //Creating hierarchy
256 
257  //Root
258  // |
259  // | __Node(Node_1)
260  // | |
261  // | |
262  // | CylinderMesh(Node_2)
263  // |
264  // | __CubeWireMesh(Node_3)
265  // |
266  // |
267  // | __CylinderMesh(Node_4)
268 
269  _3dxmlw::WriteOptions Options;//no option for the moment
270  Dtk_string inLogFile;//no config for the moment
271 
272  DtkErrorStatus errorStatus = _3dxmlw::InitWrite( outputFileName, inLogFile, Options );
273 
274  if( errorStatus == dtkNoError )
275  {
276  WriteEntity( CubeMesh, CylinderMesh );
277  }
278  else
279  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
280 
282 
283  if( errorStatus == dtkNoError )
284  std::cout << "=> " << outputFileName.c_str() << std::endl << "3dxml Write end" << std::endl;
285 
286  return errorStatus;
287 }

◆ _3mfWriteSample()

DtkErrorStatus _3mfWriteSample ( const Dtk_string &  inResultDirectory)

Entry point: writes a cube and a cylinder mesh into a sample.3mf file.

15 {
16  Dtk_ErrorStatus errorStatus = dtkNoError;
17  Dtk_MeshPtr cubeMesh = NULL;
18  Dtk_MeshPtr cylinderMesh = NULL;
19  Dtk_string outputFileName, outputDirectory;
20 
21  std::cout << std::endl << "----------------------------------------------" << std::endl;
22  std::cout << "3mf Write start" << std::endl;
23 
24  // Choosing output directory and file name
25  outputDirectory = inResultDirectory + L"3mf/";
26  outputDirectory.FixPathSeparator();
27  outputDirectory.mkdir();
28  outputFileName = outputDirectory + L"sample.3mf";
29 
30  // Cube Sample
31  cubeMesh = sampleWriter::CreateMeshCube();
33 
34  // Cylinder Sample
35  cylinderMesh = sampleWriter::CreateMeshCylinder( 30 );
36 
37  // First we initialize writing
39  Dtk_3MFWriter *_3mfw = new Dtk_3MFWriter();
40  errorStatus = _3mfw->InitWrite( outputFileName, Dtk_string( "test3mfw.log" ), options );
41 
42  if( errorStatus != dtkNoError )
43  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
44 
45 
46  // Lets write a small part composed by one cube and one cylinder
47 
48  // Let write the cube
49  cubeMesh->info() = Dtk_Info::Create();
50  cubeMesh->info()->SetName( "Cube" );
51 
52  if( errorStatus == dtkNoError )
53  errorStatus = _3mfw->WriteEntity( Dtk_EntityPtr::DtkDynamicCast( cubeMesh ) );
54 
55  // Let write the cylinder
56  cylinderMesh->info() = Dtk_Info::Create();
57  cylinderMesh->info()->SetName( "Cylinder" );
58 
59  if( errorStatus == dtkNoError )
60  errorStatus = _3mfw->WriteEntity( Dtk_EntityPtr::DtkDynamicCast( cylinderMesh ) );
61 
62  // We finish process and free memory allocated for writing
63  _3mfw->EndWrite();
64  if( errorStatus == dtkNoError )
65  std::cout << "=> " << outputFileName.c_str() << std::endl << "3mf Write end" << std::endl;
66  delete _3mfw;
67  return errorStatus;
68 }

◆ CatiaV5WriteSample()

DtkErrorStatus CatiaV5WriteSample ( const Dtk_string &  inResultDirectory,
const Dtk_string &  inInputFilesDirectory 
)
522 {
523  // First we initialize writing with name of files and protection fonction
524  //First you have to initialize the CATIA V5 writer
525  Dtk_string outputDirectory;
526 
527  std::cout << std::endl << "----------------------------------------------" << std::endl;
528  std::cout << "CatiaV5 Write start" << std::endl;
529 
530  // Choosing output directory and file name
531  outputDirectory = inResultDirectory + L"CatiaV5/";
532  outputDirectory.FixPathSeparator();
533  outputDirectory.mkdir();
534 
535  catiav5w::WriteOptions options;
536  Dtk_ErrorStatus errorStatus = options.SetFileRelease( 20 );
537  if( errorStatus != dtkNoError )
538  {
539  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
540  return errorStatus;
541  }
542 
543  errorStatus = catiav5w::InitWrite( outputDirectory + L"V5W_LogFile.log", NULL, options );
544  if( errorStatus != dtkNoError )
545  {
546  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
547  return errorStatus;
548  }
549 
550  ProcessAsm( inResultDirectory, inInputFilesDirectory );
551 
552  //...and the Main writter
554 
555  return dtkNoError;
556 }

◆ CgrWriteSample()

DtkErrorStatus CgrWriteSample ( const Dtk_string &  inResultDirectory)

Entry point: builds an assembly tree with cube, cylinder, and wire meshes and writes it to sample.cgr.

17 {
18  Dtk_MeshPtr CubeMesh;
19  Dtk_MeshPtr CylinderMesh;
20  Dtk_MeshPtr WireMesh;
21  Dtk_AxisSystemPtr TmpAxis;
22  Dtk_mesh_asm_node * mesh_asm = NULL;
23  Dtk_mesh_asm_node * mesh_asm_1 = NULL;
24  Dtk_mesh_asm_node * mesh_asm_2 = NULL;
25  Dtk_mesh_asm_node * mesh_asm_3 = NULL;
26  Dtk_mesh_asm_node * mesh_asm_4 = NULL;
27  Dtk_string outputFileName, outputDirectory;
28 
29  std::cout << std::endl << "----------------------------------------------" << std::endl;
30  std::cout << "Cgr Write start" << std::endl;
31 
32  // Choosing output directory and file name
33  outputDirectory = inResultDirectory + L"Cgr/";
34  outputDirectory.FixPathSeparator();
35  outputDirectory.mkdir();
36  outputFileName = outputDirectory + L"sample.cgr";
37 
38  // Axis System
40 
41  // Cube Sample
42  CubeMesh = sampleWriter::CreateMeshCube();
43 
44  // Cylinder Sample
45  CylinderMesh = sampleWriter::CreateMeshCylinder( 30 );
46 
47  // Wire Sample
48  WireMesh = sampleWriter::CreateMeshWire();
49 
50  // PART5 : CREATING HIERARCHY
51 
52  // CREATE ROOT ASM NODE
53  mesh_asm = new Dtk_mesh_asm_node();
54 
55  mesh_asm->set_id( 0 ); // id of node
56  Dtk_transfo * transfo1 = new Dtk_transfo(); // transformation matrix
57  //apply scale
58  transfo1->setXdir( Dtk_dir( 0.8, 0.0, 0.0 ) );
59  transfo1->setYdir( Dtk_dir( 0.0, 0.8, 0.0 ) );
60  transfo1->setZdir( Dtk_dir( 0.0, 0.0, 0.8 ) );
61  transfo1->setOrigin( Dtk_pnt( 0.0, 0.0, 0.8 ) );
62  transfo1->setScale( 1.0 );
63 
64  // CREATE ASM 1
65  mesh_asm_1 = new Dtk_mesh_asm_node(); //create new node
66  mesh_asm_1->set_id( 1 ); // id of node
67  mesh_asm->add_asm_instance( mesh_asm_1, transfo1 ); // add mesh_asm_1 node in mesh_asm
68 
69  //WRITE AXIS SYSTEM
70  mesh_asm->add_axis_system(TmpAxis); // add axis system in mesh_asm
71 
72  //WRITE CUBE MESH
73  mesh_asm->add_mesh( CubeMesh );
74 
75  //WRITE CUBE MESH
76  mesh_asm_2 = new Dtk_mesh_asm_node(); //create new node
77  mesh_asm_2->set_id( 2 ); // id of node
78  Dtk_transfo * transfo2 = new Dtk_transfo();
79  transfo2->setOrigin( Dtk_pnt( -4, -4, -4 ) );
80  mesh_asm->add_asm_instance( mesh_asm_2, transfo2 ); // add mesh_asm_2 node in mesh_asm
81  mesh_asm_2->add_mesh( CubeMesh ); // add mesh in instance mesh_asm_2
82 
83  //WRITE WIRE MESH
84  mesh_asm_3 = new Dtk_mesh_asm_node(); //create new node
85  mesh_asm_3->set_id( 3 ); // id of node
86  mesh_asm_2->add_asm_instance( mesh_asm_3, transfo2 ); // add mesh_asm_3 node in mesh_asm_2
87  mesh_asm_3->add_mesh( WireMesh ); // add wireframe in instance mesh_asm_3
88 
89  //WRITE CYLINDER MESH
90  mesh_asm_4 = new Dtk_mesh_asm_node(); //create new node
91  mesh_asm_4->set_id( 4 ); // id of node
92  Dtk_transfo * transfo3 = new Dtk_transfo();
93  transfo3->setOrigin( Dtk_pnt( -6., -7., -6. ) );
94  mesh_asm_1->add_asm_instance( mesh_asm_4, transfo3 ); // add mesh_asm_4 node in mesh_asm_1
95  Dtk_RGB rgb = Dtk_RGB( 0, 0, 255 );
96  mesh_asm_4->set_color( rgb ); // set color in instance mesh_asm_2
97  mesh_asm_4->add_mesh( CylinderMesh ); // add mesh in instance mesh_asm_4
98 
99 
100  WriteOptions options;
101 
102  //initialize writing
103  options.SetFileRelease( 14 );
104 
105  //CGR write start here
106  // First we initialize writing with name of files and protection fonction if needed (3rd parameter)
107  int Status = cgrw_InitWrite( outputFileName, outputDirectory + L"testcgrw.log", NULL, L"", options );
108  if( Status != dtkNoError )
109  {
110  cgrw_EndWrite();
111  delete mesh_asm;
112  std::cout << "error : " << dtkTypeError( Status ).c_str() << std::endl;
113  return ( Dtk_ErrorStatus)Status;
114  }
115  // Then we write for the mesh assembly constructed
116  cgrw_WriteMeshAsmNode( mesh_asm );
117 
118  // And free memory allocated for writing
119  cgrw_EndWrite();
120 
121  std::cout << "=> " << outputFileName.c_str() << std::endl << "Cgr Write end" << std::endl;
122 
123  delete mesh_asm;
124 
125  return dtkNoError;
126 }

◆ ColladaWriteSample()

DtkErrorStatus ColladaWriteSample ( const Dtk_string &  inResultDirectory)

Entry point: writes cube, cylinder, wireframe meshes with render infos and model display views into sample.dae.

15 {
16  Dtk_ErrorStatus errorStatus = dtkNoError;
17  DtkErrorStatus status;
18  Dtk_MeshPtr cubeMesh = NULL;
19  Dtk_MeshPtr cubeMeshVC = NULL;
20  Dtk_MeshPtr cylinderMesh = NULL;
21  Dtk_MeshPtr wireMesh = NULL;
22  Dtk_ModelDisplayPtr modelDisplay = NULL;
23  Dtk_RenderInfosPtr renderInfos = NULL;
24  Dtk_string outputFileName, outputDirectory;
25  Dtk_string nodeName;
26  Dtk_tab<Dtk_MetaDataPtr> tabMetadata;
27  Dtk_tab<Dtk_ID> tabNodesView1;
28  Dtk_tab<Dtk_ID> tabNodesView2;
29  Dtk_tab<Dtk_ID> tabNodesView3;
30  Dtk_tab< Dtk_tab <Dtk_ID> > tabNodesViews;
31  Dtk_ID nodeID = 0;
32  Dtk_bool reinstanciate = DTK_TRUE;
33  Dtk_InfoPtr info;
34 
35  std::cout << std::endl << "----------------------------------------------" << std::endl;
36  std::cout << "Collada Write start" << std::endl;
37 
38  // Choosing output directory and file name
39  outputDirectory = inResultDirectory + L"Collada/";
40  outputDirectory.FixPathSeparator();
41  outputDirectory.mkdir();
42  outputFileName = outputDirectory + L"sample.dae";
43 
44  // Cube Sample
45  cubeMesh = sampleWriter::CreateMeshCube();
47 
48  // Cylinder Sample
49  cylinderMesh = sampleWriter::CreateMeshCylinder( 30 );
50 
51  //RenderInfos Sample
53 
54  // First we initialize writing
55  Colladaw::WriteOptions options;
56  options.ConvertRenderInfos = 1;
57 
58  status = Colladaw::InitWrite( outputFileName, Dtk_string( "testcolladaw.log" ), options );
59 
60  if( status != 0 )
61  {
62  errorStatus = Colladaw::EndWrite();
63  std::cout << "error : " << dtkTypeError( status ).c_str() << std::endl;
64  return status;
65  }
66 
67  // Lets write a small assembly composed by one cube and one cylinder
68 
69  // let a matrix moving the cube on the left
70  Dtk_transfo cubetransfo;
71  cubetransfo.addTranslate( Dtk_dir( -10, 0, 0 ) );
72 
73  // let a matrix moving the cylinder
74  Dtk_transfo cyltransfo;
75  cyltransfo.addTranslate( Dtk_dir( 10, 0, 0 ) );
76 
77  // let a matrix moving the first instance
78  Dtk_transfo transfo;
79  transfo.addTranslate( Dtk_dir( 100, 100, 100 ) );
80  transfo.setXdir( 0.0, 1.0, 0.0 );
81  transfo.setYdir( 0.0, 0.0, 1.0 );
82  transfo.setZdir( 1.0, 0.0, 0.0 );
83 
84  // Rootnode creation
85  if( errorStatus == dtkNoError )
86  {
87  nodeName = "RootNode";
88  errorStatus = Colladaw::InitNode( nodeName );
89  }
90  // Facetted data node creation
91  if( errorStatus == dtkNoError )
92  {
93  nodeName = "Facetted data";
94  info = Dtk_Info::Create();
95  errorStatus = Colladaw::InitNode( nodeName, Dtk_transfo(), info, nodeID );
96  }
97 
98  // from this node, create a Child for the cube, giving its matrix, and naming it "Cube"
99  if( errorStatus == dtkNoError )
100  {
101  nodeName = "Cube";
102  errorStatus = Colladaw::InitNode( nodeName, cubetransfo );
103  }
104  cubeMesh->info() = Dtk_Info::Create();
105  cubeMesh->info()->AddRenderInfos( renderInfos );
106  // Write the mesh cube
107  if( errorStatus == dtkNoError )
109  // Close the mesh cube node
110  if( errorStatus == dtkNoError )
111  errorStatus = Colladaw::EndNode();
112 
113  // From root node again, create a Child for the cylinder, giving its matrix, and naming it "Cylinder"
114  if( errorStatus == dtkNoError )
115  {
116  nodeName = "Cylinder";
117  errorStatus = Colladaw::InitNode( nodeName, cyltransfo );
118  }
119  // Write the mesh cylinder
120  if( errorStatus == dtkNoError )
121  errorStatus = Colladaw::WriteEntity( Dtk_EntityPtr::DtkDynamicCast( cylinderMesh ) );
122  // Close the mesh cylinder
123  if( errorStatus == dtkNoError )
124  errorStatus = Colladaw::EndNode();
125  // Close the facetted data node
126  if( errorStatus == dtkNoError )
127  errorStatus = Colladaw::EndNode();
128 
129  if( reinstanciate )
130  {
131  // "Facetted data (Reinstanciated)" creation
132  if( errorStatus == dtkNoError )
133  {
134  nodeName = "Facetted data (Reinstanciated)";
135  errorStatus = Colladaw::InitNode( nodeName, transfo );
136  }
137  // Reinstanciating prototype nodeID
138  if( errorStatus == dtkNoError )
139  errorStatus = Colladaw::ReinstanciatePrototype( nodeID );
140  // Closing node
141  if( errorStatus == dtkNoError )
142  errorStatus = Colladaw::EndNode();
143  }
144  // Rootnode closing : VERY IMPORTANT, you must close all nodes that were opened.
145  if( errorStatus == dtkNoError )
146  errorStatus = Colladaw::EndNode();
147  // And free memory allocated for writing
148  if( errorStatus == dtkNoError )
149  errorStatus = Colladaw::EndWrite();
150 
151  std::cout << "=> " << outputFileName.c_str() << std::endl << "Collada Write end" << std::endl;
152 
153  return errorStatus;
154 }

◆ FbxWriteSample()

DtkErrorStatus FbxWriteSample ( const Dtk_string &  inResultDirectory)
92 {
93  Dtk_string outputDirectory, fileName;
94  std::cout << std::endl << "----------------------------------------------" << std::endl;
95 
96  // Choosing output directory and file name
97  outputDirectory = inResultDirectory + L"Fbx/";
98  outputDirectory.FixPathSeparator();
99  outputDirectory.mkdir();
100 
101  std::cout << "Fbx Write start" << std::endl;
102  // sample 1 : just wirte 2 meshes
103  fileName = outputDirectory + L"twomeshes.fbx";
104  Dtk_ErrorStatus errorStatus = FbxwTwoMeshes( fileName );
105  if( errorStatus == dtkNoError )
106  std::cout << "=> " << fileName.c_str() << std::endl;
107  else
108  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
109 
110  // sample 2 : write instances
111  fileName = outputDirectory + L"twomeshes.fbx";
112  errorStatus = FbxwInstances( fileName );
113  if( errorStatus == dtkNoError )
114  std::cout << "=> " << fileName.c_str() << std::endl;
115  else
116  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
117 
118  std::cout << "Fbx Write end" << std::endl;
119 
120  return errorStatus;
121 }

◆ GltfWriteSample()

DtkErrorStatus GltfWriteSample ( const Dtk_string &  inResultDirectory)
101 {
102  Dtk_string outputDirectory, fileName;
103  std::cout << std::endl << "----------------------------------------------" << std::endl;
104 
105  // Choosing output directory and file name
106  outputDirectory = inResultDirectory + L"Gltf/";
107  outputDirectory.FixPathSeparator();
108  outputDirectory.mkdir();
109 
110  std::cout << "Gltf Write start" << std::endl;
111  std::cout << "sample 1" << std::endl;
112  // sample 1 : just write 2 meshes
113  fileName = outputDirectory + L"twomeshes.gltf";
114  Dtk_ErrorStatus errorStatus = GltfwTwoMeshes( fileName );
115  if( errorStatus == dtkNoError )
116  std::cout << "=> " << fileName.c_str() << std::endl;
117  else
118  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
119 
120  std::cout << "sample 2" << std::endl;
121  // sample 2 : write instances
122  fileName = outputDirectory + L"instances.gltf";
123  errorStatus = GltfwInstances( fileName );
124  if( errorStatus == dtkNoError )
125  std::cout << "=> " << fileName.c_str() << std::endl;
126  else
127  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
128 
129  std::cout << "Gltf Write end" << std::endl;
130 
131  return errorStatus;
132 }

◆ IfcWriteSample()

DtkErrorStatus IfcWriteSample ( const Dtk_string &  inResultDirectory)

Entry point: orchestrates all IFC sample functions and writes the results into a sample.ifc file.

202 {
203  Dtk_string outputDirectory, outputFileName;
204  std::cout << std::endl << "----------------------------------------------" << std::endl;
205  std::cout << "Ifc Write start" << std::endl;
206 
207  // Choosing output directory and file name
208  outputDirectory = inResultDirectory + L"Ifc/";
209  outputDirectory.FixPathSeparator();
210  outputDirectory.mkdir();
211 
212  //The ProjectInformation class enables you to set global information while initializing the writer module
213  //This information is optionnali
215  myInfo.projectAuthor = L"my name";
216  myInfo.buildingName = L"sample building";
217  myInfo.siteLatitude = 45.7;
218  myInfo.siteLongitude = 4.8;
219  myInfo.siteElevation = 173000;
220 
221  // First we initialize writing with name of files, log file and the configuration we want to use
222  Ifcw::WriteOptions myOptions;
223  myOptions.versionIndicator = 0; //IFC2x3 version will be used to write the file. Set to 1 for IFC4.
224  outputFileName = outputDirectory + L"sample.ifc";
225  Dtk_ErrorStatus errorStatus = Ifcw::InitWrite( outputFileName, Dtk_string( outputDirectory + L"testifcw.log" ), myOptions, &myInfo );
226 
227  if( errorStatus != dtkNoError )
228  {
229  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
230  return errorStatus;
231  }
232 
233  //Write an ifc object/entity
234  ProcessBasicWall( myOptions.versionIndicator != 1 );
238 
239  Ifcw::EndWrite();
240 
241  std::cout << "=> " << outputFileName.c_str() << std::endl << "Ifc Write end" << std::endl;
242 
243  return dtkNoError;
244 }

◆ IgesWriteSample()

DtkErrorStatus IgesWriteSample ( const Dtk_string &  inResultDirectory)
146 {
147  std::cout << std::endl << "----------------------------------------------" << std::endl;
148  std::cout << "Iges Write start" << std::endl;
149  //Standard Iges Sample File Processing
150  DtkErrorStatus errorStatus = IgesAssemblySample( inResultDirectory );
151  std::cout << "Iges Write end" << std::endl;
152 
153  return errorStatus;
154 }

◆ JtWriteSample()

DtkErrorStatus JtWriteSample ( const Dtk_string &  inResultDirectory)
1331 {
1332  std::cout << std::endl << "----------------------------------------------" << std::endl;
1333  std::cout << "Jt Write start" << std::endl;
1334 
1335  tess_InitTesselation("./", 0.005); // Init Tessellation : working directory and default tolerance (needed for writing bodies)
1336  tess_ComputeBoundariesFromMesh(0); // Disable wire creation on mesh during Brep tessellation.
1337 
1338  DtkErrorStatus errorStatus = AllJtWTests(inResultDirectory); // all tests.
1339 
1340  tess_EndTesselation(); // End of tessellation
1341  std::cout << "Jt Write end" << std::endl;
1342 
1343 
1344  return errorStatus;
1345 }

◆ ObjWriteSample()

DtkErrorStatus ObjWriteSample ( const Dtk_string &  inResultDirectory)
78 {
79  std::cout << std::endl << "----------------------------------------------" << std::endl;
80  std::cout << "Obj Write start" << std::endl;
81  //Standard Obj Sample File Processing
82  DtkErrorStatus errorStatus = StandardObjSample( inResultDirectory );
83  std::cout << "Obj Write end" << std::endl;
84  return errorStatus;
85 }

◆ ParasolidWriteSample()

DtkErrorStatus ParasolidWriteSample ( const Dtk_string &  inResultDirectory)

Sample to start using Parasolid Writer Library.

Parameters
[in]inResultDirectory: Directory where the resulting parasolid files will be stored.
Returns
dtkNoError if OK
229 {
230  Dtk_ErrorStatus errorStatus = dtkNoError;
231 
232  // Logs : Print in output that we are currently using Parasolid Write.
233  std::cout << std::endl << "----------------------------------------------" << std::endl;
234  std::cout << "Parasolid Write start" << std::endl;
235 
236  // Create output directory for parasolid files.
237  Dtk_string outputDirectory = inResultDirectory + L"Parasolid/";
238  outputDirectory.FixPathSeparator();
239  outputDirectory.mkdir();
240 
241  // Test different ways to write a parasolid file.
242  // 1) Write an array of parts.
243  errorStatus = SampleWriteAnArrayOfParts( outputDirectory + L"sample_listofbody.x_t" );
244  // 2) Write an assembly.
245  if( errorStatus == dtkNoError ) // Checks should not fail in the untouched sample.
246  errorStatus = SampleWriteAnAssembly( outputDirectory + L"sample_assemblyofbody.x_t" );
247 
248  // Logs : Print in output that we finished using Parasolid Write.
249  std::cout << "Parasolid Write end" << std::endl;
250 
251  return errorStatus;
252 }

◆ PdfWriteSample()

DtkErrorStatus PdfWriteSample ( const Dtk_string &  inResultDirectory)
1059 {
1060  Dtk_ErrorStatus errStatus;
1061  std::cout << std::endl << "----------------------------------------------" << std::endl;
1062  std::cout << "Pdf Write start" << std::endl;
1063 
1064  Dtk_string imageDirectory = L"../InputFiles/Images/";
1065  Dtk_string outputDirectory;
1066 
1067  // Choosing output directory and file name
1068  outputDirectory = inResultDirectory + L"Pdf/";
1069  outputDirectory.FixPathSeparator();
1070  outputDirectory.mkdir();
1071 
1072  Dtk_string pdfFileName = outputDirectory + L"PDFW_SampleOneMesh_1_1.pdf";
1073  errStatus = PdfwSampleOneMesh_1_1( pdfFileName );
1074 
1075  pdfFileName = outputDirectory + L"PDFW_SampleMeshes_1_2.pdf";
1076  errStatus = PdfwSampleMeshes_1_2( pdfFileName );
1077 
1078  pdfFileName = outputDirectory + L"PDFW_SampleOneMeshRender_1_3.pdf";
1079  errStatus = PdfwSampleOneMeshRender_1_3( pdfFileName, imageDirectory );
1080 
1081  pdfFileName = outputDirectory + L"PDFW_SampleBody_2_1.pdf";
1082  errStatus = PdfwSampleBody_2_1( pdfFileName );
1083 
1084  pdfFileName = outputDirectory + L"PDFW_SampleWireBody_2_2.pdf";
1085  errStatus = PdfwSampleWireBody_2_2( pdfFileName );
1086 
1087  pdfFileName = outputDirectory + L"PDFW_SampleBodyVisibility_2_3.pdf";
1088  errStatus = PdfwSampleBodyVisibility_2_3( pdfFileName );
1089 
1090  pdfFileName = outputDirectory + L"PDFW_SampleAssembly_3_1.pdf";
1091  errStatus = PdfwSampleAssembly_3_1( pdfFileName );
1092 
1093  pdfFileName = outputDirectory + L"PDFW_SamplePartInstances_3_2.pdf";
1094  errStatus = PdfwSamplePartInstances_3_2( pdfFileName );
1095 
1096  pdfFileName = outputDirectory + L"PDFW_SampleAsmInstances_3_3.pdf";
1097  errStatus = PdfwSampleAsmInstances_3_3( pdfFileName );
1098 
1099  pdfFileName = outputDirectory + L"PDFW_SampleInstancesColors_3_4.pdf";
1100  errStatus = PdfwSampleInstancesColors_3_4( pdfFileName );
1101 
1102  pdfFileName = outputDirectory + L"PDFW_SampleInstancesVisibility_3_5.pdf";
1103  errStatus = PdfwSampleInstancesVisibility_3_5( pdfFileName );
1104 
1105  pdfFileName = outputDirectory + L"PDFW_SampleMetadatas_4_1.pdf";
1106  errStatus = PdfwSampleMetadatas_4_1( pdfFileName );
1107 
1108  pdfFileName = outputDirectory + L"PDFW_SampleDocumentProperties_4_2.pdf";
1109  errStatus = PdfwSampleDocumentProperties_4_2( pdfFileName );
1110 
1111  pdfFileName = outputDirectory + L"PDFW_SampleSimplePMI_5_1.pdf";
1112  errStatus = PdfwSampleSimplePMI_5_1( pdfFileName );
1113 
1114  pdfFileName = outputDirectory + L"PDFW_SampleSimpleModelview_5_2.pdf";
1115  errStatus = PdfwSampleSimpleModelview_5_2( pdfFileName );
1116 
1117  pdfFileName = outputDirectory + L"PDFW_Sample_MV_association_5_3.pdf";
1118  errStatus = PdfwSample_MV_association_5_3( pdfFileName );
1119 
1120  pdfFileName = outputDirectory + L"PDFW_SamplePMI_Geom_association_5_4.pdf";
1121  errStatus = PdfwSamplePMI_Geom_association_5_4( pdfFileName );
1122 
1123  pdfFileName = outputDirectory + L"PDFW_SampleModelview_sections_5_5.pdf";
1124  errStatus = PdfwSampleModelview_section_5_5( pdfFileName );
1125 
1126  pdfFileName = outputDirectory + L"PDFW_SamplePMI_PMI_association_5_6.pdf";
1127  errStatus = PdfwSamplePMI_PMI_association_5_6( pdfFileName );
1128 
1129  pdfFileName = outputDirectory + L"PDFW_SampleAxis_References_5_7.pdf";
1130  errStatus = PdfwSampleAxis_References_5_7( pdfFileName );
1131 
1132  pdfFileName = outputDirectory + L"PDFW_SampleCloudPoint_6_1.pdf";
1133  errStatus = PdfwSampleCloudPoint_6_1( pdfFileName );
1134 
1135  pdfFileName = outputDirectory + L"PDFW_SampleBillboard_7_1.pdf";
1136 
1137  errStatus = PdfwSampleBillboard_7_1( pdfFileName, imageDirectory );
1138 
1139  pdfFileName = outputDirectory + L"PDFW_SampleSecuredPdf_8_1.pdf";
1140  errStatus = PdfwSampleSecuredPdf_8_1( pdfFileName );
1141 
1142  pdfFileName = outputDirectory + L"PDFW_SampleLayoutMultipleViews_9_1.pdf";
1143  errStatus = PdfwSampleLayoutMultipleViews_9_1( pdfFileName );
1144 
1145  std::cout << "Pdf Write end" << std::endl;
1146 
1147  return errStatus;
1148 }

◆ PlmxmlWriteSample()

DtkErrorStatus PlmxmlWriteSample ( const Dtk_string &  inResultDirectory)
101 {
102  std::cout << std::endl << "----------------------------------------------" << std::endl;
103  std::cout << "Plmxml Write start" << std::endl;
104 
105  tess_InitTesselation("./", 0.005); // For JT : Init Tessellation : working directory and default tolerance (needed for writing bodies)
106  tess_ComputeBoundariesFromMesh(0); // Disable wire creation on mesh during Brep tessellation.
107 
108  DtkErrorStatus errorStatus = PlmxmlwritesampleJT(inResultDirectory);
109 
110  tess_EndTesselation(); // End of tessellation
111  std::cout << "Plmxml Write end" << std::endl;
112 
113 
114  return errorStatus;
115 }

◆ SatWriteSample()

DtkErrorStatus SatWriteSample ( const Dtk_string &  inResultDirectory)

Entry point: writes a solid cube and an open shell BRep body into a sample.sat (ACIS) file.

15 {
16  Dtk_string outputFileName, outputDirectory;
17 
18  std::cout << std::endl << "----------------------------------------------" << std::endl;
19  std::cout << "Acis Write start" << std::endl;
20 
21  // Choosing output directory and file name
22  outputDirectory = inResultDirectory + L"Acis/";
23  outputDirectory.FixPathSeparator();
24  outputDirectory.mkdir();
25  outputFileName = outputDirectory + L"sample.sat";
26 
27  // First you have to initialize the Sat writer
28  Dtk_ErrorStatus errorStatus = satw_InitFile( outputFileName );
29 
30  if( errorStatus )
31  {
32  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
33  return errorStatus;
34  }
35 
36  // We create 2 bodies
39 
40  // We init the part
41  satw_InitPart();
42 
43  // We write the 2 bodies
44  satw_WriteBody( body1 );
45  satw_WriteBody( body2 );
46 
47  // We close the part
48  satw_EndPart();
49 
50  // We free memory allocated for writing
51  satw_EndFile();
52  std::cout << "=> " << outputFileName.c_str() << std::endl;
53  std::cout << "Acis Write end" << std::endl;
54 
55  return dtkNoError;
56 }

◆ StepWriteSample()

DtkErrorStatus StepWriteSample ( const Dtk_string &  inResultDirectory)
821 {
822  Dtk_string outputFileName, outputDirectory;
823 
824  std::cout << std::endl << "----------------------------------------------" << std::endl;
825  std::cout << "Step Write start" << std::endl;
826 
827  stepw_SetModeProp( 3 );
828  stepw_SetModeFdt( 1 );
829  //stepw_SetModeFdt( 1, 5 ); Call this function to write both presentation placeholder and frozen graphic as PMI representation.
830 
831  // Choosing output directory and file name
832  outputDirectory = inResultDirectory + L"Step/";
833  outputDirectory.FixPathSeparator();
834  outputDirectory.mkdir();
835 
836  // First, initialize the Step writer
837  //int codeForAP203 = 1;
838  int codeForAP214 = 2;
839  //int codeForAP203E2 = 3;
840  int codeForAP242 = 4;
841  int codeForAP242Edition4 = 5;
842  int dummy;
843  {
844  outputFileName = outputDirectory + L"SampleMinimumProduct.step";
845  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP214 ) );
846  PRINT_ERROR( stepw::sample::Write_MinimumViableFile( L"SampleMinimumProduct", dummy ) );
848  std::cout << "=> " << outputFileName.c_str() << std::endl;
849  }
850  //[...]
851  //end_of_mainstepwrite
852  {
853  outputFileName = outputDirectory + L"SampleMinimumProduct_UserDefinedHeader.step";
854  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP214 ) );
855  stepw::sample::Write_UserDefinedHeader( L"SampleMinimumProduct_UserDefinedHeader", dummy );
857  std::cout << "=> " << outputFileName.c_str() << std::endl;
858  }
859  {
860  outputFileName = outputDirectory + L"SamplePart_BodyOnly.step";
861  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP214 ) );
862  stepw::sample::WritePart_BodyOnly( L"SamplePart_BodyOnly", dummy );
864  std::cout << "=> " << outputFileName.c_str() << std::endl;
865  }
866  {
867  outputFileName = outputDirectory + L"SamplePart_BodyWithAxisSystem.step";
868  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP214 ) );
869  stepw::sample::WritePart_BodyWithAxisSystem( L"SamplePart_BodyWithAxisSystem", dummy );
871  std::cout << "=> " << outputFileName.c_str() << std::endl;
872  }
873  {
874  outputFileName = outputDirectory + L"SamplePart_WireframeOnly.step";
875  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP214 ) );
876  stepw::sample::WritePart_WireframeOnly( L"SamplePart_WireframeOnly", dummy );
878  std::cout << "=> " << outputFileName.c_str() << std::endl;
879  }
880  {
881  outputFileName = outputDirectory + L"SamplePart_MeshOnly.step";
882  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP214 ) );
883  stepw::sample::WritePart_MeshOnly( L"SamplePart_MeshOnly", dummy );
885  std::cout << "=> " << outputFileName.c_str() << std::endl;
886  }
887  {
888  outputFileName = outputDirectory + L"SamplePart_MeshWithFaceColors.step";
889  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP214 ) );
890  stepw::sample::WritePart_MeshWithFaceColors( L"SamplePart_MeshWithFaceColors", dummy );
892  std::cout << "=> " << outputFileName.c_str() << std::endl;
893  }
894  {
895  outputFileName = outputDirectory + L"SamplePart_BodyAndMeshFromTessellation.step";
896  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP214 ) );
897  stepw::sample::WritePart_BodyAndMeshFromTessellation( L"SamplePart_BodyAndMeshFromTessellation", dummy );
899  std::cout << "=> " << outputFileName.c_str() << std::endl;
900  }
901  {
902  outputFileName = outputDirectory + L"SamplePart_WithProperties.step";
903  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP214 ) );
904  stepw::sample::WritePart_WithProperties( L"SamplePart_WithProperties", dummy );
906  std::cout << "=> " << outputFileName.c_str() << std::endl;
907  }
908  {
909  outputFileName = outputDirectory + L"SamplePart_BodyInNamedLayer.step";
910  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242 ) );
911  stepw::sample::WritePart_BodyInNamedLayer( L"SamplePart_BodyInNamedLayer", dummy );
913  std::cout << "=> " << outputFileName.c_str() << std::endl;
914  }
915  {
916  outputFileName = outputDirectory + L"SamplePart_Datum.step";
917  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242Edition4 ) );
918  stepw::sample::WritePart_Datum( L"SamplePart_Datum", dummy );
920  std::cout << "=> " << outputFileName.c_str() << std::endl;
921  }
922  {
923  outputFileName = outputDirectory + L"SamplePart_GeometricalTolerance.step";
924  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242Edition4 ) );
925  stepw::sample::WritePart_GeometricalTolerance( L"SamplePart_GeometricalTolerance", dummy );
927  std::cout << "=> " << outputFileName.c_str() << std::endl;
928  }
929  {
930  outputFileName = outputDirectory + L"SamplePart_UsedByExternalAssembly.step";
931  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242 ) );
932  stepw::sample::WritePart_UsedByExternalAssembly( L"SamplePart_UsedByExternalAssembly", dummy );
934  std::cout << "=> " << outputFileName.c_str() << std::endl;
935  }
936  {
937  outputFileName = outputDirectory + L"SampleAssembly.step";
938  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242Edition4 ) );
939  stepw::sample::WriteAssembly( L"SampleAssembly" );
941  std::cout << "=> " << outputFileName.c_str() << std::endl;
942  }
943  {
944  outputFileName = outputDirectory + L"SampleAssembly_InstanceOverride.step";
945  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242 ) );
946  stepw::sample::WriteAssembly_InstanceOverride( L"SampleAssembly_InstanceOverride" );
948  std::cout << "=> " << outputFileName.c_str() << std::endl;
949  }
950  {
951  outputFileName = outputDirectory + L"SampleAssembly_DimensionFDT.step";
952  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242Edition4 ) );
953  stepw::sample::WriteAssembly_DimensionFDT( L"SampleAssembly_DimensionFDT");
955  std::cout << "=> " << outputFileName.c_str() << std::endl;
956  }
957  {
958  outputFileName = outputDirectory + L"SampleAssembly_WithProperties.step";
959  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242 ) );
960  stepw::sample::WriteAssembly_WithProperties( L"SampleAssembly_WithProperties");
962  std::cout << "=> " << outputFileName.c_str() << std::endl;
963  }
964  {
965  outputFileName = outputDirectory + L"SampleAssembly_InstanceAttributes.step";
966  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242 ) );
967  stepw::sample::WriteAssembly_InstanceAttributes( L"SampleAssembly_InstanceAttributes" );
969  std::cout << "=> " << outputFileName.c_str() << std::endl;
970  }
971  {
972  outputFileName = outputDirectory + L"SampleAssembly_BasicExternalReferences.step";
973  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242 ) );
974  stepw::sample::WriteAssembly_BasicExternalReferences( L"SampleAssembly_BasicExternalReferences");
976  std::cout << "=> " << outputFileName.c_str() << std::endl;
977  }
978  {
979  outputFileName = outputDirectory + L"SampleAssembly_BasicExternalReference_DimensionFDT.step";
980  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242 ) );
981  stepw::sample::WriteAssembly_BasicExternalReference_DimensionFDT( L"SampleAssembly_BasicExternalReference_DimensionFDT");
983  std::cout << "=> " << outputFileName.c_str() << std::endl;
984  }
985  {
986  outputFileName = outputDirectory + L"SampleAssembly_NestedExternalReferences.step";
987  PRINT_ERROR( stepw_InitFile( outputFileName, " sample ", codeForAP242 ) );
988  stepw::sample::WriteAssembly_NestedExternalReferences( L"SampleAssembly_NestedExternalReferences");
990  std::cout << "=> " << outputFileName.c_str() << std::endl;
991  }
992 
993  std::cout << "Step Write end" << std::endl;
994 
995  return dtkNoError;
996 }

◆ SwWriteSample()

DtkErrorStatus SwWriteSample ( Dtk_API *  inDtkAPI,
const Dtk_string &  inResultDirectory 
)

Entry point: writes BRep parts with face colors and a SolidWorks assembly into .sldprt / .sldasm files.

217 {
218  std::cout << std::endl << "----------------------------------------------" << std::endl;
219  std::cout << "Solidworks Write start" << std::endl;
220  // Choosing output directory and file name
221  Dtk_string outputDirectory = inResultDirectory + "Sw/";
222  outputDirectory.FixPathSeparator();
223  outputDirectory.mkdir();
224  {
225  //remove old file
226  Dtk_string temp;
227  temp = outputDirectory + L"my_test_part.sldprt";
228  temp.unlink();
229  temp = outputDirectory + L"my_test_part2.sldprt";
230  temp.unlink();
231  temp = outputDirectory + L"my_test_assembly.sldasm";
232  temp.unlink();
233  temp = outputDirectory + L"logwrite.txt";
234  temp.unlink();
235  }
236 
237  Dtk_ErrorStatus errorStatus;
238 
239  Dtk_string StrSchemaPath = inResultDirectory + L"../bin/Schema/";
240 
241 #ifdef PSKERNEL_USER
242  //First if you haven't done yet, start the parasolid session
243  StartParasolid();
244  //And informs that the session is started
246 
247  //Set the schema path
248 #ifndef Linux
249  wchar_t *schPath;
250  schPath = ( wchar_t* )malloc( sizeof( wchar_t ) * ( StrSchemaPath.len() + 10 ) );
251  swprintf( schPath, 255, L"P_SCHEMA=%s", StrSchemaPath.w_str() );
252  _wputenv( schPath );
253 #else
254  char *schPath;
255  schPath = ( char* )malloc( sizeof( char ) * ( StrSchemaPath.len() + 10 ) );
256  sprintf( schPath, "P_SCHEMA=%s", StrSchemaPath.c_str() );
257  putenv( schPath );
258 #endif
259 
260  //dont delete it because getenv doesn't work or retrun null string
261  //free(schPath);
262  //schPath=NULL;
263 #endif
264  if( inDtkAPI != NULL )
265  inDtkAPI->SetSchemaDir( StrSchemaPath );
266  else
267  {
268  return dtkErrorAPINotStarted;
269  }
270 
271  Dtk_string logwrite = inDtkAPI->GetWorkingDir() + L"logwrite.txt";
272  Dtk_string FilenamePart;
273  errorStatus = sw::sww::InitWriter( logwrite, NULL, sw::sww::english );
274 
275  Dtk_string xmtfile = inResultDirectory + L"/xmt/CS_WHEEL_CAP.X_T";
276 
277 
278  if( errorStatus == dtkNoError )
279  {
280  //how to create part file
281  FilenamePart = outputDirectory + L"my_test_part.sldprt";
282  create_part( FilenamePart, xmtfile );
283  }
284 
285 
286  if( errorStatus == dtkNoError )
287  {
288  FilenamePart = outputDirectory + L"my_test_part2.sldprt";
289  create_part( FilenamePart, xmtfile );
290  }
291 
292 
293  if( errorStatus == dtkNoError )
294  {
295  //how to create assembly file
296  Dtk_string FilenameAssm = outputDirectory + L"my_test_assembly.sldasm";
297  create_assembly( FilenameAssm, FilenamePart );
298  }
299 
301 
302 #ifdef PSKERNEL_USER
303  //Stop the parasolid session
305  StopParasolid();
306 #endif
307  std::cout << "Solidworks Write end" << std::endl;
308 
309  return errorStatus;
310 }

◆ UgWriteSample()

DtkErrorStatus UgWriteSample ( const Dtk_string &  inResultDirectory)
752 {
753  Dtk_string inOutputDirectory, nxDirectory;
754  Dtk_ErrorStatus errorStatus;
755 
756  std::cout << std::endl << "----------------------------------------------" << std::endl;
757  std::cout << "Ug Write start" << std::endl;
758 
759  nxDirectory = inResultDirectory + L"NX-Unigraphics/";
760  nxDirectory.FixPathSeparator();
761  nxDirectory.mkdir();
762 
763  // Choosing output for inVersion NX5
764  inOutputDirectory = inResultDirectory + L"NX-Unigraphics/nx5/";
765  inOutputDirectory.FixPathSeparator();
766  inOutputDirectory.mkdir();
767  errorStatus = UgWriteSampleVersion(inOutputDirectory, DTK_UGW_VERSION_NX5);
768 
769  // Choosing output for inVersion NX1980
770  inOutputDirectory = inResultDirectory + L"NX-Unigraphics/nx1980/";
771  inOutputDirectory.FixPathSeparator();
772  inOutputDirectory.mkdir();
773  errorStatus = UgWriteSampleVersion(inOutputDirectory, DTK_UGW_VERSION_NX1980);
774 
775  // Choosing output for inVersion NX2212
776  inOutputDirectory = inResultDirectory + L"NX-Unigraphics/nx2212/";
777  inOutputDirectory.FixPathSeparator();
778  inOutputDirectory.mkdir();
779  errorStatus = UgWriteSampleVersion(inOutputDirectory, DTK_UGW_VERSION_NX2212);
780 
781  std::cout << "Ug Write end" << std::endl;
782 
783  return errorStatus;
784 }

◆ UsdWriteSample()

DtkErrorStatus UsdWriteSample ( const Dtk_string &  inResultDirectory)
95 {
96  Dtk_string outputDirectory, fileName;
97  std::cout << std::endl << "----------------------------------------------" << std::endl;
98 
99  // Choose the output directory and create it if necessary
100  outputDirectory = inResultDirectory + L"Usd/";
101  outputDirectory.FixPathSeparator();
102  outputDirectory.mkdir();
103 
104  std::cout << "Usd Write start" << std::endl;
105 
106  std::cout << "sample 1" << std::endl;
107  // Sample 1: simple three-mesh hierarchy.
108  fileName = outputDirectory + L"threemeshes.usd";
109  Dtk_ErrorStatus errorStatus = UsdwThreeMeshes( fileName );
110  if( errorStatus == dtkNoError )
111  std::cout << "=> " << fileName.c_str() << std::endl;
112  else
113  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
114 
115  std::cout << "sample 2" << std::endl;
116  // Sample 2: geometry instancing with USD references
117  fileName = outputDirectory + L"instances.usd";
118  errorStatus = UsdwInstances( fileName );
119  if( errorStatus == dtkNoError )
120  std::cout << "=> " << fileName.c_str() << std::endl;
121  else
122  std::cout << "error : " << dtkTypeError( errorStatus ).c_str() << std::endl;
123 
124  std::cout << "Usd Write end" << std::endl;
125 
126  return errorStatus;
127 }
Dtk_Info::Create
static Dtk_SmartPtr< Dtk_Info > Create()
Calls default constructor to allocate a new object.
PdfwSampleSecuredPdf_8_1
Dtk_ErrorStatus PdfwSampleSecuredPdf_8_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:881
satw_InitPart
DtkErrorStatus satw_InitPart()
Initializes the writing of a 3D part.
Dtk_mesh_asm_node
This class gathers asm node related datas.
Definition: cgrw.hpp:21
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:688
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
ProcessBasicWall
Dtk_ErrorStatus ProcessBasicWall(Dtk_bool inMesh)
Definition: testlibifcwrite.cpp:23
Ifcw::ProjectInformation::buildingName
Dtk_string buildingName
Definition: IFCWriter.h:70
FbxwTwoMeshes
Dtk_ErrorStatus FbxwTwoMeshes(const Dtk_string &inOutputFileName)
Sample 1: writes a cube and a cylinder mesh in a two-node hierarchy into an FBX file.
Definition: testlibfbxwrite.cpp:15
PdfwSampleMetadatas_4_1
Dtk_ErrorStatus PdfwSampleMetadatas_4_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:477
sampleWriter::CreateMeshCube
Dtk_MeshPtr CreateMeshCube()
Mesh Cube sample.
Definition: testcreatemesh.cpp:207
stepw::sample::WritePart_MeshOnly
DtkErrorStatus WritePart_MeshOnly(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:123
PdfwSampleAxis_References_5_7
Dtk_ErrorStatus PdfwSampleAxis_References_5_7(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:763
Colladaw::EndNode
DtkErrorStatus EndNode()
End the node.
ProcessAsm
Dtk_ErrorStatus ProcessAsm(const Dtk_string &inResultDirectory, const Dtk_string &inInputFilesDirectory)
Writes a CATProduct assembly: one sub-product referencing a CATPart and one instanced directly from a...
Definition: testlibcatiav5write.cpp:380
catiav5w::WriteOptions
This class provides several options to tunes CatiaV5 Writter. It must be provided to catiav5w::InitWr...
Definition: catiav5w.hpp:41
PdfwSampleLayoutMultipleViews_9_1
Dtk_ErrorStatus PdfwSampleLayoutMultipleViews_9_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:1005
Dtk_transfo::setOrigin
void setOrigin(const Dtk_pnt &O)
Set a new O center point.
Dtk_mesh_asm_node::set_id
void set_id(int inId)
Set an Id.
AllJtWTests
DtkErrorStatus AllJtWTests(const Dtk_string &inResultDirectory)
Definition: testlibjtwrite.cpp:1241
Dtk_transfo::setZdir
void setZdir(const Dtk_dir &Z)
Set a new Z vector.
Ifcw::ProjectInformation::siteElevation
Dtk_Double64 siteElevation
Definition: IFCWriter.h:76
Colladaw::InitWrite
DtkErrorStatus InitWrite(const Dtk_string &inOutputFile, const Dtk_string &inLogFile, WriteOptions &inOptions)
Initialize the Collada Writer
Ifcw::InitWrite
DtkErrorStatus InitWrite(const Dtk_string &inOutputFile, const Dtk_string &inLogFile, const WriteOptions &inOptions, ProjectInformation *inProjectInfo=nullptr)
Initialize the Ifc Writer and the IFC version you want to write
Ifcw::WriteOptions::versionIndicator
int versionIndicator
Definition: IFCWriter.h:38
StandardObjSample
DtkErrorStatus StandardObjSample(const Dtk_string &inResultDirectory)
Entry point: writes a textured cube and a per-face colored cube mesh into a sample....
Definition: testlibobjwrite.cpp:15
tess_InitTesselation
int tess_InitTesselation(Dtk_string inWorkingDirectory, double inTolerance)
Init the tesselation library.
DTK_TRUE
#define DTK_TRUE
Definition: define.h:726
_3dxmlw::WriteOptions
This class provides several options to tune 3dxml Writer. It must be provided to _3dxmlw::InitWrite m...
Definition: 3dxmlw.hpp:162
Dtk_mesh_asm_node::add_axis_system
int add_axis_system(Dtk_AxisSystemPtr inAxisSystem)
Add an Dtk_AxisSystemPtr in Dtk_mesh_asm_node in the current asm node.
create_assembly
void create_assembly(const Dtk_string &inFilename, const Dtk_string &inFilenamePart)
Definition: testlibswwrite.cpp:147
DTK_UGW_VERSION_NX5
#define DTK_UGW_VERSION_NX5
Definition: ugw.hpp:7
stepw::sample::WriteAssembly_InstanceOverride
DtkErrorStatus WriteAssembly_InstanceOverride(const Dtk_string &inRootAssemblyName)
Definition: testlibstepwrite.cpp:426
PdfwSamplePartInstances_3_2
Dtk_ErrorStatus PdfwSamplePartInstances_3_2(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:234
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
create_part
void create_part(const Dtk_string &inFilename, const Dtk_string &inParasolidFile)
Definition: testlibswwrite.cpp:59
Dtk_string::unlink
int unlink() const
File Utility : Delete a file.
stepw::sample::WritePart_BodyWithAxisSystem
DtkErrorStatus WritePart_BodyWithAxisSystem(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:86
UgWriteSampleVersion
Dtk_ErrorStatus UgWriteSampleVersion(const Dtk_string &inOutputDirectory, int inVersion)
Entry point: runs all UGW sample functions for the given NX format version and output directory.
Definition: testlibugwrite.cpp:679
Ifcw::ProjectInformation::projectAuthor
Dtk_string projectAuthor
Definition: IFCWriter.h:71
GltfwInstances
Dtk_ErrorStatus GltfwInstances(const Dtk_string &inOutputFileName)
Sample 2: writes 10 re-instanced cubes and a wireframe mesh into a GLTF file, demonstrating geometry ...
Definition: testlibgltfwrite.cpp:57
sampleWriter::CreateAxisSystem
Dtk_AxisSystemPtr CreateAxisSystem()
Creates a named axis system with a custom orientation matrix, red color, layer 123,...
Definition: testcreatecube.cpp:1541
PRINT_ERROR
#define PRINT_ERROR(inStatus)
Definition: testwriters.h:9
stepw::sample::WritePart_WireframeOnly
DtkErrorStatus WritePart_WireframeOnly(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:106
PdfwSampleModelview_section_5_5
Dtk_ErrorStatus PdfwSampleModelview_section_5_5(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:676
Dtk_bool
char Dtk_bool
Definition: define.h:724
Dtk_API::GetWorkingDir
const Dtk_string & GetWorkingDir() const
tess_ComputeBoundariesFromMesh
void tess_ComputeBoundariesFromMesh(int value)
Set boundaries computation from mesh option. Default value is enabled (1). See tess_getBoundariesFrom...
PdfwSampleBillboard_7_1
Dtk_ErrorStatus PdfwSampleBillboard_7_1(const Dtk_string &inOutputFileName, const Dtk_string &inImageDirectory)
Definition: testlibpdfwrite.cpp:848
dtkErrorAPINotStarted
@ dtkErrorAPINotStarted
Definition: error_dtk.hpp:109
Dtk_API::SetSchemaDir
Dtk_ErrorStatus SetSchemaDir(const Dtk_string &inSchemaDir)
Set Schema Directory needed for Unigraphics, Parasolid, Solidedge, Solidworks and Jt readers.
Dtk_mesh_asm_node::set_color
void set_color(Dtk_RGB &inColor)
set color on Dtk_mesh_asm_node
Colladaw::EndWrite
DtkErrorStatus EndWrite()
Creation of the output file and free the Collada Writer
Dtk_transfo::setXdir
void setXdir(const Dtk_dir &X)
Set a new X vector.
sampleWriter::FillFacesColors
void FillFacesColors(Dtk_MeshPtr &inoutCubeMesh)
Filling mesh faces with colors.
Definition: testcreatemesh.cpp:244
cgrw_EndWrite
int cgrw_EndWrite()
Free the Cgr Writer
stepw_SetModeProp
DtkErrorStatus stepw_SetModeProp(const int inMode)
Activates/Deactivates writing of properties : User Attributes, Product Data.
UsdwThreeMeshes
Dtk_ErrorStatus UsdwThreeMeshes(const Dtk_string &inOutputFileName)
Sample 1: writes a cube and a cylinder mesh in a two-node hierarchy into a USD file.
Definition: testlibusdwrite.cpp:12
Dtk_3MFWriter::InitWrite
DtkErrorStatus InitWrite(const Dtk_string &inOutputFile, const Dtk_string &inLogFile, const WriteOptions &inOptions)
Initialize the 3mf Writer
Colladaw::WriteOptions
This class provides several options to tune Collada Writer. It must be provided to Colladaw::InitWrit...
Definition: colladaw.hpp:23
WriteEntity
Dtk_ErrorStatus WriteEntity(const Dtk_MeshPtr &inCubeMesh, const Dtk_MeshPtr &inCylinderMesh)
Builds the 3DXML product hierarchy with 3 child nodes ( node, cylinder mesh, cube mesh)....
Definition: testlib3dxmlwrite.cpp:16
stepw_InitFile
DtkErrorStatus stepw_InitFile(const Dtk_string &inFileName, const char *inOriginatingSystem=" user ", const int inSchema=0)
Initializes a file to be written.
PdfwSampleInstancesVisibility_3_5
Dtk_ErrorStatus PdfwSampleInstancesVisibility_3_5(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:431
PlmxmlwritesampleJT
Dtk_ErrorStatus PlmxmlwritesampleJT(const Dtk_string &inResultDirectory)
Definition: testlibplmxmlwrite.cpp:36
stepw::sample::WriteAssembly_BasicExternalReferences
DtkErrorStatus WriteAssembly_BasicExternalReferences(const Dtk_string &inRootAssemblyName)
Definition: testlibstepwrite.cpp:658
sampleWriter::CreateMeshWire
Dtk_MeshPtr CreateMeshWire()
Wire mesh sample.
Definition: testcreatemesh.cpp:389
PdfwSampleOneMesh_1_1
Dtk_ErrorStatus PdfwSampleOneMesh_1_1(const Dtk_string &inOutputFileName)
PDF write sample entry point: orchestrates all PDF sample functions.
Definition: testlibpdfwrite.cpp:24
SampleWriteAnArrayOfParts
static Dtk_ErrorStatus SampleWriteAnArrayOfParts(const Dtk_string &inOutputFile)
Definition: testlibparasolidwrite.cpp:29
Colladaw::WriteOptions::ConvertRenderInfos
Dtk_bool ConvertRenderInfos
Definition: colladaw.hpp:33
stepw::sample::WritePart_BodyOnly
DtkErrorStatus WritePart_BodyOnly(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:68
sw::sww::InitWriter
Dtk_ErrorStatus InitWriter(const Dtk_string &inLogFile, Licence_dtk inLicFct, sw::sww::language inLanguage=sw::sww::english)
Initialize the Solidworks Writer
stepw_SetModeFdt
DtkErrorStatus stepw_SetModeFdt(const int inMode, const int inPolyline=2)
Activates/Deactivates writing of FDT.
_3dxmlw::EndWrite
DtkErrorStatus EndWrite()
Creation of the output file and free the 3dxmlw Writer
Dtk_3MFWriter::WriteOptions
This class provides several options to tune 3mf Writer. It must be provided to _3mfw::InitWrite metho...
Definition: 3mfw.hpp:29
PdfwSampleCloudPoint_6_1
Dtk_ErrorStatus PdfwSampleCloudPoint_6_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:792
stepw::sample::Write_MinimumViableFile
DtkErrorStatus Write_MinimumViableFile(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:43
ProcessMultiMeshWall
Dtk_ErrorStatus ProcessMultiMeshWall()
Writes a wall element composed of multiple mesh pieces with custom properties and a GUID.
Definition: testlibifcwrite.cpp:149
Ifcw::ProjectInformation::siteLatitude
Dtk_Double64 siteLatitude
Definition: IFCWriter.h:74
stepw::sample::WritePart_BodyInNamedLayer
DtkErrorStatus WritePart_BodyInNamedLayer(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:354
sw::sww::EndWriter
Dtk_ErrorStatus EndWriter()
Free the Solidworks Writer
Ifcw::WriteOptions
This class provides several options to tune the IFC Writer. It must be provided to Ifcw::InitWrite me...
Definition: IFCWriter.h:29
PdfwSampleBodyVisibility_2_3
Dtk_ErrorStatus PdfwSampleBodyVisibility_2_3(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:161
PdfwSampleMeshes_1_2
Dtk_ErrorStatus PdfwSampleMeshes_1_2(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:48
Dtk_SmartPtr< Dtk_Entity >::DtkDynamicCast
static Dtk_SmartPtr< Dtk_Entity > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
cgrw_InitWrite
int cgrw_InitWrite(Dtk_string inFileWritten, Dtk_string inLogFile, Licence_dtk inLicFct, Dtk_string inLicenceFile, const WriteOptions &inOptions=WriteOptions())
Initialize the Cgr Writer
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
satw_InitFile
DtkErrorStatus satw_InitFile(const Dtk_string &inFileOut, const satw_WriteOptions &inOptions=satw_WriteOptions())
Initializes a file to be written.
Dtk_3MFWriter::WriteEntity
Dtk_ErrorStatus WriteEntity(const Dtk_EntityPtr &inEntity)
Write the entity provided in parameter in a node.
stepw::sample::WritePart_Datum
DtkErrorStatus WritePart_Datum(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:228
sampleWriter::CreateCubeRenderInfos
Dtk_RenderInfosPtr CreateCubeRenderInfos()
Creates a Dtk_RenderInfos object with ambient, diffuse, and specular lighting and a texture for use o...
Definition: testcreatemesh.cpp:501
stepw::sample::WriteAssembly_InstanceAttributes
DtkErrorStatus WriteAssembly_InstanceAttributes(const Dtk_string &inRootAssemblyName)
Definition: testlibstepwrite.cpp:616
stepw::sample::WriteAssembly_BasicExternalReference_DimensionFDT
DtkErrorStatus WriteAssembly_BasicExternalReference_DimensionFDT(const Dtk_string &inRootAssemblyName)
Definition: testlibstepwrite.cpp:739
Ifcw::EndWrite
DtkErrorStatus EndWrite()
Creation of the output file and free the Ifc Writer
Dtk_transfo::setScale
void setScale(Dtk_Double64 scale)
Set a new scale.
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
stepw_EndFile
DtkErrorStatus stepw_EndFile()
Ends the writing of the current STEP file.
Ifcw::ProjectInformation::siteLongitude
Dtk_Double64 siteLongitude
Definition: IFCWriter.h:75
dtkTypeError
Dtk_string dtkTypeError(Dtk_Int32 errNumero)
catiav5w::EndWrite
Dtk_ErrorStatus EndWrite()
Free the Catia V5 Writer
catiav5w::WriteOptions::SetFileRelease
Dtk_ErrorStatus SetFileRelease(const Dtk_UInt32 inRelease)
Sets the release for the written files.
Dtk_string::c_str
const char * c_str() const
Retrieve the ASCII conversion string.
sampleWriter::CreateMeshCylinder
Dtk_MeshPtr CreateMeshCylinder(int nbpoints)
Mesh Cylinder sample.
Definition: testcreatemesh.cpp:338
stepw::sample::Write_UserDefinedHeader
DtkErrorStatus Write_UserDefinedHeader(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:54
PdfwSampleInstancesColors_3_4
Dtk_ErrorStatus PdfwSampleInstancesColors_3_4(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:333
Dtk_mesh_asm_node::add_mesh
int add_mesh(Dtk_MeshPtr mesh)
Add an Dtk_mesh in Dtk_mesh_asm_node in the current asm node.
Dtk_transfo::setYdir
void setYdir(const Dtk_dir &Y)
Set a new Y vector.
PdfwSampleAssembly_3_1
Dtk_ErrorStatus PdfwSampleAssembly_3_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:193
Dtk_string::mkdir
int mkdir() const
File Utility : Create a Directory.
PdfwSampleSimplePMI_5_1
Dtk_ErrorStatus PdfwSampleSimplePMI_5_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:547
Dtk_pnt
This is a mathematical point class.
Definition: dtk_pnt.hpp:20
PdfwSamplePMI_Geom_association_5_4
Dtk_ErrorStatus PdfwSamplePMI_Geom_association_5_4(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:644
PdfwSampleAsmInstances_3_3
Dtk_ErrorStatus PdfwSampleAsmInstances_3_3(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:278
Dtk_string::FixPathSeparator
void FixPathSeparator()
File Utility : Fixes path separator consistency. It lets you replace the '\' or '/' by the OS needed ...
cgrw_WriteMeshAsmNode
Dtk_ErrorStatus cgrw_WriteMeshAsmNode(Dtk_mesh_asm_node *inRoot)
Write a mesh assembly.
stepw::sample::WritePart_UsedByExternalAssembly
DtkErrorStatus WritePart_UsedByExternalAssembly(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:327
IgesAssemblySample
Dtk_ErrorStatus IgesAssemblySample(const Dtk_string &inResultDirectory)
Writes an IGES assembly: two products each containing BRep bodies, demonstrating multi-product IGES s...
Definition: testlibigeswrite.cpp:71
PdfwSample_MV_association_5_3
Dtk_ErrorStatus PdfwSample_MV_association_5_3(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:601
PdfwSampleDocumentProperties_4_2
Dtk_ErrorStatus PdfwSampleDocumentProperties_4_2(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:503
satw_EndPart
DtkErrorStatus satw_EndPart()
Ends the writing of a part.
sw::sww::english
@ english
Definition: solidworksw.hpp:25
Dtk_3MFWriter
3MF Writer main class.
Definition: 3mfw.hpp:16
Colladaw::ReinstanciatePrototype
DtkErrorStatus ReinstanciatePrototype(Dtk_ID inID)
Reinstanciate a node.
stepw::sample::WriteAssembly_WithProperties
DtkErrorStatus WriteAssembly_WithProperties(const Dtk_string &inRootAssemblyName)
Definition: testlibstepwrite.cpp:562
UsdwInstances
Dtk_ErrorStatus UsdwInstances(const Dtk_string &inOutputFileName)
Sample 2: writes 10 re-instanced cubes into a USD file, demonstrating USD referencing.
Definition: testlibusdwrite.cpp:59
stepw::sample::WritePart_GeometricalTolerance
DtkErrorStatus WritePart_GeometricalTolerance(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:276
GltfwTwoMeshes
Dtk_ErrorStatus GltfwTwoMeshes(const Dtk_string &inOutputFileName)
Sample 1: writes a cube and a cylinder mesh in a two-node hierarchy into a GLTF file.
Definition: testlibgltfwrite.cpp:16
stepw::sample::WriteAssembly_NestedExternalReferences
DtkErrorStatus WriteAssembly_NestedExternalReferences(const Dtk_string &inRootAssemblyName)
Definition: testlibstepwrite.cpp:697
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:84
ProcessPrototypedColumns
Dtk_ErrorStatus ProcessPrototypedColumns(int inColumnCount)
Writes a set of column elements sharing the same prototyped geometry (IfcElementType),...
Definition: testlibifcwrite.cpp:97
Dtk_transfo::addTranslate
void addTranslate(const Dtk_dir &V)
Translate the Dtk_transfo.
WriteOptions
This class provides several options to tunes cgr Writter. It must be provided to cgr::cgrw_InitWrite ...
Definition: cgrw.hpp:95
sampleWriter::CreateCube
Dtk_BodyPtr CreateCube()
Creates a 100x100x100 mm closed BRep cube body. Builds the full BRep hierarchy (Vertex,...
Definition: testcreatecube.cpp:1325
stepw::sample::WritePart_BodyAndMeshFromTessellation
DtkErrorStatus WritePart_BodyAndMeshFromTessellation(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:161
Ifcw::ProjectInformation
This struct enables the user to define global properties regarding the project, construction site and...
Definition: IFCWriter.h:65
DTK_UGW_VERSION_NX1980
#define DTK_UGW_VERSION_NX1980
Definition: ugw.hpp:8
_3dxmlw::InitWrite
DtkErrorStatus InitWrite(const Dtk_string &inOutputFile, const Dtk_string &inLogFile, WriteOptions &inOptions)
Initialize the 3dxmlw Writer
PdfwSamplePMI_PMI_association_5_6
Dtk_ErrorStatus PdfwSamplePMI_PMI_association_5_6(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:724
PdfwSampleWireBody_2_2
Dtk_ErrorStatus PdfwSampleWireBody_2_2(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:139
stepw::sample::WritePart_WithProperties
DtkErrorStatus WritePart_WithProperties(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:186
Dtk_string::len
int len() const
Retrieve the length of the Dtk_string.
Colladaw::InitNode
DtkErrorStatus InitNode(Dtk_string &inNodeName, const Dtk_transfo &inTransfo, Dtk_InfoPtr &inInfo, Dtk_ID &outID)
Initialize a node.
SampleWriteAnAssembly
static Dtk_ErrorStatus SampleWriteAnAssembly(const Dtk_string &inOutputFile)
Definition: testlibparasolidwrite.cpp:126
PdfwSampleSimpleModelview_5_2
Dtk_ErrorStatus PdfwSampleSimpleModelview_5_2(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:569
stepw::sample::WriteAssembly
DtkErrorStatus WriteAssembly(const Dtk_string &inRootAssemblyName)
Definition: testlibstepwrite.cpp:387
Dtk_3MFWriter::EndWrite
DtkErrorStatus EndWrite()
Creation of the output file and free the Obj Writer
tess_EndTesselation
void tess_EndTesselation()
Free the data used by tesselation library.
stepw::sample::WriteAssembly_DimensionFDT
DtkErrorStatus WriteAssembly_DimensionFDT(const Dtk_string &inRootAssemblyName)
Definition: testlibstepwrite.cpp:476
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:151
catiav5w::InitWrite
Dtk_ErrorStatus InitWrite(const Dtk_string &inLogFile, Licence_dtk inLicFct, const WriteOptions &inOptions=WriteOptions())
Initialize the Catia V5 Writer
PdfwSampleOneMeshRender_1_3
Dtk_ErrorStatus PdfwSampleOneMeshRender_1_3(const Dtk_string &inOutputFileName, const Dtk_string &inImageDirectory)
Definition: testlibpdfwrite.cpp:103
satw_WriteBody
DtkErrorStatus satw_WriteBody(const Dtk_BodyPtr &inBody)
Writes a Body.
PdfwSampleBody_2_1
Dtk_ErrorStatus PdfwSampleBody_2_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:122
Dtk_RGB
Definition: dtk_rgb.hpp:8
WriteOptions::SetFileRelease
void SetFileRelease(const Dtk_UInt32 inRelease)
Sets the release for the written files.
Definition: cgrw.hpp:108
FbxwInstances
Dtk_ErrorStatus FbxwInstances(const Dtk_string &inOutputFileName)
Sample 2: writes 10 re-instanced cubes into an FBX file, demonstrating geometry instancing via repeat...
Definition: testlibfbxwrite.cpp:57
Colladaw::WriteEntity
Dtk_ErrorStatus WriteEntity(const Dtk_EntityPtr &inEntity)
Write the entity provided in parameter in a node.
Dtk_dir
This is a mathematical direction class.
Definition: dtk_dir.hpp:14
Dtk_mesh_asm_node::add_asm_instance
int add_asm_instance(Dtk_mesh_asm_node *inMeshAsm, Dtk_transfo *inTransfo)
Add an asm instance to the current asm node.
DTK_UGW_VERSION_NX2212
#define DTK_UGW_VERSION_NX2212
Definition: ugw.hpp:9
stepw::sample::WritePart_MeshWithFaceColors
DtkErrorStatus WritePart_MeshWithFaceColors(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:141
ProcessWallClassification
Dtk_ErrorStatus ProcessWallClassification()
Writes a wall element with a UniFormat classification reference attached to it.
Definition: testlibifcwrite.cpp:63
sampleWriter::CreateOpenShell
Dtk_BodyPtr CreateOpenShell()
Creates an open shell body containing a single trimmed cylindrical surface (half cylinder,...
Definition: testcreatecube.cpp:1353
sw::sww::SetIsAlreadyStart
void SetIsAlreadyStart(const Dtk_Int32 &inStop)
ONLY for PSKERNEL user.
satw_EndFile
DtkErrorStatus satw_EndFile()
Ends the writing of the Sat file.