DATAKIT API  V2025.1
testwriters.h File Reference

Go to the source code of this file.

Macros

#define CHECK_OK(X)   {Dtk_ErrorStatus res;if ((res=X)!=dtkNoError) {printf("error : %s\n", dtkTypeError(res).c_str());return res;}}
 

Functions

int _3dxmlWriteSample (const Dtk_string &inResultDirectory)
 
int _3mfWriteSample (const Dtk_string &inResultDirectory)
 
int CatiaV5WriteSample (const Dtk_string &inResultDirectory)
 
int CgrWriteSample (const Dtk_string &inResultDirectory)
 
int ColladaWriteSample (const Dtk_string &inResultDirectory)
 
int FbxWriteSample (const Dtk_string &inResultDirectory)
 
int GltfWriteSample (const Dtk_string &inResultDirectory)
 
int IfcWriteSample (const Dtk_string &inResultDirectory)
 
int IgesWriteSample (const Dtk_string &inResultDirectory)
 
int JtWriteSample (const Dtk_string &inResultDirectory)
 
int ObjWriteSample (const Dtk_string &inResultDirectory)
 
int ParasolidWriteSample (const Dtk_string &inResultDirectory)
 
int PdfWriteSample (const Dtk_string &inResultDirectory)
 
int PlmxmlWriteSample (const Dtk_string &inResultDirectory)
 
int SatWriteSample (const Dtk_string &inResultDirectory)
 
int StepWriteSample (const Dtk_string &inResultDirectory)
 
int SwWriteSample (Dtk_API *inDtkAPI, const Dtk_string &inResultDirectory)
 
int UgWriteSample (const Dtk_string &inResultDirectory)
 

Macro Definition Documentation

◆ CHECK_OK

#define CHECK_OK (   X)    {Dtk_ErrorStatus res;if ((res=X)!=dtkNoError) {printf("error : %s\n", dtkTypeError(res).c_str());return res;}}

Function Documentation

◆ _3dxmlWriteSample()

int _3dxmlWriteSample ( const Dtk_string inResultDirectory)
231 {
232  Dtk_MeshPtr CubeMesh;
233  Dtk_MeshPtr CylinderMesh;
234  Dtk_string outputFileName, outputDirectory;
235 
236  cout << endl << "----------------------------------------------" << endl;
237  cout << "3dxml Write start" << endl;
238 
239  // Choosing output directory and file name
240  outputDirectory = inResultDirectory + L"dtk/CatiaV6/";
241  outputDirectory.FixPathSeparator();
242  outputDirectory.mkdir();
243  outputFileName = outputDirectory + L"sample.3dxml";
244 
245  // Cube Sample
246  CubeMesh = sampleWriter::CreateMeshCube();
247 
248  // Cylinder Sample
249  CylinderMesh = sampleWriter::CreateMeshCylinder( 30 );
250 
251  // CREATING HIERARCHY
252 
253  // Root
254  // |
255  // | __Node(Node_1)
256  // | |
257  // | |
258  // | CylinderMesh(Node_2)
259  // |
260  // | __CubeWireMesh(Node_3)
261  // |
262  // |
263  // | __CylinderMesh(Node_4)
264 
265  _3dxmlw::WriteOptions Options;//no option for the moment
266  Dtk_string inLogFile;//no config for the moment
267  DtkErrorStatus errorSt = _3dxmlw::InitWrite( outputFileName, inLogFile, Options );
268 
269  if( errorSt == dtkNoError )
270  {
271  WriteEntity( CubeMesh, CylinderMesh );
272  }
273  else
274  cout << "error : " << dtkTypeError( errorSt ).c_str() << endl;
275 
277 
278  if( errorSt == dtkNoError )
279  cout << "=> " << outputFileName.c_str() << endl << "3dxml Write end" << endl;
280 
281  return errorSt;
282 }

◆ _3mfWriteSample()

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

◆ CatiaV5WriteSample()

int CatiaV5WriteSample ( const Dtk_string inResultDirectory)
484 {
485  // First we initialize writing with name of files and protection fonction
486  //First you have to initialize the CATIA V5 writer
487  Dtk_string outputDirectory;
488 
489  cout << endl << "----------------------------------------------" << endl;
490  cout << "CatiaV5 Write start" << endl;
491 
492  // Choosing output directory and file name
493  outputDirectory = inResultDirectory + L"dtk/CatiaV5/";
494  outputDirectory.FixPathSeparator();
495  outputDirectory.mkdir();
496 
497  catiav5w::WriteOptions options;
498  Dtk_ErrorStatus st = options.SetFileRelease( 19 );
499  if( st != dtkNoError )
500  {
501  cout << "error : " << dtkTypeError( st ).c_str() << endl;
502  return st;
503  }
504 
505  st = catiav5w::InitWrite( outputDirectory + L"V5W_LogFile.log", NULL, options );
506  if( st != dtkNoError )
507  {
508  cout << "error : " << dtkTypeError( st ).c_str() << endl;
509  return st;
510  }
511 
512  ProcessAsm( inResultDirectory );
513 
514  //...and the Main writter
516 
517  return dtkNoError;
518 }

