Rhino C++ API  8.5
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
ON_TextContent Class Reference

#include <opennurbs_text.h>

Inheritance diagram for ON_TextContent:
ON_Geometry ON_Object

Public Member Functions

 ON_TextContent ()=default
 
 ON_TextContent (const ON_TextContent &src)
 
 ~ON_TextContent ()
 
void ClearBoundingBox () override
 
bool ComposeText ()
 
bool Create (const wchar_t *RtfString, ON::AnnotationType annotation_type, const ON_DimStyle *dimstyle)
 
bool Create (const wchar_t *RtfString, ON::AnnotationType annotation_type, const ON_DimStyle *dimstyle, bool bWrapped, double rect_width, double text_rotation_radians)
 Parses text string and makes runs. More...
 
*const ON_FontDefaultFont () const
 void SetCurrentDimStyle(const ON_DimStyle* dimstyle) const; More...
 
int Dimension () const override
 
ON_SHA1_Hash DimStyleTextPositionPropertiesHash () const
 
void Dump (ON_TextLog &) const override
 virtual More...
 
bool EqualTextPositionProperties (ON::AnnotationType annotation_type, const class ON_DimStyle *dimstyle) const
 
unsigned int EvaluationSerialNumber () const
 
const ON_FontFirstCharFont () const
 
double FormattingRectangleWidth () const
 FormattingRectangleWidth is a width set by text wrapping. It's in model units. More...
 
bool Get2dCorners (ON_2dPoint corners[4]) const
 
ON_MeshGet2dPickMesh () const
 
bool Get2dSize (bool raw, double &width, double &height) const
 Get the size of a 2d rectangle enclosing text. More...
 
bool Get3dCorners (ON_3dPoint corners[4]) const
 
bool Get3dMaskCorners (double border, ON_3dPoint corners[4]) const
 
ON_MeshGet3dMaskPickMesh (double maskoffset) const
 
ON_MeshGet3dPickMesh () const
 
bool Get3dUnderline (ON_3dPoint ends[2], double scaled_gap) const
 Gets endpoints of a line under the text offset down by textgap. More...
 
void GetAlignment (ON::TextHorizontalAlignment &horz, ON::TextVerticalAlignment &vert) const
 
bool GetBBox (double *boxmin, double *boxmax, bool bGrowBox=false) const override
 virtual ON_Geometry GetBBox override
More...
 
bool GetGlyphContours (const ON_Font *text_font, bool bSingleStrokeFont, const ON_Xform &text_xform, ON_ClassArray< ON_ClassArray< ON_SimpleArray< ON_Curve * > > > &text_contours) const
 
bool GetGlyphContours (const ON_Font *text_font, bool bSingleStrokeFont, double text_height, ON_ClassArray< ON_ClassArray< ON_SimpleArray< ON_Curve * > > > &text_contours) const
 
void GetGripPoints (ON_2dPoint &base, ON_2dPoint &width) const
 returns the base point and with grip using the current alignments More...
 
bool GetRun3dCorners (const ON_TextRun *run, ON_3dPoint corners[4]) const
 
bool HasWrappedRuns () const
 True if text has wrapped runs, else false. More...
 
bool IsValid (class ON_TextLog *text_log=nullptr) const override
 
ON::object_type ObjectType () const override
 
ON_TextContentoperator= (const ON_TextContent &src)
 
const ON_wString PlainText () const
 
const ON_wString PlainTextWithFields () const
 
const ON_wString PlainTextWithFields (ON_SimpleArray< ON_3dex > *runmap) const
 
const ON_wString PlatformRichTextFromRuns () const
 
bool Read (ON_BinaryArchive &) override
 
void RealignTextRuns (ON::TextHorizontalAlignment new_h_align)
 
bool RebuildRuns (ON::AnnotationType annotation_type, const ON_DimStyle *dimstyle)
 
bool ReplaceTextString (const wchar_t *RtfString, ON::AnnotationType annotation_type, const ON_DimStyle *dimstyle)
 
const ON_wString RichText () const
 
const ON_wString RichTextFromRuns (ON::RichTextStyle rich_text_style) const
 
const wchar_t * RtfText () const
 
bool RunReplaceString (const wchar_t *repl_str, int start_run_idx, int start_run_pos, int end_run_idx, int end_run_pos)
 
