FastUIDraw
Classes | Public Types | Public Member Functions | List of all members
fastuidraw::TessellatedPath Class Reference

An TessellatedPath represents the tessellation of a Path into line segments and arcs. More...

#include <tessellated_path.hpp>

Inheritance diagram for fastuidraw::TessellatedPath:
Inheritance graph
[legend]

Classes

class  cap
 Represents the geometric data for a cap. More...
 
class  join
 Represents the geometric data for a join. More...
 
class  Refiner
 
class  segment
 Represents segment of a tessellated or arc-tessellated path. More...
 
class  segment_chain
 
class  SegmentStorage
 A wrapper over a dynamic array of segment objects; segment values added to SegmentStorage must be added in order of time along the domain of a PathContour::interpolator_base. More...
 
class  TessellationParams
 A TessellationParams stores how finely to tessellate the curves of a path. More...
 

Public Types

enum  segment_type_t { arc_segment, line_segment }
 Enumeration to identify the type of a segment. More...
 
enum  split_t { segment_completey_before_split, segment_completey_after_split, segment_split_start_before, segment_split_start_after }
 

Public Member Functions

 TessellatedPath (const Path &input, TessellationParams P, reference_counted_ptr< Refiner > *ref=nullptr)
 
const Rectbounding_box (void) const
 
c_array< const capcap_data (void) const
 
c_array< const segment_chaincontour_chains (unsigned int contour) const
 
bool contour_closed (unsigned int contour) const
 
range_type< unsigned int > contour_range (unsigned int contour) const
 
c_array< const segmentcontour_segment_data (unsigned int contour) const
 
range_type< unsigned int > edge_range (unsigned int contour, unsigned int edge) const
 
segment_chain edge_segment_chain (unsigned int contour, unsigned int edge) const
 
c_array< const segmentedge_segment_data (unsigned int contour, unsigned int edge) const
 
enum PathEnums::edge_type_t edge_type (unsigned int contour, unsigned int edge) const
 
const FilledPathfilled (float thresh) const
 
const FilledPathfilled (void) const
 
bool has_arcs (void) const
 
c_array< const joinjoin_data (void) const
 
const TessellatedPathlinearization (float thresh) const
 
const TessellatedPathlinearization (void) const
 
float max_distance (void) const
 
unsigned int max_recursion (void) const
 
unsigned int number_contours (void) const
 
unsigned int number_edges (unsigned int contour) const
 
const PartitionedTessellatedPathpartitioned (void) const
 
c_array< const segment_chainsegment_chain_data (void) const
 
c_array< const segmentsegment_data (void) const
 
const StrokedPathstroked (void) const
 
const TessellationParamstessellation_parameters (void) const
 
- Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
 reference_counted_base (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
static void add_reference (const reference_counted_base< T, Counter > *p)
 
static void remove_reference (const reference_counted_base< T, Counter > *p)
 

Detailed Description

An TessellatedPath represents the tessellation of a Path into line segments and arcs.

A single contour of a TessellatedPath is constructed from a single PathContour of the source Path. Each edge of a contour of a TessellatedPath is contructed from a single PathContour::interpolator_base of the source PathContour. The ordering of the contours of a TessellatedPath is the same ordering as the source PathContour objects of the source Path. Also, the ordering of edges within a contour is the same ordering as the PathContour::interpolator_base objects of the source PathContour. In particular, for each contour of a TessellatedPath, if an edge is closed, the closing edge is the last edge.

Definition at line 62 of file tessellated_path.hpp.

Member Enumeration Documentation

◆ segment_type_t

Enumeration to identify the type of a segment.

Enumerator
arc_segment 

Indicates that the segment is an arc segment, i.e. it connects two point via an arc of a circle

line_segment 

Indicates that the segment is a line segment i.e. it connects two point via a line.

Definition at line 70 of file tessellated_path.hpp.

◆ split_t

Enumeration to describe if a segment is split

Enumerator
segment_completey_before_split 

Indicates that entire segment is before the split value

segment_completey_after_split 

Indicates that entire segment is after the split value

segment_split_start_before 

indicates that the segment was split with the segment starting before the split point.

segment_split_start_after 

indicates that the segment was split with the segment starting after the split point.

Definition at line 89 of file tessellated_path.hpp.

Constructor & Destructor Documentation

◆ TessellatedPath()

fastuidraw::TessellatedPath::TessellatedPath ( const Path input,
TessellationParams  P,
reference_counted_ptr< Refiner > *  ref = nullptr 
)

Ctor. Construct a TessellatedPath from a Path

Parameters
inputsource path to tessellate
Pparameters on how to tessellate the source Path
refif non-NULL, construct a Refiner object and return the value via upading the value of ref.

Member Function Documentation

◆ bounding_box()

const Rect& fastuidraw::TessellatedPath::bounding_box ( void  ) const

Returns the bounding box of the tessellation.

◆ cap_data()

c_array<const cap> fastuidraw::TessellatedPath::cap_data ( void  ) const

Returns all the cap data

◆ contour_chains()

c_array<const segment_chain> fastuidraw::TessellatedPath::contour_chains ( unsigned int  contour) const

Returns the array of segment_chain objects of a contour.

Parameters
contourwhich path contour to query, must have that 0 <= contour < number_contours()

◆ contour_closed()

bool fastuidraw::TessellatedPath::contour_closed ( unsigned int  contour) const

Returns true if the named contour was closed

Parameters
contourwhich path contour to query, must have that 0 <= contour < number_contours()

◆ contour_range()

range_type<unsigned int> fastuidraw::TessellatedPath::contour_range ( unsigned int  contour) const

Returns the range into segment_data() for the named contour.

Parameters
contourwhich path contour to query, must have that 0 <= contour < number_contours()

◆ contour_segment_data()

c_array<const segment> fastuidraw::TessellatedPath::contour_segment_data ( unsigned int  contour) const

Returns the segment data of the named contour. Provided as a conveniance equivalent to

segment_data().sub_array(contour_range(contour))
Parameters
contourwhich path contour to query, must have that 0 <= contour < number_contours()

◆ edge_range()

range_type<unsigned int> fastuidraw::TessellatedPath::edge_range ( unsigned int  contour,
unsigned int  edge 
) const

Returns the range into segment_data(void) for the named edge of the named contour.

Parameters
contourwhich path contour to query, must have that 0 <= contour < number_contours()
edgewhich edge of the contour to query, must have that 0 <= edge < number_edges(contour)

◆ edge_segment_chain()

segment_chain fastuidraw::TessellatedPath::edge_segment_chain ( unsigned int  contour,
unsigned int  edge 
) const

Returns the named edge as a segment_chain taking correctly into account the value of edge_type() in setting segment_chain::m_prev_to_start.

Parameters
contourwhich path contour to query, must have that 0 <= contour < number_contours()
edgewhich edge of the contour to query, must have that 0 <= edge < number_edges(contour)

◆ edge_segment_data()

c_array<const segment> fastuidraw::TessellatedPath::edge_segment_data ( unsigned int  contour,
unsigned int  edge 
) const

Returns the segment data of the named edge of the named contour, provided as a conveniance, equivalent to

segment_data().sub_array(edge_range(contour, edge))
Parameters
contourwhich path contour to query, must have that 0 <= contour < number_contours()
edgewhich edge of the contour to query, must have that 0 <= edge < number_edges(contour)

◆ edge_type()

enum PathEnums::edge_type_t fastuidraw::TessellatedPath::edge_type ( unsigned int  contour,
unsigned int  edge 
) const

Returns the edge type of the named edge of the named contour of the source Path.

Parameters
contourwhich path contour to query, must have that 0 <= contour < number_contours()
edgewhich edge of the contour to query, must have that 0 <= edge < number_edges(contour)

◆ filled() [1/2]

const FilledPath& fastuidraw::TessellatedPath::filled ( float  thresh) const

Returns this TessellatedPath filled. If this TessellatedPath has arcs will return the fill associated to the linearization() of this TessellatedPath. If a non-positive value is passed, returns the fill of the linearization where arc-segments are tessellated into very few line segments.

Parameters
threshthreshhold at which to linearize arc-segments.

◆ filled() [2/2]

const FilledPath& fastuidraw::TessellatedPath::filled ( void  ) const

Provided as a conveniance, returns the starting point tessellation. Equivalent to

filled(-1.0f)

◆ has_arcs()

bool fastuidraw::TessellatedPath::has_arcs ( void  ) const

Returns true if and only if there is a segment in segment_data() for which segment::m_type is arc_segment.

◆ join_data()

c_array<const join> fastuidraw::TessellatedPath::join_data ( void  ) const

Returns all the join data

◆ linearization() [1/2]

const TessellatedPath& fastuidraw::TessellatedPath::linearization ( float  thresh) const

Returns this TessellatedPath where any arcs are realized as segments. If this TessellatedPath has no arcs, returns this object. If a non-positive value is passed, returns a linearization where arc-segments are tessellated into very few line segments.

Parameters
threshthreshhold at which to linearize arc-segments.

◆ linearization() [2/2]

const TessellatedPath& fastuidraw::TessellatedPath::linearization ( void  ) const

Provided as a conveniance, returns the starting point tessellation. Equivalent to

◆ max_distance()

float fastuidraw::TessellatedPath::max_distance ( void  ) const

Returns the maximum across all edges of all contours of the distance between the tessellation and the actual path.

◆ max_recursion()

unsigned int fastuidraw::TessellatedPath::max_recursion ( void  ) const

Returns the maximum recursion employed by any edge

◆ number_contours()

unsigned int fastuidraw::TessellatedPath::number_contours ( void  ) const

Returns the number of contours

◆ number_edges()

unsigned int fastuidraw::TessellatedPath::number_edges ( unsigned int  contour) const

Returns the number of edges for the named contour

Parameters
contourwhich path contour to query, must have that 0 <= contour < number_contours()

◆ partitioned()

const PartitionedTessellatedPath& fastuidraw::TessellatedPath::partitioned ( void  ) const

Returns the partitioning of this TessellatedPath.

◆ segment_chain_data()

c_array<const segment_chain> fastuidraw::TessellatedPath::segment_chain_data ( void  ) const

Returns the array of segment_chain objects of the entire path.

◆ segment_data()

c_array<const segment> fastuidraw::TessellatedPath::segment_data ( void  ) const

Returns all the segment data of the entire path.

◆ stroked()

const StrokedPath& fastuidraw::TessellatedPath::stroked ( void  ) const

Returns this TessellatedPath stroked. The StrokedPath object is constructed lazily.

◆ tessellation_parameters()

const TessellationParams& fastuidraw::TessellatedPath::tessellation_parameters ( void  ) const

Returns the tessellation parameters used to construct this TessellatedPath.


The documentation for this class was generated from the following file: