DATAKIT API  V2025.4
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 
)
2110  {
2111  SetData( inWidth, inHeight, inArrowLocation, inTerminatorType, inInfos, inRefDir, inAxisDir );
2112  }

◆ ArrowHead() [2/2]

Dtk_Leader::ArrowHead::ArrowHead ( )

Default constructor.

2114 { _Init(); }

◆ ~ArrowHead()

Dtk_Leader::ArrowHead::~ArrowHead ( )

Destructor.

2116 { _Reset(); }

Member Function Documentation

◆ _Copy()

void Dtk_Leader::ArrowHead::_Copy ( const ArrowHead s)
protected
2086  {
2087  s.m_Infos.Clone( m_Infos );
2088  m_HeadType = s.m_HeadType;
2089  m_ArrowLocation = s.m_ArrowLocation;
2090  m_RefDir = s.m_RefDir;
2091  m_AxisDir = s.m_AxisDir;
2092  }

◆ _Init()

void Dtk_Leader::ArrowHead::_Init ( )
protected
2079  {
2082  //m_RefDir;// = Dtk_dir( 1.0, 0.0, 0.0 );
2083  //m_AxisDir;// = Dtk_dir( 0.0, 1.0, 0.0 );
2084  }

◆ _Reset()

void Dtk_Leader::ArrowHead::_Reset ( )
protected
2094  {
2095  m_Infos = NULL;
2097  //m_RefDir;// = Dtk_dir( 1.0, 0.0, 0.0 );
2098  //m_AxisDir;// = Dtk_dir( 0.0, 1.0, 0.0 );
2099  }

◆ CreateGeometries()

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

◆ GetArrowLocation()

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

◆ GetDirections()

void Dtk_Leader::ArrowHead::GetDirections ( Dtk_dir outRefDir,
Dtk_dir outAxisDir 
) const
2140  {
2141  outRefDir = m_RefDir; outRefDir.Normalize();
2142  outAxisDir = m_AxisDir; outAxisDir.Normalize();
2143  }

◆ GetInfo() [1/2]

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

◆ GetInfo() [2/2]

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

◆ GetType()

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

◆ GetWidthHeight()

void Dtk_Leader::ArrowHead::GetWidthHeight ( Dtk_Double64 outWidth,
Dtk_Double64 outHeight 
) const
2145  {
2146  outWidth = m_RefDir.norm();
2147  outHeight = 2. * m_AxisDir.norm();
2148  }

◆ operator=()

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

Copy assignment operator.

Parameters
inObject to copy from.
2179  {
2180  if( &in == this )
2181  {
2182  return *this;
2183  }
2184  _Reset();
2185  _Copy( in );
2186  return *this;
2187  }

◆ 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 
)
2125  {
2126  m_HeadType = inTerminatorType;
2127  m_ArrowLocation = inArrowLocation;
2128  m_RefDir = inRefDir;
2129  m_AxisDir = inAxisDir;
2130  SetWidthHeight( inWidth, inHeight );
2131  m_Infos = inInfos;
2132  }

◆ SetType()

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

◆ SetWidthHeight()

void Dtk_Leader::ArrowHead::SetWidthHeight ( const Dtk_Double64  inWidth,
const Dtk_Double64  inHeight 
)
2150  {
2151  m_RefDir.Normalize();
2152  m_AxisDir.Normalize();
2153  m_RefDir *= inWidth;
2154  m_AxisDir *= 0.5 * inHeight;
2155  }

◆ 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
2170  {
2174  return dtkNoError;
2175  }

◆ 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
2161  {
2162  Dtk_transfo TmpMatrix;
2163  TmpMatrix.addTranslate( inTranslateDir );
2164  return Transform( TmpMatrix );
2165  }

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:2072
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:2169
Dtk_Leader::ArrowHead::SetWidthHeight
void SetWidthHeight(const Dtk_Double64 inWidth, const Dtk_Double64 inHeight)
Definition: util_draw_dtk.hpp:2149
Dtk_Leader::ArrowHead::m_ArrowLocation
Dtk_pnt m_ArrowLocation
Definition: util_draw_dtk.hpp:2074
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:2118
Dtk_Leader::ArrowHead::_Reset
void _Reset()
Definition: util_draw_dtk.hpp:2093
Dtk_Leader::ArrowHead::_Copy
void _Copy(const ArrowHead &s)
Definition: util_draw_dtk.hpp:2085
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:2075
Dtk_Leader::ArrowHead::m_AxisDir
Dtk_dir m_AxisDir
Definition: util_draw_dtk.hpp:2076
Dtk_dir::Normalize
double Normalize()
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:144
Dtk_Leader::ArrowHead::_Init
void _Init()
Definition: util_draw_dtk.hpp:2078
Dtk_Leader::ArrowHead::m_HeadType
LeaderTerminatorTypeEnum m_HeadType
Definition: util_draw_dtk.hpp:2073
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:1970