DATAKIT API  V2025.1
Dtk_ColorInfosSet Class Referenceabstract

This is the Color Info Set class. This is the read color definition Class.
It gathers all information about colors in the component. Please use the Dtk_ColorInfosSetPtr class to handle it... More...

+ Inheritance diagram for Dtk_ColorInfosSet:

Public Member Functions

Dtk_Size_t AddColor (const Dtk_ID inColorReadId, const Dtk_string &inColorName, const Dtk_RGB &inColorDef)
 Add Color definition. 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 GetColorDefinition (const Dtk_Size_t inColorPos, Dtk_RGB &outColorDef) const
 Gets the ColorID giving its number. More...
 
Dtk_ErrorStatus GetColorID (const Dtk_Size_t inColorPos, Dtk_ID &outColorReadID) const
 Gets the ColorID giving its number. More...
 
Dtk_ErrorStatus GetColorName (const Dtk_Size_t inColorPos, Dtk_string &outColorName) const
 Gets the Color Name giving its number. More...
 
Dtk_ErrorStatus GetColorNameById (const Dtk_ID inColorReadId, Dtk_string &outColorName) const
 Gets the Color Name giving the ID found iby infos->GetColorID(). More...
 
Dtk_ErrorStatus GetDefaultColor (Dtk_Int32 &outDefaultColor) const
 Gets the default color number. More...
 
Dtk_Size_t GetNumColors () const
 Retrieves the number of colors. More...
 
virtual Dtk_Size_t GetSize () const
 
Dtk_ErrorStatus SetColorID (const Dtk_Size_t inColorPos, const Dtk_ID &inColorReadID)
 Sets the ColorID giving its number. More...
 
Dtk_ErrorStatus SetColorName (const Dtk_Size_t inColorPos, const Dtk_string &inColorName)
 Sets the Color Name giving its number. More...
 
Dtk_ErrorStatus SetDefaultColor (const Dtk_Int32 inDefaultColor)
 Sets the default color number. More...
 

Static Public Member Functions

static Dtk_ColorInfosSetPtr Create (const Dtk_Size_t inNumColors)
 Base constructor. More...
 
static Dtk_ColorInfosSetDtkDynamicCast (Dtk_Object *s)
 Performs a dynamic cast - doesn't need RTTI -. More...
 

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_COLOR_INFOS_SET }
 

Protected Member Functions

void _copy (const Dtk_Object &s)
 
void _init ()
 
void _reset ()
 
virtual Dtk_ObjectClone ()
 
 Dtk_ColorInfosSet (const Dtk_ColorInfosSet &s)
 
 Dtk_ColorInfosSet (const Dtk_Size_t inNumColors)
 
 ~Dtk_ColorInfosSet ()
 Destructor. More...
 

Protected Attributes

Dtk_Handle * _Private
 
unsigned long count_
 

Friends

class Dtk_SmartPtr< Dtk_ColorInfosSet >
 

Detailed Description

This is the Color Info Set class. This is the read color definition Class.
It gathers all information about colors in the component. Please use the Dtk_ColorInfosSetPtr 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_ColorInfosSet() [1/2]

Dtk_ColorInfosSet::Dtk_ColorInfosSet ( const Dtk_Size_t  inNumColors)
protected
See also
Create()

◆ Dtk_ColorInfosSet() [2/2]

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

◆ ~Dtk_ColorInfosSet()

Dtk_ColorInfosSet::~Dtk_ColorInfosSet ( )
protected

Destructor.

Member Function Documentation

◆ _copy()

void Dtk_Object::_copy ( const Dtk_Object s)
protectedinherited

◆ _init()

void Dtk_Object::_init ( )
protectedinherited

◆ _reset()

void Dtk_Object::_reset ( )
protectedinherited

◆ AddColor()

Dtk_Size_t Dtk_ColorInfosSet::AddColor ( const Dtk_ID  inColorReadId,
const Dtk_string inColorName,
const Dtk_RGB inColorDef 
)

Add Color definition.

Parameters
inColorReadIdthe color number.
inColorNamethe color name.
inColorDefthe color RGB definition.
Returns
dtkNoError if success.

◆ Clone()

virtual Dtk_Object* Dtk_ColorInfosSet::Clone ( )
protectedvirtual
586 { return new Dtk_ColorInfosSet(*this); }

◆ Create()

static Dtk_ColorInfosSetPtr Dtk_ColorInfosSet::Create ( const Dtk_Size_t  inNumColors)
static

Base constructor.

◆ DtkDynamicCast()

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

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

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_ColorInfosSet::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_ColorInfosSet::get_type_detk ( ) const
Returns
The type of the entity type - DTK_TYPE_COLOR_INFOS_SET -
603 { return DTK_TYPE_COLOR_INFOS_SET; }

◆ GetColorDefinition()

Dtk_ErrorStatus Dtk_ColorInfosSet::GetColorDefinition ( const Dtk_Size_t  inColorPos,
Dtk_RGB outColorDef 
) const

Gets the ColorID giving its number.

Parameters
inColorPosthe color number.
outColorDefthe color id
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad color number.

◆ GetColorID()

Dtk_ErrorStatus Dtk_ColorInfosSet::GetColorID ( const Dtk_Size_t  inColorPos,
Dtk_ID outColorReadID 
) const

Gets the ColorID giving its number.

Parameters
inColorPosthe color number.
outColorReadIDthe color id
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad color number.

◆ GetColorName()

Dtk_ErrorStatus Dtk_ColorInfosSet::GetColorName ( const Dtk_Size_t  inColorPos,
Dtk_string outColorName 
) const

Gets the Color Name giving its number.

Parameters
inColorPosthe color number.
inColorNamethe color name or empty string if any error.
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad color number.
dtkErrorNullPointer if no color name.

◆ GetColorNameById()

Dtk_ErrorStatus Dtk_ColorInfosSet::GetColorNameById ( const Dtk_ID  inColorReadId,
Dtk_string outColorName 
) const

Gets the Color Name giving the ID found iby infos->GetColorID().

Parameters
inColorReadIdthe color ID.
outColorNamethe color name or empty string if any error.
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad color ID.
dtkErrorNullPointer if no color name.

◆ GetDefaultColor()

Dtk_ErrorStatus Dtk_ColorInfosSet::GetDefaultColor ( Dtk_Int32 outDefaultColor) const

Gets the default color number.

Parameters
outDefaultColorthe color number or -1 if any error.
Returns
dtkNoError if success.
dtkErrorOutOfRange if no default color.

◆ GetNumColors()

Dtk_Size_t Dtk_ColorInfosSet::GetNumColors ( ) const

Retrieves the number of colors.

Returns
the number of colors.

◆ GetSize()

◆ SetColorID()

Dtk_ErrorStatus Dtk_ColorInfosSet::SetColorID ( const Dtk_Size_t  inColorPos,
const Dtk_ID inColorReadID 
)

Sets the ColorID giving its number.

Parameters
inColorPosthe color number.
inColorReadIDthe color id.
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad color number.

◆ SetColorName()

Dtk_ErrorStatus Dtk_ColorInfosSet::SetColorName ( const Dtk_Size_t  inColorPos,
const Dtk_string inColorName 
)

Sets the Color Name giving its number.

Parameters
inColorPosthe color number.
inColorNamethe color name.
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad color number.

◆ SetDefaultColor()

Dtk_ErrorStatus Dtk_ColorInfosSet::SetDefaultColor ( const Dtk_Int32  inDefaultColor)

Sets the default color number.

Parameters
inDefaultColorthe color number.
Returns
dtkNoError if success.
dtkErrorOutOfRange if bad color number.

Friends And Related Function Documentation

◆ Dtk_SmartPtr< Dtk_ColorInfosSet >

friend class Dtk_SmartPtr< Dtk_ColorInfosSet >
friend

Field Documentation

◆ _Private

Dtk_Handle* Dtk_ColorInfosSet::_Private
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
DTK_TYPE_COLOR_INFOS_SET
@ DTK_TYPE_COLOR_INFOS_SET
Definition: define.h:507
DTK_TYPE_OBJECT
@ DTK_TYPE_OBJECT
Definition: define.h:464
Dtk_ColorInfosSet::_typeID
@ _typeID
Definition: util_ent_dtk.hpp:580
Dtk_ColorInfosSet::Dtk_ColorInfosSet
Dtk_ColorInfosSet(const Dtk_Size_t inNumColors)
Dtk_Object::_typeID
@ _typeID
Definition: dtk_object.hpp:13