ON::TextHorizontalAlignment RuntimeHorizontalAlignment () const
 
void SetAlignment (ON::TextHorizontalAlignment horz, ON::TextVerticalAlignment vert)
 
void SetEvaluationSerialNumber (unsigned int sn) const
 
void SetFormattingRectangleWidth (double width)
 
void SetRuntimeHorizontalAlignment (ON::TextHorizontalAlignment halign) const
 
void SetTextIsWrapped (bool wrapped)
 
void SetTextRotationDegrees (double rotation)
 
void SetTextRotationRadians (double rotation)
 
const ON_BoundingBox TextContentBoundingBox () const
 
ON_SHA1_Hash TextContentHash () const
 
ON_SHA1_Hash TextContentHash (bool bApplyWrapping, bool bEvaluateFields) const
 
bool TextIsWrapped () const
 True if flag to wrap is set. More...
 
double TextRotationDegrees () const
 Rotation in degrees around origin. More...
 
double TextRotationRadians () const
 Rotation in radians around origin. More...
 
ON_TextRunArrayTextRuns (bool bRaw) const
 
bool Transform (const ON_Xform &xform) override
 
const ON_wString WrappedPlainText () const
 
const ON_wString WrappedPlainTextWithFields () const
 
bool WrapText (double width) const
 Wrap text to a specified width in model space. More...
 
bool Write (ON_BinaryArchive &) const override
 
- Public Member Functions inherited from ON_Geometry
 ON_Geometry ()=default
 
 ON_Geometry (const ON_Geometry &)=default
 
 ~ON_Geometry ()=default
 
ON_BoundingBox BoundingBox () const
 
virtual class ON_BrepBrepForm (class ON_Brep *brep=nullptr) const
 
virtual ON_COMPONENT_INDEX ComponentIndex () const
 
virtual bool EvaluatePoint (const class ON_ObjRef &objref, ON_3dPoint &P) const
 
bool GetBoundingBox (ON_3dPoint &bbox_min, ON_3dPoint &bbox_max, bool bGrowBox=false) const
 
bool GetBoundingBox (ON_BoundingBox &bbox, bool bGrowBox=false) const
 
virtual bool GetTightBoundingBox (class ON_BoundingBox &tight_bbox, bool bGrowBox=false, const class ON_Xform *xform=nullptr) const
 
virtual bool HasBrepForm () const
 
virtual bool IsDeformable () const
 
virtual bool IsMorphable () const
 
virtual bool MakeDeformable ()
 
virtual bool Morph (const class ON_SpaceMorph &morph)
 
ON_Geometryoperator= (const ON_Geometry &)=default
 
bool Rotate (double rotation_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center)
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center)
 
bool Scale (double scale_factor)
 
virtual bool SwapCoordinates (int i, int j)
 
const ON_BoundingBox TightBoundingBox () const
 
bool Translate (const ON_3dVector &translation_vector)
 
- Public Member Functions inherited from ON_Object
 ON_Object () ON_NOEXCEPT
 
 ON_Object (const ON_Object &)
 
virtual ~ON_Object ()
 
virtual ON_AggregateComponentStatus AggregateComponentStatus () const
 
bool AttachUserData (class ON_UserData *pUserData)
 
unsigned int ClearAllComponentStates () const
 
virtual unsigned int ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const
 
virtual unsigned int ClearComponentStates (ON_ComponentStatus states_to_clear) const
 
void CopyUserData (const ON_Object &source_object)
 
unsigned int CopyUserData (const ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution)
 
virtual ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
virtual bool DeleteComponents (const ON_COMPONENT_INDEX *ci_list, size_t ci_count)
 
virtual void DestroyRuntimeCache (bool bDelete=true)
 
bool DetachUserData (class ON_UserData *pUserData)
 
void EmergencyDestroy ()
 
class ON_UserDataFirstUserData () const
 
virtual unsigned int GetComponentsWithSetStates (ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) const
 
class ON_UserDataGetUserData (const ON_UUID &userdata_uuid) const
 
bool GetUserString (const wchar_t *key, ON_wString &string_value) const
 
int GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const
 
int GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const
 
bool IsCorrupt (bool bRepair, bool bSilentError, class ON_TextLog *text_log) const
 
