DATAKIT API  V2025.1
Dtk_MainDoc Class Reference

This is the Document Class.
The Dtk_MainDocPtr object is used as root element produced by a translation.
It contains the root Dtk_ComponentPtr. More...

+ Inheritance diagram for Dtk_MainDoc:

Public Member Functions

Dtk_ComponentPtr CreateCatalogDtk_Component (Dtk_string inComponentFullPath, Dtk_string inComponentName, Dtk_string inInstanceName, const Dtk_transfo &inTransformationMatrix, const DtkReaderType &inAssociatedModule=UnknownModule, const Dtk_Component::ComponentAvailabilityEnum &inAvailability=Dtk_Component::ComponentInternal, Dtk_string inOriginalName=Dtk_string())
 Creates a Catalog Dtk_ComponentPtr. More...
 
Dtk_ComponentPtr CreateInstanceDtk_Component (const Dtk_ComponentPtr &inPrototype, Dtk_string inInstanceName, const Dtk_transfo &inTransformationMatrix)
 Creates a physical Dtk_ComponentPtr. More...
 
Dtk_ComponentPtr CreatePrototypeDtk_Component (Dtk_string inComponentFullPath, Dtk_string inComponentName, const DtkReaderType &inAssociatedModule, const Dtk_Component::ComponentAvailabilityEnum &inAvailability, const int inAdditionnalReferenceFlag=0, Dtk_string inOriginalName=Dtk_string())
 Creates a Prototype Dtk_ComponentPtr. This type handles Assemblies and part components. More...
 
Dtk_ComponentPtr CreateVirtualDtk_Component (Dtk_string inComponentName, const DtkReaderType &inAssociatedModule, Dtk_string inComponentFullPath, const Dtk_Component::ComponentAvailabilityEnum &inAvailability)
 Creates a virtual Dtk_ComponentPtr. More...
 
Dtk_ErrorStatus DevalidateComponent (const Dtk_ComponentID &inComponentID)
 Devalidates Component into MainDoc. More...
 
Dtk_Int32 DtkDynamicType (const int &inId)
 Retrieves the dynamic entity type. More...
 
virtual void dump (FILE *file=stdout)
 
Dtk_ErrorStatus GetAdditionalReferenceList (Dtk_tab< Dtk_string > &outFileList) const
 return list of additional reference files into MainDoc. More...
 
Dtk_ComponentPtr GetComponentByID (const Dtk_ComponentID &inComponentID) const
 Retrieves a Dtk_ComponentPtr giving its ID. More...
 
Dtk_ComponentPtr GetFatherComponent (const Dtk_ComponentPtr &inComponent, Dtk_Size_t inIndex) const
 Retrieves the inIndexth father of the giving Dtk_ComponentPtr. More...
 
Dtk_ErrorStatus GetMissingComponentList (Dtk_tab< Dtk_string > &outFileList) const
 return list of missing files into MainDoc. More...
 
Dtk_Size_t GetNumComponents () const
 Give number of Components in the Dtk_MainDoc (useful if you want to handle progress bar). More...
 
Dtk_Size_t GetNumFatherComponent (const Dtk_ComponentPtr &inComponent)
 Retrieves the inIndexth father of the giving Dtk_ComponentPtr. More...
 
Dtk_Int32 GetNumInstances () const
 Give number of InstanceComponents in the Dtk_MainDoc. More...
 
virtual Dtk_Size_t GetSize () const
 
const Dtk_ComponentPtrRootComponent () const
 Retrieves the root Dtk_ComponentPtr of the Dtk_MainDoc. More...
 
void SetRootComponent (const Dtk_ComponentPtr &inRootComponent)
 Set the root Dtk_ComponentPtr. More...
 

Static Public Member Functions

static Dtk_MainDocPtr Create ()
 Base constructor. More...
 
static Dtk_MainDocDtkDynamicCast (Dtk_Object *s)
 Performs a dynamic cast - doesn't need RTTI -. More...
 

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_DOCUMENT }
 

Protected Member Functions

void _copy (const Dtk_Object &s)
 
void _init ()
 
void _ReleaseComponents ()
 
void _ReleaseNodeConnectors ()
 
void _reset ()
 

Protected Attributes

Dtk_Handle * _Private
 
unsigned long count_
 

Friends

class Dtk_API
 
class Dtk_MainDocWrapper
 
