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

#include <opennurbs_font.h>

Public Member Functions

 ON_Outline ()=default
 
 ON_Outline (const ON_Outline &)=default
 
 ~ON_Outline ()=default
 
ON__UINT16 AppendFigure (const ON_SimpleArray< ON_OutlineFigurePoint > &points)
 
ON__UINT16 AppendFigure (size_t point_count, const ON_OutlineFigurePoint *points)
 
double AreaEstimate () const
 
const ON_OutlineFigureFigure (int i) const
 
unsigned int FigureCount () const
 
const ON_ClassArray< ON_OutlineFigure > & Figures () const
 
ON_OutlineFigure::Type FigureType () const
 
unsigned int GetOutlineCurves (double scale, bool b3d, ON_ClassArray< ON_SimpleArray< ON_Curve * > > &outline_curves) const
 
unsigned int GetOutlineMesh (double tolerance, double scale, ON_SimpleArray< ON_2dPoint > &mesh_points, ON_SimpleArray< ON_3udex > &mesh_triangles) const
 
unsigned int GetOutlineMesh (double tolerance, double scale, ON_SimpleArray< ON_2dPoint > &mesh_points, ON_SimpleArray< ON_3udex > &mesh_triangles, double *mesh_boundary_area, double *mesh_triangle_area, class ONX_ErrorCounter *mesh_error_counter) const
 
const ON_TextBox GlyphMetrics () const
 
bool IsValidOutline (bool bLogErrors) const
 
ON_Outlineoperator= (const ON_Outline &)=default
 
const ON_BoundingBox OutlineBoundingBox () const
 
unsigned int OutlinePointCount () const
 
void Reverse ()
 
void SetGlyphMetrics (ON_TextBox glyph_metrics)
 
void SetUnitsPerEM (ON__UINT32 units_per_em)
 
ON_OutlineFigure::Orientation SortedFigureInnerOrientation () const
 
ON_OutlineFigure::Orientation SortedFigureOuterOrientation () const
 
void SortFigures (ON_OutlineFigure::Orientation outer_loop_orientation)
 
ON__UINT32 UnitsPerEM () const
 

Static Public Attributes

static const ON_OutlineFigure::Orientation DefaultOuterOrientation
 
static const ON_Outline Unset
 

Friends

class ON_OutlineAccumulator
 

Constructor & Destructor Documentation

◆ ON_Outline() [1/2]

ON_Outline::ON_Outline ( )
default

◆ ~ON_Outline()

ON_Outline::~ON_Outline ( )
default

◆ ON_Outline() [2/2]

ON_Outline::ON_Outline ( const ON_Outline )
default

Member Function Documentation

◆ AppendFigure() [1/2]

ON__UINT16 ON_Outline::AppendFigure ( const ON_SimpleArray< ON_OutlineFigurePoint > &  points)

◆ AppendFigure() [2/2]

ON__UINT16 ON_Outline::AppendFigure ( size_t  point_count,
const ON_OutlineFigurePoint points 
)

◆ AreaEstimate()

double ON_Outline::AreaEstimate ( ) const

Description: The signed area estimate calculated as the sum of each figure's area estimate.

◆ Figure()

const ON_OutlineFigure& ON_Outline::Figure ( int  i) const

Parameters: i - [in] 0 <= i < count

◆ FigureCount()

unsigned int ON_Outline::FigureCount ( ) const

Returns: Number of figures in the outline.

◆ Figures()

const ON_ClassArray< ON_OutlineFigure >& ON_Outline::Figures ( ) const

◆ FigureType()

ON_OutlineFigure::Type ON_Outline::FigureType ( ) const

Returns: Type of figures in the outline.

◆ GetOutlineCurves()

unsigned int ON_Outline::GetOutlineCurves ( double  scale,
bool  b3d,
ON_ClassArray< ON_SimpleArray< ON_Curve * > > &  outline_curves 
) const

Description: The outline consists of one or more figures. There can be zero or more closed outer figures (single stroke fonts have zero, Arial I has one, Arial i has two). There can be zero or more inner figures (Arial I has zero, O has one, 8 has two). Parameters: scale - [in] If scale > 0.0, then all curves are scaled this factor with (0,0) as the fixed point. Otherwise all curves are returned in font design units. ON_Font::ScaleFromTextHeight() is a good tool to get this value. b3d - [in] If true, then 3d curves in the world xy plane are returned. Otherwise 2d curves are returned. figure_curves - [in] Results are appended to this array. Returns: Number of figures appended to outline_curves[]

◆ GetOutlineMesh() [1/2]

unsigned int ON_Outline::GetOutlineMesh ( double  tolerance,
double  scale,
ON_SimpleArray< ON_2dPoint > &  mesh_points,
ON_SimpleArray< ON_3udex > &  mesh_triangles 
) const

◆ GetOutlineMesh() [2/2]

