DATAKIT API  V2025.4
Dtk_LayerInfosSet Class Referenceabstract

This class represents a set of layer information, such as their name and identifier, as well as a list of layer filters.
. More...

+ Inheritance diagram for Dtk_LayerInfosSet:

Public Member Functions

Dtk_LayerFilterInfosPtr CreateLayerFilterInfos (Dtk_string inName=L"", Dtk_string inDescription=L"", const Dtk_bool inAreLayersSelectedByDefault=DTK_FALSE, const Dtk_bool IsDefaultLayerFilter=DTK_FALSE)
 Create a layer filter. More...
 
Dtk_Int32 DtkDynamicType (const Dtk_Int32 &inId)
 Retrieves the dynamic entity type. More...
 
virtual int DtkDynamicType (const int &inId)=0
 
virtual void dump (FILE *file=stdout)
 
type_detk get_type_detk () const
 
Dtk_ErrorStatus GetDefaultLayer (Dtk_Size_t &outDefaultLayerIndex) const
 Gets the default layer index. More...
 
Dtk_ErrorStatus GetDefaultLayerFilter (Dtk_Size_t &outDefaultLayerFilterIndex) const
 Gets the default layer filter index. More...
 
Dtk_LayerFilterInfosPtr GetLayerFilterByPos (const Dtk_Size_t inLayerFilterIndex) const
 Gets a layer filter giving its index. More...
 
Dtk_ErrorStatus GetLayerID (const Dtk_Size_t inLayerIndex, Dtk_ID &outLayerID) const
 Gets the LayerID giving its index. More...
 
Dtk_ErrorStatus GetLayerName (const Dtk_Size_t inIndex, Dtk_string &outLayerName) const
 Gets the LayerName giving its index. More...
 
Dtk_ErrorStatus GetLayerNameById (const Dtk_ID inLayerID, Dtk_string &outLayerName) const
 Gets the LayerName giving the ID found by infos->GetLayer(). More...
 
Dtk_Size_t GetNumLayerFilters () const
 Retrieves the number of layer filters. More...
 
Dtk_Size_t GetNumLayers () const
 Retrieves the number of layers. More...
 
virtual Dtk_Size_t GetSize () const
 
Dtk_ErrorStatus SetDefaultLayer (const Dtk_Size_t inDefaultLayerIndex)
 Sets the default layer index. More...
 
Dtk_ErrorStatus SetLayerID (const Dtk_Size_t inLayerIndex, const Dtk_ID &inLayerID)
 Sets the LayerID giving its index. More...
 
Dtk_ErrorStatus SetLayerName (const Dtk_Size_t inIndex, const Dtk_string &inLayerName)
 Sets the layer name giving its index. More...
 

Static Public Member Functions

static Dtk_LayerInfosSetPtr Create (const Dtk_Size_t inNumLayers)
 Calls a constructor to allocate a new object. More...
 
static Dtk_LayerInfosSetDtkDynamicCast (Dtk_Object *s)
 Performs a dynamic cast - doesn't need RTTI -. More...
 

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_LAYER_INFOS_SET }
 

Protected Member Functions

virtual Dtk_ObjectClone ()
 
 Dtk_LayerInfosSet (const Dtk_LayerInfosSet &s)
 
 Dtk_LayerInfosSet (const Dtk_Size_t inNumLayers)
 
 ~Dtk_LayerInfosSet ()
 Destructor. More...
 

Protected Attributes

Dtk_Handle * _Private
 
unsigned long count_
 

Detailed Description

This class represents a set of layer information, such as their name and identifier, as well as a list of layer filters.
.

The set allows to extend the definition of legacy layers, that previously were only represented by an identifier. It lists all layers used in a given context (Dtk_Component), and allows to assign a name to each of them.
It also allows to define one of the layer as being the default one (note that this can be the same concept as the current one, depending on the format).
Creation of layer filters are also done through this set, representing a group of specific layers.
One of the filter can be defined as being the default one, similarly to individual layer.

See also
Dtk_LayerFilterInfos for more information about layer filters.
Dtk_LayerInfosSet sample code for a sample on how to use it.
Use Dtk_LayerInfosSetPtr class to handle it.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 

Constructor & Destructor Documentation

◆ Dtk_LayerInfosSet() [1/2]

Dtk_LayerInfosSet::Dtk_LayerInfosSet ( const Dtk_Size_t  inNumLayers)
protected

◆ Dtk_LayerInfosSet() [2/2]

Dtk_LayerInfosSet::Dtk_LayerInfosSet ( const Dtk_LayerInfosSet s)
protected
See also
Create(const Dtk_LayerInfosSet&)

◆ ~Dtk_LayerInfosSet()

Dtk_LayerInfosSet::~Dtk_LayerInfosSet ( )
protected

Destructor.

Member Function Documentation

◆ Clone()

virtual Dtk_Object* Dtk_LayerInfosSet::Clone ( )
protectedvirtual

◆ Create()

static Dtk_LayerInfosSetPtr Dtk_LayerInfosSet::Create ( const Dtk_Size_t  inNumLayers)
static

Calls a constructor to allocate a new object.