bool IsKindOf (const ON_ClassId *pClassId) const
 
virtual void MarkAggregateComponentStatusAsNotCurrent () const
 
virtual void MemoryRelocate ()
 
virtual ON_UUID ModelObjectId () const
 
void MoveUserData (ON_Object &source_object)
 
unsigned int MoveUserData (ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution, bool bDeleteAllSourceItems)
 
ON_Objectoperator= (const ON_Object &)
 
void PurgeUserData ()
 
virtual unsigned int SetComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const
 
virtual unsigned int SetComponentStatus (ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const
 
bool SetUserString (const wchar_t *key, const wchar_t *string_value)
 
int SetUserStrings (int count, const ON_UserString *user_strings, bool bReplace)
 
virtual unsigned int SizeOf () const
 
bool ThisIsNullptr (bool bSilentError) const
 
void TransformUserData (const class ON_Xform &xform)
 
virtual bool UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map)
 
int UserStringCount () const
 

Static Public Member Functions

static bool CreateStackedText (ON_TextRun *run)
 
static bool CreateStackedText (ON_TextRun *run, int cpcount, const ON__UINT32 *cp, ON__UINT32 stack_delimiter=L'/')
 
static bool EvaluateField (ON_TextRun *run)
 
static int FindAndStackFractions (ON_TextRunArray *runs, int i, ON_wString wstr)
 
static bool FormatAngleMeasurement (double angle, const ON_DimStyle *dimstyle, const wchar_t *user_text, ON_wString &formatted_string)
 
static bool FormatAngleStringDecimal (double angle_radians, int resolution, double roundoff, ON_DimStyle::suppress_zero zero_suppression, wchar_t decimal_char, ON_wString &formatted_string)
 
static bool FormatAngleStringDMS (double angle_degrees, wchar_t decimal_char, int resolution, ON_wString &formatted_string)
 
static bool FormatAngleStringDMS (double angle_degrees, wchar_t decimal_char, ON_wString &formatted_string)
 
static bool FormatArea (double area, ON::LengthUnitSystem units_in, const ON_DimStyle *dimstyle, bool alternate, ON_wString &formatted_string)
 Area formatting. More...
 
static bool FormatDistance (double distance, ON::LengthUnitSystem units_in, const ON_DimStyle *dimstyle, bool alternate, ON_wString &formatted_string)
 Dimension text formatting. More...
 
static bool FormatDistanceAndTolerance (double distance, ON::LengthUnitSystem units_in, const ON_DimStyle *dimstyle, bool alternate, ON_wString &formatted_string)
 Output. More...
 
static bool FormatDistanceMeasurement (double distance_in, ON::LengthUnitSystem units_in, const ON_DimStyle *dimstyle, const wchar_t *user_text, ON_wString &formatted_string)
 Output. More...
 
static bool FormatLength (double distance, ON_DimStyle::LengthDisplay output_lengthdisplay, double round_off, int resolution, ON_DimStyle::suppress_zero zero_suppress, bool bracket_fractions, wchar_t decimal_char, ON_wString &output)
 
static bool FormatTolerance (double distance, ON::LengthUnitSystem units_in, const ON_DimStyle *dimstyle, bool alternate, ON_wString &formatted_string)
 Output. More...
 
static bool FormatVolume (double volume, ON::LengthUnitSystem units_in, const ON_DimStyle *dimstyle, bool alternate, ON_wString &formatted_string)
 Volume formatting. More...
 
static double GetLinefeedHeight (ON_TextRun &run)
 
static bool GetRichTextFontTable (const ON_wString rich_text, ON_ClassArray< ON_wString > &font_table)
 
static bool MeasureTextContent (ON_TextContent *text, bool raw, bool wrapped)
 
static bool MeasureTextRun (ON_TextRun *run)
 
static bool MeasureTextRunArray (ON_TextRunArray *runs, ON::TextVerticalAlignment v_align, ON::TextHorizontalAlignment h_align)
 

Public Attributes

*bool IsCurrentDimStyle ON_DimStyle const
 

Static Public Attributes

static const ON_TextContent Empty
 
- Static Public Attributes inherited from ON_Geometry
const static ON_Geometry Unset
 

Friends

