DATAKIT API  V2025.1
testlibcatiav5write.cpp File Reference

Functions

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

Function Documentation

◆ 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 }

◆ ProcessAsm()

Dtk_ErrorStatus ProcessAsm ( const Dtk_string inResultDirectory)
351 {
352  Dtk_string outputDirectory;
353  outputDirectory = inResultDirectory + "dtk/CatiaV5/";
354  outputDirectory.FixPathSeparator();
355 
356  Dtk_string CATPartFileName = outputDirectory + L"V5_sample.CATPart";
357  Dtk_string V5FileName = inResultDirectory + L"CatiaV5/9.CATPart";
358  Dtk_string CGRFileName = inResultDirectory + L"CGR/Engine.cgr";
359  Dtk_string V4ModelFileName = inResultDirectory + L"CatiaV4/EngineComponent.model";
360  Dtk_string SubProductFileName = outputDirectory + L"SubProduct.CATProduct";
361  Dtk_string RootProductFileName = outputDirectory + L"RootProduct.CATProduct";
362  CATPartFileName.FixPathSeparator();
363  V5FileName.FixPathSeparator();
364  CGRFileName.FixPathSeparator();
365  V4ModelFileName.FixPathSeparator();
366  SubProductFileName.FixPathSeparator();
367  RootProductFileName.FixPathSeparator();
368 
369  Dtk_transfo TransformationMatrix;
370 
371  Dtk_ErrorStatus err;
372 
373  //The ProcessPart is an user implemented function to create a part
374  err = ProcessPart( CATPartFileName, L"testPart" );
375 
376  //Reference creation to external files - V4 / CGR / existing v5 file -
377  Dtk_ID PartID, V5ID, V4ID, CgrID;
378  {
379  //We create Document References to the CATPart file we create
380  err = catiav5w::CreatePartDocId( CATPartFileName, L"PartFile", PartID );
381 
382  // to an existing CATPart file
383  err = catiav5w::CreatePartDocId( V5FileName, L"V5File", V5ID );
384 
385  //...and to a CGR file
386  err = catiav5w::CreateCGRDocId( CGRFileName, "CGRFile", CgrID );
387 
388  //...and finally to a CATIA V4 '.model' file
389  err = catiav5w::CreateV4ModelDocId( V4ModelFileName, "V4File", V4ID );
390  }
391 
392  //We create the SubProduct
393  Dtk_ID SubProductID, VirtualSubComponent1ID, VirtualSubComponent2ID, PartInstanceID, VirtualSubComponent1_Instance1ID;
394  Dtk_ID PartInstanceID2, CGRInstanceID, V4InstanceID, V5InstanceID, VirtualComponent1_Instance1ID;
395  {
396  //we init a CATProduct context...
397  err = catiav5w::InitProduct( SubProductFileName, "SubProduct" );
398 
399  //we start a virtual component prototype
400  err = catiav5w::InitVirtualComponent( "VirtualSubComponent1" );
401  TransformationMatrix.setOrigin( 0, 0, 150 );
402  err = catiav5w::AddInstance( PartID, L"PartInstance", TransformationMatrix, PartInstanceID );
403  //we end the virtual component prototype
404  err = catiav5w::EndVirtualComponent( VirtualSubComponent1ID );
405 
406  //we start another virtual component prototype
407  err = catiav5w::InitVirtualComponent( "VirtualComponent1" );
408  //we add the sub component instance...
409  TransformationMatrix.setOrigin( 0.0, 0.0, 0.0 );
410  err = catiav5w::AddVirtualComponentInstance( VirtualSubComponent1ID, L"VirtualSubComponent1_Instance1", TransformationMatrix, VirtualSubComponent1_Instance1ID );
411  //we close the virtual component prototype
412  err = catiav5w::EndVirtualComponent( VirtualSubComponent2ID );
413 
414  //we insert the created Part instance...
415  TransformationMatrix.setOrigin( 0.0, 0.0, 0.0 );
416  err = catiav5w::AddInstance( PartID, L"PartInstance", TransformationMatrix, PartInstanceID2 );
417  //...a CGR instance
418  TransformationMatrix.setOrigin( 0.0, 500.0, 0.0 );
419  err = catiav5w::AddInstance( CgrID, L"CGRInstance", TransformationMatrix, CGRInstanceID );
420  //...and a V4 instance
421  TransformationMatrix.setOrigin( 0.0, -500.0, 0.0 );
422  err = catiav5w::AddInstance( V4ID, L"V4Instance", TransformationMatrix, V4InstanceID );
423  //...and an existing V5 instance
424  TransformationMatrix.setOrigin( 0.0, -1000.0, 0.0 );
425  err = catiav5w::AddInstance( V5ID, L"V5Instance", TransformationMatrix, V5InstanceID );
426  //...and the main component instance
427  TransformationMatrix.setOrigin( 0.0, 1000.0, 0.0 );
428  err = catiav5w::AddVirtualComponentInstance( VirtualSubComponent2ID, L"VirtualComponent1_Instance1", TransformationMatrix, VirtualComponent1_Instance1ID );
429 
430  //we close the CATProduct context and retrieve the resulting DocID
431  err = catiav5w::EndProduct( SubProductID );
432  }
433 
434  //Now we create the RootProduct
435  Dtk_ID RootProductID, PartInstance2ID, SubProductInstance1ID, SubProductInstance2ID;
436  {
437  //we create another CATProduct context
438  err = catiav5w::InitProduct( RootProductFileName, "RootProduct" );
439  //and we insert another time the a part instance - multinstancing management -
440  TransformationMatrix.setOrigin( 0.0, 0.0, 50.0 );
441  err = catiav5w::AddInstance( PartID, L"PartInstance2", TransformationMatrix, PartInstance2ID );
442 
443  //and two instances to the first CATProduct file
444  TransformationMatrix.setOrigin( 1000.0, 0.0, 0.0 );
445  err = catiav5w::AddInstance( SubProductID, L"SubProductInstance1", TransformationMatrix, SubProductInstance1ID );
446  TransformationMatrix.setOrigin( -1000.0, 0.0, 0.0 );
447 
448  err = catiav5w::AddInstance( SubProductID, L"SubProductInstance2", TransformationMatrix, SubProductInstance2ID );
449 
450  //Now we create an instance PathID to handle override
451  //We want to override SubProductInstance2/VirtualComponent1_Instance1/VirtualSubComponent1_Instance1/PartInstance
452  {
453  catiav5w::PathID Path1;
454  Path1.push_back( SubProductInstance2ID );
455  Path1.push_back( VirtualComponent1_Instance1ID );
456  Path1.push_back( VirtualSubComponent1_Instance1ID );
457  Path1.push_back( PartInstanceID );
458 
459  //We override Blanked status and color
461  catiav5w::OverrideInstanceColorWithPathID( Path1, Dtk_RGB( 0, 0, 255 ) );
462  }
463 
465  {
466  catiav5w::PathID Path2;
467  Path2.push_back( SubProductInstance1ID );
468  Path2.push_back( CGRInstanceID );
469 
470  //We override Color and Alpha
471  catiav5w::OverrideInstanceColorWithPathID( Path2, Dtk_RGB( 0, 255, 255 ) );
473  }
474  //finally we close the second CATProduct...
475  err = catiav5w::EndProduct( RootProductID );
476  }
477 
478  cout << "=> " << RootProductFileName.c_str() << endl << "CatiaV5 Write end" << endl;
479  return err;
480 }