Parameters
inNumLayersthe number of desired layers.

◆ CreateLayerFilterInfos()

Dtk_LayerFilterInfosPtr Dtk_LayerInfosSet::CreateLayerFilterInfos ( Dtk_string  inName = L"",
Dtk_string  inDescription = L"",
const Dtk_bool  inAreLayersSelectedByDefault = DTK_FALSE,
const Dtk_bool  IsDefaultLayerFilter = DTK_FALSE 
)

Create a layer filter.

Parameters
inNamethe layer filter name - Empty name by default -.
inAreLayersActivatedByDefaultThe default value of the layer selection. DTK_TRUE means that all layers are selected. DTK_FALSE means that no layer is selected - DTK_FALSE by default -.
IsDefaultLayerFilterTells if the new layer filter is the default one - DTK_FALSE by default -.
Returns
the newly created layer filter.
Remarks
The newly created layer filter is automatically stored into the Dtk_LayerInfosSet.

◆ DtkDynamicCast()

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

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

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_LayerInfosSet::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

◆ DtkDynamicType() [2/2]

◆ dump()

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

◆ get_type_detk()

type_detk Dtk_LayerInfosSet::get_type_detk ( ) const
Returns
The type of the entity type - DTK_TYPE_LAYER_INFOS_SET -

◆ GetDefaultLayer()

Dtk_ErrorStatus Dtk_LayerInfosSet::GetDefaultLayer ( Dtk_Size_t outDefaultLayerIndex) const

Gets the default layer index.

Parameters
outDefaultLayerthe layer index or -1 if any error.
Returns
dtkNoError if success.
dtkErrorOutOfRange if no default layer.

◆ GetDefaultLayerFilter()

Dtk_ErrorStatus Dtk_LayerInfosSet::GetDefaultLayerFilter ( Dtk_Size_t outDefaultLayerFilterIndex) const

Gets the default layer filter index.

Parameters
outDefaultLayerFilterthe layer filter index or -1 if any error.
Returns
dtkNoError if success.
dtkErrorOutOfRange if no default layer filter.

◆ GetLayerFilterByPos()

Dtk_LayerFilterInfosPtr Dtk_LayerInfosSet::GetLayerFilterByPos ( const Dtk_Size_t  inLayerFilterIndex) const

Gets a layer filter giving its index.

Parameters
inLayerFilterPosthe layer filter index.
Returns
the asked layer filter if success or a NULL Dtk_LayerFilterInfosPtr if any error.

◆ GetLayerID()

Dtk_ErrorStatus Dtk_LayerInfosSet::GetLayerID ( const Dtk_Size_t  inLayerIndex,
Dtk_ID outLayerID 
) const

Gets the LayerID giving its index.

Parameters
inLayerPosthe layer index.
outLayerIDthe layer id or inLayerPos if not given.
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad layer index.

◆ GetLayerName()

Dtk_ErrorStatus Dtk_LayerInfosSet::GetLayerName ( const Dtk_Size_t  inIndex,
Dtk_string outLayerName 
) const

Gets the LayerName giving its index.

Parameters
inLayerPosthe layer index.
outLayerNamethe layer name or empty string if any error.
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad layer index.
dtkErrorNullPointer if no layer name.

◆ GetLayerNameById()

Dtk_ErrorStatus Dtk_LayerInfosSet::GetLayerNameById ( const Dtk_ID  inLayerID,
Dtk_string outLayerName 
) const

Gets the LayerName giving the ID found by infos->GetLayer().

Parameters
inLayerIDthe layer ID.
outLayerNamethe layer name or empty string if any error.
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad layer ID.
dtkErrorNullPointer if no layer name.

◆ GetNumLayerFilters()

Dtk_Size_t Dtk_LayerInfosSet::GetNumLayerFilters ( ) const

Retrieves the number of layer filters.

Returns
the number of layer filters.

◆ GetNumLayers()

Dtk_Size_t Dtk_LayerInfosSet::GetNumLayers ( ) const

Retrieves the number of layers.

Returns
the number of layers.

◆ GetSize()

◆ SetDefaultLayer()

Dtk_ErrorStatus Dtk_LayerInfosSet::SetDefaultLayer ( const Dtk_Size_t  inDefaultLayerIndex)

Sets the default layer index.

Parameters
inDefaultLayerthe layer index.
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad layer index.

◆ SetLayerID()

Dtk_ErrorStatus Dtk_LayerInfosSet::SetLayerID ( const Dtk_Size_t  inLayerIndex,
const Dtk_ID inLayerID 
)

Sets the LayerID giving its index.

Parameters
inLayerPosthe layer index.
inLayerIDthe layer id.
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad layer index.

◆ SetLayerName()

Dtk_ErrorStatus Dtk_LayerInfosSet::SetLayerName ( const Dtk_Size_t  inIndex,
const Dtk_string inLayerName 
)

Sets the layer name giving its index.

Parameters
inIndexthe layer index.
inLayerNamethe layer name.
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad layer index.

Field Documentation

◆ _Private

Dtk_Handle* Dtk_LayerInfosSet::_Private
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited