DATAKIT API  V2025.4
Dtk_Leader Class Referenceabstract

This class graphically represents leader of annotations.
It is part of Dtk_Annotation and Dtk_Dimension. More...

+ Inheritance diagram for Dtk_Leader:

Data Structures

class  ApplicationZone
 This is the application zone class.
It is used to gather all application zone information. More...
 
class  ArrowHead
 This class graphically represents a leader head. More...
 

Public Types

enum  IncludeOptions {
  IncludeAll = -1, IncludeNone = 0, IncludeLeaderCurve = 1, IncludeLeaderArrowHead = 2,
  IncludeLeaderExtensionLine = 4, IncludeLeaderApplicationZone = 8
}
 
enum  LeaderTerminatorTypeEnum {
  TerminatorTypeNone = 0, TerminatorTypeOpenArrow, TerminatorTypeClosedArrow, TerminatorTypeFillArrow,
  TerminatorTypeCrossArrow, TerminatorTypeCircle, TerminatorTypeFilledCircle, TerminatorTypeSquare,
  TerminatorTypeFilledSquare, TerminatorTypeSlash, TerminatorTypeCrossedCircle, TerminatorTypeXCircle,
  TerminatorTypeTriangle, TerminatorTypeFilledTriangle, TerminatorTypePlus, TerminatorTypeXCross,
  TerminatorTypeIntegral, TerminatorTypeCircleCenter, TerminatorTypeDoubleOpenArrow, TerminatorTypeDoubleCloseArrow,
  TerminatorTypeDoubleFillArrow, TerminatorTypeDoubleTriangle, TerminatorTypeTopOpenArrow, TerminatorTypeBottomOpenArrow,
  TerminatorTypeTopFillArrow, TerminatorTypeBottomFillArrow, TerminatorTypeDoubleCrossArrow
}
 Internal leader terminator type. More...
 
enum  LeaderTypeEnum { TypeUnknown = 0, TypeLinear, TypeAngular }
 Internal leader type - linear or angular -. More...
 

Public Member Functions

void ConvertToGeom (Dtk_tab< Dtk_CurvePtr > &outGeomsArray, const IncludeOptions inConvertToGeomFilter=IncludeAll) const
 Converts the Dtk_Leader to geometrical elements. 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)
 
Dtk_bool GetAllAroundSet () const
 OBSOLETE Retrieves the status of the all around property for the current drawing leader. More...
 
void GetApplicationZone (Dtk_Leader::ApplicationZone &outApplicationZone) const
 Retrieves the Frame - read only -. More...
 
Dtk_Leader::ApplicationZone::ApplicationZoneEnum GetApplicationZoneType () const
 Retrieves the Frame - read only -. More...
 
ArrowHeadGetArrowHead ()
 
const ArrowHeadGetArrowHead () const
 
const Dtk_pntGetArrowLocation () const
 Retrieves The ArrowHead Location point - Get Only -. More...
 
Dtk_PolylinePtr GetExtensionLine () const
 Get the leader Extendion Line. More...
 
Dtk_InfoPtrGetInfo ()
 Retrieves the infos. More...
 
Dtk_CurvePtr GetLeaderCurve () const
 Returns the leader curve. More...
 
LeaderTypeEnum GetLeaderType () const
 Gets the leader type - read only -. More...
 
virtual Dtk_Size_t GetSize () const
 
double GetStubDelta () const
 Retrieves the value of the leader stub. More...
 
Dtk_Leaderoperator= (const Dtk_Leader &in)
 Copy assignment operator. More...
 
Dtk_Leaderoperator= (Dtk_Leader &&in) DTK_NOEXCEPT
 Move assignment operator. More...
 
Dtk_ErrorStatus RetrieveLeader_terminator_infos (Dtk_Double64 &outWidth, Dtk_Double64 &outHeight, Dtk_pnt &outArrowLocation, LeaderTerminatorTypeEnum &outTerminatorType) const
 Retrieves the leader terminator informations. More...
 
void SetAllAroundSet (const Dtk_bool &inAllAroundSetValue)
 Set the status of the all around property for the current drawing leader. More...
 
void SetApplicationZoneType (const Dtk_Leader::ApplicationZone::ApplicationZoneEnum &inApplicationZoneType, const Dtk_tab< Dtk_CurvePtr > &inRelatedGeomElements)
 Set the text frame information - get/set -. More...
 