class Dtk_SmartPtr< Dtk_MainDoc >
 

Detailed Description

This is the Document Class.
The Dtk_MainDocPtr object is used as root element produced by a translation.
It contains the root Dtk_ComponentPtr.

See also
Please use the Dtk_MainDoc class to handle it.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 

Member Function Documentation

◆ _copy()

void Dtk_Object::_copy ( const Dtk_Object s)
protectedinherited

◆ _init()

void Dtk_Object::_init ( )
protectedinherited

◆ _ReleaseComponents()

void Dtk_MainDoc::_ReleaseComponents ( )
protected

◆ _ReleaseNodeConnectors()

void Dtk_MainDoc::_ReleaseNodeConnectors ( )
protected

◆ _reset()

void Dtk_Object::_reset ( )
protectedinherited

◆ Create()

static Dtk_MainDocPtr Dtk_MainDoc::Create ( )
static

Base constructor.

◆ CreateCatalogDtk_Component()

Dtk_ComponentPtr Dtk_MainDoc::CreateCatalogDtk_Component ( Dtk_string  inComponentFullPath,
Dtk_string  inComponentName,
Dtk_string  inInstanceName,
const Dtk_transfo inTransformationMatrix,
const DtkReaderType inAssociatedModule = UnknownModule,
const Dtk_Component::ComponentAvailabilityEnum inAvailability = Dtk_Component::ComponentInternal,
Dtk_string  inOriginalName = Dtk_string() 
)

Creates a Catalog Dtk_ComponentPtr.

Parameters
inComponentFullPathComponent full path.
inComponentNameComponent name.
inInstanceNameInstance name.
inTransformationMatrixTransformation matrix.
inAssociatedModuleAssociated module - Unknown by default -.
Returns
the constructed Dtk_ComponentPtr.

◆ CreateInstanceDtk_Component()

Dtk_ComponentPtr Dtk_MainDoc::CreateInstanceDtk_Component ( const Dtk_ComponentPtr inPrototype,
Dtk_string  inInstanceName,
const Dtk_transfo inTransformationMatrix 
)

Creates a physical Dtk_ComponentPtr.

Parameters
inComponentTypeComponent type - Part or Assembly -.
inComponentFullPathComponent full path.
inComponentNameComponent name.
inInstanceNameInstance name.
inTransformationMatrixTransformation matrix.
inAssociatedModuleAssociated module - Unknown by default -.
Returns
the constructed Dtk_ComponentPtr.

Creates an Instance Dtk_ComponentPtr.

Parameters
inPrototypeThe Prototype Dtk_ComponentPtr used to create instance.
inInstanceNameInstance name.
inTransformationMatrixTransformation matrix.
Returns
the constructed InstanceDtk_ComponentPtr.
Remarks
The Prototype is automatically linked to the instance.

◆ CreatePrototypeDtk_Component()

Dtk_ComponentPtr Dtk_MainDoc::CreatePrototypeDtk_Component ( Dtk_string  inComponentFullPath,
Dtk_string  inComponentName,
const DtkReaderType inAssociatedModule,
const Dtk_Component::ComponentAvailabilityEnum inAvailability,
const int  inAdditionnalReferenceFlag = 0,
Dtk_string  inOriginalName = Dtk_string() 
)

Creates a Prototype Dtk_ComponentPtr. This type handles Assemblies and part components.

Parameters
inComponentFullPathComponent full path.
inComponentNameComponent name.
inAssociatedModuleAssociated module - Unknown by default -.
inAvailability: Is component found/missing or internal
inAdditionnalReferenceFlag: Is component an additionnal reference ( not part of assembly) or not
Returns
the constructed Prototype Dtk_ComponentPtr.

◆ CreateVirtualDtk_Component()

Dtk_ComponentPtr Dtk_MainDoc::CreateVirtualDtk_Component ( Dtk_string  inComponentName,
const DtkReaderType inAssociatedModule,
Dtk_string  inComponentFullPath,
const Dtk_Component::ComponentAvailabilityEnum inAvailability 
)

Creates a virtual Dtk_ComponentPtr.

Parameters
inComponentNameComponent name.
inAssociatedModuleAssociated module - Unknown by default -.
Returns
the constructed Dtk_ComponentPtr.
Remarks
A virtual Dtk_ComponentPtr hasn't any full path.

