DATAKIT API  V2025.1
Dtk_LineTypeDefinition Class Referenceabstract

This is the Dtk_LineTypeDefinition Class.
The Dtk_LineTypeDefinition object is used to store any informations about style of curves. More...

+ Inheritance diagram for Dtk_LineTypeDefinition:

Public Types

enum  Dtk_LineTypePatternDescriptorType { DTK_LINE_TYPE_PATTERN_DESCRIPTOR_UNKNOWN, DTK_LINE_TYPE_PATTERN_DESCRIPTOR_DASH, DTK_LINE_TYPE_PATTERN_DESCRIPTOR_DOT, DTK_LINE_TYPE_PATTERN_DESCRIPTOR_GAP }
 

Public Member Functions

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)
 
bool GetBoldSegmentsOnChangeOfDirections (Dtk_Double64 &outBoldSegmentsThickness, Dtk_Double64 &outBoldSegmentsLength) const
 Get bold segments when curve changes of direction. More...
 
Dtk_FontLineType GetClosestAppearanceInFontLineTypeEnumeration () const
 Get what we consider as the closest type in the Dtk_FontLineType enumeration. More...
 
const Dtk_stringGetName () const
 Returns the line type definition name. More...
 
Dtk_ErrorStatus GetPatternDescriptorDashAtIndex (const Dtk_Size_t &inIndex, Dtk_Double64 &outDashLength) const
 Get the length of the segment at index in the pattern. More...
 
Dtk_ErrorStatus GetPatternDescriptorGapAtIndex (const Dtk_Size_t &inIndex, Dtk_Double64 &outGapLength) const
 Get the length of the gap at index in the pattern. More...
 
Dtk_ErrorStatus GetPatternDescriptorTypeAtIndex (const Dtk_Size_t &inIndex, Dtk_LineTypePatternDescriptorType &outPatternType) const
 Get the type of the pattern descriptor at index to call the correct function. More...
 
Dtk_Size_t GetPatternLength () const
 Get the the number of pattern descriptor. More...
 
virtual Dtk_Size_t GetSize () const
 
void PushBackPatternDescriptorDash (const Dtk_Double64 &inDashLength) const
 Add a new pattern descriptor of type DASH and precise it's length. More...
 
void PushBackPatternDescriptorDot () const
 Add a new pattern descriptor of type DOT. More...
 
void PushBackPatternDescriptorGap (const Dtk_Double64 &inGapLength) const
 Add a new pattern descriptor of type GAP and precise it's length. More...
 
void SetClosestAppearanceInFontLineTypeEnumeration (const Dtk_FontLineType &inClosestFontLineTypeEnumValue) const
 Set what can be consider as the closest type in the Dtk_FontLineType enumeration. More...
 
void SetName (const Dtk_string &inName)
 Set the line type definition name. More...
 

Static Public Member Functions

static Dtk_LineTypeDefinitionPtr Create (const Dtk_FontLineType &inClosestAppearanceInFontLineTypeEnumeration)
 Create a Dtk_LineTypeDefinitionPtr without any pattern but only a closest enumeration value. More...
 
static Dtk_LineTypeDefinitionPtr Create (const Dtk_string &inName)
 Create a Dtk_LineTypeDefinitionPtr. More...
 
static Dtk_LineTypeDefinitionPtr Create (const Dtk_string &inName, const bool inHasBoldSegmentsAtEndOfLines, const Dtk_Double64 &inBoldSegmentsOnEndOfLinesThickness, const Dtk_Double64 &inBoldSegmentsOnEndOfLinesLength)
 Create a Dtk_LineTypeDefinitionPtr. More...
 
static Dtk_LineTypeDefinitionDtkDynamicCast (Dtk_Object *s)
 Performs a dynamic cast - doesn't need RTTI -. More...
 

Protected Types

enum  { _typeID = DTK_TYPE_LINE_TYPE_DEFINITION }
 

Protected Member Functions