◆ ProcessPart()

Dtk_ErrorStatus ProcessPart ( const Dtk_string inOutputFile,
const Dtk_string inReferenceName 
)
71 {
72  Dtk_ErrorStatus err;
73  // We construct a body with a solid
75 
76  // We construct a body with an Open Shell
77  Dtk_BodyPtr body_openshell = sampleWriter::CreateOpenShell();
78 
79  // We construct a body with Wireframe
80  Dtk_BodyPtr body_wireframe = sampleWriter::CreateCurves();
81 
82  // We construct a body with a Point
84 
85  // We construct a body with an Infinite Plane
87 
88  // We construct a body with an Infinite Line / Axis
90 
91  // We construct a mesh
93 
94  Dtk_UUID PartUUID;
95  //You init the Part writer
96  err = catiav5w::InitPart( inOutputFile, inReferenceName, PartUUID );
97  if( err != dtkNoError )
98  {
99  std::cout << "error : " << dtkTypeError( err ) << std::endl;
100  return err;
101  }
102 
103 
104  // We create a new group of entities with a name (you must create at least one group)
105  // This sample make a surfacic group use to construct a solid
106  Dtk_InfoPtr MyCurveSetInfo = Dtk_Info::create();
107  MyCurveSetInfo->SetName( L"MyCurveSet" );
108  err = catiav5w::CreateNode( catiav5w::NodeTypeGeometricSet, MyCurveSetInfo );
109  if( err != dtkNoError )
110  {
111  std::cout << "error : " << dtkTypeError( err ) << std::endl;
112  return err;
113  }
114 
116  err = catiav5w::WriteEntity( Dtk_EntityPtr::DtkDynamicCast( body_wireframe ) );
117  if( err != dtkNoError )
118  {
119  std::cout << "error : " << dtkTypeError( err ) << std::endl;
120  return err;
121  }
122 
124  if( err != dtkNoError )
125  {
126  std::cout << "error : " << dtkTypeError( err ) << std::endl;
127  return err;
128  }
129 
130  // Close the group of entities
132  if( err != dtkNoError )
133  {
134  std::cout << "error : " << dtkTypeError( err ) << std::endl;
135  return err;
136  }
137 
138 
139  Dtk_InfoPtr MyOpenShellInfo = Dtk_Info::create();
140  MyOpenShellInfo->SetName( L"MyOpenShell" );
141  MyOpenShellInfo->SetLayer( 123 );
142  MyOpenShellInfo->SetColor( Dtk_RGB( 255, 255, 0 ) );
143  MyOpenShellInfo->SetBlankedStatus( DTK_TRUE );
144  err = catiav5w::CreateNode( catiav5w::NodeTypeGeometricSet, MyOpenShellInfo );
145  if( err != dtkNoError )
146  {
147  std::cout << "error : " << dtkTypeError( err ) << std::endl;
148  return err;
149  }
150 
152  Dtk_InfoPtr& body_openshellInfo = body_openshell->info();
153  if( body_openshellInfo.IsNULL() )
154  {
155  body_openshellInfo = Dtk_Info::create();
156  }
157  body_openshellInfo->SetColor( Dtk_RGB( 0, 255, 0 ) );
158  err = catiav5w::WriteEntity( Dtk_EntityPtr::DtkDynamicCast( body_openshell ) );
159  if( err != dtkNoError )
160  {
161  std::cout << "error : " << dtkTypeError( err ) << std::endl;
162  return err;
163  }
164 
165  // Close the group of entities
167  if( err != dtkNoError )
168  {
169  std::cout << "error : " << dtkTypeError( err ) << std::endl;
170  return err;
171  }
172 
173 
174  // We create a solid group with a name
175  Dtk_InfoPtr MySolidInfo = Dtk_Info::create();
176  MySolidInfo->SetName( L"My Solid" );
177  MySolidInfo->SetLayer( 12 );
178  MySolidInfo->SetColor( Dtk_RGB( 255, 0, 255 ) );
179  err = catiav5w::CreateNode( catiav5w::NodeTypePartBody, MySolidInfo );
180  if( err != dtkNoError )
181  {
182  std::cout << "error : " << dtkTypeError( err ) << std::endl;
183  return err;
184  }
185 
186  // And we write body in the catiav5 file
187  Dtk_InfoPtr& body_solidInfo = body_solid->info();
188  if( body_solidInfo.IsNULL() )
189  {
190  body_solidInfo = Dtk_Info::create();
191  }
192  body_solidInfo->SetColor( Dtk_RGB( 255, 0, 0 ) );
194  if( err != dtkNoError )
195  {
196  std::cout << "error : " << dtkTypeError( err ) << std::endl;
197  return err;
198  }
199 
200  // Close the group of entities
202  if( err != dtkNoError )
203  {
204  std::cout << "error : " << dtkTypeError( err ) << std::endl;
205  return err;
206  }
207 
208  Dtk_InfoPtr MyOpenShellForMeshInfo = Dtk_Info::create();
209  MyOpenShellForMeshInfo->SetName( L"MyOpenShellForMesh" );
210  err = catiav5w::CreateNode( catiav5w::NodeTypeGeometricSet, MyOpenShellForMeshInfo );
211  if( err != dtkNoError )
212  {
213  std::cout << "error : " << dtkTypeError( err ) << std::endl;
214  return err;
215  }
216 
219  if( err != dtkNoError )
220  {
221  std::cout << "error : " << dtkTypeError( err ) << std::endl;
222  return err;
223  }
224 
225  // Close the group of entities
227  if( err != dtkNoError )
228  {
229  std::cout << "error : " << dtkTypeError( err ) << std::endl;
230  return err;
231  }
232 
233  Dtk_InfoPtr MyOpenShellForPlaneInfo = Dtk_Info::create();
234  MyOpenShellForPlaneInfo->SetName( L"MyOpenShellForPlane" );
235  err = catiav5w::CreateNode( catiav5w::NodeTypeGeometricSet, MyOpenShellForPlaneInfo );
236  if( err != dtkNoError )
237  {
238  std::cout << "error : " << dtkTypeError( err ) << std::endl;
239  return err;
240  }
241 
244  if( err != dtkNoError )
245  {
246  std::cout << "error : " << dtkTypeError( err ) << std::endl;
247  return err;
248  }
249 
250  // Close the group of entities
252  if( err != dtkNoError )
253  {
254  std::cout << "error : " << dtkTypeError( err ) << std::endl;
255  return err;
256  }
257 
258  Dtk_InfoPtr MyOpenShellForInifiniteLineInfo = Dtk_Info::create();
259  MyOpenShellForInifiniteLineInfo->SetName( L"MyOpenShellForInifiniteLine" );
260  err = catiav5w::CreateNode( catiav5w::NodeTypeGeometricSet, MyOpenShellForInifiniteLineInfo );
261  if( err != dtkNoError )
262  {
263  std::cout << "error : " << dtkTypeError( err ) << std::endl;
264  return err;
265  }
266 
269  if( err != dtkNoError )
270  {
271  std::cout << "error : " << dtkTypeError( err ) << std::endl;
272  return err;
273  }
274 
275  // Close the group of entities
277  if( err != dtkNoError )
278  {
279  std::cout << "error : " << dtkTypeError( err ) << std::endl;
280  return err;
281  }
282 
283  //Now we will create an AxisSystem
285  if( err != dtkNoError )
286  {
287  std::cout << "error : " << dtkTypeError( err ) << std::endl;
288  return err;
289  }
290 
291  //we write it now
293  if( err != dtkNoError )
294  {
295  std::cout << "error : " << dtkTypeError( err ) << std::endl;
296  return err;
297  }
298 
299  //We create a default Named View - Camera -
300  //For that we firstly create a camera
302  Dtk_pnt( 200, 100, 100 ), //Origin Point
303  Dtk_pnt( 0, 100, 100 ), //Target Point
304  100., 100., //SemiWidth / SemiHeight
305  Dtk_dir( 0, 1, 0 ) ); //Up Vector - can be reprocessed by CatiaV5 if needed -
306 
307  //We create the model display from the camera
308  //We don't put any clipping entity - not used by V5 write -
309  //The 3rd parameter set the Named View as the default one - used at the V5 file opening -
310  Dtk_ModelDisplayPtr NamedView = Dtk_ModelDisplay::Create( Cam, NULL, DTK_TRUE );
311  //We don't need any name because the default Named View name is hardcoded
312  //Finally we write the NamedView
313  err = catiav5w::WriteNamedView( NamedView );
314  if( err != dtkNoError )
315  {
316  std::cout << "error : " << dtkTypeError( err ) << std::endl;
317  return err;
318  }
319 
320 
321  //Now we create another named view
322  Cam = Dtk_Camera::Create( Dtk_pnt( 100, 100, 100 ), Dtk_pnt( 0, 0, 0 ), 100., 100., Dtk_dir( 0, 1, 0 ) );
323  //Not set as default => will appear in the 'Named Views' Dialog Box into Catia V5
324  NamedView = Dtk_ModelDisplay::Create( Cam, NULL, DTK_FALSE );
325  NamedView->info() = Dtk_Info::create();
326  //We put the Named view name
327  NamedView->info()->SetName( L"MyNamedView" );
328  //Finally we write the NamedView
329  err = catiav5w::WriteNamedView( NamedView );
330  if( err != dtkNoError )
331  {
332  std::cout << "error : " << dtkTypeError( err ) << std::endl;
333  return err;
334  }
335 
336  //Now we write layer data - Layers Names and Layer Filters -
337  err = WriteLayerData();
338  if( err != dtkNoError )
339  {
340  std::cout << "error : " << dtkTypeError( err ) << std::endl;
341  return err;
342  }
343 
344  // Close the current part
345  err = catiav5w::EndPart();
346 
347  return err;
348 }