void SetArrowHead (const ArrowHead &inArroWHead)
 
void SetExtensionLine (const Dtk_PolylinePtr &inExtLine)
 Set the leader Extendion Line. More...
 
void SetLeaderCurveColor (const Dtk_RGB &inColor)
 Set the leader curve Color. More...
 
void SetLeaderCurveLineType (const Dtk_FontLineType inCurveLineType)
 Set the leader curve FontLineType . More...
 
void SetLeaderCurveThicknessInMM (const Dtk_Double64 inCurveThicknessinMM)
 Set the leader curve Thickness in Millimeters. More...
 
void SetLeaderTerminatorType (const LeaderTerminatorTypeEnum &inTerminatorType)
 Set the Leader Terminator Type. More...
 
void SetLeaderWidthHeight (const Dtk_Double64 &inWidth, const Dtk_Double64 &inHeight)
 
void SetStubDelta (const double &inStubDelta)
 Set the value of the leader stub. More...
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 Applies a transformation matrix to the entity. //! More...
 

Static Public Member Functions

static Dtk_LeaderPtr Create ()
 Calls default constructor to allocate a new object. More...
 
static Dtk_LeaderPtr Create (const Dtk_Double64 &inWidth, const Dtk_Double64 &inHeight, const Dtk_pnt &inArrowLocation, const Dtk_Double64 &inRadius, const LeaderTerminatorTypeEnum &inTerminatorType, const Dtk_pnt &inEndingPnt, const Dtk_pnt &inCenterPnt, const Dtk_bool &IsCounterClockwise)
 Angular leader constructor. More...
 
static Dtk_LeaderPtr Create (const Dtk_Double64 &inWidth, const Dtk_Double64 &inHeight, const Dtk_pnt &inArrowLocation, const LeaderTerminatorTypeEnum &inTerminatorType, const Dtk_tab< Dtk_pnt > &inPntsArray)
 Linear leader constructor. More...
 
static Dtk_LeaderPtr Create (const Dtk_Leader &s)
 Calls copy constructor to allocate a new object. More...
 
static Dtk_LeaderPtr Create (Dtk_Leader &&s)
 Calls move constructor to allocate a new object. More...
 
static Dtk_LeaderDtkDynamicCast (Dtk_Object *s)
 Performs a dynamic cast - doesn't need RTTI -. More...
 
static Dtk_string LeaderTerminatorTypeEnumToString (const LeaderTerminatorTypeEnum &inEnum)
 

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_LEADER }
 

Protected Member Functions

void _CommonAngularCtor (const Dtk_Double64 &inWidth, const Dtk_Double64 &inHeight, const Dtk_pnt &inArrowLocation, const Dtk_Double64 &inRadius, const LeaderTerminatorTypeEnum &inTerminatorType, const Dtk_pnt &inEndingPnt, const Dtk_pnt &inCenterPnt, const Dtk_bool &IsCounterClockwise)
 
void _CommonLinearCtor (const Dtk_Double64 &inWidth, const Dtk_Double64 &inHeight, const Dtk_pnt &inArrowLocation, const LeaderTerminatorTypeEnum &inTerminatorType, const Dtk_tab< Dtk_pnt > &inPntsArray)
 
virtual Dtk_ObjectClone ()
 
 Dtk_Leader ()
 
 Dtk_Leader (const Dtk_Double64 &inWidth, const Dtk_Double64 &inHeight, const Dtk_pnt &inArrowLocation, const Dtk_Double64 &inRadius, const LeaderTerminatorTypeEnum &inTerminatorType, const Dtk_pnt &inEndingPnt, const Dtk_pnt &inCenterPnt, const Dtk_bool &IsCounterClockwise)
 
 Dtk_Leader (const Dtk_Double64 &inWidth, const Dtk_Double64 &inHeight, const Dtk_pnt &inArrowLocation, const LeaderTerminatorTypeEnum &inTerminatorType, const Dtk_tab< Dtk_pnt > &inPntsArray)
 
 Dtk_Leader (const Dtk_Leader &in)
 
 Dtk_Leader (Dtk_Leader &&in) DTK_NOEXCEPT
 
virtual ~Dtk_Leader ()
 Destructor. More...
 

Protected Attributes

Dtk_Handle * _Private
 
unsigned long count_
 

Detailed Description

This class graphically represents leader of annotations.
It is part of Dtk_Annotation and Dtk_Dimension.