void _Copy (const Dtk_LineTypeDefinition &inToBeCopied)
 
void _copy (const Dtk_Object &s)
 
void _init ()
 
void _Init ()
 
void _reset ()
 
void _Reset ()
 
virtual Dtk_ObjectClone ()
 
 Dtk_LineTypeDefinition (const Dtk_FontLineType &inClosestAppearanceInFontLineTypeEnumeration)
 
 Dtk_LineTypeDefinition (const Dtk_LineTypeDefinition &inToBeCopied)
 Copy constructor. More...
 
 Dtk_LineTypeDefinition (const Dtk_string &inName)
 
 Dtk_LineTypeDefinition (const Dtk_string &inName, const bool inHasBoldSegmentsOnChangeOfDirections, const Dtk_Double64 &inBoldSegmentsOnChangeOfDirectionsThickness, const Dtk_Double64 &inBoldSegmentsOnChangeOfDirectionsLength)
 
virtual ~Dtk_LineTypeDefinition ()
 Destructor. More...
 

Protected Attributes

Dtk_Handle * _Private
 
unsigned long count_
 

Friends

class Dtk_SmartPtr< Dtk_LineTypeDefinition >
 

Detailed Description

This is the Dtk_LineTypeDefinition Class.
The Dtk_LineTypeDefinition object is used to store any informations about style of curves.

See also
Please use the Dtk_LineTypeDefinitionPtr class to handle it.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 
35  {
37  };

◆ Dtk_LineTypePatternDescriptorType

Enumerator
DTK_LINE_TYPE_PATTERN_DESCRIPTOR_UNKNOWN 
DTK_LINE_TYPE_PATTERN_DESCRIPTOR_DASH 
DTK_LINE_TYPE_PATTERN_DESCRIPTOR_DOT 
DTK_LINE_TYPE_PATTERN_DESCRIPTOR_GAP 

Constructor & Destructor Documentation

◆ Dtk_LineTypeDefinition() [1/4]

Dtk_LineTypeDefinition::Dtk_LineTypeDefinition ( const Dtk_LineTypeDefinition inToBeCopied)
protected

Copy constructor.

Parameters
inToBeCopiedObject to copy.

◆ Dtk_LineTypeDefinition() [2/4]

Dtk_LineTypeDefinition::Dtk_LineTypeDefinition ( const Dtk_string inName)
protected

◆ Dtk_LineTypeDefinition() [3/4]

Dtk_LineTypeDefinition::Dtk_LineTypeDefinition ( const Dtk_string inName,
const bool  inHasBoldSegmentsOnChangeOfDirections,
const Dtk_Double64 inBoldSegmentsOnChangeOfDirectionsThickness,
const Dtk_Double64 inBoldSegmentsOnChangeOfDirectionsLength 
)
protected

◆ Dtk_LineTypeDefinition() [4/4]

Dtk_LineTypeDefinition::Dtk_LineTypeDefinition ( const Dtk_FontLineType inClosestAppearanceInFontLineTypeEnumeration)
protected

◆ ~Dtk_LineTypeDefinition()

virtual Dtk_LineTypeDefinition::~Dtk_LineTypeDefinition ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ _Copy()

void Dtk_LineTypeDefinition::_Copy ( const Dtk_LineTypeDefinition inToBeCopied)
protected

◆ _copy()

void Dtk_Object::_copy ( const Dtk_Object s)
protectedinherited

◆ _init()

void Dtk_Object::_init ( )
protectedinherited

◆ _Init()

void Dtk_LineTypeDefinition::_Init ( )
protected

◆ _reset()

void Dtk_Object::_reset ( )
protectedinherited

◆ _Reset()

void Dtk_LineTypeDefinition::_Reset ( )
protected

◆ Clone()

virtual Dtk_Object* Dtk_LineTypeDefinition::Clone ( )
protectedvirtual
61  {
62  return new Dtk_LineTypeDefinition( *this );
63  }

◆ Create() [1/3]

static Dtk_LineTypeDefinitionPtr Dtk_LineTypeDefinition::Create ( const Dtk_FontLineType inClosestAppearanceInFontLineTypeEnumeration)
static

Create a Dtk_LineTypeDefinitionPtr without any pattern but only a closest enumeration value.

Returns
The constructed Dtk_LineTypeDefinitionPtr.

◆ Create() [2/3]

static Dtk_LineTypeDefinitionPtr Dtk_LineTypeDefinition::Create ( const Dtk_string inName)
static

Create a Dtk_LineTypeDefinitionPtr.

Parameters
inNameName of the Dtk_LineTypeDefinition to construct.
Returns
The constructed Dtk_LineTypeDefinitionPtr.

◆ Create() [3/3]

static Dtk_LineTypeDefinitionPtr Dtk_LineTypeDefinition::Create ( const Dtk_string inName,
const bool  inHasBoldSegmentsAtEndOfLines,
const Dtk_Double64 inBoldSegmentsOnEndOfLinesThickness,
const Dtk_Double64 inBoldSegmentsOnEndOfLinesLength 
)
static

Create a Dtk_LineTypeDefinitionPtr.

Parameters
inNameName of the Dtk_LineTypeDefinition to construct.
inHasBoldSegmentsAtEndOfLinesIf true, the curves have a specific thickness when there is a change of direction.
inBoldSegmentsOnEndOfLinesThicknessPrecise the specific thickness if inHasBoldSegmentsAtEndOfLines is true.
inBoldSegmentsOnEndOfLinesLengthPrecise the specific thickness length if inHasBoldSegmentsAtEndOfLines is true.
Returns
The constructed Dtk_LineTypeDefinitionPtr.

◆ DtkDynamicCast()

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

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

96  {
97  if( s->DtkDynamicType( _typeID ) ) return static_cast< Dtk_LineTypeDefinition* >( s );
98  return NULL;
99  }

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_LineTypeDefinition::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

89  {
90  if( inId == _typeID ) return 1;
91  return Dtk_Object::DtkDynamicType( inId );
92  }

◆ DtkDynamicType() [2/2]

◆ dump()

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

◆ GetBoldSegmentsOnChangeOfDirections()

bool Dtk_LineTypeDefinition::GetBoldSegmentsOnChangeOfDirections ( Dtk_Double64 outBoldSegmentsThickness,
Dtk_Double64 outBoldSegmentsLength 
) const

Get bold segments when curve changes of direction.

Returns
True if the style has bold segments on change of directions, False if doesn't have those bold segments.

◆ GetClosestAppearanceInFontLineTypeEnumeration()

Dtk_FontLineType Dtk_LineTypeDefinition::GetClosestAppearanceInFontLineTypeEnumeration ( ) const

Get what we consider as the closest type in the Dtk_FontLineType enumeration.

Attention
We recommend not using this function if the integration uses the patterns. As it is not precise, it should only be used for fast integrations that don't uses patterns.
Returns
Dtk_FontLineType::DTK_NO_PATTERN if no enumeration value is considered close.

◆ GetName()

const Dtk_string& Dtk_LineTypeDefinition::GetName ( ) const

Returns the line type definition name.

◆ GetPatternDescriptorDashAtIndex()

Dtk_ErrorStatus Dtk_LineTypeDefinition::GetPatternDescriptorDashAtIndex ( const Dtk_Size_t inIndex,
Dtk_Double64 outDashLength 
) const

Get the length of the segment at index in the pattern.

Returns
dtkNoError if OK. dtkErrorOutOfRange if index is out of bounds or not of valid type.

◆ GetPatternDescriptorGapAtIndex()

Dtk_ErrorStatus Dtk_LineTypeDefinition::GetPatternDescriptorGapAtIndex ( const Dtk_Size_t inIndex,
Dtk_Double64 outGapLength 
) const

Get the length of the gap at index in the pattern.

Returns
dtkNoError if OK. dtkErrorOutOfRange if index is out of bounds or not of valid type.

◆ GetPatternDescriptorTypeAtIndex()

Dtk_ErrorStatus Dtk_LineTypeDefinition::GetPatternDescriptorTypeAtIndex ( const Dtk_Size_t inIndex,
Dtk_LineTypePatternDescriptorType outPatternType 
) const

Get the type of the pattern descriptor at index to call the correct function.

Returns
dtkNoError if OK. dtkErrorOutOfRange if index is out of bounds.

◆ GetPatternLength()

Dtk_Size_t Dtk_LineTypeDefinition::GetPatternLength ( ) const

Get the the number of pattern descriptor.

◆ GetSize()

◆ PushBackPatternDescriptorDash()

void Dtk_LineTypeDefinition::PushBackPatternDescriptorDash ( const Dtk_Double64 inDashLength) const

Add a new pattern descriptor of type DASH and precise it's length.

◆ PushBackPatternDescriptorDot()

void Dtk_LineTypeDefinition::PushBackPatternDescriptorDot ( ) const

Add a new pattern descriptor of type DOT.

◆ PushBackPatternDescriptorGap()

void Dtk_LineTypeDefinition::PushBackPatternDescriptorGap ( const Dtk_Double64 inGapLength) const

Add a new pattern descriptor of type GAP and precise it's length.

◆ SetClosestAppearanceInFontLineTypeEnumeration()

void Dtk_LineTypeDefinition::SetClosestAppearanceInFontLineTypeEnumeration ( const Dtk_FontLineType inClosestFontLineTypeEnumValue) const

Set what can be consider as the closest type in the Dtk_FontLineType enumeration.

◆ SetName()

void Dtk_LineTypeDefinition::SetName ( const Dtk_string inName)

Set the line type definition name.

Friends And Related Function Documentation

◆ Dtk_SmartPtr< Dtk_LineTypeDefinition >

friend class Dtk_SmartPtr< Dtk_LineTypeDefinition >
friend

Field Documentation

◆ _Private

Dtk_Handle* Dtk_LineTypeDefinition::_Private
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
Dtk_LineTypeDefinition::DTK_LINE_TYPE_PATTERN_DESCRIPTOR_UNKNOWN
@ DTK_LINE_TYPE_PATTERN_DESCRIPTOR_UNKNOWN
Definition: dtk_line_type_definition.hpp:27
Dtk_LineTypeDefinition::DTK_LINE_TYPE_PATTERN_DESCRIPTOR_DASH
@ DTK_LINE_TYPE_PATTERN_DESCRIPTOR_DASH
Definition: dtk_line_type_definition.hpp:28
Dtk_LineTypeDefinition
This is the Dtk_LineTypeDefinition Class. The Dtk_LineTypeDefinition object is used to store any info...
Definition: dtk_line_type_definition.hpp:23
Dtk_LineTypeDefinition::DTK_LINE_TYPE_PATTERN_DESCRIPTOR_DOT
@ DTK_LINE_TYPE_PATTERN_DESCRIPTOR_DOT
Definition: dtk_line_type_definition.hpp:29
Dtk_LineTypeDefinition::Dtk_LineTypeDefinition
Dtk_LineTypeDefinition(const Dtk_LineTypeDefinition &inToBeCopied)
Copy constructor.
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0
Dtk_LineTypeDefinition::DTK_LINE_TYPE_PATTERN_DESCRIPTOR_GAP
@ DTK_LINE_TYPE_PATTERN_DESCRIPTOR_GAP
Definition: dtk_line_type_definition.hpp:30
Dtk_LineTypeDefinition::_typeID
@ _typeID
Definition: dtk_line_type_definition.hpp:36
DTK_TYPE_LINE_TYPE_DEFINITION
@ DTK_TYPE_LINE_TYPE_DEFINITION
Definition: define.h:615