DATAKIT API  V2025.1
Dtk_CompositeText Class Reference

This is the composite text class.
It's basically a Dtk_Text Container.
This class represents a group of several base_texts.
It contains an inner Dtk_Oriented2dBBox and a outer Dtk_Oriented2dBBox.
The Dtk_CompositeText uses a lot of informations. The most important ones are shown in the picture below:
. More...

Public Member Functions

void AddText (Dtk_Text inText)
 Adds a Dtk_Text to the Dtk_CompositeText. More...
 
void Clear ()
 
Dtk_string ConvertToDtk_string () const
 Merges the Dtk_CompositeText to Dtk_string. More...
 
Dtk_ErrorStatus CreateFrameAsGeometry (Dtk_tab< Dtk_CurvePtr > &outGeoms) const
 
 Dtk_CompositeText ()
 Base constructor. More...
 
 Dtk_CompositeText (const Dtk_CompositeText &t)
 Copy constructor. More...
 
 Dtk_CompositeText (const Dtk_Size_t &inNumTexts)
 Pre allocator constructor. More...
 
 Dtk_CompositeText (Dtk_CompositeText &&t) DTK_NOEXCEPT
 \MoveConstructor{t} More...
 
 Dtk_CompositeText (Dtk_tab< Dtk_Text > inTexts)
 Constructor from several Dtk_Text. More...
 
 Dtk_CompositeText (Dtk_Text inText)
 Constructor from one Dtk_Text. More...
 
Dtk_InfoPtrGetInfo ()
 Retrieves the infos. More...
 
const Dtk_InfoPtrGetInfo () const
 Retrieves the infos. More...
 
const Dtk_Oriented2dBBox GetInnerBoundingBox () const
 Processes the inner bounding box. More...
 
const Dtk_Oriented2dBBox GetInnerBoundingBox (Dtk_ErrorStatus &outError) const
 Processes the inner bounding box. More...
 
Dtk_Size_t GetNumTexts () const
 Retrieves the texts number. More...
 
const Dtk_Oriented2dBBox GetOuterBoundingBox (Dtk_bool inIncludeInvisible=DTK_TRUE) const
 Processes the outer bounding box. More...
 
const Dtk_Oriented2dBBox GetOuterBoundingBox (Dtk_ErrorStatus &outError, Dtk_bool inIncludeInvisible=DTK_TRUE) const
 Processes the outer bounding box. More...
 
const Dtk_Double64GetWrappingWidth () const
 Retrieves the wrapping width. More...
 
Dtk_CompositeTextoperator+= (Dtk_CompositeText s2)
 Merges the Dtk_CompositeText to another one. More...
 
Dtk_CompositeTextoperator= (const Dtk_CompositeText &inToBeAssigned)
 Assignment Operator. More...
 
Dtk_CompositeTextoperator= (Dtk_CompositeText &&inToBeAssigned) DTK_NOEXCEPT
 \MoveOp{inToBeAssigned} More...
 
Dtk_Textoperator[] (Dtk_Size_t inPos)
 Access operator - get/set -. More...
 
const Dtk_Textoperator[] (Dtk_Size_t inPos) const
 Access operator - read only -. More...
 
void ReplaceTexts (const Dtk_tab< Dtk_Text > &inTexts)
 Replaces all the included Dtk_Texts by the given ones. More...
 
Dtk_ErrorStatus Reverse ()
 Reverses the Dtk_CompositeText and included Dtk_Texts. More...
 
 SetAsDeprecated ("2020.2", "Use CreateFrameAsGeometry(Dtk_tab<Dtk_CurvePtr> &outGeoms) instead") Dtk_ErrorStatus CreateFrameAsGeometry(Dtk_tab< Geometric_set_select_entity * > &outGeoms) const
 Processes geometrical elements from Dtk_CompositeText frame type - and included Dtk_Texts -. More...
 
 SetAsDeprecated ("Undefined", "Use GetOuterBoundingBox") Dtk_ErrorStatus GetOuterAnchorPoints(Dtk_pnt(&outTabPnts)[DTK_NB_ANCHOR_TYPES]) const
 Processes all the Dtk_CompositeText outer anchor points. More...
 
