Blender V4.3
blender::bke::CurvesGeometry Class Reference

#include <BKE_curves.hh>

Inherits CurvesGeometry.

Classes

struct  BlendWriteData
 

Public Member Functions

AttributeAccessor attributes () const
 
MutableAttributeAccessor attributes_for_write ()
 
template<typename T >
VArray< Tadapt_domain (const VArray< T > &varray, AttrDomain from, AttrDomain to) const
 
Constructors/Destructor
 CurvesGeometry ()
 
 CurvesGeometry (int point_num, int curve_num)
 
 CurvesGeometry (const CurvesGeometry &other)
 
 CurvesGeometry (CurvesGeometry &&other)
 
CurvesGeometryoperator= (const CurvesGeometry &other)
 
CurvesGeometryoperator= (CurvesGeometry &&other)
 
 ~CurvesGeometry ()
 
Accessors
Span< intoffsets () const
 
MutableSpan< intoffsets_for_write ()
 
VArray< int8_tcurve_types () const
 
MutableSpan< int8_tcurve_types_for_write ()
 
void fill_curve_types (CurveType type)
 
void fill_curve_types (const IndexMask &selection, CurveType type)
 
void update_curve_types ()
 
Span< float3positions () const
 
MutableSpan< float3positions_for_write ()
 
VArray< bool > cyclic () const
 
MutableSpan< bool > cyclic_for_write ()
 
VArray< intresolution () const
 
MutableSpan< intresolution_for_write ()
 
VArray< floattilt () const
 
MutableSpan< floattilt_for_write ()
 
VArray< int8_tnormal_mode () const
 
MutableSpan< int8_tnormal_mode_for_write ()
 
VArray< int8_thandle_types_left () const
 
MutableSpan< int8_thandle_types_left_for_write ()
 
VArray< int8_thandle_types_right () const
 
MutableSpan< int8_thandle_types_right_for_write ()
 
Span< float3handle_positions_left () const
 
MutableSpan< float3handle_positions_left_for_write ()
 
Span< float3handle_positions_right () const
 
MutableSpan< float3handle_positions_right_for_write ()
 
VArray< int8_tnurbs_orders () const
 
MutableSpan< int8_tnurbs_orders_for_write ()
 
VArray< int8_tnurbs_knots_modes () const
 
MutableSpan< int8_tnurbs_knots_modes_for_write ()
 
Span< floatnurbs_weights () const
 
MutableSpan< floatnurbs_weights_for_write ()
 
Span< float2surface_uv_coords () const
 
MutableSpan< float2surface_uv_coords_for_write ()
 
Span< MDeformVertdeform_verts () const
 
MutableSpan< MDeformVertdeform_verts_for_write ()
 
Operations
std::optional< Bounds< float3 > > bounds_min_max () const
 
void count_memory (MemoryCounter &memory) const
 
void resize (int points_num, int curves_num)
 
void tag_positions_changed ()
 
void tag_topology_changed ()
 
void tag_normals_changed ()
 
void tag_radii_changed ()
 
void translate (const float3 &translation)
 
void transform (const float4x4 &matrix)
 
void calculate_bezier_auto_handles ()
 
void remove_points (const IndexMask &points_to_delete, const AttributeFilter &attribute_filter)
 
void remove_curves (const IndexMask &curves_to_delete, const AttributeFilter &attribute_filter)
 
void reverse_curves (const IndexMask &curves_to_reverse)
 
void remove_attributes_based_on_types ()
 
Domain Interpolation
GVArray adapt_domain (const GVArray &varray, AttrDomain from, AttrDomain to) const
 
File reading/writing.
void blend_read (BlendDataReader &reader)
 
BlendWriteData blend_write_prepare ()
 
void blend_write (BlendWriter &writer, ID &id, const BlendWriteData &write_data)
 

#CurvesGeometry Inline Methods

int points_num () const
 
int curves_num () const
 
IndexRange points_range () const
 
IndexRange curves_range () const
 
OffsetIndices< intpoints_by_curve () const
 
bool has_curve_with_type (CurveType type) const
 
bool has_curve_with_type (Span< CurveType > types) const
 
bool is_single_type (CurveType type) const
 
const std::array< int, CURVE_TYPES_NUM > & curve_type_counts () const
 
int evaluated_points_num () const
 
Span< intbezier_evaluated_offsets_for_curve (int curve_index) const
 
Span< floatevaluated_lengths_for_curve (int curve_index, bool cyclic) const
 
float evaluated_length_total_for_curve (int curve_index, bool cyclic) const
 

Evaluation

