DATAKIT SDK  V2026.3
testlibcatiav5write.cpp File Reference

Functions

int CatiaV5WriteSample (const Dtk_string &inResultDirectory, const Dtk_string &inInputFilesDirectory)
 
Dtk_ErrorStatus ProcessAsm (const Dtk_string &inResultDirectory, const Dtk_string &inInputFilesDirectory)
 
Dtk_ErrorStatus ProcessPart (const Dtk_string &inOutputFile, const Dtk_string &inReferenceName)
 
Dtk_ErrorStatus WriteLayerData ()
 

Function Documentation

◆ CatiaV5WriteSample()

int CatiaV5WriteSample ( const Dtk_string inResultDirectory,
const Dtk_string inInputFilesDirectory 
)
473 {
474  // First we initialize writing with name of files and protection fonction
475  //First you have to initialize the CATIA V5 writer
476  Dtk_string outputDirectory;
477 
478  cout << endl << "----------------------------------------------" << endl;
479  cout << "CatiaV5 Write start" << endl;
480 
481  // Choosing output directory and file name
482  outputDirectory = inResultDirectory + L"CatiaV5/";
483  outputDirectory.FixPathSeparator();
484  outputDirectory.mkdir();
485 
486  catiav5w::WriteOptions options;
487  Dtk_ErrorStatus st = options.SetFileRelease( 19 );
488  if( st != dtkNoError )
489  {
490  cout << "error : " << dtkTypeError( st ).c_str() << endl;
491  return st;
492  }
493 
494  st = catiav5w::InitWrite( outputDirectory + L"V5W_LogFile.log", NULL, options );
495  if( st != dtkNoError )
496  {
497  cout << "error : " << dtkTypeError( st ).c_str() << endl;
498  return st;
499  }
500 
501  ProcessAsm( inResultDirectory, inInputFilesDirectory );
502 
503  //...and the Main writter
505 
506  return dtkNoError;
507 }

◆ ProcessAsm()