Dtk_ErrorStatus SetInnerAnchorPoint (const Dtk_pnt &inNewLocationPnt, const Dtk_anchor_type &inNewAnchorType=DTK_ANCHOR_BOTTOM_LEFT, const Dtk_Int32 &inStartingGetText=-1, const Dtk_Int32 &inNumGetTexts=-1, const Dtk_Int32 &inStartingSetText=-1, const Dtk_Int32 &inNumSetTexts=-1)
 Set the Dtk_CompositeText inner anchor point. More...
 
Dtk_ErrorStatus SetInnerXAxis (const Dtk_dir &inXAxis)
 Sets the inner bounding box X Axis for the Dtk_CompositeText and included Dtk_Texts. More...
 
Dtk_ErrorStatus SetInnerXYAxis (const Dtk_dir &inXaxis, const Dtk_dir &inYaxis)
 Sets the inner bounding box X and Y axes for the Dtk_CompositeText and included Dtk_Texts. More...
 
Dtk_ErrorStatus SetInnerYAxis (const Dtk_dir &axis_dir)
 Sets the inner bounding box Y Axis for the Dtk_CompositeText and included Dtk_Texts. More...
 
Dtk_ErrorStatus SetOuterAnchorPoint (const Dtk_pnt &inNewLocationPnt, const Dtk_anchor_type &inNewAnchorType=DTK_ANCHOR_BOTTOM_LEFT, const Dtk_Int32 &inStartingGetText=-1, const Dtk_Int32 &inNumGetTexts=-1, const Dtk_Int32 &inStartingSetText=-1, const Dtk_Int32 &inNumSetTexts=-1)
 Set the Dtk_CompositeText outer anchor point. More...
 
Dtk_ErrorStatus SetOuterXAxis (const Dtk_dir &inXAxis)
 Sets the outer bounding box X Axis for the Dtk_CompositeText and included Dtk_Texts. More...
 
Dtk_ErrorStatus SetOuterXYAxis (const Dtk_dir &inXaxis, const Dtk_dir &inYaxis)
 Sets the outer bounding box X and Y axes for the Dtk_CompositeText and included Dtk_Texts. More...
 
Dtk_ErrorStatus SetOuterYAxis (const Dtk_dir &axis_dir)
 Sets the outer bounding box Y Axis for the Dtk_CompositeText and included Dtk_Texts. More...
 
void SetWrappingWidth (const Dtk_Double64 &inWrappingWidth)
 Sets the wrapping width. More...
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 Applies a transformation matrix to the Dtk_CompositeText and included Dtk_Texts. More...
 
Dtk_ErrorStatus Translate (const Dtk_dir &inTranslateDir)
 Translates the Dtk_CompositeText giving a translation vector. More...
 
 ~Dtk_CompositeText ()
 Destructor. More...
 

Friends

Dtk_CompositeText operator+ (Dtk_CompositeText s1, Dtk_CompositeText s2)
 Add all the Dtk_Text from the two Dtk_CompositeText. More...
 
std::ostream & operator<< (std::ostream &o, const Dtk_CompositeText &d)
 

Detailed Description

This is the composite text class.
It's basically a Dtk_Text Container.
This class represents a group of several base_texts.
It contains an inner Dtk_Oriented2dBBox and a outer Dtk_Oriented2dBBox.
The Dtk_CompositeText uses a lot of informations. The most important ones are shown in the picture below:
.

Dtk_CompositeText Most Important Informations

Constructor & Destructor Documentation

◆ ~Dtk_CompositeText()

Dtk_CompositeText::~Dtk_CompositeText ( )

Destructor.

◆ Dtk_CompositeText() [1/6]

Dtk_CompositeText::Dtk_CompositeText ( )

Base constructor.

◆ Dtk_CompositeText() [2/6]

Dtk_CompositeText::Dtk_CompositeText ( const Dtk_CompositeText t)

Copy constructor.

Parameters
tObject to copy.