◆ CgrWriteSample()

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

◆ ColladaWriteSample()

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

◆ FbxWriteSample()

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

◆ GltfWriteSample()

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

◆ IfcWriteSample()

int IfcWriteSample ( const Dtk_string inResultDirectory)
197 {
198  Dtk_string outputDirectory, outputFileName;
199  cout << endl << "----------------------------------------------" << endl;
200  cout << "Ifc Write start" << endl;
201 
202  // Choosing output directory and file name
203  outputDirectory = inResultDirectory + L"dtk/Ifc/";
204  outputDirectory.FixPathSeparator();
205  outputDirectory.mkdir();
206 
207  //The ProjectInformation class enables you to set global information while initializing the writer module
208  //This information is optionnali
210  myInfo.projectAuthor = "my name";
211  myInfo.buildingName = "sample building";
212  myInfo.siteLatitude = 45.7;
213  myInfo.siteLongitude = 4.8;
214  myInfo.siteElevation = 173000;
215 
216  // First we initialize writing with name of files, log file and the configuration we want to use
217  Ifcw::WriteOptions myOptions;
218  myOptions.versionIndicator = 1; //IFC4
219  myOptions.buildingTypeRecognition = 0; //Forces building type recognition. If set to true, all IfcElement without a building element type set will be analyzed (looking through their metadata etc.. to see if we can deduce their building type
220  outputFileName = outputDirectory + L"sample.ifc";
221  Dtk_ErrorStatus st = Ifcw::InitWrite( outputFileName, Dtk_string( outputDirectory + L"testifcw.log" ), myOptions, &myInfo );
222 
223  if( st != dtkNoError )
224  {
225  cout << "error : " << dtkTypeError( st ).c_str() << endl;
226  return st;
227  }
228 
229  //Write an ifc object/entity
230  ProcessBasicWall( myOptions.versionIndicator != 1 );
234 
235  Ifcw::EndWrite();
236 
237  cout << "=> " << outputFileName.c_str() << endl << "Ifc Write end" << endl;
238 
239  return 0;
240 }

◆ IgesWriteSample()

int IgesWriteSample ( const Dtk_string inResultDirectory)
148 {
149  cout << endl << "----------------------------------------------" << endl;
150  cout << "Iges Write start" << endl;
151  //Standard Iges Sample File Processing
152  int err = IgesAssemblySample( inResultDirectory );
153  cout << "Iges Write end" << endl;
154 
155  return err;
156 }

◆ JtWriteSample()

int JtWriteSample ( const Dtk_string inResultDirectory)
1179 {
1180  cout << endl << "----------------------------------------------" << endl;
1181  cout <<"Jt Write start" << endl;
1182 
1183  tess_InitTesselation("./", 0.005); // Init Tessellation : working directory and default tolerance (needed for writing bodies)
1184  tess_ComputeBoundariesFromMesh(0); // Disable wire creation on mesh during Brep tessellation.
1185 
1186  int err = AllJtWTests(inResultDirectory); // all tests.
1187 
1188  tess_EndTesselation(); // End of tessellation
1189  cout <<"Jt Write end" << endl;
1190 
1191 
1192  return err;
1193 }

◆ ObjWriteSample()

int ObjWriteSample ( const Dtk_string inResultDirectory)
80 {
81  cout << endl << "----------------------------------------------" << endl;
82  cout << "Obj Write start" << endl;
83  //Standard Obj Sample File Processing
84  int err = StandardObjSample( inResultDirectory );
85  cout << "Obj Write end" << endl;
86  return err;
87 }

◆ ParasolidWriteSample()

