DATAKIT SDK  V2026.1
Dtk_Leader::ArrowHead Class Reference

This class graphically represents a leader head. More...

Public Member Functions

 ArrowHead ()
 Default constructor. More...
 
 ArrowHead (const Dtk_Double64 inWidth, const Dtk_Double64 inHeight, const Dtk_pnt &inArrowLocation, const LeaderTerminatorTypeEnum inTerminatorType, const Dtk_InfoPtr &inInfos, const Dtk_dir &inRefDir, const Dtk_dir &inAxisDir)
 
void CreateGeometries (Dtk_tab< Dtk_CurvePtr > &outRes) const
 
const Dtk_pntGetArrowLocation () const
 
void GetDirections (Dtk_dir &outRefDir, Dtk_dir &outAxisDir) const
 
Dtk_InfoPtrGetInfo ()
 
const Dtk_InfoPtrGetInfo () const
 
const LeaderTerminatorTypeEnum GetType () const
 
void GetWidthHeight (Dtk_Double64 &outWidth, Dtk_Double64 &outHeight) const
 
ArrowHeadoperator= (const ArrowHead &in)
 Copy assignment operator. More...
 
void SetData (const Dtk_Double64 inWidth, const Dtk_Double64 inHeight, const Dtk_pnt &inArrowLocation, const LeaderTerminatorTypeEnum inTerminatorType, const Dtk_InfoPtr &inInfos, const Dtk_dir &inRefDir, const Dtk_dir &inAxisDir)
 
void SetType (const LeaderTerminatorTypeEnum inTerminatorType)
 
void SetWidthHeight (const Dtk_Double64 inWidth, const Dtk_Double64 inHeight)
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 Applies a transformation matrix to the ApplicationZone. More...
 
Dtk_ErrorStatus Translate (const Dtk_dir &inTranslateDir)
 Translates the ApplicationZone giving a translation vector. More...
 
 ~ArrowHead ()
 Destructor. More...
 

Protected Member Functions

void _Copy (const ArrowHead &s)
 
void _Init ()
 
void _Reset ()
 

Protected Attributes

Dtk_pnt m_ArrowLocation
 
Dtk_dir m_AxisDir
 
LeaderTerminatorTypeEnum m_HeadType
 
Dtk_InfoPtr m_Infos
 
Dtk_dir m_RefDir
 

Detailed Description

This class graphically represents a leader head.

Constructor & Destructor Documentation

◆ ArrowHead() [1/2]

Dtk_Leader::ArrowHead::ArrowHead ( const Dtk_Double64  inWidth,
const Dtk_Double64  inHeight,
const Dtk_pnt inArrowLocation,
const LeaderTerminatorTypeEnum  inTerminatorType,
const Dtk_InfoPtr inInfos,
const Dtk_dir inRefDir,
const Dtk_dir inAxisDir 
)
2099  {
2100  SetData( inWidth, inHeight, inArrowLocation, inTerminatorType, inInfos, inRefDir, inAxisDir );
2101  }

◆ ArrowHead() [2/2]

Dtk_Leader::ArrowHead::ArrowHead ( )

Default constructor.

2103 { _Init(); }

◆ ~ArrowHead()

Dtk_Leader::ArrowHead::~ArrowHead ( )

Destructor.

2105 { _Reset(); }

Member Function Documentation

◆ _Copy()

void Dtk_Leader::ArrowHead::_Copy ( const ArrowHead s)
protected
2075  {
2076  s.m_Infos.Clone( m_Infos );
2077  m_HeadType = s.m_HeadType;
2078  m_ArrowLocation = s.m_ArrowLocation;
2079  m_RefDir = s.m_RefDir;
2080  m_AxisDir = s.m_AxisDir;
2081  }

◆ _Init()

void Dtk_Leader::ArrowHead::_Init ( )
protected
2068  {
2071  //m_RefDir;// = Dtk_dir( 1.0, 0.0, 0.0 );
2072  //m_AxisDir;// = Dtk_dir( 0.0, 1.0, 0.0 );
2073  }

◆ _Reset()

void Dtk_Leader::ArrowHead::_Reset ( )
protected
2083  {
2084  m_Infos = NULL;
2086  //m_RefDir;// = Dtk_dir( 1.0, 0.0, 0.0 );
2087  //m_AxisDir;// = Dtk_dir( 0.0, 1.0, 0.0 );
2088  }

◆ CreateGeometries()

void Dtk_Leader::ArrowHead::CreateGeometries ( Dtk_tab< Dtk_CurvePtr > &  outRes) const

◆ GetArrowLocation()

const Dtk_pnt& Dtk_Leader::ArrowHead::GetArrowLocation ( ) const
2124 { return m_ArrowLocation; }

◆ GetDirections()

void Dtk_Leader::ArrowHead::GetDirections ( Dtk_dir outRefDir,
Dtk_dir outAxisDir 
) const
2129  {
2130  outRefDir = m_RefDir; outRefDir.Normalize();
2131  outAxisDir = m_AxisDir; outAxisDir.Normalize();
2132  }

◆ GetInfo() [1/2]

Dtk_InfoPtr& Dtk_Leader::ArrowHead::GetInfo ( )
2123 { return m_Infos; }

◆ GetInfo() [2/2]

const Dtk_InfoPtr& Dtk_Leader::ArrowHead::GetInfo ( ) const
2122 { return m_Infos; }

◆ GetType()

const LeaderTerminatorTypeEnum Dtk_Leader::ArrowHead::GetType ( ) const
2125 { return m_HeadType; }

◆ GetWidthHeight()

void Dtk_Leader::ArrowHead::GetWidthHeight ( Dtk_Double64 outWidth,
Dtk_Double64 outHeight 
) const
2134  {
2135  outWidth = m_RefDir.norm();
2136  outHeight = 2. * m_AxisDir.norm();
2137  }