◆ Dtk_CompositeText() [3/6]

Dtk_CompositeText::Dtk_CompositeText ( Dtk_CompositeText &&  t)

\MoveConstructor{t}

◆ Dtk_CompositeText() [4/6]

Dtk_CompositeText::Dtk_CompositeText ( const Dtk_Size_t inNumTexts)

Pre allocator constructor.

Parameters
inNumTextsNumber of text to be reserved

◆ Dtk_CompositeText() [5/6]

Dtk_CompositeText::Dtk_CompositeText ( Dtk_Text  inText)

Constructor from one Dtk_Text.

Parameters
inTextDtk_Text to be included into

◆ Dtk_CompositeText() [6/6]

Dtk_CompositeText::Dtk_CompositeText ( Dtk_tab< Dtk_Text inTexts)

Constructor from several Dtk_Text.

Parameters
inTextsDtk_Text to be included into

Member Function Documentation

◆ AddText()

void Dtk_CompositeText::AddText ( Dtk_Text  inText)

Adds a Dtk_Text to the Dtk_CompositeText.

Parameters
inTextThe Dtk_Text to be added

◆ Clear()

void Dtk_CompositeText::Clear ( )

◆ ConvertToDtk_string()

Dtk_string Dtk_CompositeText::ConvertToDtk_string ( ) const

Merges the Dtk_CompositeText to Dtk_string.

Returns
The merged Dtk_string

◆ CreateFrameAsGeometry()

Dtk_ErrorStatus Dtk_CompositeText::CreateFrameAsGeometry ( Dtk_tab< Dtk_CurvePtr > &  outGeoms) const

◆ GetInfo() [1/2]

Dtk_InfoPtr& Dtk_CompositeText::GetInfo ( )

Retrieves the infos.

Returns
The infos

◆ GetInfo() [2/2]

const Dtk_InfoPtr& Dtk_CompositeText::GetInfo ( ) const

Retrieves the infos.

Returns
The infos

◆ GetInnerBoundingBox() [1/2]

const Dtk_Oriented2dBBox Dtk_CompositeText::GetInnerBoundingBox ( ) const

Processes the inner bounding box.

Returns
The inner bounding box

◆ GetInnerBoundingBox() [2/2]

const Dtk_Oriented2dBBox Dtk_CompositeText::GetInnerBoundingBox ( Dtk_ErrorStatus outError) const

Processes the inner bounding box.

Parameters
outErrorReturn dtkNoError if OK
Returns
The inner bounding box

◆ GetNumTexts()

Dtk_Size_t Dtk_CompositeText::GetNumTexts ( ) const

Retrieves the texts number.

Returns
the texts number

◆ GetOuterBoundingBox() [1/2]

const Dtk_Oriented2dBBox Dtk_CompositeText::GetOuterBoundingBox ( Dtk_bool  inIncludeInvisible = DTK_TRUE) const

Processes the outer bounding box.

Parameters
inIncludeInvisible: If DTK_TRUE - default value - invisible texts are processed . Else They are not.
Returns
The outer bounding box

◆ GetOuterBoundingBox() [2/2]

const Dtk_Oriented2dBBox Dtk_CompositeText::GetOuterBoundingBox ( Dtk_ErrorStatus outError,
Dtk_bool  inIncludeInvisible = DTK_TRUE 
) const

Processes the outer bounding box.

Parameters
outErrorReturn dtkNoError if OK
inIncludeInvisible: If DTK_TRUE - default value - invisible texts are processed . Else They are not.
Returns
The outer bounding box

◆ GetWrappingWidth()

const Dtk_Double64& Dtk_CompositeText::GetWrappingWidth ( ) const

Retrieves the wrapping width.

Returns
The wrapping width

◆ operator+=()

Dtk_CompositeText& Dtk_CompositeText::operator+= ( Dtk_CompositeText  s2)

Merges the Dtk_CompositeText to another one.

Parameters
s2The first Dtk_CompositeText to merge to this

◆ operator=() [1/2]