class ON_Text
 ON__INT_PTR m_reserved0 = (ON__INT_PTR)0;. More...
 

Additional Inherited Members

- Public Types inherited from ON_Object
enum  UserDataConflictResolution : unsigned char {
  UserDataConflictResolution::destination_object = 0, UserDataConflictResolution::source_object = 1, UserDataConflictResolution::source_copycount_gt = 2, UserDataConflictResolution::source_copycount_ge = 3,
  UserDataConflictResolution::destination_copycount_gt = 4, UserDataConflictResolution::destination_copycount_ge = 5, UserDataConflictResolution::delete_item = 6
}
 

Constructor & Destructor Documentation

◆ ON_TextContent() [1/2]

ON_TextContent::ON_TextContent ( )
default

◆ ~ON_TextContent()

ON_TextContent::~ON_TextContent ( )

◆ ON_TextContent() [2/2]

ON_TextContent::ON_TextContent ( const ON_TextContent src)

Member Function Documentation

◆ ClearBoundingBox()

void ON_TextContent::ClearBoundingBox ( )
overridevirtual

Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.

Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

The default implementation does nothing.

Reimplemented from ON_Geometry.

◆ ComposeText()

bool ON_TextContent::ComposeText ( )

With runs in place, compose the text in the runs and fill in the Text's string that is returned by RtfText

◆ Create() [1/2]

bool ON_TextContent::Create ( const wchar_t *  RtfString,
ON::AnnotationType  annotation_type,
const ON_DimStyle dimstyle 
)
Parameters
annotation_typeused to select type specific dimstyle properties like text alignment settings

◆ Create() [2/2]

bool ON_TextContent::Create ( const wchar_t *  RtfString,
ON::AnnotationType  annotation_type,
const ON_DimStyle dimstyle,
bool  bWrapped,
double  rect_width,
double  text_rotation_radians 
)

Parses text string and makes runs.

Parameters
annotation_typeused to select type specific dimstyle properties like text alignment settings

◆ CreateStackedText() [1/2]

static bool ON_TextContent::CreateStackedText ( ON_TextRun run)
static

◆ CreateStackedText() [2/2]

static bool ON_TextContent::CreateStackedText ( ON_TextRun run,
int  cpcount,
const ON__UINT32 cp,
ON__UINT32  stack_delimiter = L'/' 
)
static

◆ DefaultFont()

* const ON_Font& ON_TextContent::DefaultFont ( ) const

void SetCurrentDimStyle(const ON_DimStyle* dimstyle) const;

Returns the default font for this text content. Typically, that would be the font from the dimstyle

◆ Dimension()

int ON_TextContent::Dimension ( ) const
overridevirtual

Description: Dimension of the object. Returns: Dimension of the object. Remarks: The dimension is typically three. For parameter space trimming curves the dimension is two. In rare cases the dimension can be one or greater than three.

Reimplemented from ON_Geometry.

◆ DimStyleTextPositionPropertiesHash()

ON_SHA1_Hash ON_TextContent::DimStyleTextPositionPropertiesHash ( ) const

◆ Dump()

void ON_TextContent::Dump ( ON_TextLog ) const
overridevirtual

virtual

for debugging

Reimplemented from ON_Object.

◆ EqualTextPositionProperties()

bool ON_TextContent::EqualTextPositionProperties ( ON::AnnotationType  annotation_type,
const class ON_DimStyle dimstyle 
) const

Returns: True if this text position information used to create this text is identical to the text position parameters on dimstyle.

◆ EvaluateField()

static bool ON_TextContent::EvaluateField ( ON_TextRun run)
static

Description: Evaluates the field instructions in the run and puts the results in run->m_display_string. Parameters: [in/out] ON_TextRun& run - Run to evsluste. Modified to store results Returns: true = Success false = Failure Remarks: The runs in the text are modified to store the string result of evaluating any fields in the run m_string or m_codepoints

◆ EvaluationSerialNumber()

unsigned int ON_TextContent::EvaluationSerialNumber ( ) const

◆ FindAndStackFractions()

static int ON_TextContent::FindAndStackFractions ( ON_TextRunArray runs,
int  i,
ON_wString  wstr 
)
static

Replaces runs[i] with stacked runs if any "[[xx/xx]]" strings are found in wstr Returns the number of runs added to the array