◆ operator=()

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

Copy assignment operator.

Parameters
inObject to copy from.
2168  {
2169  if( &in == this )
2170  {
2171  return *this;
2172  }
2173  _Reset();
2174  _Copy( in );
2175  return *this;
2176  }

◆ SetData()

void Dtk_Leader::ArrowHead::SetData ( const Dtk_Double64  inWidth,
const Dtk_Double64  inHeight,
const Dtk_pnt inArrowLocation,
const LeaderTerminatorTypeEnum  inTerminatorType,
const Dtk_InfoPtr inInfos,
const Dtk_dir inRefDir,
const Dtk_dir inAxisDir 
)
2114  {
2115  m_HeadType = inTerminatorType;
2116  m_ArrowLocation = inArrowLocation;
2117  m_RefDir = inRefDir;
2118  m_AxisDir = inAxisDir;
2119  SetWidthHeight( inWidth, inHeight );
2120  m_Infos = inInfos;
2121  }

◆ SetType()

void Dtk_Leader::ArrowHead::SetType ( const LeaderTerminatorTypeEnum  inTerminatorType)
2126 { m_HeadType = inTerminatorType; }

◆ SetWidthHeight()

void Dtk_Leader::ArrowHead::SetWidthHeight ( const Dtk_Double64  inWidth,
const Dtk_Double64  inHeight 
)
2139  {
2140  m_RefDir.Normalize();
2141  m_AxisDir.Normalize();
2142  m_RefDir *= inWidth;
2143  m_AxisDir *= 0.5 * inHeight;
2144  }

◆ Transform()

Dtk_ErrorStatus Dtk_Leader::ArrowHead::Transform ( const Dtk_transfo inTransfo)

Applies a transformation matrix to the ApplicationZone.

Parameters
inTransfoThe transformation matrix
Returns
dtkNoError if OK
2159  {
2163  return dtkNoError;
2164  }

◆ Translate()

Dtk_ErrorStatus Dtk_Leader::ArrowHead::Translate ( const Dtk_dir inTranslateDir)

Translates the ApplicationZone giving a translation vector.

Parameters
inTranslateDirthe translation vector
Returns
dtkNoError if OK
2150  {
2151  Dtk_transfo TmpMatrix;
2152  TmpMatrix.addTranslate( inTranslateDir );
2153  return Transform( TmpMatrix );
2154  }

Field Documentation

◆ m_ArrowLocation

Dtk_pnt Dtk_Leader::ArrowHead::m_ArrowLocation
protected

◆ m_AxisDir

Dtk_dir Dtk_Leader::ArrowHead::m_AxisDir
protected

◆ m_HeadType

LeaderTerminatorTypeEnum Dtk_Leader::ArrowHead::m_HeadType
protected

◆ m_Infos

Dtk_InfoPtr Dtk_Leader::ArrowHead::m_Infos
protected

◆ m_RefDir

Dtk_dir Dtk_Leader::ArrowHead::m_RefDir
protected
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_dir::norm
double norm() const
Dtk_Leader::ArrowHead::m_Infos
Dtk_InfoPtr m_Infos
Definition: util_draw_dtk.hpp:2061
catiav5w::inTransfo
const Dtk_string const Dtk_transfo & inTransfo
Definition: catiav5w.hpp:622
Dtk_Leader::ArrowHead::Transform
Dtk_ErrorStatus Transform(const Dtk_transfo &inTransfo)
Applies a transformation matrix to the ApplicationZone.
Definition: util_draw_dtk.hpp:2158
Dtk_Leader::ArrowHead::SetWidthHeight
void SetWidthHeight(const Dtk_Double64 inWidth, const Dtk_Double64 inHeight)
Definition: util_draw_dtk.hpp:2138
Dtk_Leader::ArrowHead::m_ArrowLocation
Dtk_pnt m_ArrowLocation
Definition: util_draw_dtk.hpp:2063
Dtk_Leader::ArrowHead::SetData
void SetData(const Dtk_Double64 inWidth, const Dtk_Double64 inHeight, const Dtk_pnt &inArrowLocation, const LeaderTerminatorTypeEnum inTerminatorType, const Dtk_InfoPtr &inInfos, const Dtk_dir &inRefDir, const Dtk_dir &inAxisDir)
Definition: util_draw_dtk.hpp:2107
Dtk_Leader::ArrowHead::_Reset
void _Reset()
Definition: util_draw_dtk.hpp:2082
Dtk_Leader::ArrowHead::_Copy
void _Copy(const ArrowHead &s)
Definition: util_draw_dtk.hpp:2074
Dtk_transfo::addTranslate
void addTranslate(const Dtk_dir &V)
Translate the Dtk_transfo.
Dtk_Leader::ArrowHead::m_RefDir
Dtk_dir m_RefDir
Definition: util_draw_dtk.hpp:2064
Dtk_Leader::ArrowHead::m_AxisDir
Dtk_dir m_AxisDir
Definition: util_draw_dtk.hpp:2065
Dtk_dir::Normalize
double Normalize()
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:147
Dtk_Leader::ArrowHead::_Init
void _Init()
Definition: util_draw_dtk.hpp:2067
Dtk_Leader::ArrowHead::m_HeadType
LeaderTerminatorTypeEnum m_HeadType
Definition: util_draw_dtk.hpp:2062
Dtk_Info::create
static Dtk_SmartPtr< Dtk_Info > create()
Calls default constructor to allocate a new object.
Dtk_Leader::TerminatorTypeOpenArrow
@ TerminatorTypeOpenArrow
Definition: util_draw_dtk.hpp:1959