Dtk_CompositeText& Dtk_CompositeText::operator= ( const Dtk_CompositeText inToBeAssigned)

Assignment Operator.

Parameters
inToBeAssignedObject to copy.

◆ operator=() [2/2]

Dtk_CompositeText& Dtk_CompositeText::operator= ( Dtk_CompositeText &&  inToBeAssigned)

\MoveOp{inToBeAssigned}

◆ operator[]() [1/2]

Dtk_Text& Dtk_CompositeText::operator[] ( Dtk_Size_t  inPos)

Access operator - get/set -.

Parameters
inPosThe position of the element to be retrieved
Returns
the inPos'th Dtk_Text

◆ operator[]() [2/2]

const Dtk_Text& Dtk_CompositeText::operator[] ( Dtk_Size_t  inPos) const

Access operator - read only -.

Parameters
inPosThe position of the element to be retrieved
Returns
the inPos'th Dtk_Text

◆ ReplaceTexts()

void Dtk_CompositeText::ReplaceTexts ( const Dtk_tab< Dtk_Text > &  inTexts)

Replaces all the included Dtk_Texts by the given ones.

Parameters
inTextsThe Dtk_Texts to add

◆ Reverse()

Dtk_ErrorStatus Dtk_CompositeText::Reverse ( )

Reverses the Dtk_CompositeText and included Dtk_Texts.

See also
Dtk_Text::Reverse
Returns
dtkNoError if OK

◆ SetAsDeprecated() [1/2]

Dtk_CompositeText::SetAsDeprecated ( "2020.2"  ,
"Use CreateFrameAsGeometry(Dtk_tab<Dtk_CurvePtr> &outGeoms) instead"   
) const &

Processes geometrical elements from Dtk_CompositeText frame type - and included Dtk_Texts -.

Parameters
outGeomsThe resulting geometries
Returns
dtkNoError if OK

◆ SetAsDeprecated() [2/2]

Dtk_CompositeText::SetAsDeprecated ( "Undefined"  ,
"Use GetOuterBoundingBox  
) )[DTK_NB_ANCHOR_TYPES] const &

Processes all the Dtk_CompositeText outer anchor points.

Deprecated:
Use GetOuterBoundingBox() const function instead.
Parameters
outTabPntsthe resulting anchor point array
Returns
dtkNoError if OK

◆ SetInnerAnchorPoint()

Dtk_ErrorStatus Dtk_CompositeText::SetInnerAnchorPoint ( const Dtk_pnt inNewLocationPnt,
const Dtk_anchor_type inNewAnchorType = DTK_ANCHOR_BOTTOM_LEFT,
const Dtk_Int32 inStartingGetText = -1,
const Dtk_Int32 inNumGetTexts = -1,
const Dtk_Int32 inStartingSetText = -1,
const Dtk_Int32 inNumSetTexts = -1 
)

Set the Dtk_CompositeText inner anchor point.

Parameters
inNewLocationPntThe new anchor point
inNewAnchorTypeThe new anchor type
inStartingGetTextThe starting text - -1 to process from the 1st text - for the old anchor points process
inNumGetTextsThe number of processed texts - -1 to process all texts from starting text - for the old anchor points process
inStartingSetTextThe starting text - -1 to process from the 1st text - for the new anchor points process
inNumSetTextsThe number of processed texts - -1 to process all texts from starting text - for the new anchor points process
Returns
dtkNoError if OK

◆ SetInnerXAxis()

Dtk_ErrorStatus Dtk_CompositeText::SetInnerXAxis ( const Dtk_dir inXAxis)

Sets the inner bounding box X Axis for the Dtk_CompositeText and included Dtk_Texts.

Parameters
inXAxisThe new inner bounding box X Axis
Returns
dtkNoError if OK

◆ SetInnerXYAxis()

Dtk_ErrorStatus Dtk_CompositeText::SetInnerXYAxis ( const Dtk_dir inXaxis,
const Dtk_dir inYaxis 
)

Sets the inner bounding box X and Y axes for the Dtk_CompositeText and included Dtk_Texts.