IndexMask indices_for_curve_type (CurveType type, IndexMaskMemory &memory) const
 
IndexMask indices_for_curve_type (CurveType type, const IndexMask &selection, IndexMaskMemory &memory) const
 
Array< intpoint_to_curve_map () const
 
OffsetIndices< intevaluated_points_by_curve () const
 
Span< float3evaluated_positions () const
 
Span< float3evaluated_tangents () const
 
Span< float3evaluated_normals () const
 
void ensure_evaluated_lengths () const
 
void ensure_can_interpolate_to_evaluated () const
 
void interpolate_to_evaluated (int curve_index, GSpan src, GMutableSpan dst) const
 
void interpolate_to_evaluated (GSpan src, GMutableSpan dst) const
 

Additional Inherited Members

- Public Attributes inherited from CurvesGeometry
intcurve_offsets
 
CustomData point_data
 
CustomData curve_data
 
int point_num
 
int curve_num
 
ListBase vertex_group_names
 
int vertex_group_active_index
 
int attributes_active_index
 
CurvesGeometryRuntimeHandleruntime
 

Detailed Description

A C++ class that wraps the DNA struct for better encapsulation and ease of use. It inherits directly from the struct rather than storing a pointer to avoid more complicated ownership handling.

Definition at line 135 of file BKE_curves.hh.

Constructor & Destructor Documentation

◆ CurvesGeometry() [1/4]

CurvesGeometry::CurvesGeometry ( )

Definition at line 58 of file curves_geometry.cc.

Referenced by operator=(), and operator=().

◆ CurvesGeometry() [2/4]

◆ CurvesGeometry() [3/4]

◆ CurvesGeometry() [4/4]

◆ ~CurvesGeometry()

Member Function Documentation

◆ adapt_domain() [1/2]

◆ adapt_domain() [2/2]

template<typename T >
VArray< T > blender::bke::CurvesGeometry::adapt_domain ( const VArray< T > & varray,
AttrDomain from,
AttrDomain to ) const
inline

Definition at line 420 of file BKE_curves.hh.

References adapt_domain(), and blender::GVArray::typed().

◆ attributes()

AttributeAccessor CurvesGeometry::attributes ( ) const

Definition at line 719 of file geometry_component_curves.cc.

References blender::bke::get_curves_accessor_functions_ref().