◆ FirstCharFont()

const ON_Font* ON_TextContent::FirstCharFont ( ) const

◆ FormatAngleMeasurement()

static bool ON_TextContent::FormatAngleMeasurement ( double  angle,
const ON_DimStyle dimstyle,
const wchar_t *  user_text,
ON_wString formatted_string 
)
static
Parameters
dimstyleAngle format comes from dimstyle

◆ FormatAngleStringDecimal()

static bool ON_TextContent::FormatAngleStringDecimal ( double  angle_radians,
int  resolution,
double  roundoff,
ON_DimStyle::suppress_zero  zero_suppression,
wchar_t  decimal_char,
ON_wString formatted_string 
)
static

◆ FormatAngleStringDMS() [1/2]

static bool ON_TextContent::FormatAngleStringDMS ( double  angle_degrees,
wchar_t  decimal_char,
int  resolution,
ON_wString formatted_string 
)
static

◆ FormatAngleStringDMS() [2/2]

static bool ON_TextContent::FormatAngleStringDMS ( double  angle_degrees,
wchar_t  decimal_char,
ON_wString formatted_string 
)
static

◆ FormatArea()

static bool ON_TextContent::FormatArea ( double  area,
ON::LengthUnitSystem  units_in,
const ON_DimStyle dimstyle,
bool  alternate,
ON_wString formatted_string 
)
static

Area formatting.

Output

Parameters
alternatePrimary or alternate

◆ FormatDistance()

static bool ON_TextContent::FormatDistance ( double  distance,
ON::LengthUnitSystem  units_in,
const ON_DimStyle dimstyle,
bool  alternate,
ON_wString formatted_string 
)
static

Dimension text formatting.

Output

Parameters
alternatePrimary or alternate

◆ FormatDistanceAndTolerance()

static bool ON_TextContent::FormatDistanceAndTolerance ( double  distance,
ON::LengthUnitSystem  units_in,
const ON_DimStyle dimstyle,
bool  alternate,
ON_wString formatted_string 
)
static

Output.

Parameters
alternatePrimary or alternate

◆ FormatDistanceMeasurement()

static bool ON_TextContent::FormatDistanceMeasurement ( double  distance_in,
ON::LengthUnitSystem  units_in,
const ON_DimStyle dimstyle,
const wchar_t *  user_text,
ON_wString formatted_string 
)
static

Output.

Parameters
user_textReplace "<>" in user_text with formatted dimension

◆ FormatLength()

static bool ON_TextContent::FormatLength ( double  distance,
ON_DimStyle::LengthDisplay  output_lengthdisplay,
double  round_off,
int  resolution,
ON_DimStyle::suppress_zero  zero_suppress,
bool  bracket_fractions,
wchar_t  decimal_char,
ON_wString output 
)
static

◆ FormattingRectangleWidth()

double ON_TextContent::FormattingRectangleWidth ( ) const

FormattingRectangleWidth is a width set by text wrapping. It's in model units.

◆ FormatTolerance()

static bool ON_TextContent::FormatTolerance ( double  distance,
ON::LengthUnitSystem  units_in,
const ON_DimStyle dimstyle,
bool  alternate,
ON_wString formatted_string 
)
static

Output.

Parameters
alternatePrimary or alternate

◆ FormatVolume()

static bool ON_TextContent::FormatVolume ( double  volume,
ON::LengthUnitSystem  units_in,
const ON_DimStyle dimstyle,
bool  alternate,
ON_wString formatted_string 
)
static

Volume formatting.

Output

Parameters
alternatePrimary or alternate

◆ Get2dCorners()

bool ON_TextContent::Get2dCorners ( ON_2dPoint  corners[4]) const

Get corners of the whole text object corners requires space for 4 points

◆ Get2dPickMesh()

ON_Mesh* ON_TextContent::Get2dPickMesh ( ) const

◆ Get2dSize()

bool ON_TextContent::Get2dSize ( bool  raw,
double &  width,
double &  height 
) const

Get the size of a 2d rectangle enclosing text.

◆ Get3dCorners()

bool ON_TextContent::Get3dCorners ( ON_3dPoint  corners[4]) const

Get corners of the whole text object corners requires space for 4 points Basic size of text, not including annotation scaling or 2d rotation And rotated and translated in 3d to text's plane (not object's plane)

