DATAKIT API  V2025.4
WriteInstance.cpp File Reference

Functions

Dtk_ErrorStatus WriteInstance (Dtk_ComponentPtr inComponent)
 

Variables

Dtk_tab< Dtk_IDComponentProcessed
 

Function Documentation

◆ WriteInstance()

Dtk_ErrorStatus WriteInstance ( Dtk_ComponentPtr  inComponent)
15 {
16 
17  //Instance represent a prototype with a matrix placement
18  Dtk_string PrototypeName, InstanceName;
19  PrototypeName = inComponent->Name();//Prototype Component name = prototype->Name()
20  InstanceName = inComponent->InstanceName();//Instance Component name
21  Dtk_ComponentPtr prototype = inComponent->GetChild(0);
22  Dtk_transfo matrix = inComponent->TransformationMatrix();
23  Dtk_ID pdfInstID = 0;
24  Dtk_ID childID = inComponent->GetChild(0)->GetID();
25 
26  if (IsPdfDumpActivated())
27  {
28  pdfInstID = PdfInitInstance(inComponent);
29  }
30 
31  //you have to write matrix and instance the prototype
32  WriteComponent(prototype, Dtk_transfo());
33 
34 
35 
36  if (IsPdfDumpActivated())
37  {
38  PdfEndInstance(pdfInstID, childID);
39  }
40 
41  if (ComponentProcessed.find(childID) < 0)
42  {
43  ComponentProcessed.push_back(childID);
44  }
45 
46  return dtkNoError;
47 }

Variable Documentation

◆ ComponentProcessed

Dtk_tab<Dtk_ID> ComponentProcessed
extern
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:691
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
PdfEndInstance
void PdfEndInstance(Dtk_ID pdfInstID, Dtk_ID childID)
Definition: PdfWrite.cpp:112
WriteComponent
Dtk_ErrorStatus WriteComponent(Dtk_ComponentPtr inComponent, const Dtk_transfo &inMatrix=Dtk_transfo())
Definition: WriteComponent.cpp:9
ComponentProcessed
Dtk_tab< Dtk_ID > ComponentProcessed
Definition: WritePrototype.cpp:12
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
PdfInitInstance
Dtk_ID PdfInitInstance(Dtk_ComponentPtr inComponent)
Definition: PdfWrite.cpp:94
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:144
IsPdfDumpActivated
Dtk_bool IsPdfDumpActivated()
Definition: PdfWrite.cpp:30