Referenced by blender::ed::greasepencil::apply_color_operation_for_mode(), attr_create_generic(), blender::ed::greasepencil::bake_grease_pencil_animation_exec(), BKE_grease_pencil_material_index_used(), blender::bke::build_mesh_positions(), blender::ed::spreadsheet::GreasePencilLayerCurvesDomainViewItem::build_row(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::ed::greasepencil::create_curves_outline(), blender::create_dashes(), blender::create_envelope_strokes(), blender::ed::greasepencil::curves_geometry_is_equal(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_CurvesGeometry(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute(), export_hair_curves(), export_hair_curves_motion(), blender::geometry::extend_curves(), blender::geometry::extract_curves(), blender::geometry::extract_curves_points(), blender::geometry::extract_greasepencil_layer_curves(), blender::geometry::extract_greasepencil_layer_points(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::ed::greasepencil::fill_strokes(), blender::geometry::fillet_curves(), blender::geometry::gather_curve_attributes_to_interpolate(), blender::geometry::gather_point_attributes_to_interpolate(), blender::geometry::gather_point_attributes_to_interpolate(), blender::ed::greasepencil::get_boundary_bounds(), blender::bke::AttributeExistsFieldInput::get_varray_for_context(), blender::ed::greasepencil::get_visible_boundary_strokes(), blender::io::grease_pencil::get_visible_strokes(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::greasepencil::grease_pencil_copy_strokes_exec(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_attributes(), blender::geometry::join_curves_ranges(), blender::nodes::node_geo_deform_curves_on_surface_cc::node_geo_exec(), blender::nodes::node_geo_instance_on_points_cc::node_geo_exec(), OVERLAY_grease_pencil_material_names(), blender::geometry::reorder_and_flip_curves(), blender::geometry::reorder_curves_exec(), blender::reorder_cyclic_curve_points(), blender::draw::request_attribute(), blender::geometry::retrieve_attribute_spans(), blender::geometry::retrieve_attribute_spans(), blender::geometry::separate_curves_selection(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::geometry::subdivide_curves(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), and blender::geometry::trim_curves().

◆ attributes_for_write()

MutableAttributeAccessor CurvesGeometry::attributes_for_write ( )

Definition at line 724 of file geometry_component_curves.cc.

References blender::bke::get_curves_accessor_functions_ref().

Referenced by blender::ed::object::apply_eval_grease_pencil_data(), blender::nodes::ForeachElementComponent::attributes_for_write(), BKE_grease_pencil_material_index_remove(), BKE_grease_pencil_material_remap(), blender::build_concurrent(), blender::build_sequential(), blender::ed::greasepencil::clipboard_paste_strokes(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::create_array_copies(), blender::create_dashes(), blender::create_envelope_strokes(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::bke::curves_copy_curve_selection(), CurvesGeometry(), blender::deform_drawing(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::execute_realize_grease_pencil_task(), blender::geometry::extend_curves(), blender::geometry::extract_greasepencil_layer_curves(), blender::geometry::extract_greasepencil_layer_points(), blender::ed::greasepencil::extrude_grease_pencil_curves(), fill_curve_types(), blender::geometry::fillet_curves(), blender::geometry::gather_point_attributes_to_interpolate(), blender::generate_curves(), blender::bke::get_attribute_accessor_for_write(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::greasepencil::grease_pencil_vertex_paint_set_exec(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_attributes(), blender::geometry::join_curves_ranges(), MOD_lineart_gpencil_generate_v3(), blender::modify_fill_color(), blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_done(), blender::ed::greasepencil::remove_points_and_split(), blender::geometry::reorder_and_flip_curves(), blender::geometry::reorder_curves_exec(), blender::geometry::reorder_curves_geometry(), blender::reorder_cyclic_curve_points(), blender::ed::curves::resize_curves(), blender::geometry::retrieve_attribute_spans(), blender::geometry::retrieve_attribute_spans(), blender::nodes::node_geo_set_material_index_cc::set_material_index_in_grease_pencil(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::nodes::node_geo_interpolate_curves_cc::store_output_attributes(), blender::geometry::subdivide_curves(), and blender::geometry::trim_curves().

◆ bezier_evaluated_offsets_for_curve()

Span< int > CurvesGeometry::bezier_evaluated_offsets_for_curve ( int curve_index) const
inline

Retrieve offsets into a Bezier curve's evaluated points for each control point. Stored in the same format as #OffsetIndices. Call evaluated_points_by_curve() first to ensure that the evaluated offsets cache is current.

Definition at line 929 of file BKE_curves.hh.

References blender::Span< T >::data(), offsets(), blender::bke::curves::per_curve_point_offsets_range(), points_by_curve(), CurvesGeometry::runtime, and blender::Span< T >::slice().

Referenced by blender::geometry::lookup_point_bezier().

◆ blend_read()

◆ blend_write()

void CurvesGeometry::blend_write ( BlendWriter & writer,
ID & id,
const BlendWriteData & write_data )

◆ blend_write_prepare()

CurvesGeometry::BlendWriteData CurvesGeometry::blend_write_prepare ( )

This function needs to be called before blend_write and before the CurvesGeometry struct is written because it can mutate the CustomData struct.

Definition at line 1599 of file curves_geometry.cc.

References CustomData_blend_write_prepare().

◆ bounds_min_max()

std::optional< Bounds< float3 > > CurvesGeometry::bounds_min_max ( ) const

◆ calculate_bezier_auto_handles()

void CurvesGeometry::calculate_bezier_auto_handles ( )

◆ count_memory()

◆ curve_type_counts()

◆ curve_types()

◆ curve_types_for_write()

MutableSpan< int8_t > CurvesGeometry::curve_types_for_write ( )

Mutable access to curve types. Call tag_topology_changed and update_curve_types after changing any type. Consider using the other methods to change types below.

Definition at line 278 of file curves_geometry.cc.

References blender::bke::ATTR_CURVE_TYPE, blender::bke::Curve, and blender::bke::get_mutable_attribute().

Referenced by fill_curve_types(), and fill_curve_types().

◆ curves_num()

int CurvesGeometry::curves_num ( ) const
inline

The number of curves in the data-block.

Definition at line 874 of file BKE_curves.hh.

References CurvesGeometry::curve_num.

Referenced by blender::ed::curves::append_primitive_curve(), blender::build_drawing(), blender::bke::calculate_result_offsets(), blender::ed::greasepencil::clipboard_paste_strokes(), blender::ed::greasepencil::compute_topology_change(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::bke::curves::copy_only_curve_domain(), blender::bke::create_attribute_providers_for_curve(), blender::create_envelope_strokes(), blender::nodes::node_geo_curve_fill_cc::curve_fill_calculate(), blender::bke::curves_copy_curve_selection(), blender::ed::curves::curves_draw_exec(), blender::ed::greasepencil::curves_geometry_is_equal(), blender::ed::greasepencil::curves_merge_by_distance(), blender::geometry::curves_merge_endpoints(), blender::ed::greasepencil::curves_merge_endpoints_by_distance(), curves_range(), blender::ed::sculpt_paint::AddOperationExecutor::ensure_curve_roots_kdtree(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute(), blender::geometry::extend_curves(), blender::ed::curves::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), fill_curve_types(), blender::geometry::fillet_curves(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::greasepencil::grease_pencil_copy_strokes_exec(), blender::ed::greasepencil::grease_pencil_paste_strokes_poll(), blender::geometry::interpolate_curves(), is_single_type(), blender::ed::greasepencil::join_curves(), blender::geometry::join_curves(), blender::nodes::node_geo_curve_spline_type_cc::node_geo_exec(), blender::nodes::node_geo_instance_on_points_cc::node_geo_exec(), blender::nodes::node_geo_interpolate_curves_cc::parameterize_guide_curves(), blender::points_info_sequential(), blender::ed::sculpt_paint::DensityAddOperationExecutor::prepare_curve_roots_kdtrees(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_projected(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_spherical(), blender::reorder_cyclic_curve_points(), blender::geometry::resample_to_count(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), blender::ed::curves::resize_curves(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::stroke_eraser(), blender::geometry::subdivide_curves(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::trim_curves(), and blender::nodes::node_geo_curve_trim_cc::trim_curves().

◆ curves_range()

IndexRange CurvesGeometry::curves_range ( ) const
inline

Definition at line 882 of file BKE_curves.hh.

References curves_num().

Referenced by blender::ed::greasepencil::bake_grease_pencil_animation_exec(), blender::ed::greasepencil::compute_topology_change(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::create_envelope_strokes(), blender::ed::greasepencil::curves_merge_by_distance(), blender::ed::greasepencil::curves_merge_endpoints_by_distance(), blender::draw::DRW_curves_batch_cache_create_requested(), blender::ed::sculpt_paint::AddOperationExecutor::ensure_curve_roots_kdtree(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::execute(), blender::geometry::extend_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::nodes::node_geo_curve_fillet_cc::fillet_curve(), blender::geometry::fillet_curves(), blender::geometry::find_connected_ranges(), blender::ed::sculpt_paint::greasepencil::find_curve_mapping_from_index(), blender::ed::greasepencil::trim::get_intersections_of_curve_with_curves(), blender::ed::greasepencil::get_visible_boundary_strokes(), blender::io::grease_pencil::get_visible_strokes(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_sequence_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_update(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::hard_eraser(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_attributes(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_shapes(), blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_done(), OVERLAY_grease_pencil_material_names(), blender::nodes::node_geo_interpolate_curves_cc::parameterize_guide_curves(), blender::ed::sculpt_paint::DensityAddOperationExecutor::prepare_curve_roots_kdtrees(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_projected(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_spherical(), blender::geometry::resample_to_count(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), blender::geometry::resample_to_uniform(), blender::ed::greasepencil::retrieve_editable_strokes_by_material(), blender::ed::greasepencil::retrieve_visible_strokes(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::nodes::node_geo_interpolate_curves_cc::store_output_attributes(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::stroke_eraser(), blender::geometry::subdivide_curves(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_curves(), blender::subdivide_drawing(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_grease_pencil_curves(), blender::ed::greasepencil::trim::trim_curve_segments(), and blender::geometry::trim_curves().

◆ cyclic()

VArray< bool > CurvesGeometry::cyclic ( ) const

Whether the curve loops around to connect to itself, on the curve domain.

Definition at line 379 of file curves_geometry.cc.

References blender::bke::ATTR_CYCLIC.

Referenced by blender::ed::greasepencil::compute_topology_change(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::create_dashes(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::curves_intersections_and_points_sides(), blender::ed::greasepencil::curves_merge_by_distance(), blender::geometry::curves_merge_endpoints(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::geometry::fillet_curves(), blender::ed::greasepencil::trim::get_intersections_of_curve_with_curves(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_sequence_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_update(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::hard_eraser(), blender::geometry::interpolate_curves(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::stroke_eraser(), blender::geometry::subdivide_curves(), blender::bke::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::trim_catmull_rom_curves(), and blender::ed::greasepencil::trim::trim_curve_segments().

◆ cyclic_for_write()

◆ deform_verts()

Span< MDeformVert > CurvesGeometry::deform_verts ( ) const

Vertex group data, encoded as an array of indices and weights for every vertex.

Warning
: May be empty.

Definition at line 488 of file curves_geometry.cc.

References CD_MDEFORMVERT, and CustomData_get_layer().

◆ deform_verts_for_write()

MutableSpan< MDeformVert > CurvesGeometry::deform_verts_for_write ( )

◆ ensure_can_interpolate_to_evaluated()

void CurvesGeometry::ensure_can_interpolate_to_evaluated ( ) const

Definition at line 1033 of file curves_geometry.cc.

Referenced by blender::geometry::resample_to_evaluated().

◆ ensure_evaluated_lengths()

◆ evaluated_length_total_for_curve()

float CurvesGeometry::evaluated_length_total_for_curve ( int curve_index,
bool cyclic ) const
inline

◆ evaluated_lengths_for_curve()

Span< float > CurvesGeometry::evaluated_lengths_for_curve ( int curve_index,
bool cyclic ) const
inline

Return a cache of accumulated lengths along the curve. Each item is the length of the subsequent segment (the first value is the length of the first segment rather than 0). This calculation is rather trivial, and only depends on the evaluated positions, but the results are used often, and it is necessarily single threaded per curve, so it is cached.

Parameters
cyclicThis argument is redundant with the data stored for the curve, but is passed for performance reasons to avoid looking up the attribute.

Definition at line 947 of file BKE_curves.hh.

References CurvesGeometry::runtime.

Referenced by evaluated_length_total_for_curve(), blender::geometry::interpolate_curves(), and blender::geometry::resample_to_uniform().

◆ evaluated_normals()

◆ evaluated_points_by_curve()

◆ evaluated_points_num()

int CurvesGeometry::evaluated_points_num ( ) const
inline

The total number of points in the evaluated poly curve. This can depend on the resolution attribute if it exists.

Definition at line 923 of file BKE_curves.hh.

References evaluated_points_by_curve().

Referenced by blender::ed::greasepencil::build_curves_2d_bvh_from_visible(), and blender::draw::grease_pencil_edit_batch_ensure().

◆ evaluated_positions()

◆ evaluated_tangents()

◆ fill_curve_types() [1/2]

void CurvesGeometry::fill_curve_types ( const IndexMask & selection,
CurveType type )

◆ fill_curve_types() [2/2]

◆ handle_positions_left()

Span< float3 > CurvesGeometry::handle_positions_left ( ) const

The positions of Bezier curve handles. Though these are really control points for the Bezier segments, they are stored in separate arrays to better reflect user expectations. Note that values may be generated automatically based on the handle types. Call tag_positions_changed after changes.

Definition at line 433 of file curves_geometry.cc.

References blender::bke::ATTR_HANDLE_POSITION_LEFT.

Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::geometry::fillet_curves(), blender::geometry::subdivide_curves(), and blender::geometry::trim_bezier_curves().

◆ handle_positions_left_for_write()

◆ handle_positions_right()

◆ handle_positions_right_for_write()

◆ handle_types_left()

VArray< int8_t > CurvesGeometry::handle_types_left ( ) const

◆ handle_types_left_for_write()

◆ handle_types_right()

◆ handle_types_right_for_write()

◆ has_curve_with_type() [1/2]

◆ has_curve_with_type() [2/2]

bool CurvesGeometry::has_curve_with_type ( Span< CurveType > types) const
inline

Definition at line 897 of file BKE_curves.hh.

◆ indices_for_curve_type() [1/2]

IndexMask CurvesGeometry::indices_for_curve_type ( CurveType type,
const IndexMask & selection,
IndexMaskMemory & memory ) const

Definition at line 609 of file curves_geometry.cc.

◆ indices_for_curve_type() [2/2]

IndexMask CurvesGeometry::indices_for_curve_type ( CurveType type,
IndexMaskMemory & memory ) const

All of the curve indices for curves with a specific type.

Definition at line 603 of file curves_geometry.cc.

◆ interpolate_to_evaluated() [1/2]

void CurvesGeometry::interpolate_to_evaluated ( GSpan src,
GMutableSpan dst ) const

◆ interpolate_to_evaluated() [2/2]

void CurvesGeometry::interpolate_to_evaluated ( int curve_index,
GSpan src,
GMutableSpan dst ) const

Evaluate a generic data to the standard evaluated points of a specific curve, defined by the resolution attribute or other factors, depending on the curve type.

Warning
This function expects offsets to the evaluated points for each curve to be calculated. That can be ensured with ensure_can_interpolate_to_evaluated.

Definition at line 960 of file curves_geometry.cc.

References BLI_assert, blender::bke::evaluate_generic_data_for_curve(), blender::bke::CurvesGeometryRuntime::evaluated_offsets_cache, blender::bke::CurvesGeometryRuntime::nurbs_basis_cache, blender::GMutableSpan::size(), and blender::GSpan::size().

Referenced by blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_uniform(), and blender::geometry::sample_curve_attribute().

◆ is_single_type()

bool CurvesGeometry::is_single_type ( CurveType type) const
inline

Return true if all of the curves have the provided type.

Definition at line 887 of file BKE_curves.hh.

References curve_type_counts(), and curves_num().

Referenced by blender::nodes::node_geo_curve_spline_type_cc::node_geo_exec().

◆ normal_mode()

VArray< int8_t > CurvesGeometry::normal_mode ( ) const

Which method to use for calculating the normals of evaluated points (NormalMode). Call tag_normals_changed after changes.

Definition at line 397 of file curves_geometry.cc.

References blender::bke::ATTR_NORMAL_MODE.

◆ normal_mode_for_write()

MutableSpan< int8_t > CurvesGeometry::normal_mode_for_write ( )

Definition at line 401 of file curves_geometry.cc.

References blender::bke::ATTR_NORMAL_MODE.

◆ nurbs_knots_modes()

VArray< int8_t > CurvesGeometry::nurbs_knots_modes ( ) const

The automatic generation mode for each NURBS curve's knots vector, on the curve domain. Call tag_topology_changed after changes.

Definition at line 469 of file curves_geometry.cc.

References blender::bke::ATTR_NURBS_KNOTS_MODE.

Referenced by blender::geometry::convert_curves_to_bezier().

◆ nurbs_knots_modes_for_write()

MutableSpan< int8_t > CurvesGeometry::nurbs_knots_modes_for_write ( )

◆ nurbs_orders()

VArray< int8_t > CurvesGeometry::nurbs_orders ( ) const

The order (degree plus one) of each NURBS curve, on the curve domain. Call tag_topology_changed after changes.

Definition at line 451 of file curves_geometry.cc.

References blender::bke::ATTR_NURBS_ORDER.

◆ nurbs_orders_for_write()

MutableSpan< int8_t > CurvesGeometry::nurbs_orders_for_write ( )

◆ nurbs_weights()

Span< float > CurvesGeometry::nurbs_weights ( ) const

The weight for each control point for NURBS curves. Call tag_positions_changed after changes.

Definition at line 460 of file curves_geometry.cc.

References blender::bke::ATTR_NURBS_WEIGHT.

Referenced by blender::geometry::convert_curves_to_nurbs().

◆ nurbs_weights_for_write()

MutableSpan< float > CurvesGeometry::nurbs_weights_for_write ( )

◆ offsets()

◆ offsets_for_write()

MutableSpan< int > CurvesGeometry::offsets_for_write ( )

Definition at line 369 of file curves_geometry.cc.

References blender::implicit_sharing::make_trivial_data_mutable().

Referenced by blender::build_concurrent(), blender::build_sequential(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::create_dashes(), blender::create_envelope_strokes(), blender::bke::curves_copy_curve_selection(), blender::ed::greasepencil::curves_merge_by_distance(), blender::bke::curves_new_nomain_single(), CurvesGeometry(), blender::geometry::execute_realize_curve_task(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::extend_curves(), blender::geometry::extract_greasepencil_layer_points(), blender::ed::curves::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::geometry::fillet_curves(), blender::nodes::node_geo_interpolate_curves_cc::generate_interpolated_curves(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::geometry::join_curves_ranges(), MOD_lineart_gpencil_generate_v3(), blender::ed::space_node::node_draw_zones_and_frames(), blender::ed::greasepencil::remove_points_and_split(), blender::geometry::reorder_and_flip_curves(), blender::geometry::reorder_curves_exec(), blender::geometry::resample_to_count(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), blender::ed::curves::resize_curves(), blender::geometry::subdivide_curves(), and blender::geometry::trim_curves().

◆ operator=() [1/2]

CurvesGeometry & CurvesGeometry::operator= ( const CurvesGeometry & other)

Definition at line 131 of file curves_geometry.cc.

References CurvesGeometry().

◆ operator=() [2/2]

CurvesGeometry & CurvesGeometry::operator= ( CurvesGeometry && other)

Definition at line 171 of file curves_geometry.cc.

References CurvesGeometry().

◆ point_to_curve_map()

◆ points_by_curve()

OffsetIndices< int > CurvesGeometry::points_by_curve ( ) const
inline

The offsets of every curve into arrays on the points domain.

Definition at line 917 of file BKE_curves.hh.

References CurvesGeometry::curve_num, and CurvesGeometry::curve_offsets.

Referenced by bezier_evaluated_offsets_for_curve(), blender::geometry::calculate_result_offsets(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical(), blender::io::grease_pencil::compute_drawing_bounds(), blender::nodes::node_geo_interpolate_curves_cc::compute_point_counts_per_child(), blender::nodes::node_geo_interpolate_curves_cc::compute_points_per_curve_by_group(), blender::ed::greasepencil::compute_topology_change(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id(), blender::geometry::copy_or_defaults_for_unselected_curves(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::create_dashes(), blender::create_envelope_strokes(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::curves_intersections_and_points_sides(), blender::ed::greasepencil::curves_merge_by_distance(), blender::ed::greasepencil::curves_merge_endpoints_by_distance(), blender::deform_drawing(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical(), blender::ed::sculpt_paint::greasepencil::deselect_stroke(), blender::draw::DRW_curves_batch_cache_create_requested(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::greasepencil::execute_trim_on_drawing(), blender::ed::greasepencil::trim::expand_trim_segment_direction(), export_hair_curves(), export_hair_curves_motion(), blender::geometry::extend_curves(), blender::geometry::extract_curves(), blender::geometry::extract_greasepencil_layer_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::geometry::fill_bezier_data(), blender::geometry::fill_nurbs_data(), blender::geometry::fillet_curves(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curves_weights_spherical(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_spherical_smooth_factors(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical(), blender::ed::greasepencil::get_boundary_bounds(), blender::ed::greasepencil::trim::get_intersections_of_curve_with_curves(), blender::ed::greasepencil::get_visible_boundary_strokes(), blender::io::grease_pencil::get_visible_strokes(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_sequence_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_update(), blender::ed::greasepencil::grease_pencil_primitive_update_curves(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::hard_eraser(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_attributes(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_shapes(), blender::geometry::interpolate_curves(), blender::geometry::join_curves_ranges(), blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_done(), OVERLAY_grease_pencil_material_names(), blender::nodes::node_geo_interpolate_curves_cc::parameterize_guide_curves(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::reorder_cyclic_curve_points(), blender::geometry::resample_to_count(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), blender::geometry::resample_to_uniform(), blender::ed::curves::resize_curves(), blender::geometry::sample_curve_attribute(), blender::ed::sculpt_paint::SlideOperationExecutor::slide(), blender::ed::sculpt_paint::SmoothOperationExecutor::smooth(), blender::ed::sculpt_paint::greasepencil::smooth_stroke(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::stroke_eraser(), blender::geometry::subdivide_curves(), blender::subdivide_drawing(), blender::geometry::trim_attribute_linear(), blender::geometry::trim_bezier_curves(), blender::geometry::trim_catmull_rom_curves(), blender::ed::greasepencil::trim::trim_curve_segments(), blender::geometry::trim_curves(), blender::ed::sculpt_paint::greasepencil::trim_end_points(), blender::geometry::trim_evaluated_curves(), and blender::geometry::trim_polygonal_curves().

◆ points_num()

int CurvesGeometry::points_num ( ) const
inline

The total number of control points in all curves.

Definition at line 870 of file BKE_curves.hh.

References CurvesGeometry::point_num.

Referenced by blender::ed::curves::append_primitive_curve(), BKE_grease_pencil_stroke_point_count(), blender::bke::build_mesh_positions(), blender::bke::create_attribute_providers_for_curve(), blender::create_envelope_strokes(), blender::ed::greasepencil::curves_geometry_is_equal(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::curves_intersections_and_points_sides(), blender::ed::greasepencil::curves_merge_by_distance(), blender::deform_drawing(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_CurvesGeometry(), blender::duplicate_strokes(), blender::ed::curves::subdivide::exec(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::execute(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::ed::greasepencil::execute_trim_on_drawing(), blender::geometry::extend_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::nodes::node_geo_curve_fillet_cc::fillet_curve(), blender::geometry::fillet_curves(), blender::geometry::fillet_curves_bezier(), blender::nodes::node_geo_curve_fillet_cc::fillet_grease_pencil(), blender::bke::get_curves_accessor_functions(), blender::bke::crazyspace::get_evaluated_curves_deformation(), blender::bke::crazyspace::get_evaluated_grease_pencil_drawing_deformation(), blender::ed::greasepencil::grease_pencil_copy_strokes_exec(), blender::draw::grease_pencil_edit_batch_ensure(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_sequence_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_update(), blender::ed::greasepencil::grease_pencil_primitive_init_curves(), blender::draw::grease_pencil_weight_batch_ensure(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::hard_eraser(), blender::geometry::interpolate_curves(), blender::geometry::join_curves_ranges(), blender::ed::sculpt_paint::greasepencil::TintOperation::on_stroke_begin(), blender::ed::curves::point_normals_array_create(), points_range(), blender::bke::remember_deformed_curve_positions_if_necessary(), blender::bke::remember_deformed_grease_pencil_if_necessary(), blender::reorder_cyclic_curve_points(), blender::geometry::resample_to_uniform(), blender::nodes::node_geo_set_position_cc::set_position_in_grease_pencil(), blender::ed::sculpt_paint::greasepencil::simplify_stroke(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::geometry::subdivide_curves(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_curves(), blender::subdivide_drawing(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_grease_pencil_curves(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::geometry::tests::TEST(), blender::ed::greasepencil::trim::trim_curve_segments(), and blender::ed::sculpt_paint::greasepencil::trim_stroke_ends().

◆ points_range()

◆ positions()

◆ positions_for_write()

MutableSpan< float3 > CurvesGeometry::positions_for_write ( )

Definition at line 357 of file curves_geometry.cc.

References ATTR_POSITION.

Referenced by blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::geometry::copy_or_defaults_for_unselected_curves(), blender::deform_drawing(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::geometry::execute_realize_curve_task(), blender::geometry::extend_curves(), blender::geometry::fillet_curves(), blender::generate_curves(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_sequence_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_update(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_shapes(), blender::geometry::interpolate_curves(), MOD_lineart_gpencil_generate_v3(), blender::ed::space_node::node_draw_zones_and_frames(), blender::ed::object::object_convert_exec(), blender::ed::sculpt_paint::greasepencil::outline_stroke(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_uniform(), blender::ed::sculpt_paint::SlideOperationExecutor::slide(), blender::ed::sculpt_paint::SmoothOperationExecutor::smooth(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook(), blender::geometry::subdivide_curves(), blender::subdivide_drawing(), blender::geometry::trim_bezier_curves(), blender::geometry::trim_catmull_rom_curves(), blender::geometry::trim_evaluated_curves(), and blender::geometry::trim_polygonal_curves().

◆ remove_attributes_based_on_types()

◆ remove_curves()

◆ remove_points()

◆ resize()

void CurvesGeometry::resize ( int points_num,
int curves_num )

◆ resolution()

VArray< int > CurvesGeometry::resolution ( ) const

How many evaluated points to create for each segment when evaluating Bezier, Catmull Rom, and NURBS curves. On the curve domain. Values must be one or greater.

Definition at line 388 of file curves_geometry.cc.

References blender::bke::ATTR_RESOLUTION.

◆ resolution_for_write()

MutableSpan< int > CurvesGeometry::resolution_for_write ( )

Mutable access to curve resolution. Call tag_topology_changed after changes.

Definition at line 392 of file curves_geometry.cc.

References blender::bke::ATTR_RESOLUTION.

◆ reverse_curves()

◆ surface_uv_coords()

Span< float2 > CurvesGeometry::surface_uv_coords ( ) const

UV coordinate for each curve that encodes where the curve is attached to the surface mesh.

Definition at line 478 of file curves_geometry.cc.

References blender::bke::ATTR_SURFACE_UV_COORDINATE.

Referenced by blender::ed::sculpt_paint::SlideOperationExecutor::execute(), and blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide().

◆ surface_uv_coords_for_write()

MutableSpan< float2 > CurvesGeometry::surface_uv_coords_for_write ( )

◆ tag_normals_changed()

void CurvesGeometry::tag_normals_changed ( )

Call after changing the "tilt" or "up" attributes.

Definition at line 1080 of file curves_geometry.cc.

References blender::bke::CurvesGeometryRuntime::evaluated_normal_cache.

Referenced by blender::bke::tag_component_normals_changed().

◆ tag_positions_changed()

◆ tag_radii_changed()

void CurvesGeometry::tag_radii_changed ( )

Call when making manual changes to the "radius" attribute. The attribute API will also call this in #finish() calls.

Definition at line 1084 of file curves_geometry.cc.

Referenced by blender::bke::tag_component_radii_changed().

◆ tag_topology_changed()

◆ tilt()

VArray< float > CurvesGeometry::tilt ( ) const

The angle used to rotate evaluated normals around the tangents after their calculation. Call tag_normals_changed after changes.

Definition at line 406 of file curves_geometry.cc.

References blender::bke::ATTR_TILT.

◆ tilt_for_write()

MutableSpan< float > CurvesGeometry::tilt_for_write ( )

Definition at line 410 of file curves_geometry.cc.

References blender::bke::ATTR_TILT.

◆ transform()

◆ translate()

◆ update_curve_types()


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