◆ Get3dMaskCorners()

bool ON_TextContent::Get3dMaskCorners ( double  border,
ON_3dPoint  corners[4] 
) const

Get corners of the whole text object inflated by the border distance for mask drawing corners requires space for 4 points

◆ Get3dMaskPickMesh()

ON_Mesh* ON_TextContent::Get3dMaskPickMesh ( double  maskoffset) const

◆ Get3dPickMesh()

ON_Mesh* ON_TextContent::Get3dPickMesh ( ) const

◆ Get3dUnderline()

bool ON_TextContent::Get3dUnderline ( ON_3dPoint  ends[2],
double  scaled_gap 
) const

Gets endpoints of a line under the text offset down by textgap.

◆ GetAlignment()

void ON_TextContent::GetAlignment ( ON::TextHorizontalAlignment horz,
ON::TextVerticalAlignment vert 
) const

◆ GetBBox()

bool ON_TextContent::GetBBox ( double *  boxmin,
double *  boxmax,
bool  bGrowBox = false 
) const
overridevirtual

virtual ON_Geometry GetBBox override

Reimplemented from ON_Geometry.

◆ GetGlyphContours() [1/2]

bool ON_TextContent::GetGlyphContours ( const ON_Font text_font,
bool  bSingleStrokeFont,
const ON_Xform text_xform,
ON_ClassArray< ON_ClassArray< ON_SimpleArray< ON_Curve * > > > &  text_contours 
) const

◆ GetGlyphContours() [2/2]

bool ON_TextContent::GetGlyphContours ( const ON_Font text_font,
bool  bSingleStrokeFont,
double  text_height,
ON_ClassArray< ON_ClassArray< ON_SimpleArray< ON_Curve * > > > &  text_contours 
) const

◆ GetGripPoints()

void ON_TextContent::GetGripPoints ( ON_2dPoint base,
ON_2dPoint width 
) const

returns the base point and with grip using the current alignments

◆ GetLinefeedHeight()

static double ON_TextContent::GetLinefeedHeight ( ON_TextRun run)
static

Description: Returns the height in model units of the run, including text height and inter-line spacing

◆ GetRichTextFontTable()

static bool ON_TextContent::GetRichTextFontTable ( const ON_wString  rich_text,
ON_ClassArray< ON_wString > &  font_table 
)
static

Get the exact strings in the RTF font table and add them to font_table[] Example Input rich_text = {\rtf1\deff0{\fonttbl{\f0 ArialMT;}{\f1 SegoeUI;}}\f0 \fs40{\f1 This is Segoe UI}} returns font_table[] = { "ArialMT", "SegoeUI"}

◆ GetRun3dCorners()

bool ON_TextContent::GetRun3dCorners ( const ON_TextRun run,
ON_3dPoint  corners[4] 
) const

Get corners of individual runs corners requires space for 4 points

◆ HasWrappedRuns()

bool ON_TextContent::HasWrappedRuns ( ) const

True if text has wrapped runs, else false.

◆ IsValid()

bool ON_TextContent::IsValid ( class ON_TextLog text_log = nullptr) const
overridevirtual

Description: Tests an object to see if its data members are correctly initialized. Parameters: text_log - [in] if the object is not valid and text_log is not nullptr, then a brief englis description of the reason the object is not valid is appened to the log. The information appended to text_log is suitable for low-level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. Returns: @untitled table true object is valid false object is invalid, uninitialized, etc.

Reimplemented from ON_Geometry.

◆ MeasureTextContent()

static bool ON_TextContent::MeasureTextContent ( ON_TextContent text,
bool  raw,
bool  wrapped 
)
static

Description: Calculates the size, spacing and position of the runs in the ON_TextContent Parameters: [in/out] ON_TextContent& text - Text to measure. Modified to store results [in] bool raw - if true, measure m_runs [in] bool wrapped - if true, measure m_wrapped_runs Returns: true = Success false = Failure Remarks: The runs in the text are modified to store the location info for positioning within the text object

◆ MeasureTextRun()

static bool ON_TextContent::MeasureTextRun ( ON_TextRun run)
static