Dtk_ErrorStatus ProcessAsm ( const Dtk_string inResultDirectory,
const Dtk_string inInputFilesDirectory 
)
313 {
314  Dtk_string outputDirectory;
315  outputDirectory = inResultDirectory + "CatiaV5/";
316  outputDirectory.FixPathSeparator();
317 
318  Dtk_string CATPartFileName = outputDirectory + L"V5_sample.CATPart";
319  Dtk_string SubProductFileName = outputDirectory + L"SubProduct.CATProduct";
320  Dtk_string RootProductFileName = outputDirectory + L"RootProduct.CATProduct";
321 
322  Dtk_string V5FileName = inInputFilesDirectory + L"CatiaV5/9.CATPart";
323  //
324  //Catia V5 does not support the paths L"../Input Files/Models/"
325  Dtk_string inputFilesDirectoryFixed = L"";
326 #ifdef _MSC_VER
327  char cwd[ MAX_PATH ];
328  GetCurrentDirectoryA( MAX_PATH, cwd ); // WinAPI
329  inputFilesDirectoryFixed = cwd;
330 #else
331  char cwd[ PATH_MAX ];
332  getcwd( cwd, sizeof( cwd ) ); // POSIX
333  inputFilesDirectoryFixed = cwd;
334 #endif
335  inputFilesDirectoryFixed.replace( '\\', '/' );
336  int pos = inputFilesDirectoryFixed.find_last( '/' );
337  int pos1 = inInputFilesDirectory.find_first( '/' );
338  if( ( pos > 0 ) && ( pos1 > 0 ) )
339  {
340  Dtk_string subPath = inInputFilesDirectory.right_exclusive( pos1 );
341  inputFilesDirectoryFixed = inputFilesDirectoryFixed.left_exclusive( pos + 1 );
342  inputFilesDirectoryFixed += subPath;
343  }
344  else
345  {
346  inputFilesDirectoryFixed = inInputFilesDirectory;
347  }
348  Dtk_string CGRFileName = inputFilesDirectoryFixed + L"CGR/Engine.cgr";
349  Dtk_string V4ModelFileName = inputFilesDirectoryFixed + L"CatiaV4/EngineComponent.model";
350 
351  CATPartFileName.FixPathSeparator();
352  V5FileName.FixPathSeparator();
353  CGRFileName.FixPathSeparator();
354  V4ModelFileName.FixPathSeparator();
355  SubProductFileName.FixPathSeparator();
356  RootProductFileName.FixPathSeparator();
357 
358  Dtk_transfo TransformationMatrix;
359 
360  Dtk_ErrorStatus err;
361 
362  //The ProcessPart is an user implemented function to create a part
363  err = ProcessPart( CATPartFileName, L"testPart" );
364 
365  //Reference creation to external files - V4 / CGR / existing v5 file -
366  Dtk_ID PartID, V5ID, V4ID, CgrID;
367  {
368  //We create Document References to the CATPart file we create
369  err = catiav5w::CreatePartDocId( CATPartFileName, L"PartFile", PartID );
370 
371  // to an existing CATPart file
372  err = catiav5w::CreatePartDocId( V5FileName, L"V5File", V5ID );
373 
374  //...and to a CGR file
375  err = catiav5w::CreateCGRDocId( CGRFileName, "CGRFile", CgrID );
376 
377  //...and finally to a CATIA V4 '.model' file
378  err = catiav5w::CreateV4ModelDocId( V4ModelFileName, "V4File", V4ID );
379  }
380 
381  //We create the SubProduct
382  Dtk_ID SubProductID, VirtualSubComponent1ID, VirtualSubComponent2ID, PartInstanceID, VirtualSubComponent1_Instance1ID;
383  Dtk_ID PartInstanceID2, CGRInstanceID, V4InstanceID, V5InstanceID, VirtualComponent1_Instance1ID;
384  {
385  //we init a CATProduct context...
386  err = catiav5w::InitProduct( SubProductFileName, "SubProduct" );
387 
388  //we start a virtual component prototype
389  err = catiav5w::InitVirtualComponent( "VirtualSubComponent1" );
390  TransformationMatrix.setOrigin( 0, 0, 150 );
391  err = catiav5w::AddInstance( PartID, L"PartInstance", TransformationMatrix, PartInstanceID );
392  //we end the virtual component prototype
393  err = catiav5w::EndVirtualComponent( VirtualSubComponent1ID );
394 
395  //we start another virtual component prototype
396  err = catiav5w::InitVirtualComponent( "VirtualComponent1" );
397  //we add the sub component instance...
398  TransformationMatrix.setOrigin( 0.0, 0.0, 0.0 );
399  err = catiav5w::AddVirtualComponentInstance( VirtualSubComponent1ID, L"VirtualSubComponent1_Instance1", TransformationMatrix, VirtualSubComponent1_Instance1ID );
400  //we close the virtual component prototype
401  err = catiav5w::EndVirtualComponent( VirtualSubComponent2ID );
402 
403  //we insert the created Part instance...
404  TransformationMatrix.setOrigin( 0.0, 0.0, 0.0 );
405  err = catiav5w::AddInstance( PartID, L"PartInstance", TransformationMatrix, PartInstanceID2 );
406  //...a CGR instance
407  TransformationMatrix.setOrigin( 0.0, 500.0, 0.0 );
408  err = catiav5w::AddInstance( CgrID, L"CGRInstance", TransformationMatrix, CGRInstanceID );
409  //...and a V4 instance
410  TransformationMatrix.setOrigin( 0.0, -500.0, 0.0 );
411  err = catiav5w::AddInstance( V4ID, L"V4Instance", TransformationMatrix, V4InstanceID );
412  //...and an existing V5 instance
413  TransformationMatrix.setOrigin( 0.0, -1000.0, 0.0 );
414  err = catiav5w::AddInstance( V5ID, L"V5Instance", TransformationMatrix, V5InstanceID );
415  //...and the main component instance
416  TransformationMatrix.setOrigin( 0.0, 1000.0, 0.0 );
417  err = catiav5w::AddVirtualComponentInstance( VirtualSubComponent2ID, L"VirtualComponent1_Instance1", TransformationMatrix, VirtualComponent1_Instance1ID );
418 
419  //we close the CATProduct context and retrieve the resulting DocID
420  err = catiav5w::EndProduct( SubProductID );
421  }
422 
423  //Now we create the RootProduct
424  Dtk_ID RootProductID, PartInstance2ID, SubProductInstance1ID, SubProductInstance2ID;
425  {
426  //we create another CATProduct context
427  err = catiav5w::InitProduct( RootProductFileName, "RootProduct" );
428  //and we insert another time the a part instance - multinstancing management -
429  TransformationMatrix.setOrigin( 0.0, 0.0, 50.0 );
430  err = catiav5w::AddInstance( PartID, L"PartInstance2", TransformationMatrix, PartInstance2ID );
431 
432  //and two instances to the first CATProduct file
433  TransformationMatrix.setOrigin( 1000.0, 0.0, 0.0 );
434  err = catiav5w::AddInstance( SubProductID, L"SubProductInstance1", TransformationMatrix, SubProductInstance1ID );
435  TransformationMatrix.setOrigin( -1000.0, 0.0, 0.0 );
436 
437  err = catiav5w::AddInstance( SubProductID, L"SubProductInstance2", TransformationMatrix, SubProductInstance2ID );
438 
439  //Now we create an instance PathID to handle override
440  //We want to override SubProductInstance2/VirtualComponent1_Instance1/VirtualSubComponent1_Instance1/PartInstance
441  {
442  catiav5w::PathID Path1;
443  Path1.push_back( SubProductInstance2ID );
444  Path1.push_back( VirtualComponent1_Instance1ID );
445  Path1.push_back( VirtualSubComponent1_Instance1ID );
446  Path1.push_back( PartInstanceID );
447 
448  //We override Blanked status and color
450  catiav5w::OverrideInstanceColorWithPathID( Path1, Dtk_RGB( 0, 0, 255 ) );
451  }
452 
453  ////No we want to override SubProductInstance1/CGRInstance
454  {
455  catiav5w::PathID Path2;
456  Path2.push_back( SubProductInstance1ID );
457  Path2.push_back( CGRInstanceID );
458 
459  //We override Color and Alpha
460  catiav5w::OverrideInstanceColorWithPathID( Path2, Dtk_RGB( 0, 255, 255 ) );
462  }
463  //finally we close the second CATProduct...
464  err = catiav5w::EndProduct( RootProductID );
465  }
466 
467  cout << "=> " << RootProductFileName.c_str() << endl << "CatiaV5 Write end" << endl;
468  return err;
469 }