unsigned int ON_Outline::GetOutlineMesh ( double  tolerance,
double  scale,
ON_SimpleArray< ON_2dPoint > &  mesh_points,
ON_SimpleArray< ON_3udex > &  mesh_triangles,
double *  mesh_boundary_area,
double *  mesh_triangle_area,
class ONX_ErrorCounter mesh_error_counter 
) const

Description: Get a mesh of a sorted outline. Parameters: tolerance - [in] tolerance passed to ON_OutlineFigure::GetPolyline(tolerance,...) to create mesh boundary. scale - [in] If scale > 0.0, then all points are scaled this factor with (0,0) as the fixed point. Otherwise all points are returned in font design units. ON_Font::ScaleFromTextHeight() is a good tool to get this value. mesh_points - [out] Mesh points are appended to mesh_points[]. mesh_triangles - [out] Mesh triangles are appended to mesh_triangles[] mesh_boundary_area - [out] If not nullptr, the area of the polyline boundary is returned here. mesh_triangle_area - [out] If not nullptr, the area of the mesh is returned here. When mesh_boundary_area and mesh_triangle_area are different, it is an indication that the boundary contains selft intersections or incorrectly oriented figures and additional cleaning or validation of the outline may be needed to get desirable results. mesh_error_counter - [out] If not nullptr, warning and error counts are returned here. When there are warnings or errors and a value > 0 is returned, then a mesh is still returned but you may wish to perform addtional validation before using it.

◆ GlyphMetrics()

const ON_TextBox ON_Outline::GlyphMetrics ( ) const

Returns: Glyph metrics. Remarks: The glyph metrics bounding box of the metrics can be different from the figure outline bounding box. For example, the glyph metrics box for 1 (numeral one) often contains space beyond the glyph outline because 1 visually occupies the same space as a 2. The choice is up to the font designer and takes into account the desired font asthetics of columns of numbers.

◆ IsValidOutline()

bool ON_Outline::IsValidOutline ( bool  bLogErrors) const

Parameters: bLogErrors - [in]

Returns: True if the outline and all figures are valid.

◆ operator=()

ON_Outline& ON_Outline::operator= ( const ON_Outline )
default

◆ OutlineBoundingBox()

const ON_BoundingBox ON_Outline::OutlineBoundingBox ( ) const

Returns: The bounding box of the outline curves.

Remarks: The glyph metrics bounding box of the metrics can be different from the figure outline bounding box. For example, the glyph metrics box for 1 (numeral one) often contains space beyond the glyph outline because 1 visually occupies the same space as a 2. The choice is up to the font designer and takes into account the desired font asthetics of columns of numbers.

◆ OutlinePointCount()

unsigned int ON_Outline::OutlinePointCount ( ) const

Returns: Number of points in all figures in the outline.

◆ Reverse()

void ON_Outline::Reverse ( )

Description: Reverse every figure.

◆ SetGlyphMetrics()

void ON_Outline::SetGlyphMetrics ( ON_TextBox  glyph_metrics)

◆ SetUnitsPerEM()

void ON_Outline::SetUnitsPerEM ( ON__UINT32  units_per_em)

◆ SortedFigureInnerOrientation()

ON_OutlineFigure::Orientation ON_Outline::SortedFigureInnerOrientation ( ) const

Returns: ON_OutlineFigure::Orientation::Unset Figures are not sorted. ON_OutlineFigure::Orientation::CounterClockwise Figures are sorted and inner figures are CCW. ON_OutlineFigure::Orientation::Clockwise Figures are sorted and inner figures are CW. ON_OutlineFigure::Orientation::Error Figure sorting failed.

◆ SortedFigureOuterOrientation()

ON_OutlineFigure::Orientation ON_Outline::SortedFigureOuterOrientation ( ) const

Returns: ON_OutlineFigure::Orientation::Unset Figures are not sorted. ON_OutlineFigure::Orientation::CounterClockwise Figures are sorted and outer figures are CCW. ON_OutlineFigure::Orientation::Clockwise Figures are sorted and outer figures are CW. ON_OutlineFigure::Orientation::Error Figure sorting failed.

◆ SortFigures()

void ON_Outline::SortFigures ( ON_OutlineFigure::Orientation  outer_loop_orientation)

Description: Sort figures so that each outer loop is followed by it's inner loops.

◆ UnitsPerEM()

ON__UINT32 ON_Outline::UnitsPerEM ( ) const

Friends And Related Function Documentation

◆ ON_OutlineAccumulator

friend class ON_OutlineAccumulator
friend

Member Data Documentation

◆ DefaultOuterOrientation

const ON_OutlineFigure::Orientation ON_Outline::DefaultOuterOrientation
static

Default value for outer orientation when it is not explicitly specified.

◆ Unset

const ON_Outline ON_Outline::Unset
static