Description: Calculates the size, spacing and position of the ON_TextRun within an ON_TextContent object Parameters: [in/out] ON_TextRun& run - Run to measure. Modified to store results Returns: true = Success false = Failure Remarks: The runs in the text are modified to store the location info for positioning within the text object

◆ MeasureTextRunArray()

static bool ON_TextContent::MeasureTextRunArray ( ON_TextRunArray runs,
ON::TextVerticalAlignment  v_align,
ON::TextHorizontalAlignment  h_align 
)
static

Description: Calculates the size, spacing and position of the runs in the ON_TextRunArray Parameters: [in/out] ON_TextRunArray* runs - TextRuns to measure. Modified to store results [in] ON::TextVerticalAlignment v_align - how to align the text [in] ON::TextHorizontalAlignment h_align) Returns: true = Success false = Failure Remarks: The runs in the text are modified to store the location info for positioning within the text object

◆ ObjectType()

ON::object_type ON_TextContent::ObjectType ( ) const
overridevirtual

Description: Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.

Returns: ON::object_type enum value.

Remarks: The default implementation of this virtual function returns ON::unknown_object_type

Reimplemented from ON_Object.

◆ operator=()

ON_TextContent& ON_TextContent::operator= ( const ON_TextContent src)

◆ PlainText()

const ON_wString ON_TextContent::PlainText ( ) const

Returns: Plain text information with any rich text formatting instructions removed. The result string from evaluating fields is included Field results may be cached from previous evaluation

◆ PlainTextWithFields() [1/2]

const ON_wString ON_TextContent::PlainTextWithFields ( ) const

Returns: Plain text information with any rich text formatting instructions removed. Fields are not evaluated

◆ PlainTextWithFields() [2/2]

const ON_wString ON_TextContent::PlainTextWithFields ( ON_SimpleArray< ON_3dex > *  runmap) const

Returns the same string as PlainTextWithFields() and fills in the runmap Each 3dex in the runmap array is i: run index, j: position in the string where text from run[i] starts, k: length of text from run[i]

◆ PlatformRichTextFromRuns()

const ON_wString ON_TextContent::PlatformRichTextFromRuns ( ) const

Returns: Rich text suitable for initializing SDK controls on the current platform (Windows or Apple OS X). The returned string is always rich text (never plain text). The returned rich text is always generated directly from the runs. This text is typically different from the Rhino clean rich text returned by the RichText() command.

◆ Read()

bool ON_TextContent::Read ( ON_BinaryArchive binary_archive)
overridevirtual

Description: Low level archive writing tool used by ON_BinaryArchive::ReadObject(). Parameters: binary_archive - archive to read from Returns: Returns true if the read is successful. Remarks: Use ON_BinaryArchive::ReadObject() to read objects. This Read() function should read the objects definition back into its data members.

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

◆ RealignTextRuns()

void ON_TextContent::RealignTextRuns ( ON::TextHorizontalAlignment  new_h_align)

◆ RebuildRuns()

bool ON_TextContent::RebuildRuns ( ON::AnnotationType  annotation_type,
const ON_DimStyle dimstyle 
)

◆ ReplaceTextString()

bool ON_TextContent::ReplaceTextString ( const wchar_t *  RtfString,
ON::AnnotationType  annotation_type,
const ON_DimStyle dimstyle 
)
Parameters
annotation_typeused to select type specific dimstyle properties like text alignment settings

◆ RichText()

const ON_wString ON_TextContent::RichText ( ) const

Returns: Rhino clean rich text that is currently saved on this instance. The text can contain text formatting instructions. Fields are not evaluated.

◆ RichTextFromRuns()

const ON_wString ON_TextContent::RichTextFromRuns ( ON::RichTextStyle  rich_text_style) const

Parameters: rich_text_style - [in] Type of rich text to return. Returns: The returned string is always rich text (never plain text). The returned rich text is always generated directly from the runs. This text is typically different from the Rhino clean rich text returned by the RichText() command.

◆ RtfText()

const wchar_t* ON_TextContent::RtfText ( ) const

◆ RunReplaceString()

bool ON_TextContent::RunReplaceString ( const wchar_t *  repl_str,
int  start_run_idx,
int  start_run_pos,
int  end_run_idx,
int  end_run_pos 
)

◆ RuntimeHorizontalAlignment()