◆ ProcessPart()

Dtk_ErrorStatus ProcessPart ( const Dtk_string inOutputFile,
const Dtk_string inReferenceName 
)
33 {
34  Dtk_ErrorStatus err;
35  // We construct a body with a solid
37 
38  // We construct a body with an Open Shell
39  Dtk_BodyPtr body_openshell = sampleWriter::CreateOpenShell();
40 
41  // We construct a body with Wireframe
42  Dtk_BodyPtr body_wireframe = sampleWriter::CreateCurves();
43 
44  // We construct a body with a Point
46 
47  // We construct a body with an Infinite Plane
49 
50  // We construct a body with an Infinite Line / Axis
52 
53  // We construct a mesh
55 
56  Dtk_UUID PartUUID;
57  //You init the Part writer
58  err = catiav5w::InitPart( inOutputFile, inReferenceName, PartUUID );
59  if( err != dtkNoError )
60  {
61  std::cout << "error : " << dtkTypeError( err ) << std::endl;
62  return err;
63  }
64 
65 
66  // We create a new group of entities with a name (you must create at least one group)
67  // This sample make a surfacic group use to construct a solid
68  Dtk_InfoPtr MyCurveSetInfo = Dtk_Info::create();
69  MyCurveSetInfo->SetName( L"MyCurveSet" );
71  if( err != dtkNoError )
72  {
73  std::cout << "error : " << dtkTypeError( err ) << std::endl;
74  return err;
75  }
76 
77  ////Writing Wire entities
78  err = catiav5w::WriteEntity( Dtk_EntityPtr::DtkDynamicCast( body_wireframe ) );
79  if( err != dtkNoError )
80  {
81  std::cout << "error : " << dtkTypeError( err ) << std::endl;
82  return err;
83  }
84 
86  if( err != dtkNoError )
87  {
88  std::cout << "error : " << dtkTypeError( err ) << std::endl;
89  return err;
90  }
91 
92  // Close the group of entities
94  if( err != dtkNoError )
95  {
96  std::cout << "error : " << dtkTypeError( err ) << std::endl;
97  return err;
98  }
99 
100 
101  Dtk_InfoPtr MyOpenShellInfo = Dtk_Info::create();
102  MyOpenShellInfo->SetName( L"MyOpenShell" );
103  MyOpenShellInfo->SetLayer( 123 );
104  MyOpenShellInfo->SetColor( Dtk_RGB( 255, 255, 0 ) );
105  MyOpenShellInfo->SetBlankedStatus( DTK_TRUE );
106  err = catiav5w::CreateNode( catiav5w::NodeTypeGeometricSet, MyOpenShellInfo );
107  if( err != dtkNoError )
108  {
109  std::cout << "error : " << dtkTypeError( err ) << std::endl;
110  return err;
111  }
112 
113  ////Writing OpenShell entity
114  Dtk_InfoPtr& body_openshellInfo = body_openshell->info();
115  if( body_openshellInfo.IsNULL() )
116  {
117  body_openshellInfo = Dtk_Info::create();
118  }
119  body_openshellInfo->SetColor( Dtk_RGB( 0, 255, 0 ) );
120  err = catiav5w::WriteEntity( Dtk_EntityPtr::DtkDynamicCast( body_openshell ) );
121  if( err != dtkNoError )
122  {
123  std::cout << "error : " << dtkTypeError( err ) << std::endl;
124  return err;
125  }
126 
127  // Close the group of entities
129  if( err != dtkNoError )
130  {
131  std::cout << "error : " << dtkTypeError( err ) << std::endl;
132  return err;
133  }
134 
135 
136  // We create a solid group with a name
137  Dtk_InfoPtr MySolidInfo = Dtk_Info::create();
138  MySolidInfo->SetName( L"My Solid" );
139  MySolidInfo->SetLayer( 12 );
140  MySolidInfo->SetColor( Dtk_RGB( 255, 0, 255 ) );
141  err = catiav5w::CreateNode( catiav5w::NodeTypePartBody, MySolidInfo );
142  if( err != dtkNoError )
143  {
144  std::cout << "error : " << dtkTypeError( err ) << std::endl;
145  return err;
146  }
147 
148  // And we write body in the catiav5 file
149  Dtk_InfoPtr& body_solidInfo = body_solid->info();
150  if( body_solidInfo.IsNULL() )
151  {
152  body_solidInfo = Dtk_Info::create();
153  }
154  body_solidInfo->SetColor( Dtk_RGB( 255, 0, 0 ) );
156  if( err != dtkNoError )
157  {
158  std::cout << "error : " << dtkTypeError( err ) << std::endl;
159  return err;
160  }
161 
162  // Close the group of entities
164  if( err != dtkNoError )
165  {
166  std::cout << "error : " << dtkTypeError( err ) << std::endl;
167  return err;
168  }
169 
170  Dtk_InfoPtr MyOpenShellForMeshInfo = Dtk_Info::create();
171  MyOpenShellForMeshInfo->SetName( L"MyOpenShellForMesh" );
172  err = catiav5w::CreateNode( catiav5w::NodeTypeGeometricSet, MyOpenShellForMeshInfo );
173  if( err != dtkNoError )
174  {
175  std::cout << "error : " << dtkTypeError( err ) << std::endl;
176  return err;
177  }
178 
179  ////Writing Mesh entity
181  if( err != dtkNoError )
182  {
183  std::cout << "error : " << dtkTypeError( err ) << std::endl;
184  return err;
185  }
186 
187  // Close the group of entities
189  if( err != dtkNoError )
190  {
191  std::cout << "error : " << dtkTypeError( err ) << std::endl;
192  return err;
193  }
194 
195  Dtk_InfoPtr MyOpenShellForPlaneInfo = Dtk_Info::create();
196  MyOpenShellForPlaneInfo->SetName( L"MyOpenShellForPlane" );
197  err = catiav5w::CreateNode( catiav5w::NodeTypeGeometricSet, MyOpenShellForPlaneInfo );
198  if( err != dtkNoError )
199  {
200  std::cout << "error : " << dtkTypeError( err ) << std::endl;
201  return err;
202  }
203 
204  ////Writing Plane entity
206  if( err != dtkNoError )
207  {
208  std::cout << "error : " << dtkTypeError( err ) << std::endl;
209  return err;
210  }
211 
212  // Close the group of entities
214  if( err != dtkNoError )
215  {
216  std::cout << "error : " << dtkTypeError( err ) << std::endl;
217  return err;
218  }
219 
220  Dtk_InfoPtr MyOpenShellForInifiniteLineInfo = Dtk_Info::create();
221  MyOpenShellForInifiniteLineInfo->SetName( L"MyOpenShellForInifiniteLine" );
222  err = catiav5w::CreateNode( catiav5w::NodeTypeGeometricSet, MyOpenShellForInifiniteLineInfo );
223  if( err != dtkNoError )
224  {
225  std::cout << "error : " << dtkTypeError( err ) << std::endl;
226  return err;
227  }
228 
229  ////Writing Plane entity
231  if( err != dtkNoError )
232  {
233  std::cout << "error : " << dtkTypeError( err ) << std::endl;
234  return err;
235  }
236 
237  // Close the group of entities
239  if( err != dtkNoError )
240  {
241  std::cout << "error : " << dtkTypeError( err ) << std::endl;
242  return err;
243  }
244 
245  //Now we will create an AxisSystem
247  if( err != dtkNoError )
248  {
249  std::cout << "error : " << dtkTypeError( err ) << std::endl;
250  return err;
251  }
252 
253  //we write it now
255  if( err != dtkNoError )
256  {
257  std::cout << "error : " << dtkTypeError( err ) << std::endl;
258  return err;
259  }
260 
261  //We create a default Named View - Camera -
262  //For that we firstly create a camera
264  Dtk_pnt( 200, 100, 100 ), //Origin Point
265  Dtk_pnt( 0, 100, 100 ), //Target Point
266  100., 100., //SemiWidth / SemiHeight
267  Dtk_dir( 0, 1, 0 ) ); //Up Vector - can be reprocessed by CatiaV5 if needed -
268 
269  //We create the model display from the camera
270  //We don't put any clipping entity - not used by V5 write -
271  //The 3rd parameter set the Named View as the default one - used at the V5 file opening -
272  Dtk_ModelDisplayPtr NamedView = Dtk_ModelDisplay::Create( Cam, NULL, DTK_TRUE );
273  //We don't need any name because the default Named View name is hardcoded
274  //Finally we write the NamedView
275  err = catiav5w::WriteNamedView( NamedView );
276  if( err != dtkNoError )
277  {
278  std::cout << "error : " << dtkTypeError( err ) << std::endl;
279  return err;
280  }
281 
282 
283  //Now we create another named view
284  Cam = Dtk_Camera::Create( Dtk_pnt( 100, 100, 100 ), Dtk_pnt( 0, 0, 0 ), 100., 100., Dtk_dir( 0, 1, 0 ) );
285  //Not set as default => will appear in the 'Named Views' Dialog Box into Catia V5
286  NamedView = Dtk_ModelDisplay::Create( Cam, NULL, DTK_FALSE );
287  NamedView->info() = Dtk_Info::create();
288  //We put the Named view name
289  NamedView->info()->SetName( L"MyNamedView" );
290  //Finally we write the NamedView
291  err = catiav5w::WriteNamedView( NamedView );
292  if( err != dtkNoError )
293  {
294  std::cout << "error : " << dtkTypeError( err ) << std::endl;
295  return err;
296  }
297 
298  //Now we write layer data - Layers Names and Layer Filters -
299  err = WriteLayerData();
300  if( err != dtkNoError )
301  {
302  std::cout << "error : " << dtkTypeError( err ) << std::endl;
303  return err;
304  }
305 
306  // Close the current part
307  err = catiav5w::EndPart();
308 
309  return err;
310 }

