DATAKIT API  V2025.1
WriteInstance.cpp File Reference

Functions

Dtk_ErrorStatus WriteInstance (Dtk_ComponentPtr inComponent, const Dtk_transfo &inMatrix)
 

Variables

Dtk_tab< Dtk_IDComponentProcessed
 

Function Documentation

◆ WriteInstance()

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

Variable Documentation

◆ ComponentProcessed

Dtk_tab<Dtk_ID> ComponentProcessed
extern
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:689
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:108
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:90
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:140
IsPdfDumpActivated
Dtk_bool IsPdfDumpActivated()
Definition: PdfWrite.cpp:26