ON::TextHorizontalAlignment ON_TextContent::RuntimeHorizontalAlignment ( ) const

◆ SetAlignment()

void ON_TextContent::SetAlignment ( ON::TextHorizontalAlignment  horz,
ON::TextVerticalAlignment  vert 
)

◆ SetEvaluationSerialNumber()

void ON_TextContent::SetEvaluationSerialNumber ( unsigned int  sn) const

◆ SetFormattingRectangleWidth()

void ON_TextContent::SetFormattingRectangleWidth ( double  width)

◆ SetRuntimeHorizontalAlignment()

void ON_TextContent::SetRuntimeHorizontalAlignment ( ON::TextHorizontalAlignment  halign) const

◆ SetTextIsWrapped()

void ON_TextContent::SetTextIsWrapped ( bool  wrapped)

◆ SetTextRotationDegrees()

void ON_TextContent::SetTextRotationDegrees ( double  rotation)

◆ SetTextRotationRadians()

void ON_TextContent::SetTextRotationRadians ( double  rotation)

◆ TextContentBoundingBox()

const ON_BoundingBox ON_TextContent::TextContentBoundingBox ( ) const

◆ TextContentHash() [1/2]

ON_SHA1_Hash ON_TextContent::TextContentHash ( ) const

Returns: A hash of the information that determines the text content using wrapped text with evaluated fields.

◆ TextContentHash() [2/2]

ON_SHA1_Hash ON_TextContent::TextContentHash ( bool  bApplyWrapping,
bool  bEvaluateFields 
) const

Parameters: bApplyWrapping - [in] true - hash wrapped text false - has unwrapped text bEvaluateFields - [in] true - hash text with fields evaluated false - hash text with fields unevaluated Returns: A hash of the information that determines the text content without evaluating the fields.

◆ TextIsWrapped()

bool ON_TextContent::TextIsWrapped ( ) const

True if flag to wrap is set.

◆ TextRotationDegrees()

double ON_TextContent::TextRotationDegrees ( ) const

Rotation in degrees around origin.

◆ TextRotationRadians()

double ON_TextContent::TextRotationRadians ( ) const

Rotation in radians around origin.

◆ TextRuns()

ON_TextRunArray* ON_TextContent::TextRuns ( bool  bRaw) const

Returns pointer to either m_runs, the basic parsed and evaluated text or m_wrapped_runs which is the runs after text wrapping m_wrapped_runs will be null unless the text has been wrapped If raw is false and m_wrapped_runs is not null, m_wrapped_runs will be returned If raw is true or m_wrapped_runs is null, m_runs will be returned

◆ Transform()

bool ON_TextContent::Transform ( const ON_Xform xform)
overridevirtual

Description: Transforms the object.

Parameters: xform - [in] transformation to apply to object. If xform.IsSimilarity() is zero, then you may want to call MakeSquishy() before calling Transform.

Remarks: When overriding this function, be sure to include a call to ON_Object::TransformUserData() which takes care of transforming any ON_UserData that may be attached to the object.

See Also: ON_Geometry::IsDeformable();

Remarks: Classes derived from ON_Geometry should call ON_Geometry::Transform() to handle user data transformations and then transform their definition.

Reimplemented from ON_Geometry.

◆ WrappedPlainText()

const ON_wString ON_TextContent::WrappedPlainText ( ) const

Same as PlainText() but separated wrapped run lines with '
' for soft return and '\r''
' for hard returns

◆ WrappedPlainTextWithFields()

const ON_wString ON_TextContent::WrappedPlainTextWithFields ( ) const

Same as PlainTextWithFields() but separated wrapped run lines with '
' for soft return and '\r''
' for hard returns

◆ WrapText()

bool ON_TextContent::WrapText ( double  width) const

Wrap text to a specified width in model space.

◆ Write()

bool ON_TextContent::Write ( ON_BinaryArchive binary_archive) const
overridevirtual

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

Friends And Related Function Documentation

◆ ON_Text

friend class ON_Text
friend

ON__INT_PTR m_reserved0 = (ON__INT_PTR)0;.

Member Data Documentation

◆ const

* bool IsCurrentDimStyle ON_DimStyle ON_TextContent::const

◆ Empty

const ON_TextContent ON_TextContent::Empty
static