Parameters
inXAxisThe new inner bounding box X Axis
inYAxisThe new inner bounding box Y Axis
Returns
dtkNoError if OK

◆ SetInnerYAxis()

Dtk_ErrorStatus Dtk_CompositeText::SetInnerYAxis ( const Dtk_dir axis_dir)

Sets the inner bounding box Y Axis for the Dtk_CompositeText and included Dtk_Texts.

Parameters
inYAxisThe new inner bounding box Y Axis
Returns
dtkNoError if OK

◆ SetOuterAnchorPoint()

Dtk_ErrorStatus Dtk_CompositeText::SetOuterAnchorPoint ( const Dtk_pnt inNewLocationPnt,
const Dtk_anchor_type inNewAnchorType = DTK_ANCHOR_BOTTOM_LEFT,
const Dtk_Int32 inStartingGetText = -1,
const Dtk_Int32 inNumGetTexts = -1,
const Dtk_Int32 inStartingSetText = -1,
const Dtk_Int32 inNumSetTexts = -1 
)

Set the Dtk_CompositeText outer anchor point.

Parameters
inNewLocationPntThe new anchor point
inNewAnchorTypeThe new anchor type
inStartingGetTextThe starting text - -1 to process from the 1st text - for the old anchor points process
inNumGetTextsThe number of processed texts - -1 to process all texts from starting text - for the old anchor points process
inStartingSetTextThe starting text - -1 to process from the 1st text - for the new anchor points process
inNumSetTextsThe number of processed texts - -1 to process all texts from starting text - for the new anchor points process
inOffSetFor internal use only
inBoundingTypeThe bounding type
Returns
dtkNoError if OK

◆ SetOuterXAxis()

Dtk_ErrorStatus Dtk_CompositeText::SetOuterXAxis ( const Dtk_dir inXAxis)

Sets the outer bounding box X Axis for the Dtk_CompositeText and included Dtk_Texts.

Parameters
inXAxisThe new outer bounding box X Axis
Returns
dtkNoError if OK

◆ SetOuterXYAxis()

Dtk_ErrorStatus Dtk_CompositeText::SetOuterXYAxis ( const Dtk_dir inXaxis,
const Dtk_dir inYaxis 
)

Sets the outer bounding box X and Y axes for the Dtk_CompositeText and included Dtk_Texts.

Parameters
inXAxisThe new outer bounding box X Axis
inYAxisThe new outer bounding box Y Axis
Returns
dtkNoError if OK

◆ SetOuterYAxis()

Dtk_ErrorStatus Dtk_CompositeText::SetOuterYAxis ( const Dtk_dir axis_dir)

Sets the outer bounding box Y Axis for the Dtk_CompositeText and included Dtk_Texts.

Parameters
inYAxisThe new outer bounding box Y Axis
Returns
dtkNoError if OK

◆ SetWrappingWidth()

void Dtk_CompositeText::SetWrappingWidth ( const Dtk_Double64 inWrappingWidth)

Sets the wrapping width.

Parameters
inWrappingWidthThe new wrapping width

◆ Transform()

Dtk_ErrorStatus Dtk_CompositeText::Transform ( const Dtk_transfo inTransfo)

Applies a transformation matrix to the Dtk_CompositeText and included Dtk_Texts.

Parameters
inTransfoThe transformation matrix to apply

◆ Translate()

Dtk_ErrorStatus Dtk_CompositeText::Translate ( const Dtk_dir inTranslateDir)

Translates the Dtk_CompositeText giving a translation vector.

Parameters
inTranslateDirthe translation vector
Returns
dtkNoError if OK

Friends And Related Function Documentation

◆ operator+

Dtk_CompositeText operator+ ( Dtk_CompositeText  s1,
Dtk_CompositeText  s2 
)
friend

Add all the Dtk_Text from the two Dtk_CompositeText.

Parameters
s1the first composite text
s2the second composite text
Returns
the resulting Dtk_CompositeText

◆ operator<<

std::ostream& operator<< ( std::ostream &  o,
const Dtk_CompositeText d 
)
friend