◆ WriteLayerData()

Dtk_ErrorStatus WriteLayerData ( )
24 {
25  //Keep in mind that layer data can only be set into CATPart context.
26  auto layerInfoSet = sampleWriter::layer::CreateSetWithFilters();
27 
28  //We send layer data to the writer
29  return catiav5w::SetLayerData( layerInfoSet );
30 }
sampleWriter::CreateAxis
Dtk_BodyPtr CreateAxis()
Definition: testcreatecube.cpp:1551
Dtk_ModelDisplay::Create
static Dtk_ModelDisplayPtr Create(const Dtk_CameraPtr &inCamera, const Dtk_EntityPtr &inClippingEntity, const Dtk_bool inIsActivated)
Calls full featured constructor to allocate a new object.
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:688
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
catiav5w::InitVirtualComponent
Dtk_ErrorStatus InitVirtualComponent(const Dtk_string &inReferenceName, const catiav5w::FileDescription &inFileDescription=catiav5w::FileDescription())
Initialize a virtual component during CATProduct process.
catiav5w::OverrideInstanceAlphaWithPathID
Dtk_ErrorStatus OverrideInstanceAlphaWithPathID(const PathID &inInstancePathId, const Dtk_UChar8 inInstanceAlpha)
Override the Alpha of an instance in a Sub Product.
catiav5w::AddVirtualComponentInstance
Dtk_ErrorStatus AddVirtualComponentInstance(const Dtk_ID &inDocId, const Dtk_string &inInstanceName, const Dtk_transfo &inTransfo, Dtk_ID &outInstanceId)
Add an instance to a DocID into the Current (Sub/Root) CATProduct.
Dtk_Info::SetName
Dtk_ErrorStatus SetName(Dtk_string inName)
ProcessAsm
Dtk_ErrorStatus ProcessAsm(const Dtk_string &inResultDirectory, const Dtk_string &inInputFilesDirectory)
Definition: testlibcatiav5write.cpp:312
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.
catiav5w::NodeTypeGeometricSet
@ NodeTypeGeometricSet
Definition: catiav5w.hpp:426
DTK_TRUE
#define DTK_TRUE
Definition: define.h:726
ProcessPart
Dtk_ErrorStatus ProcessPart(const Dtk_string &inOutputFile, const Dtk_string &inReferenceName)
Definition: testlibcatiav5write.cpp:32
sampleWriter::CreateInfinitePlane
Dtk_BodyPtr CreateInfinitePlane()
Definition: testcreatecube.cpp:1496
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
catiav5w::WriteEntity
Dtk_ErrorStatus WriteEntity(const Dtk_EntityPtr &inEntity)
Write the entity provided in parameter.
Dtk_UUID
Definition: dtk_uuid.hpp:8
sampleWriter::CreateAxisSystem
Dtk_AxisSystemPtr CreateAxisSystem()
Definition: testcreatecube.cpp:1525
DTK_FALSE
#define DTK_FALSE
Definition: define.h:727
catiav5w::OverrideInstanceColorWithPathID
Dtk_ErrorStatus OverrideInstanceColorWithPathID(const PathID &inInstancePathId, const Dtk_RGB &inInstanceColor)
Override the Color of an instance in a Sub Product.
catiav5w::CreateNode
Dtk_ErrorStatus CreateNode(const NodeType &inNodeType, const Dtk_string &inNodeName=Dtk_string())
Create a node in the Specification Tree.
catiav5w::InitProduct
Dtk_ErrorStatus InitProduct(const Dtk_string &inFileName, const Dtk_string &inReferenceName, const catiav5w::FileDescription &inFileDescription=catiav5w::FileDescription())
Initialize a sub Product during CATProduct process.
Dtk_Info::SetBlankedStatus
Dtk_ErrorStatus SetBlankedStatus(const Dtk_Int32 &inBlankedStatus)
catiav5w::CreateCGRDocId
Dtk_ErrorStatus CreateCGRDocId(const Dtk_string &inCGRFileName, const Dtk_string &inCGRName, Dtk_ID &outDocId)
Create a CGR Reference and DocID related to a given CGR File.
catiav5w::inReferenceName
const Dtk_string & inReferenceName
Definition: catiav5w.hpp:447
catiav5w::InitPart
Dtk_ErrorStatus InitPart(const Dtk_string &inOutputFile, const Dtk_string &inReferenceName, Dtk_UUID &outPartUUID, const catiav5w::FileDescription &inFileDescription=catiav5w::FileDescription())
Initialize the part
Dtk_string::replace
int replace(const int &old_char, const int &new_char)
Replaces all occurrences of a character in a string with a new character.
sampleWriter::CreatePoint
Dtk_BodyPtr CreatePoint()
Definition: testcreatecube.cpp:1469
catiav5w::NodeTypePartBody
@ NodeTypePartBody
Definition: catiav5w.hpp:427
catiav5w::EndVirtualComponent
Dtk_ErrorStatus EndVirtualComponent(Dtk_ID &outDocId)
End - and write - the virtual component initialized by catiav5w::InitVirtualComponent.
Dtk_SmartPtr< Dtk_Entity >::DtkDynamicCast
static Dtk_SmartPtr< Dtk_Entity > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
catiav5w::AddInstance
Dtk_ErrorStatus AddInstance(const Dtk_ID &inDocId, const Dtk_string &inInstanceName, const Dtk_transfo &inTransfo, Dtk_ID &outInstanceId)
Add an instance to a DocID into the Current (Sub/Root) CATProduct.
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_SmartPtr::IsNULL
Dtk_bool IsNULL() const
Definition: util_ptr_dtk.hpp:118
catiav5w::CreateV4ModelDocId
Dtk_ErrorStatus CreateV4ModelDocId(const Dtk_string &inV4ModelFileName, const Dtk_string &inV4ModelName, Dtk_ID &outDocId)
Create a V4 Model Reference and DocID related to a given V4 Model File.
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
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.
catiav5w::CreatePartDocId
Dtk_ErrorStatus CreatePartDocId(const Dtk_string &inPartFileName, const Dtk_string &inPartName, Dtk_ID &outDocId)
Create a Part Reference and DocID related to a given CATPart.
sampleWriter::layer::CreateSetWithFilters
Dtk_LayerInfosSetPtr CreateSetWithFilters()
Definition: testcreatelayerinfoset.cpp:23
sampleWriter::CreateMeshCylinder
Dtk_MeshPtr CreateMeshCylinder(int nbpoints)
Mesh Cylinder sample.
Definition: testcreatemesh.cpp:334
Dtk_string::find_first
int find_first(int character) const
find the position of a character into a Dtk_string
Dtk_string::mkdir
int mkdir() const
File Utility : Create a Directory.
Dtk_Info::SetLayer
Dtk_ErrorStatus SetLayer(const Dtk_Int32 &inLayer)
Dtk_string::left_exclusive
Dtk_string left_exclusive(int pos) const
retrieve the left part of the Dtk_string from a position
Dtk_pnt
This is a mathematical point class.
Definition: dtk_pnt.hpp:20
Dtk_string::FixPathSeparator
void FixPathSeparator()
File Utility : Fixes path separator consistency. It lets you replace the '\' or '/' by the OS needed ...
Dtk_Camera::Create
static Dtk_CameraPtr Create()
Calls default constructor to allocate a new object.
Dtk_string::find_last
int find_last(int character) const
find the position of a character into a Dtk_string
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:84
sampleWriter::CreateCube
Dtk_BodyPtr CreateCube()
Definition: testcreatecube.cpp:1316
Dtk_string::right_exclusive
Dtk_string right_exclusive(int pos) const
retrieve the right part of the Dtk_string from a position
catiav5w::EndProduct
Dtk_ErrorStatus EndProduct(Dtk_ID &outDocId)
Write effectively the Sub Product initialized by catiav5w::InitProduct.
catiav5w::CloseCurrentNode
Dtk_ErrorStatus CloseCurrentNode()
close the current node previously created by catiav5w::CreateNode.
catiav5w::SetLayerData
Dtk_ErrorStatus SetLayerData(const Dtk_LayerInfosSetPtr &inLayerDataSet)
Set Layer and LayerFilter Data in a CATPart context.
sampleWriter::CreateCurves
Dtk_BodyPtr CreateCurves()
Definition: testcreatecube.cpp:1357
catiav5w::WriteNamedView
Dtk_ErrorStatus WriteNamedView(const Dtk_ModelDisplayPtr &inNamedView)
Write the given ModelDisplay as NamedView - V5 camera -.
catiav5w::EndPart
Dtk_ErrorStatus EndPart()
Free data allocated by catiav5w::InitPart
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:151
Dtk_tab::push_back
void push_back(const T &x)
Inserts an element at the end of the array.
Definition: util_stl_dtk.hpp:416
catiav5w::InitWrite
Dtk_ErrorStatus InitWrite(const Dtk_string &inLogFile, Licence_dtk inLicFct, const WriteOptions &inOptions=WriteOptions())
Initialize the Catia V5 Writer
Dtk_RGB
Definition: dtk_rgb.hpp:7
Dtk_Info::SetColor
Dtk_ErrorStatus SetColor(const int &R, const int &G, const int &B)
Dtk_Info::create
static Dtk_SmartPtr< Dtk_Info > create()
Calls default constructor to allocate a new object.
WriteLayerData
Dtk_ErrorStatus WriteLayerData()
Definition: testlibcatiav5write.cpp:23
Dtk_dir
This is a mathematical direction class.
Definition: dtk_dir.hpp:14
catiav5w::OverrideBlankedStatusWithPathID
Dtk_ErrorStatus OverrideBlankedStatusWithPathID(const PathID &inInstancePathId, const Dtk_bool inBlankedStatus)
Override the Blanked Status of an instance in a Sub Product.
sampleWriter::CreateOpenShell
Dtk_BodyPtr CreateOpenShell()
Definition: testcreatecube.cpp:1343