FastUIDraw
Public Member Functions | Friends | List of all members
fastuidraw::PathContour::interpolator_base Class Referenceabstract

Base class to describe how to interpolate from one point of a PathContour to the next, i.e. describes the shape of an edge. More...

#include <path.hpp>

Inheritance diagram for fastuidraw::PathContour::interpolator_base:
Inheritance graph
[legend]

Public Member Functions

 interpolator_base (PathContour &contour, const vec2 &end, enum PathEnums::edge_type_t tp)
 
virtual enum return_code add_to_builder (ShaderFilledPath::Builder *builder, float tol) const
 
virtual void approximate_bounding_box (Rect *out_bb) const =0
 
virtual reference_counted_ptr< interpolator_basedeep_copy (PathContour &contour) const =0
 
enum PathEnums::edge_type_t edge_type (void) const
 
const vec2end_pt (void) const
 
virtual bool is_flat (void) const =0
 
virtual reference_counted_ptr< tessellation_stateproduce_tessellation (const TessellatedPath::TessellationParams &tess_params, TessellatedPath::SegmentStorage *out_data, float *out_max_distance) const =0
 
const vec2start_pt (void) const
 
- Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
 reference_counted_base (void)
 

Friends

class PathContour
 

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

Base class to describe how to interpolate from one point of a PathContour to the next, i.e. describes the shape of an edge.

Definition at line 94 of file path.hpp.

Constructor & Destructor Documentation

◆ interpolator_base()

fastuidraw::PathContour::interpolator_base::interpolator_base ( PathContour contour,
const vec2 end,
enum PathEnums::edge_type_t  tp 
)

Ctor.

Parameters
contourPathContour to which to add the interpolator. The interpolator is added to the contour at the interpolator's construction. The start point is computed from the current state of the PathContour.
endend point of the edge of this interpolator
tpnature the edge represented by this interpolator_base

Member Function Documentation

◆ add_to_builder()

virtual enum return_code fastuidraw::PathContour::interpolator_base::add_to_builder ( ShaderFilledPath::Builder builder,
float  tol 
) const
virtual

To be optionally implemented by a derived class to add this interpolator to a ShaderFilledPath::Builder. A return code of routine_fail means that the interpolator cannot be realized in such a way to be added and a Path that includes such an interpolator in a closed contour will be unable to realized a ShaderFilledPath value and Path::shader_filled_path() will return a null handle. Default implementation is to return routine_fail.

Parameters
builderobject to which to add interpolator.
tolerror goal between the interpolator and how it is realized on the ShaderFilledPath::Builder

Reimplemented in fastuidraw::PathContour::arc, fastuidraw::PathContour::bezier, and fastuidraw::PathContour::flat.

◆ approximate_bounding_box()

virtual void fastuidraw::PathContour::interpolator_base::approximate_bounding_box ( Rect out_bb) const
pure virtual

To be implemented by a derived class to return a fast (and approximate) bounding box for the interpolator.

Parameters
out_bb(output) location to which to write the bounding box value

Implemented in fastuidraw::PathContour::arc, fastuidraw::PathContour::bezier, and fastuidraw::PathContour::flat.

◆ deep_copy()

virtual reference_counted_ptr<interpolator_base> fastuidraw::PathContour::interpolator_base::deep_copy ( PathContour contour) const
pure virtual

To be implemented by a derived class to create and return a deep copy of the interpolator object.

Implemented in fastuidraw::PathContour::arc, fastuidraw::PathContour::bezier, and fastuidraw::PathContour::flat.

◆ edge_type()

enum PathEnums::edge_type_t fastuidraw::PathContour::interpolator_base::edge_type ( void  ) const

Returns the edge type.

◆ end_pt()

const vec2& fastuidraw::PathContour::interpolator_base::end_pt ( void  ) const

Returns the ending point of this interpolator

◆ is_flat()

virtual bool fastuidraw::PathContour::interpolator_base::is_flat ( void  ) const
pure virtual

To be implemented by a derived class to return true if the interpolator is flat, i.e. is just a line segment connecting start_pt() to end_pt().

Implemented in fastuidraw::PathContour::arc, fastuidraw::PathContour::bezier, and fastuidraw::PathContour::flat.

◆ produce_tessellation()

virtual reference_counted_ptr<tessellation_state> fastuidraw::PathContour::interpolator_base::produce_tessellation ( const TessellatedPath::TessellationParams tess_params,
TessellatedPath::SegmentStorage out_data,
float *  out_max_distance 
) const
pure virtual

To be implemented by a derived class to produce the arc-tessellation from start_pt() to end_pt(). In addition, for recursive tessellation, returns the tessellation state to be queried for recursion depth and reused to refine the tessellation. If the tessellation routine is not recursive in nature, return nullptr.

Parameters
tess_paramstessellation parameters
out_datalocation to which to write the tessellations
out_max_distancelocation to which to write an upperbound for the distance between the curve and the tesseallation approximation.

Implemented in fastuidraw::PathContour::arc, fastuidraw::PathContour::interpolator_generic, and fastuidraw::PathContour::flat.

◆ start_pt()

const vec2& fastuidraw::PathContour::interpolator_base::start_pt ( void  ) const

Returns the starting point of this interpolator.


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