Blender  V3.3
Public Member Functions | List of all members
blender::bke::VArrayImpl_For_SplinePosition Class Referencefinal
Inheritance diagram for blender::bke::VArrayImpl_For_SplinePosition:
blender::VMutableArrayImpl< float3 > blender::VArrayImpl< T >

Public Member Functions

 VArrayImpl_For_SplinePosition (MutableSpan< SplinePtr > splines, Array< int > offsets)
 
float3 get (const int64_t index) const final
 
void set (const int64_t index, float3 value) final
 
void set_all (Span< float3 > src) final
 
Array< Span< float3 > > get_position_spans () const
 
void materialize (const IndexMask mask, MutableSpan< float3 > r_span) const final
 
void materialize_to_uninitialized (const IndexMask mask, MutableSpan< float3 > r_span) const final
 
- Public Member Functions inherited from blender::VMutableArrayImpl< float3 >
virtual bool try_assign_GVMutableArray (GVMutableArray &UNUSED(varray)) const
 
- Public Member Functions inherited from blender::VArrayImpl< T >
 VArrayImpl (const int64_t size)
 
virtual ~VArrayImpl ()=default
 
int64_t size () const
 
virtual CommonVArrayInfo common_info () const
 
virtual void materialize (IndexMask mask, MutableSpan< T > r_span) const
 
virtual void materialize_to_uninitialized (IndexMask mask, MutableSpan< T > r_span) const
 
virtual void materialize_compressed (IndexMask mask, MutableSpan< T > r_span) const
 
virtual void materialize_compressed_to_uninitialized (IndexMask mask, MutableSpan< T > r_span) const
 
virtual bool try_assign_GVArray (GVArray &UNUSED(varray)) const
 
virtual bool is_same (const VArrayImpl< T > &UNUSED(other)) const
 

Additional Inherited Members

- Protected Attributes inherited from blender::VArrayImpl< T >
int64_t size_
 

Detailed Description

Virtual array implementation specifically for control point positions. This is only needed for Bezier splines, where adjusting the position also requires adjusting handle positions depending on handle types. We pay a small price for this when other spline types are mixed with Bezier.

Note
There is no need to check the handle type to avoid changing auto handles, since retrieving write access to the position data will mark them for recomputation anyway.

Definition at line 707 of file geometry_component_curve.cc.

Constructor & Destructor Documentation

◆ VArrayImpl_For_SplinePosition()

blender::bke::VArrayImpl_For_SplinePosition::VArrayImpl_For_SplinePosition ( MutableSpan< SplinePtr splines,
Array< int >  offsets 
)
inline

Definition at line 713 of file geometry_component_curve.cc.

Member Function Documentation

◆ get()

float3 blender::bke::VArrayImpl_For_SplinePosition::get ( const int64_t  index) const
inlinefinalvirtual

Get the element at #index. This does not return a reference, because the value may be computed on the fly.

Implements blender::VArrayImpl< T >.

Definition at line 718 of file geometry_component_curve.cc.

References indices, and blender::bke::lookup_point_indices().

◆ get_position_spans()

Array<Span<float3> > blender::bke::VArrayImpl_For_SplinePosition::get_position_spans ( ) const
inline

Utility so we can pass positions to the materialize functions above.

Definition at line 742 of file geometry_component_curve.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), and blender::MutableSpan< T >::size().

Referenced by materialize(), and materialize_to_uninitialized().

◆ materialize()

void blender::bke::VArrayImpl_For_SplinePosition::materialize ( const IndexMask  mask,
MutableSpan< float3 r_span 
) const
inlinefinal

◆ materialize_to_uninitialized()

void blender::bke::VArrayImpl_For_SplinePosition::materialize_to_uninitialized ( const IndexMask  mask,
MutableSpan< float3 r_span 
) const
inlinefinal

◆ set()

void blender::bke::VArrayImpl_For_SplinePosition::set ( const int64_t  index,
float3  value 
)
inlinefinalvirtual

Assign the provided #value to the #index.

Implements blender::VMutableArrayImpl< float3 >.

Definition at line 724 of file geometry_component_curve.cc.

References indices, blender::bke::lookup_point_indices(), and Spline::positions().

◆ set_all()

void blender::bke::VArrayImpl_For_SplinePosition::set_all ( Span< float3 src)
inlinefinalvirtual

Copy all elements from the provided span into the virtual array.

Reimplemented from blender::VMutableArrayImpl< float3 >.

Definition at line 731 of file geometry_component_curve.cc.

References blender::MutableSpan< T >::index_range(), offset, Spline::positions(), spline_index, and src.


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