 |
DATAKIT SDK
V2026.2
|
|
Sample to browse a Dtk_MainDoc
Sample to browse a Dtk_Component
Sample to browse a Dtk_Component type Instance
Sample to browse a Dtk_Component type Prototype
Selection Set sample
Sample to browse a Dtk_MainDoc
#include "../../WritingSample/PdfWrite/PdfWrite.hpp"
{
{
{
}
{
}
}
}
Sample to browse a Dtk_Component
#include "../../WritingSample/XmlWrite/XmlWrite.hpp"
{
double unitFactor;
inComponent->GetConceptionUnitScale(unitFactor);
Dtk_InfoPtr componentAttributes = inComponent->GetInfos();
{
int activationStatus = 1;
int blankedStatus = 0;
}
{
char *jpgImage = preview->GetStream();
if (jpg)
{
fwrite(jpgImage, sizeof(char), size, jpg);
fclose(jpg);
}
}
{
}
switch (type)
{
{
break;
}
{
break;
}
{
Dtk_Size_t numChildren = inComponent->GetNumChildren();
if (numChildren > 0)
{
Dtk_Int32 defaultComponentIndex = inComponent->GetDefaultChildInCatalog();
Dtk_tab<Dtk_Int32> activatedComponentIndices = inComponent->GetActivatedChildrenInCatalog();
{
{
{
continue;
}
if( defaultComponentIndex == (
Dtk_Int32 )i )
{
continue;
}
}
}
if (numActivatedComponents > 0)
{
for (
Dtk_Size_t i = 0; i < numActivatedComponents; i++)
{
Dtk_ComponentPtr activatedComponent = inComponent->GetChild(activatedComponentIndices[i]);
}
}
else
{
Dtk_ComponentPtr defaultChildComponent = inComponent->GetChild(defaultComponentIndex);
}
}
break;
}
{
Dtk_Size_t numChildComponents = inComponent->GetNumChildren();
for (
Dtk_Size_t i = 0; i < numChildComponents; i++)
{
}
break;
}
}
{
}
}
Sample to browse a Dtk_Component type Instance
#include "../../WritingSample/PdfWrite/PdfWrite.hpp"
#include "../../WritingSample/XmlWrite/XmlWrite.hpp"
{
Dtk_string instanceName = inComponent->InstanceName();
Dtk_transfo matrix = inComponent->TransformationMatrix();
Dtk_ID childID = prototype->GetID();
{
}
{
}
{
}
}
Sample to browse a Dtk_Component type Prototype
#include "../../WritingSample/PdfWrite/PdfWrite.hpp"
#include "../../WritingSample/XmlWrite/XmlWrite.hpp"
#include "../ThroughData/WriteNode.hpp"
{
Dtk_ID componentID = inComponent->GetID();
if (componentIndex == -1)
{
Dtk_Size_t numChildComponents = inComponent->GetNumChildren();
for (
Dtk_Size_t i = 0; i < numChildComponents; i++)
{
}
{
}
else
{
}
{
{
Dtk_Size_t numMetaData = inComponent->GetNumMetaData();
if (numMetaData)
{
{
}
}
}
}
{
}
}
else
{
{
}
}
}
uint32_t Dtk_ID
Definition: define.h:681
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
int GetBlankedStatus() const
Retrieves the entity Blanked Status.
@ CatalogComponentType
Definition: dtk_maindoc.hpp:571
@ dtkErrorFileNotExist
Definition: error_dtk.hpp:101
Dtk_bool IsNotNULL() const
Definition: util_ptr_dtk.hpp:119
void XmlInitComponent(Dtk_ComponentPtr inComponent)
Definition: XmlWrite.cpp:50
void XmlWriteMetaData(const Dtk_MetaDataPtr &inMetaData)
Definition: XmlWrite.cpp:130
void XmlEndComponent()
Definition: XmlWrite.cpp:57
void PdfWriteMetaData(Dtk_ComponentPtr inComponent)
Definition: PdfWrite.cpp:120
void XmlWriteGlobalDataSet(const Dtk_GlobalDataSetPtr &inSelectionSet)
Definition: XmlWrite.cpp:124
This is a high level string class.
Definition: dtk_string.hpp:53
Dtk_ErrorStatus WriteDocument(Dtk_MainDocPtr inDocument)
Definition: WriteDocument.cpp:14
void PdfEndInstance(Dtk_ID pdfInstID, Dtk_ID childID)
Definition: PdfWrite.cpp:111
size_t Dtk_Size_t
Definition: define.h:704
Dtk_RGB GetColor() const
Retrieves the entity color as Dtk_RGBA values.
int GetActivationFlag() const
Dtk_ErrorStatus EndComponent(Dtk_ComponentPtr &inComponent)
EndComponent.
FILE * OpenFile(const Dtk_string &inRights) const
File Utility : Open a file with the given rights.
Dtk_ErrorStatus WriteComponent(Dtk_ComponentPtr inComponent, const Dtk_transfo &inMatrix=Dtk_transfo())
Definition: WriteComponent.cpp:12
void WritePrototype(Dtk_ComponentPtr inComponent, const Dtk_transfo &inMatrix)
Definition: WritePrototype.cpp:19
@ VirtualComponentType
Definition: dtk_maindoc.hpp:572
@ InstanceComponentType
Definition: dtk_maindoc.hpp:569
static Dtk_API * GetAPI()
Get DATAKIT API.
Dtk_ErrorStatus WriteInstance(Dtk_ComponentPtr inComponent)
Definition: WriteInstance.cpp:16
int find(const T &e) const
Definition: util_stl_dtk.hpp:746
void PdfInstanceExistingPrototype(Dtk_ID ComponentIndex)
Definition: PdfWrite.cpp:141
int32_t Dtk_Int32
Definition: define.h:679
ComponentTypeEnum
Definition: dtk_maindoc.hpp:568
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_transfo CurrentMatrix
Definition: WritePrototype.cpp:13
Definition: util_ptr_dtk.hpp:37
Dtk_ID PdfInitInstance(Dtk_ComponentPtr inComponent)
Definition: PdfWrite.cpp:93
Dtk_tab< Dtk_ID > ProcessedComponents
Definition: WritePrototype.cpp:16
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:503
@ PrototypeComponentType
Definition: dtk_maindoc.hpp:570
Dtk_bool IsXmlDumpActivated()
Definition: XmlWrite.cpp:17
@ ComponentMissing
Definition: dtk_maindoc.hpp:559
@ dtkNoError
Definition: error_dtk.hpp:149
Dtk_ErrorStatus ReadComponent(const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outRootNode)
Read Component from Assembly Tree (Call EndComponent to free data allocated)
Dtk_ErrorStatus WriteNode(Dtk_NodePtr inNode)
Definition: WriteNode.cpp:16
Definition: dtk_rgb.hpp:7
Dtk_bool IsPdfDumpActivated()
Definition: PdfWrite.cpp:29
@ dtkErrorNullPointer
Definition: error_dtk.hpp:23
Definition: dtk_api.hpp:75
void PdfEndComponent()
Definition: PdfWrite.cpp:154
Dtk_ID PdfInitComponent(Dtk_ComponentPtr inComponent)
Definition: PdfWrite.cpp:146