FastUIDraw
Public Member Functions | Public Attributes | List of all members
fastuidraw::TessellatedPath::segment Class Reference

Represents segment of a tessellated or arc-tessellated path. More...

#include <tessellated_path.hpp>

Public Member Functions

enum split_t compute_split (float split, segment *dst_before_split, segment *dst_after_split, int splitting_coordinate) const
 
enum split_t compute_split_x (float x_split, segment *dst_before_split, segment *dst_after_split) const
 
enum split_t compute_split_y (float y_split, segment *dst_before_split, segment *dst_after_split) const
 
vec2 enter_segment_normal (void) const
 
vec2 leaving_segment_normal (void) const
 
void split_segment (float t, segment *dst_0_t, segment *dst_t_1) const
 

Public Attributes

range_type< float > m_arc_angle
 
vec2 m_center
 
bool m_continuation_with_predecessor
 
unsigned int m_contour_id
 
float m_contour_length
 
float m_distance_from_contour_start
 
float m_distance_from_edge_start
 
unsigned int m_edge_id
 
float m_edge_length
 
vec2 m_end_pt
 
vec2 m_enter_segment_unit_vector
 
bool m_first_segment_of_edge
 
bool m_last_segment_of_edge
 
vec2 m_leaving_segment_unit_vector
 
float m_length
 
float m_radius
 
vec2 m_start_pt
 
enum segment_type_t m_type
 

Detailed Description

Represents segment of a tessellated or arc-tessellated path.

Definition at line 178 of file tessellated_path.hpp.

Member Function Documentation

◆ compute_split()

enum split_t fastuidraw::TessellatedPath::segment::compute_split ( float  split,
segment dst_before_split,
segment dst_after_split,
int  splitting_coordinate 
) const

Compute the splitting splitting of this segment against a horizontal or vertical line with the given coordinate. Provided as a conveniance, equivalent to

if (splitting_coordinate == 0)
{
compute_split_x(split, dst_before_split, dst_after_split);
}
else
{
compute_split_y(split, dst_before_split, dst_after_split);
}
Parameters
splitx-coordinate or y-coordinate of splitting line
dst_before_splitlocation to which to write the portion of the segment that comes before the splitting line
dst_after_splitlocation to which to write the portion of the segment that comes after the splitting line
splitting_coordinatedetermines if to split by a vertical line or a horizontal line.
Returns
how the segment was split. Note that if the return value is segment_completey_before_split or segment_completey_after_split then neither of dst_before_split and dst_after_split are written to.

◆ compute_split_x()

enum split_t fastuidraw::TessellatedPath::segment::compute_split_x ( float  x_split,
segment dst_before_split,
segment dst_after_split 
) const

Compute the splitting splitting of this segment against a vertical line with the given x-coordinate

Parameters
x_splitx-coordinate of vertical splitting line
dst_before_splitlocation to which to write the portion of the segment that comes before the splitting line
dst_after_splitlocation to which to write the portion of the segment that comes after the splitting line
Returns
how the segment was split. Note that if the return value is segment_completey_before_split or segment_completey_after_split then neither of dst_before_split and dst_after_split are written to.

◆ compute_split_y()

enum split_t fastuidraw::TessellatedPath::segment::compute_split_y ( float  y_split,
segment dst_before_split,
segment dst_after_split 
) const

Compute the splitting splitting of this segment against a horizontal line with the given y-coordinate

Parameters
y_splity-coordinate of horizontal splitting line
dst_before_splitlocation to which to write the portion of the segment that comes before the splitting line
dst_after_splitlocation to which to write the portion of the segment that comes after the splitting line
Returns
how the segment was split. Note that if the return value is segment_completey_before_split or segment_completey_after_split then neither of dst_before_split and dst_after_split are written to.

◆ enter_segment_normal()

vec2 fastuidraw::TessellatedPath::segment::enter_segment_normal ( void  ) const
inline

Returns the normal vector to the path at the start of the segment.

Definition at line 300 of file tessellated_path.hpp.

◆ leaving_segment_normal()

vec2 fastuidraw::TessellatedPath::segment::leaving_segment_normal ( void  ) const
inline

Returns the normal vector to the path at the end of the segment.

Definition at line 310 of file tessellated_path.hpp.

◆ split_segment()

void fastuidraw::TessellatedPath::segment::split_segment ( float  t,
segment dst_0_t,
segment dst_t_1 
) const

Split this segment at a time t where the start of the segment is at t = 0 and the end of the segment is t = 1.

