Blender  V3.3
Public Member Functions | Protected Member Functions | List of all members
PolySpline Class Referencefinal

#include <BKE_spline.hh>

Inheritance diagram for PolySpline:
Spline

Public Member Functions

 PolySpline ()
 
 PolySpline (const PolySpline &other)
 
int size () const final
 
void resize (int size) final
 
blender::MutableSpan< blender::float3positions () final
 
blender::Span< blender::float3positions () const final
 
blender::MutableSpan< floatradii () final
 
blender::Span< floatradii () const final
 
blender::MutableSpan< floattilts () final
 
blender::Span< floattilts () const final
 
void mark_cache_invalid () final
 
int evaluated_points_num () const final
 
blender::Span< blender::float3evaluated_positions () const final
 
blender::GVArray interpolate_to_evaluated (const blender::GVArray &src) const final
 
- Public Member Functions inherited from Spline
virtual ~Spline ()=default
 
 Spline (const CurveType type)
 
 Spline (Spline &other)
 
SplinePtr copy () const
 
SplinePtr copy_only_settings () const
 
SplinePtr copy_without_attributes () const
 
CurveType type () const
 
int segments_num () const
 
bool is_cyclic () const
 
void set_cyclic (bool value)
 
virtual void translate (const blender::float3 &translation)
 
virtual void transform (const blender::float4x4 &matrix)
 
void reverse ()
 
int evaluated_edges_num () const
 
float length () const
 
blender::Span< floatevaluated_lengths () const
 
blender::Span< blender::float3evaluated_tangents () const
 
blender::Span< blender::float3evaluated_normals () const
 
void bounds_min_max (blender::float3 &min, blender::float3 &max, bool use_evaluated) const
 
LookupResult lookup_evaluated_factor (float factor) const
 
LookupResult lookup_evaluated_length (float length) const
 
blender::Array< floatsample_uniform_index_factors (int samples_num) const
 
LookupResult lookup_data_from_index_factor (float index_factor) const
 
void sample_with_index_factors (const blender::GVArray &src, blender::Span< float > index_factors, blender::GMutableSpan dst) const
 
template<typename T >
void sample_with_index_factors (const blender::VArray< T > &src, blender::Span< float > index_factors, blender::MutableSpan< T > dst) const
 
template<typename T >
void sample_with_index_factors (blender::Span< T > src, blender::Span< float > index_factors, blender::MutableSpan< T > dst) const
 
blender::GVArray interpolate_to_evaluated (blender::GSpan data) const
 
template<typename T >
blender::VArray< Tinterpolate_to_evaluated (blender::Span< T > data) const
 

Protected Member Functions

void correct_end_tangents () const final
 
void copy_settings (Spline &dst) const final
 
void copy_data (Spline &dst) const final
 
void reverse_impl () override
 

Additional Inherited Members

- Static Public Member Functions inherited from Spline
static void copy_base_settings (const Spline &src, Spline &dst)
 
- Public Attributes inherited from Spline
NormalMode normal_mode = NORMAL_MODE_MINIMUM_TWIST
 
blender::bke::CustomDataAttributes attributes
 
- Protected Attributes inherited from Spline
CurveType type_
 
bool is_cyclic_ = false
 
blender::Vector< blender::float3evaluated_tangents_cache_
 
std::mutex tangent_cache_mutex_
 
bool tangent_cache_dirty_ = true
 
blender::Vector< blender::float3evaluated_normals_cache_
 
std::mutex normal_cache_mutex_
 
bool normal_cache_dirty_ = true
 
blender::Vector< floatevaluated_lengths_cache_
 
std::mutex length_cache_mutex_
 
bool length_cache_dirty_ = true
 

Detailed Description

A Poly spline is like a Bezier spline with a resolution of one. The main reason to distinguish the two is for reduced complexity and increased performance, since interpolating data to control points does not change it.

Poly spline code is very simple, since it doesn't do anything that the base Spline doesn't handle. Mostly it just worries about storing the data used by the base class.

Definition at line 557 of file BKE_spline.hh.

Constructor & Destructor Documentation

◆ PolySpline() [1/2]

PolySpline::PolySpline ( )
inline

Definition at line 563 of file BKE_spline.hh.

◆ PolySpline() [2/2]

PolySpline::PolySpline ( const PolySpline other)
inline

Definition at line 566 of file BKE_spline.hh.

Member Function Documentation

◆ copy_data()

void PolySpline::copy_data ( Spline dst) const
finalprotectedvirtual

Implements Spline.

Definition at line 18 of file spline_poly.cc.

◆ copy_settings()

void PolySpline::copy_settings ( Spline dst) const
finalprotectedvirtual

Implements Spline.

Definition at line 13 of file spline_poly.cc.

◆ correct_end_tangents()

void PolySpline::correct_end_tangents ( ) const
finalprotectedvirtual

Implements Spline.

Definition at line 84 of file spline_poly.cc.

◆ evaluated_points_num()

int PolySpline::evaluated_points_num ( ) const
finalvirtual

Implements Spline.

Definition at line 79 of file spline_poly.cc.

References size().

◆ evaluated_positions()

Span< float3 > PolySpline::evaluated_positions ( ) const
finalvirtual

Implements Spline.

Definition at line 88 of file spline_poly.cc.

References positions().

◆ interpolate_to_evaluated()

GVArray PolySpline::interpolate_to_evaluated ( const blender::GVArray src) const
finalvirtual

Poly spline interpolation from control points to evaluated points is a special case, since the result data is the same as the input data. This function returns a #GVArray that points to the original data. Therefore the lifetime of the returned virtual array must not be longer than the source data.

Implements Spline.

Definition at line 93 of file spline_poly.cc.

References BLI_assert, and src.

◆ mark_cache_invalid()

void PolySpline::mark_cache_invalid ( )
finalvirtual

Mark all caches for re-computation. This must be called after any operation that would change the generated positions, tangents, normals, mapping, etc. of the evaluated points.

Implements Spline.

Definition at line 72 of file spline_poly.cc.

References Spline::length_cache_dirty_, Spline::normal_cache_dirty_, and Spline::tangent_cache_dirty_.

Referenced by resize().

◆ positions() [1/2]

Span< float3 > PolySpline::positions ( ) const
finalvirtual

Implements Spline.

Definition at line 47 of file spline_poly.cc.

◆ positions() [2/2]

MutableSpan< float3 > PolySpline::positions ( )
finalvirtual

◆ radii() [1/2]

Span< float > PolySpline::radii ( ) const
finalvirtual

Implements Spline.

Definition at line 55 of file spline_poly.cc.

◆ radii() [2/2]

MutableSpan< float > PolySpline::radii ( )
finalvirtual

◆ resize()

void PolySpline::resize ( int  size)
finalvirtual

◆ reverse_impl()

void PolySpline::reverse_impl ( )
overrideprotectedvirtual

Implements Spline.

Definition at line 68 of file spline_poly.cc.

◆ size()

int PolySpline::size ( ) const
finalvirtual

Return the number of control points.

Implements Spline.

Definition at line 26 of file spline_poly.cc.

References BLI_assert, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().

Referenced by evaluated_points_num(), and resize().

◆ tilts() [1/2]

Span< float > PolySpline::tilts ( ) const
finalvirtual

Implements Spline.

Definition at line 63 of file spline_poly.cc.

◆ tilts() [2/2]

MutableSpan< float > PolySpline::tilts ( )
finalvirtual

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