◆ WriteLayerData()

Dtk_ErrorStatus WriteLayerData ( )
18 {
19  //Keep in mind that layer data can only be set into CATPart context.
20 
21  //We will add 9 layers to the layer info set so we have to allocate the correct size
23  //we use a layer Idx to correctly handle the layers count
24  Dtk_Size_t LayerIdx = 0;
25  //1st layer - 888 -
26  Dtk_Size_t Layer888Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer888Idx, 888 ); layerInfoSet->SetLayerName( Layer888Idx, L"My First Layer" );
27 
28  //2nd layer - 111 -
29  Dtk_Size_t Layer111Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer111Idx, 111 ); layerInfoSet->SetLayerName( Layer111Idx, L"My Second Layer" );
30 
31  //3rd layer - 987 -
32  Dtk_Size_t Layer987Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer987Idx, 987 ); layerInfoSet->SetLayerName( Layer987Idx, L"My Third Layer" );
33 
34  //4th layer - 4 -
35  Dtk_Size_t Layer4Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer4Idx, 4 );
36 
37  //5th layer - 5 -
38  Dtk_Size_t Layer5Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer5Idx, 5 );
39 
40  //6th layer - 6 -
41  Dtk_Size_t Layer6Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer6Idx, 6 );
42 
43  //7th layer - 10 -
44  Dtk_Size_t Layer10Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer10Idx, 10 );
45 
46  //8th layer - 11 -
47  Dtk_Size_t Layer11Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer11Idx, 11 );
48 
49  //9th layer - 12 -
50  Dtk_Size_t Layer12Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer12Idx, 12 );
51 
52 
53  // 2 layer filters :
54  //The first one gathers layers 4 - 5 - 6
55  Dtk_LayerFilterInfosPtr filter4_5_6 = layerInfoSet->CreateLayerFilterInfos( "FILTER_4-5-6", "MyDescription", DTK_FALSE, DTK_FALSE );
56  Dtk_tab<Dtk_Size_t> layers4_5_6;
57  layers4_5_6.push_back( Layer4Idx ); layers4_5_6.push_back( Layer5Idx ); layers4_5_6.push_back( Layer6Idx );
58  filter4_5_6->SelectLayers( layers4_5_6 );
59 
60  //The second one gathers layers 10 - 11 - 12
61  Dtk_LayerFilterInfosPtr filter10_11_12 = layerInfoSet->CreateLayerFilterInfos( "FILTER_10-11-12" );
62  Dtk_tab<Dtk_Size_t> layers10_11_12;
63  layers10_11_12.push_back( Layer10Idx ); layers10_11_12.push_back( Layer11Idx ); layers10_11_12.push_back( Layer12Idx );
64  filter10_11_12->SelectLayers( layers10_11_12 );
65 
66  //We send layer data to the writer
67  return catiav5w::SetLayerData( layerInfoSet );
68 }
sampleWriter::CreateAxis
Dtk_BodyPtr CreateAxis()
Definition: testcreatecube.cpp:1492
Dtk_ModelDisplay::Create
static Dtk_ModelDisplayPtr Create(const Dtk_CameraPtr &inCamera, const Dtk_EntityPtr &inClippingEntity, const Dtk_bool inIsActivated)
Full featured constructor.
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
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)
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:428
DTK_TRUE
#define DTK_TRUE
Definition: define.h:727
ProcessPart
Dtk_ErrorStatus ProcessPart(const Dtk_string &inOutputFile, const Dtk_string &inReferenceName)
Definition: testlibcatiav5write.cpp:70
sampleWriter::CreateInfinitePlane
Dtk_BodyPtr CreateInfinitePlane()
Definition: testcreatecube.cpp:1435
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
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:1465
DTK_FALSE
#define DTK_FALSE
Definition: define.h:728
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:456
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
sampleWriter::CreatePoint
Dtk_BodyPtr CreatePoint()
Definition: testcreatecube.cpp:1407
catiav5w::NodeTypePartBody
@ NodeTypePartBody
Definition: catiav5w.hpp:429
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::CreateMeshCylinder
Dtk_MeshPtr CreateMeshCylinder(int nbpoints)
Mesh Cylinder sample.
Definition: testcreatemesh.cpp:337
Dtk_string::mkdir
int mkdir() const
File Utility : Create a Directory.
Dtk_Info::SetLayer
Dtk_ErrorStatus SetLayer(const Dtk_Int32 &inLayer)
Dtk_pnt
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
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()
Base constructor.
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:85
sampleWriter::CreateCube
Dtk_BodyPtr CreateCube()
Definition: testcreatecube.cpp:1249
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:1292
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
Dtk_LayerInfosSet::Create
static Dtk_LayerInfosSetPtr Create(const Dtk_Size_t inNumLayers)
Base constructor.
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
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
Dtk_Info::SetColor
Dtk_ErrorStatus SetColor(const int &R, const int &G, const int &B)
Dtk_Info::create
static Dtk_SmartPtr< Dtk_Info > create()
WriteLayerData
Dtk_ErrorStatus WriteLayerData()
Definition: testlibcatiav5write.cpp:17
Dtk_dir
This is a mathematical direction class.
Definition: dtk_dir.hpp:15
catiav5w::OverrideBlankedStatusWithPathID
Dtk_ErrorStatus OverrideBlankedStatusWithPathID(const PathID &inInstancePathId, const Dtk_bool inBlankedStatus)
Override the Blanked Status of an instance in a Sub Product.