Parameters
ttime to split the segment, must have that 0 <= t <= 1
dst_0_tlocation to which to write the portion of this segment on the interval [0, t].
dst_t_1location to which to write the portion of this segment on the interval [t, 1].

Member Data Documentation

◆ m_arc_angle

range_type<float> fastuidraw::TessellatedPath::segment::m_arc_angle

Only valid if m_type is arc_segment; gives the angle range of the arc.

Definition at line 206 of file tessellated_path.hpp.

◆ m_center

vec2 fastuidraw::TessellatedPath::segment::m_center

Only valid if m_type is arc_segment; gives the center of the arc.

Definition at line 200 of file tessellated_path.hpp.

◆ m_continuation_with_predecessor

bool fastuidraw::TessellatedPath::segment::m_continuation_with_predecessor

If true, indicates that the arc is a continuation of its predecessor. This happens when TessellatedPath breaks a segment into smaller pieces to make its angle smaller, to make it monotonic or if it is the second portion of a split segment as calculated from compute_split_x() or compute_split_y().

Definition at line 264 of file tessellated_path.hpp.

◆ m_contour_id

unsigned int fastuidraw::TessellatedPath::segment::m_contour_id

The contour from which the segment originates, i.e. the segment originates from the PathContour::interpolator_base PathContour::interpolator(m_edge_id) of the PathContour of Path::contour(m_contour_id).

Definition at line 273 of file tessellated_path.hpp.

◆ m_contour_length

float fastuidraw::TessellatedPath::segment::m_contour_length

Gives the length of the contour on which this segment lies. This value is the same for all segments along a fixed contour.

Definition at line 244 of file tessellated_path.hpp.

◆ m_distance_from_contour_start

float fastuidraw::TessellatedPath::segment::m_distance_from_contour_start

Gives the distance of the start of segment to the start of the -contour-.

Definition at line 229 of file tessellated_path.hpp.

◆ m_distance_from_edge_start

float fastuidraw::TessellatedPath::segment::m_distance_from_edge_start

Gives the distance of the start of the segment from the start of the edge (i.e PathContour::interpolator_base).

Definition at line 223 of file tessellated_path.hpp.

◆ m_edge_id

unsigned int fastuidraw::TessellatedPath::segment::m_edge_id

The edge from which the segment originates, i.e. the segment originates from the PathContour::interpolator_base PathContour::interpolator(m_edge_id) of the PathContour of Path::contour(m_contour_id).

Definition at line 282 of file tessellated_path.hpp.

◆ m_edge_length

float fastuidraw::TessellatedPath::segment::m_edge_length

Gives the length of the edge (i.e. PathContour::interpolator_base) on which the segment lies. This value is the same for all segments along a fixed edge.

Definition at line 237 of file tessellated_path.hpp.

◆ m_end_pt

vec2 fastuidraw::TessellatedPath::segment::m_end_pt

Gives the end point on the path of the segment.

Definition at line 194 of file tessellated_path.hpp.

◆ m_enter_segment_unit_vector

vec2 fastuidraw::TessellatedPath::segment::m_enter_segment_unit_vector

Gives the unit-vector of the path entering the segment.

Definition at line 249 of file tessellated_path.hpp.

◆ m_first_segment_of_edge

bool fastuidraw::TessellatedPath::segment::m_first_segment_of_edge

Indicates the this segment is the first segment of an edge

Definition at line 288 of file tessellated_path.hpp.

◆ m_last_segment_of_edge

bool fastuidraw::TessellatedPath::segment::m_last_segment_of_edge

Indicates the this segment is the last segment of an edge

Definition at line 294 of file tessellated_path.hpp.

◆ m_leaving_segment_unit_vector

vec2 fastuidraw::TessellatedPath::segment::m_leaving_segment_unit_vector

Gives the unit-vector of the path leaving the segment.

Definition at line 254 of file tessellated_path.hpp.

◆ m_length

float fastuidraw::TessellatedPath::segment::m_length

Gives the length of the segment.

Definition at line 217 of file tessellated_path.hpp.

◆ m_radius

float fastuidraw::TessellatedPath::segment::m_radius

Only valid if m_type is arc_segment; gives the radius of the arc.

Definition at line 212 of file tessellated_path.hpp.

◆ m_start_pt

vec2 fastuidraw::TessellatedPath::segment::m_start_pt

Gives the start point on the path of the segment.

Definition at line 189 of file tessellated_path.hpp.

◆ m_type

enum segment_type_t fastuidraw::TessellatedPath::segment::m_type

Specifies the segment type.

Definition at line 184 of file tessellated_path.hpp.


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