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

◆ ProcessAsm()

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

◆ ProcessPart()

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

◆ WriteLayerData()

Dtk_ErrorStatus WriteLayerData ( )
14 {
15  //Keep in mind that layer data can only be set into CATPart context.
16 
17  //We will add 9 layers to the layer info set so we have to allocate the correct size
19  //we use a layer Idx to correctly handle the layers count
20  Dtk_Size_t LayerIdx = 0;
21  //1st layer - 888 -
22  Dtk_Size_t Layer888Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer888Idx, 888 ); layerInfoSet->SetLayerName( Layer888Idx, L"My First Layer" );
23 
24  //2nd layer - 111 -
25  Dtk_Size_t Layer111Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer111Idx, 111 ); layerInfoSet->SetLayerName( Layer111Idx, L"My Second Layer" );
26 
27  //3rd layer - 987 -
28  Dtk_Size_t Layer987Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer987Idx, 987 ); layerInfoSet->SetLayerName( Layer987Idx, L"My Third Layer" );
29 
30  //4th layer - 4 -
31  Dtk_Size_t Layer4Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer4Idx, 4 );
32 
33  //5th layer - 5 -
34  Dtk_Size_t Layer5Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer5Idx, 5 );
35 
36  //6th layer - 6 -
37  Dtk_Size_t Layer6Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer6Idx, 6 );
38 
39  //7th layer - 10 -
40  Dtk_Size_t Layer10Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer10Idx, 10 );
41 
42  //8th layer - 11 -
43  Dtk_Size_t Layer11Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer11Idx, 11 );
44 
45  //9th layer - 12 -
46  Dtk_Size_t Layer12Idx = LayerIdx++; layerInfoSet->SetLayerID( Layer12Idx, 12 );
47 
48 
49  // 2 layer filters :
50  //The first one gathers layers 4 - 5 - 6
51  Dtk_LayerFilterInfosPtr filter4_5_6 = layerInfoSet->CreateLayerFilterInfos( "FILTER_4-5-6", "MyDescription", DTK_FALSE, DTK_FALSE );
52  Dtk_tab<Dtk_Size_t> layers4_5_6;
53  layers4_5_6.push_back( Layer4Idx ); layers4_5_6.push_back( Layer5Idx ); layers4_5_6.push_back( Layer6Idx );
54  filter4_5_6->SelectLayers( layers4_5_6 );
55 
56  //The second one gathers layers 10 - 11 - 12
57  Dtk_LayerFilterInfosPtr filter10_11_12 = layerInfoSet->CreateLayerFilterInfos( "FILTER_10-11-12" );
58  Dtk_tab<Dtk_Size_t> layers10_11_12;
59  layers10_11_12.push_back( Layer10Idx ); layers10_11_12.push_back( Layer11Idx ); layers10_11_12.push_back( Layer12Idx );
60  filter10_11_12->SelectLayers( layers10_11_12 );
61 
62  //We send layer data to the writer
63  return catiav5w::SetLayerData( layerInfoSet );
64 }
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.
ProcessAsm
Dtk_ErrorStatus ProcessAsm(const Dtk_string &inResultDirectory)
Definition: testlibcatiav5write.cpp:346
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:692
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:430
DTK_TRUE
#define DTK_TRUE
Definition: define.h:730
ProcessPart
Dtk_ErrorStatus ProcessPart(const Dtk_string &inOutputFile, const Dtk_string &inReferenceName)
Definition: testlibcatiav5write.cpp:66
sampleWriter::CreateInfinitePlane
Dtk_BodyPtr CreateInfinitePlane()
Definition: testcreatecube.cpp:1496
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:715
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:731
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:459
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:1469
catiav5w::NodeTypePartBody
@ NodeTypePartBody
Definition: catiav5w.hpp:431
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:334
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: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_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:84
sampleWriter::CreateCube
Dtk_BodyPtr CreateCube()
Definition: testcreatecube.cpp:1316
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
Dtk_LayerInfosSet::Create
static Dtk_LayerInfosSetPtr Create(const Dtk_Size_t inNumLayers)
Calls a constructor to allocate a new object.
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:147
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:13
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