Its main curve (also called LeaderCurve), is represented using a Dtk_Polyline. The following schema indicated the points order to expect.

The first point of the Dtk_Polyline indicates the location of the ArrowHead / leader terminator. See the following schema for a simple representation of an ArrowHead, with a head of type Dtk_Leader::TerminatorTypeOpenArrow.

In Datakit representation, a leader can also have an extension line, that usually points from the annotation to the model geometry.

Dtk_Dimension is the most common annotation having leaders with an extension line, but it is also possible for a Dtk_Roughness or any other kind of Dtk_Annotation.

Warning
To represent a stand-alone extension line, it is possible to encounter a leader with an extension line, and no main curve.
See also
Use Dtk_LeaderPtr class to handle it.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 

◆ IncludeOptions

Enumerator
IncludeAll 
IncludeNone 
IncludeLeaderCurve 
IncludeLeaderArrowHead 
IncludeLeaderExtensionLine 
IncludeLeaderApplicationZone 

◆ LeaderTerminatorTypeEnum

Internal leader terminator type.

Enumerator
TerminatorTypeNone 
TerminatorTypeOpenArrow 
TerminatorTypeClosedArrow 
TerminatorTypeFillArrow 
TerminatorTypeCrossArrow 
TerminatorTypeCircle 
TerminatorTypeFilledCircle 
TerminatorTypeSquare 
TerminatorTypeFilledSquare 
TerminatorTypeSlash 
TerminatorTypeCrossedCircle 
TerminatorTypeXCircle 
TerminatorTypeTriangle 
TerminatorTypeFilledTriangle 
TerminatorTypePlus 
TerminatorTypeXCross 
TerminatorTypeIntegral 
TerminatorTypeCircleCenter 
TerminatorTypeDoubleOpenArrow 
TerminatorTypeDoubleCloseArrow 
TerminatorTypeDoubleFillArrow 
TerminatorTypeDoubleTriangle 
TerminatorTypeTopOpenArrow 
TerminatorTypeBottomOpenArrow 
TerminatorTypeTopFillArrow 
TerminatorTypeBottomFillArrow 
TerminatorTypeDoubleCrossArrow 

◆ LeaderTypeEnum

Internal leader type - linear or angular -.

Enumerator
TypeUnknown 
TypeLinear 
TypeAngular 

Constructor & Destructor Documentation

◆ Dtk_Leader() [1/5]

Dtk_Leader::Dtk_Leader ( )
protected
See also
Create()

◆ Dtk_Leader() [2/5]

Dtk_Leader::Dtk_Leader ( const Dtk_Leader in)
protected

◆ Dtk_Leader() [3/5]

Dtk_Leader::Dtk_Leader ( Dtk_Leader &&  in)
protected

◆ Dtk_Leader() [4/5]

Dtk_Leader::Dtk_Leader ( const Dtk_Double64 inWidth,
const Dtk_Double64 inHeight,
const Dtk_pnt inArrowLocation,
const Dtk_Double64 inRadius,
const LeaderTerminatorTypeEnum inTerminatorType,
const Dtk_pnt inEndingPnt,
const Dtk_pnt inCenterPnt,
const Dtk_bool IsCounterClockwise 
)
protected

◆ Dtk_Leader() [5/5]

Dtk_Leader::Dtk_Leader ( const Dtk_Double64 inWidth,
const Dtk_Double64 inHeight,
const Dtk_pnt inArrowLocation,
const LeaderTerminatorTypeEnum inTerminatorType,
const Dtk_tab< Dtk_pnt > &  inPntsArray 
)
protected

◆ ~Dtk_Leader()

virtual Dtk_Leader::~Dtk_Leader ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ _CommonAngularCtor()

void Dtk_Leader::_CommonAngularCtor ( const Dtk_Double64 inWidth,
const Dtk_Double64 inHeight,
const Dtk_pnt inArrowLocation,
const Dtk_Double64 inRadius,
const LeaderTerminatorTypeEnum inTerminatorType,
const Dtk_pnt inEndingPnt,
const Dtk_pnt inCenterPnt,
const Dtk_bool IsCounterClockwise 
)
protected

◆ _CommonLinearCtor()

void Dtk_Leader::_CommonLinearCtor ( const Dtk_Double64 inWidth,
const Dtk_Double64 inHeight,
const Dtk_pnt inArrowLocation,
const LeaderTerminatorTypeEnum inTerminatorType,
const Dtk_tab< Dtk_pnt > &  inPntsArray 
)
protected