◆ DevalidateComponent()

Dtk_ErrorStatus Dtk_MainDoc::DevalidateComponent ( const Dtk_ComponentID inComponentID)

Devalidates Component into MainDoc.

Parameters
inComponentIDThe ComponentID to devalidate.
Returns
DtkNoError if success.
Remarks
Internal Use only.

◆ DtkDynamicCast()

static Dtk_MainDoc* Dtk_MainDoc::DtkDynamicCast ( Dtk_Object s)
static

Performs a dynamic cast - doesn't need RTTI -.

◆ DtkDynamicType()

Dtk_Int32 Dtk_MainDoc::DtkDynamicType ( const int &  inId)
virtual

Retrieves the dynamic entity type.

Implements Dtk_Object.

◆ dump()

virtual void Dtk_Object::dump ( FILE *  file = stdout)
virtualinherited

◆ GetAdditionalReferenceList()

Dtk_ErrorStatus Dtk_MainDoc::GetAdditionalReferenceList ( Dtk_tab< Dtk_string > &  outFileList) const

return list of additional reference files into MainDoc.

Parameters
outFileList: list of additionnal reference files
Returns
DtkNoError if success.

◆ GetComponentByID()

Dtk_ComponentPtr Dtk_MainDoc::GetComponentByID ( const Dtk_ComponentID inComponentID) const

Retrieves a Dtk_ComponentPtr giving its ID.

Parameters
inComponentIDThe component ID
Returns
The wanted Dtk_ComponentPtr.

◆ GetFatherComponent()

Dtk_ComponentPtr Dtk_MainDoc::GetFatherComponent ( const Dtk_ComponentPtr inComponent,
Dtk_Size_t  inIndex 
) const

Retrieves the inIndexth father of the giving Dtk_ComponentPtr.

Parameters
inComponentThe component from which we want the father.
inIndexindex of father wanted.
Returns
The wanted Dtk_ComponentPtr.

◆ GetMissingComponentList()

Dtk_ErrorStatus Dtk_MainDoc::GetMissingComponentList ( Dtk_tab< Dtk_string > &  outFileList) const

return list of missing files into MainDoc.

Parameters
outFileList: list of missing files
Returns
DtkNoError if success.

◆ GetNumComponents()

Dtk_Size_t Dtk_MainDoc::GetNumComponents ( ) const

Give number of Components in the Dtk_MainDoc (useful if you want to handle progress bar).

Returns
number of Components.

◆ GetNumFatherComponent()

Dtk_Size_t Dtk_MainDoc::GetNumFatherComponent ( const Dtk_ComponentPtr inComponent)

Retrieves the inIndexth father of the giving Dtk_ComponentPtr.

Parameters
inComponentThe component from which we want the number of fathers.
Returns
The number of father.

◆ GetNumInstances()

Dtk_Int32 Dtk_MainDoc::GetNumInstances ( ) const

Give number of InstanceComponents in the Dtk_MainDoc.

Returns
number of Instance Components.

◆ GetSize()

◆ RootComponent()

const Dtk_ComponentPtr& Dtk_MainDoc::RootComponent ( ) const

Retrieves the root Dtk_ComponentPtr of the Dtk_MainDoc.

Returns
The root Dtk_ComponentPtr.

◆ SetRootComponent()

void Dtk_MainDoc::SetRootComponent ( const Dtk_ComponentPtr inRootComponent)

Set the root Dtk_ComponentPtr.

Parameters
inRootComponentThe root Ccomponent

Friends And Related Function Documentation

◆ Dtk_API

friend class Dtk_API
friend

◆ Dtk_MainDocWrapper

friend class Dtk_MainDocWrapper
friend

◆ Dtk_SmartPtr< Dtk_MainDoc >

friend class Dtk_SmartPtr< Dtk_MainDoc >
friend

Field Documentation

◆ _Private

Dtk_Handle* Dtk_MainDoc::_Private
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
DTK_TYPE_OBJECT
@ DTK_TYPE_OBJECT
Definition: define.h:464
DTK_TYPE_DOCUMENT
@ DTK_TYPE_DOCUMENT
Definition: define.h:509
Dtk_MainDoc::_typeID
@ _typeID
Definition: dtk_maindoc.hpp:928
Dtk_Object::_typeID
@ _typeID
Definition: dtk_object.hpp:13