DATAKIT API  V2025.1
Dtk_Leader::ArrowHead Class Reference

Public Member Functions

 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)
 
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 &inToBeAssigned)
 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 ()
 

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
 

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 
)
2141  {
2142  SetData( inWidth, inHeight, inArrowLocation, inTerminatorType, inInfos, inRefDir, inAxisDir );
2143  }

◆ ArrowHead() [2/2]

Dtk_Leader::ArrowHead::ArrowHead ( )
2144 { _Init(); }

◆ ~ArrowHead()

Dtk_Leader::ArrowHead::~ArrowHead ( )
2145 { _Reset(); }

Member Function Documentation

◆ _Copy()

void Dtk_Leader::ArrowHead::_Copy ( const ArrowHead s)
protected
2117  {
2118  s.m_Infos.Clone( m_Infos );
2119  m_HeadType = s.m_HeadType;
2120  m_ArrowLocation = s.m_ArrowLocation;
2121  m_RefDir = s.m_RefDir;
2122  m_AxisDir = s.m_AxisDir;
2123  }

◆ _Init()

void Dtk_Leader::ArrowHead::_Init ( )
protected
2110  {
2113  //m_RefDir;// = Dtk_dir( 1.0, 0.0, 0.0 );
2114  //m_AxisDir;// = Dtk_dir( 0.0, 1.0, 0.0 );
2115  }

◆ _Reset()

void Dtk_Leader::ArrowHead::_Reset ( )
protected
2125  {
2126  m_Infos = NULL;
2128  //m_RefDir;// = Dtk_dir( 1.0, 0.0, 0.0 );
2129  //m_AxisDir;// = Dtk_dir( 0.0, 1.0, 0.0 );
2130  }

◆ CreateGeometries()

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

◆ GetArrowLocation()

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

◆ GetDirections()

void Dtk_Leader::ArrowHead::GetDirections ( Dtk_dir outRefDir,
Dtk_dir outAxisDir 
) const
2169  {
2170  outRefDir = m_RefDir; outRefDir.Normalize();
2171  outAxisDir = m_AxisDir; outAxisDir.Normalize();
2172  }

◆ GetInfo() [1/2]

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

◆ GetInfo() [2/2]

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

◆ GetType()

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

◆ GetWidthHeight()

void Dtk_Leader::ArrowHead::GetWidthHeight ( Dtk_Double64 outWidth,
Dtk_Double64 outHeight 
) const
2174  {
2175  outWidth = m_RefDir.norm();
2176  outHeight = 2. * m_AxisDir.norm();
2177  }

◆ operator=()

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

Assignment Operator.

Parameters
inTobeAssignedObject to copy.
2208  {
2209  if( &inToBeAssigned == this )
2210  {
2211  return *this;
2212  }
2213  _Reset();
2214  _Copy( inToBeAssigned );
2215  return *this;
2216  }

◆ 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 
)
2154  {
2155  m_HeadType = inTerminatorType;
2156  m_ArrowLocation = inArrowLocation;
2157  m_RefDir = inRefDir;
2158  m_AxisDir = inAxisDir;
2159  SetWidthHeight( inWidth, inHeight );
2160  m_Infos = inInfos;
2161  }

◆ SetType()

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

◆ SetWidthHeight()

void Dtk_Leader::ArrowHead::SetWidthHeight ( const Dtk_Double64  inWidth,
const Dtk_Double64  inHeight 
)
2179  {
2180  m_RefDir.Normalize();
2181  m_AxisDir.Normalize();
2182  m_RefDir *= inWidth;
2183  m_AxisDir *= 0.5 * inHeight;
2184  }

◆ 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
2199  {
2203  return dtkNoError;
2204  }

◆ 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
2190  {
2191  Dtk_transfo TmpMatrix;
2192  TmpMatrix.addTranslate( inTranslateDir );
2193  return Transform( TmpMatrix );
2194  }

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:2103
catiav5w::inTransfo
const Dtk_string const Dtk_transfo & inTransfo
Definition: catiav5w.hpp:619
Dtk_Leader::ArrowHead::Transform
Dtk_ErrorStatus Transform(const Dtk_transfo &inTransfo)
Applies a transformation matrix to the ApplicationZone.
Definition: util_draw_dtk.hpp:2198
Dtk_Leader::ArrowHead::SetWidthHeight
void SetWidthHeight(const Dtk_Double64 inWidth, const Dtk_Double64 inHeight)
Definition: util_draw_dtk.hpp:2178
Dtk_Leader::ArrowHead::m_ArrowLocation
Dtk_pnt m_ArrowLocation
Definition: util_draw_dtk.hpp:2105
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:2147
Dtk_Leader::ArrowHead::_Reset
void _Reset()
Definition: util_draw_dtk.hpp:2124
Dtk_Leader::ArrowHead::_Copy
void _Copy(const ArrowHead &s)
Definition: util_draw_dtk.hpp:2116
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:2106
Dtk_Leader::ArrowHead::m_AxisDir
Dtk_dir m_AxisDir
Definition: util_draw_dtk.hpp:2107
Dtk_dir::Normalize
double Normalize()
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:140
Dtk_Leader::ArrowHead::_Init
void _Init()
Definition: util_draw_dtk.hpp:2109
Dtk_Leader::ArrowHead::m_HeadType
LeaderTerminatorTypeEnum m_HeadType
Definition: util_draw_dtk.hpp:2104
Dtk_Info::create
static Dtk_SmartPtr< Dtk_Info > create()
Dtk_Leader::TerminatorTypeOpenArrow
@ TerminatorTypeOpenArrow
Definition: util_draw_dtk.hpp:2003