◆ Clone()

virtual Dtk_Object* Dtk_Leader::Clone ( )
protectedvirtual

◆ ConvertToGeom()

void Dtk_Leader::ConvertToGeom ( Dtk_tab< Dtk_CurvePtr > &  outGeomsArray,
const IncludeOptions  inConvertToGeomFilter = IncludeAll 
) const

Converts the Dtk_Leader to geometrical elements.

Parameters
outGeomsArrayGeometrical elements array

◆ Create() [1/5]

static Dtk_LeaderPtr Dtk_Leader::Create ( )
static

Calls default constructor to allocate a new object.

◆ Create() [2/5]

static Dtk_LeaderPtr Dtk_Leader::Create ( const Dtk_Double64 inWidth,
const Dtk_Double64 inHeight,
const Dtk_pnt inArrowLocation,
const Dtk_Double64 inRadius,
const LeaderTerminatorTypeEnum inTerminatorType,
const Dtk_pnt inEndingPnt,
const Dtk_pnt inCenterPnt,
const Dtk_bool IsCounterClockwise 
)
static

Angular leader constructor.

Parameters
inWidthArrow width
inHeightArrow height
inArrowLocationArrow location point
inRadiusLeader radius
inTerminatorTypeTerminator type
inEndingPntLeader ending point
inCenterPntCenter point
IsCounterClockwiseDTK_TRUE if the leader angle is counter-clockwise

◆ Create() [3/5]

static Dtk_LeaderPtr Dtk_Leader::Create ( const Dtk_Double64 inWidth,
const Dtk_Double64 inHeight,
const Dtk_pnt inArrowLocation,
const LeaderTerminatorTypeEnum inTerminatorType,
const Dtk_tab< Dtk_pnt > &  inPntsArray 
)
static

Linear leader constructor.

Parameters
inWidthArrow width
inHeightArrow height
inArrowLocationArrow location point
inTerminatorTypeTerminator type
inPntsArrayPoints array representing the leader body - in polyline form -

◆ Create() [4/5]

static Dtk_LeaderPtr Dtk_Leader::Create ( const Dtk_Leader s)
static

Calls copy constructor to allocate a new object.

Parameters
sObject to copy from.

◆ Create() [5/5]

static Dtk_LeaderPtr Dtk_Leader::Create ( Dtk_Leader &&  s)
static

Calls move constructor to allocate a new object.

Parameters
sObject to move from.

◆ DtkDynamicCast()

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

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

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_Leader::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

◆ DtkDynamicType() [2/2]

◆ dump()

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

◆ GetAllAroundSet()

Dtk_bool Dtk_Leader::GetAllAroundSet ( ) const

OBSOLETE Retrieves the status of the all around property for the current drawing leader.

Returns
DTK_TRUE or DTK_FALSE
Deprecated:
Use GetApplicationZoneType() const or GetApplicationZone()::GetApplicationZoneType() methods instead.

◆ GetApplicationZone()

void Dtk_Leader::GetApplicationZone ( Dtk_Leader::ApplicationZone outApplicationZone) const

Retrieves the Frame - read only -.

Parameters
outFrameThe frame
See also
FrameType() const

◆ GetApplicationZoneType()

Dtk_Leader::ApplicationZone::ApplicationZoneEnum Dtk_Leader::GetApplicationZoneType ( ) const

Retrieves the Frame - read only -.

Parameters
outFrameThe frame
See also
FrameType() const

◆ GetArrowHead() [1/2]

ArrowHead& Dtk_Leader::GetArrowHead ( )

◆ GetArrowHead() [2/2]

const ArrowHead& Dtk_Leader::GetArrowHead ( ) const

◆ GetArrowLocation()

const Dtk_pnt& Dtk_Leader::GetArrowLocation ( ) const

Retrieves The ArrowHead Location point - Get Only -.

Returns
The ArrowHead Location point.

◆ GetExtensionLine()

Dtk_PolylinePtr Dtk_Leader::GetExtensionLine ( ) const

Get the leader Extendion Line.

Returns
The Dtk_PolylinePtr defining the Extension Line.

◆ GetInfo()

Dtk_InfoPtr& Dtk_Leader::GetInfo ( )

Retrieves the infos.

Returns
The infos

◆ GetLeaderCurve()

Dtk_CurvePtr Dtk_Leader::GetLeaderCurve ( ) const