int ParasolidWriteSample ( const Dtk_string inResultDirectory)
17 {
18  cout << endl << "----------------------------------------------" << endl;
19  cout << "Parasolid Write start" << endl;
20  // Choosing output directory and file name
21  Dtk_string outputDirectory = inResultDirectory + L"dtk/Parasolid/";
22  outputDirectory.FixPathSeparator();
23  outputDirectory.mkdir();
24  Dtk_string outputFileName0 = outputDirectory + L"sample_listofbody.x_t";
25 
26  // We construct 3 parts
30 
31  // We add the 3 parts in an array
32  Dtk_tab<Dtk_BodyPtr> arrayOfParts;
33  arrayOfParts.push_back( body1 );
34  arrayOfParts.push_back( body2 );
35  arrayOfParts.push_back( body3 );
36 
37  // First we initialize writing with name of files and protection function if needed (3rd parameter)
38  Dtk_bool muteMode = DTK_TRUE; // no log write
39  DtkErrorStatus status = psw_InitFile( outputFileName0, muteMode );
40 
41  if( status != dtkNoError )
42  {
43  cout << "error : " << dtkTypeError( status ).c_str() << endl;
44  return status;
45  }
46 
47 
48  // Then we write the 3 parts constructed
49  Dtk_Size_t i, l = arrayOfParts.size();
50  Dtk_tab<Dtk_ID> returnID;
51  for( i = 0; i < l; ++i )
52  status = psw_WriteBody( arrayOfParts[ i ], returnID );
53 
54  // And free memory allocated for writing
55  status = psw_EndFile( returnID );
56 
57 
58  if( status != dtkNoError )
59  {
60  cout << "error : " << dtkTypeError( status ).c_str() << endl;
61  }
62  else
63  cout << "=> " << outputFileName0.c_str() << endl;
64 
65 
66  // then we write the same 3 part as an assembly that use these parts 2 times
67  Dtk_string outputFileName1 = outputDirectory + L"sample_assemblyofbody.x_t";
68  status = psw_InitFile( outputFileName1, muteMode );
69 
70  // first we register all part ID
71  Dtk_tab<Dtk_ID> partID (l, 1);
72  for( i = 0; i < l; ++i )
73  {
74  returnID.clear();
75  status = psw_WriteBody( arrayOfParts[ i ], returnID );
76  if( returnID.size() > 1 )
77  { // if more than one parasolid body created we decide to create a subassembly
78  Dtk_ID outIdass;
79  status = psw_CreateEmptyAssembly( outIdass );
80  Dtk_transfoPtr MatrixIdentity = Dtk_transfo::create();
81  for( Dtk_Size_t j = 0; j < returnID.size(); j++ )
82  {
83  Dtk_ID outIdInst;
84  status = psw_CreateInstance( outIdass, returnID[ j ], MatrixIdentity, outIdInst );
85  }
86 
87  partID[ i ] = outIdass;
88  status = psw_LinkAttribut( outIdass );
89  }
90  else
91  partID[ i ] = returnID[ 0 ];
92 
93  Dtk_string partName = L"DtkPart";
94  partName.add_int((int)i);
96  info->SetName( partName );
97  info->SetId ( Dtk_Int32 (i + 1) );
98 
99  status = psw_CreateAttribut( partID[ i ], info );
100  }
101 
102  // we create an assembly
103  Dtk_ID assemblyID;
104  status = psw_CreateEmptyAssembly( assemblyID );
105 
106  Dtk_string assName = L"DtkAssembly";
107  Dtk_InfoPtr info = Dtk_Info::create();
108  info->SetName( assName );
109  info->SetId( 5 );
110 
111  status = psw_CreateAttribut( assemblyID, info );
112 
113  // we create each instance of the parts
114  for( i = 0; i < l; ++i )
115  {
117  Matrix1->setOrigin( Dtk_pnt( 100.0, 0.0, 0.0 ) );
118  Dtk_ID outIdInst;
119  status = psw_CreateInstance( assemblyID, partID[ i ], Matrix1, outIdInst );
120 
121  Dtk_string instName = L"DtkInstance";
122  instName.add_int( ( int )i );
123  info->SetName( instName );
124  info->SetId( Dtk_Int32( 10 + i) );
125  status = psw_CreateAttribut( outIdInst, info );
126 
127 
129  Matrix2->setOrigin( Dtk_pnt( 100.0, 100.0, 100.0 ) );
130  status = psw_CreateInstance( assemblyID, partID[ i ], Matrix2, outIdInst );
131 
132  Dtk_string instName2 = L"DtkInstance";
133  instName2.add_int( ( int )(i + l));
134  info->SetName( instName2 );
135  info->SetId( Dtk_Int32( 10 + i + l ) );
136  status = psw_CreateAttribut( outIdInst, info );
137  }
138 
139  status = psw_LinkAttribut( assemblyID );
140 
141  returnID.clear();
142  // And free memory allocated for writing
143  status = psw_EndFile( returnID );
144 
145  if( status != dtkNoError )
146  {
147  cout << "error : " << dtkTypeError( status ).c_str() << endl;
148  }
149  else
150  cout << "=> " << outputFileName1.c_str() << endl;
151 
152  cout << "Parasolid Write end" << endl;
153 
154  return 0;
155 }

◆ PdfWriteSample()

int PdfWriteSample ( const Dtk_string inResultDirectory)
1031 {
1032  Dtk_ErrorStatus errStatus;
1033  cout << endl << "----------------------------------------------" << endl;
1034  cout << "Pdf Write start" << endl;
1035 
1036  Dtk_string imageDirectory = inResultDirectory + L"../InputImages/";
1037  Dtk_string outputDirectory;
1038 
1039  // Choosing output directory and file name
1040  outputDirectory = inResultDirectory + L"dtk/Pdf/";
1041  outputDirectory.FixPathSeparator();
1042  outputDirectory.mkdir();
1043 
1044  Dtk_string pdfFileName = outputDirectory + L"PDFW_SampleOneMesh_1_1.pdf";
1045  errStatus = PdfwSampleOneMesh_1_1( pdfFileName );
1046 
1047  pdfFileName = outputDirectory + L"PDFW_SampleMeshes_1_2.pdf";
1048  errStatus = PdfwSampleMeshes_1_2( pdfFileName );
1049 
1050  pdfFileName = outputDirectory + L"PDFW_SampleOneMeshRender_1_3.pdf";
1051  errStatus = PdfwSampleOneMeshRender_1_3( pdfFileName, imageDirectory );
1052 
1053  pdfFileName = outputDirectory + L"PDFW_SampleBody_2_1.pdf";
1054  errStatus = PdfwSampleBody_2_1( pdfFileName );
1055 
1056  pdfFileName = outputDirectory + L"PDFW_SampleWireBody_2_2.pdf";
1057  errStatus = PdfwSampleWireBody_2_2( pdfFileName );
1058 
1059  pdfFileName = outputDirectory + L"PDFW_SampleBodyVisibility_2_3.pdf";
1060  errStatus = PdfwSampleBodyVisibility_2_3( pdfFileName );
1061 
1062  pdfFileName = outputDirectory + L"PDFW_SampleAssembly_3_1.pdf";
1063  errStatus = PdfwSampleAssembly_3_1( pdfFileName );
1064 
1065  pdfFileName = outputDirectory + L"PDFW_SamplePartInstances_3_2.pdf";
1066  errStatus = PdfwSamplePartInstances_3_2( pdfFileName );
1067 
1068  pdfFileName = outputDirectory + L"PDFW_SampleAsmInstances_3_3.pdf";
1069  errStatus = PdfwSampleAsmInstances_3_3( pdfFileName );
1070 
1071  pdfFileName = outputDirectory + L"PDFW_SampleInstancesColors_3_4.pdf";
1072  errStatus = PdfwSampleInstancesColors_3_4( pdfFileName );
1073 
1074  pdfFileName = outputDirectory + L"PDFW_SampleInstancesVisibility_3_5.pdf";
1075  errStatus = PdfwSampleInstancesVisibility_3_5( pdfFileName );
1076 
1077  pdfFileName = outputDirectory + L"PDFW_SampleMetadatas_4_1.pdf";
1078  errStatus = PdfwSampleMetadatas_4_1( pdfFileName );
1079 
1080  pdfFileName = outputDirectory + L"PDFW_SampleDocumentProperties_4_2.pdf";
1081  errStatus = PdfwSampleDocumentProperties_4_2( pdfFileName );
1082 
1083  pdfFileName = outputDirectory + L"PDFW_SampleSimplePMI_5_1.pdf";
1084  errStatus = PdfwSampleSimplePMI_5_1( pdfFileName );
1085 
1086  pdfFileName = outputDirectory + L"PDFW_SampleSimpleModelview_5_2.pdf";
1087  errStatus = PdfwSampleSimpleModelview_5_2( pdfFileName );
1088 
1089  pdfFileName = outputDirectory + L"PDFW_Sample_MV_association_5_3.pdf";
1090  errStatus = PdfwSample_MV_association_5_3( pdfFileName );
1091 
1092  pdfFileName = outputDirectory + L"PDFW_SamplePMI_Geom_association_5_4.pdf";
1093  errStatus = PdfwSamplePMI_Geom_association_5_4( pdfFileName );
1094 
1095  pdfFileName = outputDirectory + L"PDFW_SampleModelview_sections_5_5.pdf";
1096  errStatus = PdfwSampleModelview_section_5_5( pdfFileName );
1097 
1098  pdfFileName = outputDirectory + L"PDFW_SamplePMI_PMI_association_5_6.pdf";
1099  errStatus = PdfwSamplePMI_PMI_association_5_6( pdfFileName );
1100 
1101  pdfFileName = outputDirectory + L"PDFW_SampleAxis_References_5_7.pdf";
1102  errStatus = PdfwSampleAxis_References_5_7( pdfFileName );
1103 
1104  pdfFileName = outputDirectory + L"PDFW_SampleCloudPoint_6_1.pdf";
1105  errStatus = PdfwSampleCloudPoint_6_1( pdfFileName );
1106 
1107  pdfFileName = outputDirectory + L"PDFW_SampleBillboard_7_1.pdf";
1108 
1109  errStatus = PdfwSampleBillboard_7_1( pdfFileName, imageDirectory );
1110 
1111  pdfFileName = outputDirectory + L"PDFW_SampleSecuredPdf_8_1.pdf";
1112  errStatus = PdfwSampleSecuredPdf_8_1( pdfFileName );
1113 
1114  pdfFileName = outputDirectory + L"PDFW_SampleLayoutMultipleViews_9_1.pdf";
1115  errStatus = PdfwSampleLayoutMultipleViews_9_1( pdfFileName );
1116 
1117  cout << "Pdf Write end" << endl;
1118 
1119  return errStatus;
1120 }

◆ PlmxmlWriteSample()

int PlmxmlWriteSample ( const Dtk_string inResultDirectory)
101 {
102  std::cout << endl << "----------------------------------------------" << endl;
103  std::cout << "Plmxml Write start" << 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  int err = PlmxmlwritesampleJT(inResultDirectory);
109 
110  tess_EndTesselation(); // End of tessellation
111  std::cout << "Plmxml Write end" << endl;
112 
113 
114  return err;
115 }

◆ SatWriteSample()

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

◆ StepWriteSample()

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

◆ SwWriteSample()

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

◆ UgWriteSample()

int UgWriteSample ( const Dtk_string inResultDirectory)
757 {
758  Dtk_string outputDirectory, nxDirectory;
759  Dtk_ErrorStatus errStatus;
760 
761  std::cout << endl << "----------------------------------------------" << endl;
762  std::cout << "Ug Write start" << endl;
763 
764  nxDirectory = inResultDirectory + L"dtk/NX-Unigraphics/";
765  nxDirectory.FixPathSeparator();
766  nxDirectory.mkdir();
767 
768  // Choosing output for version NX5
769  outputDirectory = inResultDirectory + L"dtk/NX-Unigraphics/nx5/";
770  outputDirectory.FixPathSeparator();
771  outputDirectory.mkdir();
772  errStatus = UgWriteSampleVersion(outputDirectory, DTK_UGW_VERSION_NX5);
773 
774  // Choosing output for version NX1980
775  outputDirectory = inResultDirectory + L"dtk/NX-Unigraphics/nx1980/";
776  outputDirectory.FixPathSeparator();
777  outputDirectory.mkdir();
778  errStatus = UgWriteSampleVersion(outputDirectory, DTK_UGW_VERSION_NX1980);
779 
780  // Choosing output for version NX2212
781  outputDirectory = inResultDirectory + L"dtk/NX-Unigraphics/nx2212/";
782  outputDirectory.FixPathSeparator();
783  outputDirectory.mkdir();
784  errStatus = UgWriteSampleVersion(outputDirectory, DTK_UGW_VERSION_NX2212);
785 
786  std::cout << "Ug Write end" << endl;
787 
788  return errStatus;
789 }
PdfwSampleSecuredPdf_8_1
Dtk_ErrorStatus PdfwSampleSecuredPdf_8_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:856
satw_InitPart
DtkErrorStatus satw_InitPart()
Initializes the writing of a 3D part.
Dtk_mesh_asm_node
This class gathers asm node related datas.
Definition: util_cgr_dtk.hpp:178
ProcessAsm
Dtk_ErrorStatus ProcessAsm(const Dtk_string &inResultDirectory)
Definition: testlibcatiav5write.cpp:350
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:689
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
ProcessBasicWall
Dtk_ErrorStatus ProcessBasicWall(Dtk_bool inMesh)
Definition: testlibifcwrite.cpp:22
Ifcw::ProjectInformation::buildingName
Dtk_string buildingName
Definition: IFCWriter.h:63
solidworksw::InitWriter
Dtk_ErrorStatus InitWriter(const Dtk_string &inLogFile, Licence_dtk inLicFct, solidworksw::language inLanguage=solidworksw::english)
Initialize the Solidworks Writer
PdfwSampleMetadatas_4_1
Dtk_ErrorStatus PdfwSampleMetadatas_4_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:464
psw_CreateInstance
DtkErrorStatus psw_CreateInstance(Dtk_ID inIdAss, Dtk_ID inIdPart, Dtk_transfoPtr &Matrix, Dtk_ID &outIdInst)
Create an Instance item of a part referenced by inIdPart.
Dtk_Info::SetName
Dtk_ErrorStatus SetName(Dtk_string inName)
sampleWriter::CreateMeshCube
Dtk_MeshPtr CreateMeshCube()
Mesh Cube sample.
Definition: testcreatemesh.cpp:207
PdfwSampleAxis_References_5_7
Dtk_ErrorStatus PdfwSampleAxis_References_5_7(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:742
psw_InitFile
DtkErrorStatus psw_InitFile(const Dtk_string &inFileOut, Dtk_bool muteMode, Dtk_Int32 inVersion=180)
Initialise a file to be written.
Colladaw::EndNode
DtkErrorStatus EndNode()
End the node.
catiav5w::WriteOptions
This class provides several options to tunes CatiaV5 Writter. It must be provided to catiav5w::InitWr...
Definition: catiav5w.hpp:41
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.
Dtk_transfo::create
static Dtk_SmartPtr< Dtk_transfo > create()
Dtk_transfo::setZdir
void setZdir(const Dtk_dir &Z)
Set a new Z vector.
Ifcw::ProjectInformation::siteElevation
Dtk_Double64 siteElevation
Definition: IFCWriter.h:69
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
Int representing IFC version to use : 0 ( default ) = IFC2x3; 1 = IFC4.
Definition: IFCWriter.h:35
DTK_TRUE
#define DTK_TRUE
Definition: define.h:727
_3dxmlw::WriteOptions
This class provides several options to tune 3dxml Writer. It must be provided to _3dxmlw::InitWrite m...
Definition: 3dxmlw.hpp:89
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.
Ifcw::WriteOptions::buildingTypeRecognition
Dtk_bool buildingTypeRecognition
DTK_TRUE : enable building type recognition (deduces if an element is an IFCWALL, IFCWINDOW....
Definition: IFCWriter.h:37
create_assembly
void create_assembly(const Dtk_string &inFilename, const Dtk_string &inFilenamePart)
Definition: testlibswwrite.cpp:144
DTK_UGW_VERSION_NX5
#define DTK_UGW_VERSION_NX5
Definition: ugw.hpp:7
stepw_SetModeFdt
DtkErrorStatus stepw_SetModeFdt(const int inMode, const int inPolyline=0)
Activates/Deactivates writing of FDT (ignored if product Step3dWriteFdt is not present)
FbxwInstances
Dtk_ErrorStatus FbxwInstances(const Dtk_string &outputFileName)
Definition: testlibfbxwrite.cpp:58
PdfwSamplePartInstances_3_2
Dtk_ErrorStatus PdfwSamplePartInstances_3_2(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:225
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:712
create_part
void create_part(const Dtk_string &inFilename, const Dtk_string &inParasolidFile)
Definition: testlibswwrite.cpp:56
Dtk_string::unlink
int unlink() const
File Utility : Delete a file.
Ifcw::ProjectInformation::projectAuthor
Dtk_string projectAuthor
Definition: IFCWriter.h:64
sampleWriter::CreateAxisSystem
Dtk_AxisSystemPtr CreateAxisSystem()
Definition: testcreatecube.cpp:1465
PdfwSampleLayoutMultipleViews_9_1
Dtk_ErrorStatus PdfwSampleLayoutMultipleViews_9_1(const Dtk_string &pdfFileName)
Definition: testlibpdfwrite.cpp:978
PdfwSampleModelview_section_5_5
Dtk_ErrorStatus PdfwSampleModelview_section_5_5(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:657
Dtk_bool
char Dtk_bool
Definition: define.h:725
Dtk_API::GetWorkingDir
const Dtk_string & GetWorkingDir() const
PdfwSampleBillboard_7_1
Dtk_ErrorStatus PdfwSampleBillboard_7_1(const Dtk_string &inOutputFileName, const Dtk_string &inImageDirectory)
Definition: testlibpdfwrite.cpp:825
dtkErrorAPINotStarted
@ dtkErrorAPINotStarted
Definition: error_dtk.hpp:101
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
tess_InitTesselation
int tess_InitTesselation(Dtk_string inWorkingDirectory, double inTolerance)
Init the tesselation library.
solidworksw::SetIsAlreadyStart
void SetIsAlreadyStart(const Dtk_Int32 &inStop)
ONLY for PSKERNEL user.
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
solidworksw::EndWriter
Dtk_ErrorStatus EndWriter()
Free the Solidworks Writer
stepw_SetModeProp
DtkErrorStatus stepw_SetModeProp(const int inMode)
Activates/Deactivates writing of Properties : User Attributes, Product Data.
Dtk_3MFWriter::InitWrite
DtkErrorStatus InitWrite(const Dtk_string &inOutputFile, const Dtk_string &inLogFile, const WriteOptions &inOptions)
Initialize the 3mf Writer
Dtk_string::add_int
void add_int(const int integer, int force_unsigned_int=0)
concat an int to the Dtk_string (convert the int to Dtk_string)
psw_CreateAttribut
DtkErrorStatus psw_CreateAttribut(Dtk_ID inIdCompo, Dtk_InfoPtr &info)
Create all attribut attached to a component (body, assembly, instance)
Colladaw::WriteOptions
This class provides several options to tune Collada Writer. It must be provided to Colladaw::InitWrit...
Definition: colladaw.hpp:17
WriteEntity
Dtk_ErrorStatus WriteEntity(const Dtk_MeshPtr &inCubeMesh, const Dtk_MeshPtr &inCylinderMesh)
Definition: testlib3dxmlwrite.cpp:16
PdfwSampleInstancesVisibility_3_5
Dtk_ErrorStatus PdfwSampleInstancesVisibility_3_5(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:419
PlmxmlwritesampleJT
Dtk_ErrorStatus PlmxmlwritesampleJT(const Dtk_string &inResultDirectory)
Definition: testlibplmxmlwrite.cpp:36
sampleWriter::CreateMeshWire
Dtk_MeshPtr CreateMeshWire()
Wire mesh sample.
Definition: testcreatemesh.cpp:388
PdfwSampleOneMesh_1_1
Dtk_ErrorStatus PdfwSampleOneMesh_1_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:22
Colladaw::WriteOptions::ConvertRenderInfos
Dtk_bool ConvertRenderInfos
Definition: colladaw.hpp:27
_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:23
PdfwSampleCloudPoint_6_1
Dtk_ErrorStatus PdfwSampleCloudPoint_6_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:770
ProcessMultiMeshWall
Dtk_ErrorStatus ProcessMultiMeshWall()
Definition: testlibifcwrite.cpp:145
Ifcw::ProjectInformation::siteLatitude
Dtk_Double64 siteLatitude
Definition: IFCWriter.h:67
cgrw_WriteMeshAsm
Dtk_status cgrw_WriteMeshAsm(Dtk_mesh_asm_node *inRoot)
Write a mesh assembly.
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:687
FbxwTwoMeshes
Dtk_ErrorStatus FbxwTwoMeshes(const Dtk_string &outputFileName)
Definition: testlibfbxwrite.cpp:17
IgesAssemblySample
int IgesAssemblySample(const Dtk_string &inResultDirectory)
Definition: testlibigeswrite.cpp:71
solidworksw::english
@ english
Definition: solidworksw.hpp:17
Ifcw::WriteOptions
This class provides several options to tune the IFC Writer. It must be provided to Ifcw::InitWrite me...
Definition: IFCWriter.h:18
PdfwSampleBodyVisibility_2_3
Dtk_ErrorStatus PdfwSampleBodyVisibility_2_3(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:154
PdfwSampleMeshes_1_2
Dtk_ErrorStatus PdfwSampleMeshes_1_2(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:45
Dtk_SmartPtr< Dtk_Entity >::DtkDynamicCast
static Dtk_SmartPtr< Dtk_Entity > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
GltfwTwoMeshes
Dtk_ErrorStatus GltfwTwoMeshes(const Dtk_string &outputFileName)
Definition: testlibgltfwrite.cpp:17
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
psw_CreateEmptyAssembly
DtkErrorStatus psw_CreateEmptyAssembly(Dtk_ID &outIdass)
Create the entry item of an assembly.
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.
sampleWriter::CreateCubeRenderInfos
Dtk_RenderInfosPtr CreateCubeRenderInfos()
Definition: testcreatemesh.cpp:498
Dtk_Info::SetId
Dtk_ErrorStatus SetId(const Dtk_Int32 &inId)
ProcessPrototypedColumns
Dtk_ErrorStatus ProcessPrototypedColumns(int columnNumber)
Definition: testlibifcwrite.cpp:94
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 STEP file.
Ifcw::ProjectInformation::siteLongitude
Dtk_Double64 siteLongitude
Definition: IFCWriter.h:68
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:337
PdfwSampleInstancesColors_3_4
Dtk_ErrorStatus PdfwSampleInstancesColors_3_4(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:322
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:185
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:533
Dtk_pnt
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
UgWriteSampleVersion
Dtk_ErrorStatus UgWriteSampleVersion(const Dtk_string &outputDirectory, int version)
Definition: testlibugwrite.cpp:684
PdfwSamplePMI_Geom_association_5_4
Dtk_ErrorStatus PdfwSamplePMI_Geom_association_5_4(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:626
psw_WriteBody
Dtk_ErrorStatus psw_WriteBody(Dtk_BodyPtr &inBody)
Writes a Body of a 3D part (3D content of a product), of any kind (solid, shell / faces,...
PdfwSampleAsmInstances_3_3
Dtk_ErrorStatus PdfwSampleAsmInstances_3_3(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:268
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.
PdfwSample_MV_association_5_3
Dtk_ErrorStatus PdfwSample_MV_association_5_3(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:586
PdfwSampleDocumentProperties_4_2
Dtk_ErrorStatus PdfwSampleDocumentProperties_4_2(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:489
satw_EndPart
DtkErrorStatus satw_EndPart()
Ends the writing of a part.
Dtk_3MFWriter
3MF Writer main class.
Definition: 3mfw.hpp:10
Colladaw::ReinstanciatePrototype
DtkErrorStatus ReinstanciatePrototype(Dtk_ID inID)
Reinstanciate a node.
tess_ComputeBoundariesFromMesh
int tess_ComputeBoundariesFromMesh()
: Check value of option memorize noundaries of mesh
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:85
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:18
sampleWriter::CreateCube
Dtk_BodyPtr CreateCube()
Definition: testcreatecube.cpp:1249
Dtk_tab::size
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:502
Ifcw::ProjectInformation
This struct enables the user to define global properties regarding the project, construction site and...
Definition: IFCWriter.h:58
DTK_UGW_VERSION_NX1980
#define DTK_UGW_VERSION_NX1980
Definition: ugw.hpp:8
GltfwInstances
Dtk_ErrorStatus GltfwInstances(const Dtk_string &outputFileName)
Definition: testlibgltfwrite.cpp:57
tess_EndTesselation
void tess_EndTesselation()
Free the data used by tesselation library.
_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:704
PdfwSampleWireBody_2_2
Dtk_ErrorStatus PdfwSampleWireBody_2_2(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:133
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.
StandardObjSample
int StandardObjSample(const Dtk_string &inResultDirectory)
Definition: testlibobjwrite.cpp:17
psw_EndFile
DtkErrorStatus psw_EndFile(Dtk_tab< Dtk_ID > &inTabIds, Dtk_bool binForceListOfBody=DTK_FALSE)
Ends the writing of the Parasolid (x_t or x_b) file.
PdfwSampleSimpleModelview_5_2
Dtk_ErrorStatus PdfwSampleSimpleModelview_5_2(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:554
sampleWriter::CreateCurves
Dtk_BodyPtr CreateCurves()
Definition: testcreatecube.cpp:1292
WriteAsmExt
void WriteAsmExt(const int level, const int asm_only)
Definition: testlibstepwrite.cpp:346
Dtk_3MFWriter::EndWrite
DtkErrorStatus EndWrite()
Creation of the output file and free the Obj Writer
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:140
Dtk_tab::push_back
void push_back(const T &x)
Inserts an element at the end of the array.
Definition: util_stl_dtk.hpp:415
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:99
satw_WriteBody
DtkErrorStatus satw_WriteBody(const Dtk_BodyPtr &inBody)
Writes a Body.
psw_LinkAttribut
DtkErrorStatus psw_LinkAttribut(Dtk_ID inIdAss)
link all attribut attached to an assembly
Dtk_tab::clear
void clear(int no_delete=0)
Resets the Dtk_tab content.
Definition: util_stl_dtk.hpp:351
PdfwSampleBody_2_1
Dtk_ErrorStatus PdfwSampleBody_2_1(const Dtk_string &inOutputFileName)
Definition: testlibpdfwrite.cpp:117
sampleWriter::CreateOpenShell
void CreateOpenShell(std::map< Dtk_ID, Dtk_EntityPtr > &outArrayTopo, const Dtk_BodyPtr &inDtkBody)
Definition: testcreatecube.cpp:1194
Dtk_RGB
Definition: dtk_rgb.hpp:7
AllJtWTests
int AllJtWTests(const Dtk_string &inResultDirectory)
Definition: testlibjtwrite.cpp:1097
WriteOptions::SetFileRelease
void SetFileRelease(const Dtk_UInt32 inRelease)
Sets the release for the written files.
Definition: cgrw.hpp:31
Dtk_Info::create
static Dtk_SmartPtr< Dtk_Info > create()
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:15
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
ProcessWallClassification
Dtk_ErrorStatus ProcessWallClassification()
Definition: testlibifcwrite.cpp:61
satw_EndFile
DtkErrorStatus satw_EndFile()
Ends the writing of the Sat file.