Blender
V3.3
|
#include <BKE_spline.hh>
Classes | |
struct | BasisCache |
Public Attributes | |
KnotsMode | knots_mode |
![]() | |
NormalMode | normal_mode = NORMAL_MODE_MINIMUM_TWIST |
blender::bke::CustomDataAttributes | attributes |
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 |
void | calculate_knots () const |
const BasisCache & | calculate_basis_cache () const |
Additional Inherited Members | |
![]() | |
static void | copy_base_settings (const Spline &src, Spline &dst) |
![]() | |
CurveType | type_ |
bool | is_cyclic_ = false |
blender::Vector< blender::float3 > | evaluated_tangents_cache_ |
std::mutex | tangent_cache_mutex_ |
bool | tangent_cache_dirty_ = true |
blender::Vector< blender::float3 > | evaluated_normals_cache_ |
std::mutex | normal_cache_mutex_ |
bool | normal_cache_dirty_ = true |
blender::Vector< float > | evaluated_lengths_cache_ |
std::mutex | length_cache_mutex_ |
bool | length_cache_dirty_ = true |
Data for Non-Uniform Rational B-Splines. The mapping from control points to evaluated points is influenced by a vector of knots, weights for each point, and the order of the spline. Every mapping of data to evaluated points is handled the same way, but the positions are cached in the spline.
Definition at line 443 of file BKE_spline.hh.
|
inline |
Definition at line 496 of file BKE_spline.hh.
|
inline |
Definition at line 499 of file BKE_spline.hh.
|
protected |
Definition at line 276 of file spline_nurbs.cc.
References calculate_basis_for_point(), blender::math::clamp(), Spline::evaluated_edges_num(), evaluated_points_num(), blender::MutableSpan< T >::index_range(), Spline::is_cyclic_, knots(), lock, order(), point_index, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), size(), blender::MutableSpan< T >::slice(), NURBSpline::BasisCache::start_indices, NURBSpline::BasisCache::weights, and weights().
Referenced by interpolate_to_evaluated().
|
protected |
Definition at line 161 of file spline_nurbs.cc.
References ELEM, Spline::is_cyclic_, knots(), knots_mode, knots_num(), min_ii(), NURBS_KNOT_MODE_BEZIER, NURBS_KNOT_MODE_ENDPOINT, NURBS_KNOT_MODE_ENDPOINT_BEZIER, offset, order(), r, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), and blender::Span< T >::size().
Referenced by knots().
bool NURBSpline::check_valid_num_and_order | ( | ) | const |
Definition at line 139 of file spline_nurbs.cc.
References ELEM, Spline::is_cyclic_, knots_mode, NURBS_KNOT_MODE_BEZIER, NURBS_KNOT_MODE_ENDPOINT_BEZIER, and size().
Referenced by evaluated_points_num().
Implements Spline.
Definition at line 26 of file spline_nurbs.cc.
|
finalprotectedvirtual |
Implements Spline.
Definition at line 135 of file spline_nurbs.cc.
|
finalvirtual |
Implements Spline.
Definition at line 127 of file spline_nurbs.cc.
References check_valid_num_and_order(), and Spline::segments_num().
Referenced by calculate_basis_cache(), and evaluated_positions().
Implements Spline.
Definition at line 375 of file spline_nurbs.cc.
References evaluated_points_num(), Spline::interpolate_to_evaluated(), lock, and blender::VArrayCommon< T >::materialize().
|
finalvirtual |
Interpolate a virtual array of data with the size of the number of control points to the evaluated points. For poly splines, the lifetime of the returned virtual array must not exceed the lifetime of the input data.
Implements Spline.
Definition at line 352 of file spline_nurbs.cc.
References BLI_assert, calculate_basis_cache(), blender::attribute_math::convert_to_static_type(), and src.
Definition at line 203 of file spline_nurbs.cc.
References BLI_assert, calculate_knots(), lock, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
Referenced by calculate_basis_cache(), and calculate_knots().
int NURBSpline::knots_num | ( | ) | const |
Definition at line 155 of file spline_nurbs.cc.
References Spline::is_cyclic_, and size().
Referenced by calculate_knots().
|
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 118 of file spline_nurbs.cc.
References Spline::length_cache_dirty_, Spline::normal_cache_dirty_, and Spline::tangent_cache_dirty_.
Referenced by resize(), set_order(), and set_resolution().
uint8_t NURBSpline::order | ( | ) | const |
Definition at line 58 of file spline_nurbs.cc.
Referenced by calculate_basis_cache(), and calculate_knots().
Implements Spline.
Definition at line 84 of file spline_nurbs.cc.
|
finalvirtual |
Implements Spline.
Definition at line 80 of file spline_nurbs.cc.
Implements Spline.
Definition at line 92 of file spline_nurbs.cc.
|
finalvirtual |
Implements Spline.
Definition at line 88 of file spline_nurbs.cc.
|
finalvirtual |
Implements Spline.
Definition at line 70 of file spline_nurbs.cc.
References Spline::attributes, mark_cache_invalid(), blender::bke::CustomDataAttributes::reallocate(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), and size().
int NURBSpline::resolution | ( | ) | const |
Definition at line 46 of file spline_nurbs.cc.
|
overrideprotectedvirtual |
Definition at line 63 of file spline_nurbs.cc.
References BLI_assert, and mark_cache_invalid().
void NURBSpline::set_resolution | ( | int | value | ) |
Definition at line 51 of file spline_nurbs.cc.
References BLI_assert, and mark_cache_invalid().
|
finalvirtual |
Return the number of control points.
Implements Spline.
Definition at line 37 of file spline_nurbs.cc.
References BLI_assert, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
Referenced by calculate_basis_cache(), check_valid_num_and_order(), knots_num(), and resize().
Implements Spline.
Definition at line 100 of file spline_nurbs.cc.
|
finalvirtual |
Implements Spline.
Definition at line 96 of file spline_nurbs.cc.
MutableSpan< float > NURBSpline::weights | ( | ) |
Definition at line 104 of file spline_nurbs.cc.
Referenced by calculate_basis_cache(), and reverse_impl().
Definition at line 108 of file spline_nurbs.cc.
KnotsMode NURBSpline::knots_mode |
Method used to recalculate the knots vector when points are added or removed.
Definition at line 446 of file BKE_spline.hh.
Referenced by calculate_knots(), check_valid_num_and_order(), and copy_settings().