Returns the leader curve.

Returns
Dtk_CurvePtr or NULL.

◆ GetLeaderType()

LeaderTypeEnum Dtk_Leader::GetLeaderType ( ) const

Gets the leader type - read only -.

Returns
The leader type

◆ GetSize()

◆ GetStubDelta()

double Dtk_Leader::GetStubDelta ( ) const

Retrieves the value of the leader stub.

Returns
double.
Remarks
If the Stub Delta is positive, the last leader segment represents the stub.

◆ LeaderTerminatorTypeEnumToString()

static Dtk_string Dtk_Leader::LeaderTerminatorTypeEnumToString ( const LeaderTerminatorTypeEnum inEnum)
static

◆ operator=() [1/2]

Dtk_Leader& Dtk_Leader::operator= ( const Dtk_Leader in)

Copy assignment operator.

Parameters
inObject to copy from.

◆ operator=() [2/2]

Dtk_Leader& Dtk_Leader::operator= ( Dtk_Leader &&  in)

Move assignment operator.

Parameters
inObject to move from.

◆ RetrieveLeader_terminator_infos()

Dtk_ErrorStatus Dtk_Leader::RetrieveLeader_terminator_infos ( Dtk_Double64 outWidth,
Dtk_Double64 outHeight,
Dtk_pnt outArrowLocation,
LeaderTerminatorTypeEnum outTerminatorType 
) const

Retrieves the leader terminator informations.

Parameters
outWidthArrow width
outHeightArrow height
outArrowLocationArrow location point
outTerminatorTypeTerminator type
Returns
dtkNoError if OK

◆ SetAllAroundSet()

void Dtk_Leader::SetAllAroundSet ( const Dtk_bool inAllAroundSetValue)

Set the status of the all around property for the current drawing leader.

Parameters
inAllAroundSetValueas boolean value

◆ SetApplicationZoneType()

void Dtk_Leader::SetApplicationZoneType ( const Dtk_Leader::ApplicationZone::ApplicationZoneEnum inApplicationZoneType,
const Dtk_tab< Dtk_CurvePtr > &  inRelatedGeomElements 
)

Set the text frame information - get/set -.

Returns
The text frame type
See also
FrameType() const

◆ SetArrowHead()

void Dtk_Leader::SetArrowHead ( const ArrowHead inArroWHead)

◆ SetExtensionLine()

void Dtk_Leader::SetExtensionLine ( const Dtk_PolylinePtr inExtLine)

Set the leader Extendion Line.

Parameters
inExtLineThe Dtk_PolylinePtr defining the Extension Line.

◆ SetLeaderCurveColor()

void Dtk_Leader::SetLeaderCurveColor ( const Dtk_RGB inColor)

Set the leader curve Color.

Parameters
inColorThe curve Color.

◆ SetLeaderCurveLineType()

void Dtk_Leader::SetLeaderCurveLineType ( const Dtk_FontLineType  inCurveLineType)

Set the leader curve FontLineType .

Parameters
inCurveLineTypeThe curve FontLineType .

◆ SetLeaderCurveThicknessInMM()

void Dtk_Leader::SetLeaderCurveThicknessInMM ( const Dtk_Double64  inCurveThicknessinMM)

Set the leader curve Thickness in Millimeters.

Parameters
inCurveThicknessinMMThe curve Thickness in Millimeters.

◆ SetLeaderTerminatorType()

void Dtk_Leader::SetLeaderTerminatorType ( const LeaderTerminatorTypeEnum inTerminatorType)

Set the Leader Terminator Type.

Parameters
inTerminatorTypeThe Leader Terminator Type

◆ SetLeaderWidthHeight()

void Dtk_Leader::SetLeaderWidthHeight ( const Dtk_Double64 inWidth,
const Dtk_Double64 inHeight 
)

◆ SetStubDelta()

void Dtk_Leader::SetStubDelta ( const double &  inStubDelta)

Set the value of the leader stub.

Parameters
inStubDeltaas double value.
Remarks
If the Stub Delta is positive, the last leader segment represents the stub.

◆ Transform()

Dtk_ErrorStatus Dtk_Leader::Transform ( const Dtk_transfo inTransfo)

Applies a transformation matrix to the entity. //!

Parameters
inTransfoThe transformation matrix to apply.

Field Documentation

◆ _Private

Dtk_Handle* Dtk_Leader::_Private
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited