Blender
V3.3
|
#include <BKE_curves.hh>
Static Public Member Functions | |
static CurvesGeometry & | wrap (::CurvesGeometry &dna_struct) |
static const CurvesGeometry & | wrap (const ::CurvesGeometry &dna_struct) |
#CurvesGeometry Inline Methods | |
int | points_num () const |
int | curves_num () const |
IndexRange | points_range () const |
IndexRange | curves_range () const |
IndexRange | points_for_curve (int index) const |
IndexRange | points_for_curves (IndexRange curves) 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 |
IndexRange | evaluated_points_for_curve (int index) const |
IndexRange | evaluated_points_for_curves (IndexRange curves) const |
Span< int > | bezier_evaluated_offsets_for_curve (int curve_index) const |
Span< float > | evaluated_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, Vector< int64_t > &r_indices) const |
IndexMask | indices_for_curve_type (CurveType type, IndexMask selection, Vector< int64_t > &r_indices) const |
Span< int > | evaluated_offsets () const |
void | ensure_evaluated_offsets () const |
Span< float3 > | evaluated_positions () const |
Span< float3 > | evaluated_tangents () const |
Span< float3 > | evaluated_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 | |
![]() | |
int * | curve_offsets |
CustomData | point_data |
CustomData | curve_data |
int | point_num |
int | curve_num |
CurvesGeometryRuntimeHandle * | runtime |
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 124 of file BKE_curves.hh.
CurvesGeometry::CurvesGeometry | ( | ) |
Definition at line 47 of file curves_geometry.cc.
CurvesGeometry::CurvesGeometry | ( | int | point_num, |
int | curve_num | ||
) |
Create curves with the given size. Only the position attribute is created, along with the offsets.
Definition at line 51 of file curves_geometry.cc.
References blender::bke::ATTR_POSITION, CD_DEFAULT, CD_PROP_FLOAT3, CurvesGeometry::curve_data, CurvesGeometry::curve_num, CurvesGeometry::curve_offsets, CURVE_TYPE_CATMULL_ROM, CustomData_add_layer_named(), CustomData_reset(), MEM_malloc_arrayN, offsets_for_write(), CurvesGeometry::point_data, CurvesGeometry::point_num, and CurvesGeometry::runtime.
CurvesGeometry::CurvesGeometry | ( | const CurvesGeometry & | other | ) |
Definition at line 98 of file curves_geometry.cc.
References blender::bke::copy_curves_geometry().
CurvesGeometry::CurvesGeometry | ( | CurvesGeometry && | other | ) |
Definition at line 131 of file curves_geometry.cc.
References blender::bke::move_curves_geometry().
CurvesGeometry::~CurvesGeometry | ( | ) |
Definition at line 145 of file curves_geometry.cc.
References CurvesGeometry::curve_data, CurvesGeometry::curve_num, CurvesGeometry::curve_offsets, CustomData_free(), MEM_SAFE_FREE, CurvesGeometry::point_data, CurvesGeometry::point_num, and CurvesGeometry::runtime.
Referenced by curves_free_data().
GVArray CurvesGeometry::adapt_domain | ( | const GVArray & | varray, |
eAttrDomain | from, | ||
eAttrDomain | to | ||
) | const |
Definition at line 1542 of file curves_geometry.cc.
References blender::bke::adapt_curve_domain_curve_to_point(), blender::bke::adapt_curve_domain_point_to_curve(), ATTR_DOMAIN_CURVE, ATTR_DOMAIN_POINT, BLI_assert_unreachable, from, and blender::GVArrayCommon::is_empty().
Referenced by adapt_domain().
|
inline |
Definition at line 414 of file BKE_curves.hh.
References adapt_domain(), from, T, and blender::GVArray::typed().
AttributeAccessor CurvesGeometry::attributes | ( | ) | const |
Definition at line 621 of file geometry_component_curves.cc.
References blender::bke::get_curves_accessor_functions_ref().
Referenced by blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::bke::curve_to_mesh_sweep(), curves_batch_ensure_attribute(), blender::geometry::fillet_curves(), request_attribute(), and blender::geometry::subdivide_curves().
MutableAttributeAccessor CurvesGeometry::attributes_for_write | ( | ) |
Definition at line 626 of file geometry_component_curves.cc.
References blender::bke::get_curves_accessor_functions_ref().
Referenced by blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::fillet_curves(), modifier_apply_obdata(), and blender::geometry::subdivide_curves().
|
inline |
Retrieve offsets into a Bezier curve's evaluated points for each control point. Call ensure_evaluated_offsets() first to ensure that the evaluated offsets cache is current.
Definition at line 863 of file BKE_curves.hh.
References points_for_curve(), and CurvesGeometry::runtime.
Calculate the largest and smallest position values, only including control points (rather than evaluated points). The existing values of min
and max
are taken into account.
Definition at line 1075 of file curves_geometry.cc.
References bounds(), blender::bke::curves_bounds(), blender::math::max(), max, min, and blender::math::min().
Referenced by blender::bke::tests::TEST().
void CurvesGeometry::calculate_bezier_auto_handles | ( | ) |
Definition at line 1009 of file curves_geometry.cc.
References blender::bke::curves::bezier::calculate_auto_handles(), CURVE_TYPE_BEZIER, blender::threading::parallel_for(), positions, blender::MutableSpan< T >::slice(), and types.
Referenced by apply_objects_internal().
|
inline |
Return the number of curves with each type.
Definition at line 816 of file BKE_curves.hh.
References BLI_assert, blender::bke::calculate_type_counts(), curve_types(), and CurvesGeometry::runtime.
Referenced by blender::bke::curve_to_mesh_sweep(), blender::geometry::gather_point_attributes_to_interpolate(), has_curve_with_type(), and is_single_type().
The type (CurveType) of each curve, or potentially a single if all are the same type.
Definition at line 232 of file curves_geometry.cc.
References blender::bke::ATTR_CURVE_TYPE, ATTR_DOMAIN_CURVE, and CURVE_TYPE_CATMULL_ROM.
Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_nurbs(), blender::bke::curve_to_mesh_sweep(), curve_type_counts(), and blender::geometry::resample_to_uniform().
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 238 of file curves_geometry.cc.
References blender::bke::ATTR_CURVE_TYPE, and ATTR_DOMAIN_CURVE.
Referenced by fill_curve_types().
|
inline |
Definition at line 787 of file BKE_curves.hh.
References CurvesGeometry::curve_num.
Referenced by blender::bke::calculate_result_offsets(), blender::bke::curves::copy_only_curve_domain(), 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(), fill_curve_types(), blender::geometry::fillet_curves(), blender::ed::sculpt_paint::get_curves_selection(), is_single_type(), blender::nodes::node_geo_curve_spline_type_cc::node_geo_exec(), 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_evaluated(), blender::geometry::resample_to_uniform(), and blender::geometry::subdivide_curves().
|
inline |
Definition at line 795 of file BKE_curves.hh.
References curves_num().
Referenced by blender::bke::calculate_result_offsets(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_curve(), blender::ed::sculpt_paint::AddOperationExecutor::ensure_curve_roots_kdtree(), blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::geometry::fillet_curves(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::ed::sculpt_paint::DensityAddOperationExecutor::prepare_curve_roots_kdtrees(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_projected(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_spherical(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_uniform(), and blender::geometry::subdivide_curves().
Whether the curve loops around to connect to itself, on the curve domain.
Definition at line 318 of file curves_geometry.cc.
References blender::bke::ATTR_CYCLIC, and ATTR_DOMAIN_CURVE.
Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_nurbs(), evaluated_length_total_for_curve(), evaluated_lengths_for_curve(), blender::geometry::fillet_curves(), blender::geometry::resample_to_uniform(), blender::geometry::subdivide_curves(), and blender::bke::tests::TEST().
MutableSpan< bool > CurvesGeometry::cyclic_for_write | ( | ) |
Mutable access to curve cyclic values. Call tag_topology_changed after changes.
Definition at line 322 of file curves_geometry.cc.
References blender::bke::ATTR_CYCLIC, and ATTR_DOMAIN_CURVE.
void CurvesGeometry::ensure_can_interpolate_to_evaluated | ( | ) | const |
Definition at line 944 of file curves_geometry.cc.
Referenced by blender::geometry::resample_to_evaluated().
void CurvesGeometry::ensure_evaluated_lengths | ( | ) | const |
Calculates the data described by evaluated_lengths_for_curve if necessary.
Definition at line 907 of file curves_geometry.cc.
References blender::length_parameterize::accumulate_lengths(), blender::threading::isolate_task(), lock, blender::threading::parallel_for(), blender::MutableSpan< T >::slice(), and blender::Span< T >::slice().
Referenced by blender::geometry::resample_to_uniform().
void CurvesGeometry::ensure_evaluated_offsets | ( | ) | const |
Makes sure the data described by evaluated_offsets if necessary.
Definition at line 504 of file curves_geometry.cc.
References blender::bke::calculate_evaluated_offsets(), CURVE_TYPE_BEZIER, blender::threading::isolate_task(), and lock.
Referenced by blender::bke::calculate_result_offsets(), and blender::geometry::resample_to_evaluated().
|
inline |
Definition at line 886 of file BKE_curves.hh.
References cyclic(), evaluated_lengths_for_curve(), blender::Span< T >::is_empty(), and blender::Span< T >::last().
|
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.
cyclic | This 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 878 of file BKE_curves.hh.
References BLI_assert, cyclic(), and CurvesGeometry::runtime.
Referenced by evaluated_length_total_for_curve().
Definition at line 765 of file curves_geometry.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), calculate_normals_minimum(), calculate_normals_z_up(), blender::Vector< T, InlineBufferCapacity, Allocator >::clear(), CURVE_TYPE_POLY, blender::VArrayCommon< T >::get_internal_single(), blender::VArrayCommon< T >::get_internal_span(), blender::bke::curves::bezier::interpolate_to_evaluated(), blender::VArrayCommon< T >::is_single(), blender::threading::isolate_task(), lock, NORMAL_MODE_MINIMUM_TWIST, NORMAL_MODE_Z_UP, blender::threading::parallel_for(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::bke::rotate_directions_around_axes(), blender::IndexRange::size(), blender::MutableSpan< T >::slice(), blender::Span< T >::slice(), and types.
Span< int > CurvesGeometry::evaluated_offsets | ( | ) | const |
The index of the first evaluated point for every curve. The size of this span is one larger than the number of curves. Consider using evaluated_points_for_curve rather than using the offsets directly.
Definition at line 533 of file curves_geometry.cc.
Referenced by evaluated_points_num().
|
inline |
Access a range of indices of point data for a specific curve. Call evaluated_offsets() first to ensure that the evaluated offsets cache is current.
Definition at line 848 of file BKE_curves.hh.
References BLI_assert, blender::bke::offsets_to_range(), and CurvesGeometry::runtime.
Referenced by blender::bke::calculate_result_offsets().
|
inline |
Definition at line 854 of file BKE_curves.hh.
References BLI_assert, CurvesGeometry::curve_num, offset, blender::IndexRange::one_after_last(), CurvesGeometry::runtime, and blender::IndexRange::start().
|
inline |
The total number of points in the evaluated poly curve. This can depend on the resolution attribute if it exists.
Definition at line 842 of file BKE_curves.hh.
References evaluated_offsets(), and blender::Span< T >::last().
Definition at line 609 of file curves_geometry.cc.
References BLI_assert_unreachable, blender::bke::curves::bezier::calculate_evaluated_positions(), blender::MutableSpan< T >::copy_from(), CURVE_TYPE_BEZIER, CURVE_TYPE_CATMULL_ROM, CURVE_TYPE_NURBS, CURVE_TYPE_POLY, blender::bke::curves::bezier::interpolate_to_evaluated(), blender::threading::isolate_task(), lock, blender::threading::parallel_for(), positions, blender::MutableSpan< T >::slice(), blender::Span< T >::slice(), and types.
Referenced by blender::bke::curve_to_mesh_sweep(), and blender::geometry::resample_to_uniform().
Definition at line 690 of file curves_geometry.cc.
References calculate_tangents(), CURVE_TYPE_BEZIER, blender::IndexMask::index_range(), blender::IndexMask::is_empty(), blender::threading::isolate_task(), lock, blender::threading::parallel_for(), positions, blender::Span< T >::slice(), and tangents.
Set all curve types to the value and call update_curve_types.
Definition at line 243 of file curves_geometry.cc.
References curve_types_for_write(), curves_num(), CurvesGeometry::runtime, tag_topology_changed(), and type.
Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_nurbs(), blender::geometry::convert_curves_trivial(), fill_curve_types(), blender::geometry::resample_to_evaluated(), and blender::geometry::resample_to_uniform().
Set the types for the curves in the selection and call update_curve_types.
Definition at line 251 of file curves_geometry.cc.
References curve_types_for_write(), fill_curve_types(), blender::IndexMask::size(), tag_topology_changed(), type, and update_curve_types().
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 372 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_HANDLE_POSITION_LEFT.
Referenced by blender::geometry::fillet_curves(), and blender::geometry::subdivide_curves().
MutableSpan< float3 > CurvesGeometry::handle_positions_left_for_write | ( | ) |
Definition at line 376 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_HANDLE_POSITION_LEFT.
Referenced by blender::geometry::fillet_curves(), and blender::geometry::subdivide_curves().
Definition at line 381 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_HANDLE_POSITION_RIGHT.
Referenced by blender::geometry::fillet_curves(), and blender::geometry::subdivide_curves().
MutableSpan< float3 > CurvesGeometry::handle_positions_right_for_write | ( | ) |
Definition at line 385 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_HANDLE_POSITION_RIGHT.
Referenced by blender::geometry::fillet_curves(), and blender::geometry::subdivide_curves().
Handle types for Bezier control points. Call tag_topology_changed after changes.
Definition at line 354 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_HANDLE_TYPE_LEFT.
Referenced by blender::bke::curve_to_mesh_sweep(), blender::geometry::fillet_curves(), and blender::geometry::subdivide_curves().
MutableSpan< int8_t > CurvesGeometry::handle_types_left_for_write | ( | ) |
Definition at line 358 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_HANDLE_TYPE_LEFT.
Referenced by blender::geometry::fillet_curves(), and blender::geometry::subdivide_curves().
Definition at line 363 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_HANDLE_TYPE_RIGHT.
Referenced by blender::bke::curve_to_mesh_sweep(), blender::geometry::fillet_curves(), and blender::geometry::subdivide_curves().
MutableSpan< int8_t > CurvesGeometry::handle_types_right_for_write | ( | ) |
Definition at line 367 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_HANDLE_TYPE_RIGHT.
Referenced by blender::geometry::fillet_curves(), and blender::geometry::subdivide_curves().
Definition at line 805 of file BKE_curves.hh.
References curve_type_counts(), and type.
Referenced by blender::geometry::fillet_curves().
Definition at line 810 of file BKE_curves.hh.
IndexMask CurvesGeometry::indices_for_curve_type | ( | CurveType | type, |
IndexMask | selection, | ||
Vector< int64_t > & | r_indices | ||
) | const |
Definition at line 545 of file curves_geometry.cc.
References blender::bke::curves::indices_for_type(), and type.
IndexMask CurvesGeometry::indices_for_curve_type | ( | CurveType | type, |
Vector< int64_t > & | r_indices | ||
) | const |
All of the curve indices for curves with a specific type.
Definition at line 539 of file curves_geometry.cc.
References type.
void CurvesGeometry::interpolate_to_evaluated | ( | GSpan | src, |
GMutableSpan | dst | ||
) | const |
Evaluate generic data for curve control points to the standard evaluated points of the curves.
Definition at line 865 of file curves_geometry.cc.
References BLI_assert, blender::GMutableSpan::copy_from(), CURVE_TYPE_BEZIER, CURVE_TYPE_CATMULL_ROM, CURVE_TYPE_NURBS, CURVE_TYPE_POLY, blender::bke::curves::bezier::interpolate_to_evaluated(), blender::threading::parallel_for(), blender::GMutableSpan::slice(), blender::Span< T >::slice(), src, and types.
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.
Definition at line 833 of file curves_geometry.cc.
References BLI_assert, BLI_assert_unreachable, blender::CPPType::copy_assign_n(), CURVE_TYPE_BEZIER, CURVE_TYPE_CATMULL_ROM, CURVE_TYPE_NURBS, CURVE_TYPE_POLY, blender::GMutableSpan::data(), blender::bke::curves::bezier::interpolate_to_evaluated(), blender::GMutableSpan::size(), blender::IndexRange::size(), src, and blender::GMutableSpan::type().
Return true if all of the curves have the provided type.
Definition at line 800 of file BKE_curves.hh.
References curve_type_counts(), curves_num(), and type.
Referenced by blender::nodes::node_geo_curve_spline_type_cc::node_geo_exec().
Which method to use for calculating the normals of evaluated points (NormalMode). Call tag_normals_changed after changes.
Definition at line 336 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_NORMAL_MODE.
MutableSpan< int8_t > CurvesGeometry::normal_mode_for_write | ( | ) |
Definition at line 340 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_NORMAL_MODE.
The automatic generation mode for each NURBS curve's knots vector, on the curve domain. Call tag_topology_changed after changes.
Definition at line 408 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_NURBS_KNOTS_MODE.
Referenced by blender::geometry::convert_curves_to_bezier().
MutableSpan< int8_t > CurvesGeometry::nurbs_knots_modes_for_write | ( | ) |
Definition at line 412 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_NURBS_KNOTS_MODE.
The order (degree plus one) of each NURBS curve, on the curve domain. Call tag_topology_changed after changes.
Definition at line 390 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_NURBS_ORDER.
MutableSpan< int8_t > CurvesGeometry::nurbs_orders_for_write | ( | ) |
Definition at line 394 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_NURBS_ORDER.
The weight for each control point for NURBS curves. Call tag_positions_changed after changes.
Definition at line 399 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_NURBS_WEIGHT.
MutableSpan< float > CurvesGeometry::nurbs_weights_for_write | ( | ) |
Definition at line 403 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_NURBS_WEIGHT.
Span< int > CurvesGeometry::offsets | ( | ) | const |
The index of the first point in every curve. The size of this span is one larger than the number of curves. Consider using points_for_curve rather than using the offsets directly.
Definition at line 309 of file curves_geometry.cc.
Referenced by blender::ed::sculpt_paint::AddOperationExecutor::ensure_curve_roots_kdtree(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::geometry::fillet_curves(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide(), blender::ed::sculpt_paint::DensityAddOperationExecutor::prepare_curve_roots_kdtrees(), blender::geometry::subdivide_curves(), and blender::bke::tests::TEST().
MutableSpan< int > CurvesGeometry::offsets_for_write | ( | ) |
Definition at line 313 of file curves_geometry.cc.
Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_nurbs(), blender::bke::copy_curves_geometry(), CurvesGeometry(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_curves(), blender::geometry::execute_realize_curve_task(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::fillet_curves(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_uniform(), and blender::geometry::subdivide_curves().
CurvesGeometry & CurvesGeometry::operator= | ( | const CurvesGeometry & | other | ) |
Definition at line 104 of file curves_geometry.cc.
References blender::bke::copy_curves_geometry().
CurvesGeometry & CurvesGeometry::operator= | ( | CurvesGeometry && | other | ) |
Definition at line 137 of file curves_geometry.cc.
References blender::bke::move_curves_geometry().
|
inline |
Access a range of indices of point data for a specific curve.
Definition at line 822 of file BKE_curves.hh.
References BLI_assert, CurvesGeometry::curve_num, CurvesGeometry::curve_offsets, and offset.
Referenced by bezier_evaluated_offsets_for_curve().
|
inline |
Definition at line 832 of file BKE_curves.hh.
References BLI_assert, CurvesGeometry::curve_num, CurvesGeometry::curve_offsets, offset, blender::IndexRange::one_after_last(), and blender::IndexRange::start().
Referenced by blender::ed::sculpt_paint::DeleteOperationExecutor::execute().
|
inline |
Definition at line 783 of file BKE_curves.hh.
References CurvesGeometry::point_num.
Referenced by blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_curve(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::geometry::fillet_curves(), blender::geometry::fillet_curves_bezier(), blender::bke::crazyspace::get_evaluated_curves_deformation(), blender::ed::sculpt_paint::get_point_selection(), points_range(), blender::geometry::resample_to_uniform(), and blender::geometry::subdivide_curves().
|
inline |
Definition at line 791 of file BKE_curves.hh.
References points_num().
Referenced by blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_point_selection_projected().
Definition at line 300 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and ATTR_POSITION.
Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_nurbs(), blender::ed::sculpt_paint::AddOperationExecutor::ensure_curve_roots_kdtree(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::geometry::fillet_curves(), blender::bke::crazyspace::get_evaluated_curves_deformation(), blender::ed::sculpt_paint::DensityAddOperationExecutor::prepare_curve_roots_kdtrees(), blender::geometry::subdivide_curves(), and blender::bke::tests::TEST().
MutableSpan< float3 > CurvesGeometry::positions_for_write | ( | ) |
Definition at line 304 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and ATTR_POSITION.
Referenced by blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::geometry::execute_realize_curve_task(), blender::geometry::fillet_curves(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::geometry::resample_to_uniform(), blender::ed::sculpt_paint::SlideOperationExecutor::slide(), and blender::geometry::subdivide_curves().
void CurvesGeometry::remove_attributes_based_on_types | ( | ) |
Remove any attributes that are unused based on the types in the curves.
Definition at line 1427 of file curves_geometry.cc.
References blender::bke::ATTR_HANDLE_POSITION_LEFT, blender::bke::ATTR_HANDLE_POSITION_RIGHT, blender::bke::ATTR_HANDLE_TYPE_LEFT, blender::bke::ATTR_HANDLE_TYPE_RIGHT, blender::bke::ATTR_NURBS_KNOTS_MODE, blender::bke::ATTR_NURBS_ORDER, blender::bke::ATTR_NURBS_WEIGHT, blender::bke::ATTR_RESOLUTION, CURVE_TYPE_BEZIER, CURVE_TYPE_CATMULL_ROM, CURVE_TYPE_NURBS, and CustomData_free_layer_named().
Referenced by blender::geometry::convert_curves_trivial().
Definition at line 1311 of file curves_geometry.cc.
References blender::bke::copy_with_removed_curves(), blender::IndexMask::is_empty(), and blender::IndexMask::size().
Referenced by blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), and blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute().
Definition at line 1215 of file curves_geometry.cc.
References blender::bke::copy_with_removed_points(), blender::IndexMask::is_empty(), and blender::IndexMask::size().
void CurvesGeometry::resize | ( | int | points_num, |
int | curves_num | ||
) |
Change the number of elements. New values for existing attributes should be properly initialized afterwards.
Definition at line 956 of file curves_geometry.cc.
References CustomData_realloc(), and MEM_reallocN.
Referenced by blender::geometry::fillet_curves(), blender::geometry::resample_to_uniform(), and blender::geometry::subdivide_curves().
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.
Definition at line 327 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_RESOLUTION.
MutableSpan< int > CurvesGeometry::resolution_for_write | ( | ) |
Mutable access to curve resolution. Call tag_topology_changed after changes.
Definition at line 331 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_RESOLUTION.
Change the direction of selected curves (switch the start and end) without changing their shape.
Definition at line 1369 of file curves_geometry.cc.
References blender::bke::ATTR_HANDLE_POSITION_LEFT, blender::bke::ATTR_HANDLE_POSITION_RIGHT, blender::bke::ATTR_HANDLE_TYPE_LEFT, blender::bke::ATTR_HANDLE_TYPE_RIGHT, CD_PROP_FLOAT3, CD_PROP_INT8, blender::attribute_math::convert_to_static_type(), CustomData_duplicate_referenced_layers(), CustomDataLayer::data, blender::MutableSpan< T >::is_empty(), blender::bke::layer_matches_name_and_type(), blender::bke::reverse_swap_curve_point_data(), T, and CustomDataLayer::type.
Definition at line 437 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_SELECTION_CURVE_FLOAT.
MutableSpan< float > CurvesGeometry::selection_curve_float_for_write | ( | ) |
Definition at line 442 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_SELECTION_CURVE_FLOAT.
Referenced by blender::ed::sculpt_paint::SelectionPaintOperationExecutor::execute().
Definition at line 427 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_SELECTION_POINT_FLOAT.
MutableSpan< float > CurvesGeometry::selection_point_float_for_write | ( | ) |
Definition at line 432 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_SELECTION_POINT_FLOAT.
Referenced by blender::ed::sculpt_paint::SelectionPaintOperationExecutor::execute().
UV coordinate for each curve that encodes where the curve is attached to the surface mesh.
Definition at line 417 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_SURFACE_UV_COORDINATE.
Referenced by blender::ed::sculpt_paint::SlideOperationExecutor::execute(), and blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide().
MutableSpan< float2 > CurvesGeometry::surface_uv_coords_for_write | ( | ) |
Definition at line 422 of file curves_geometry.cc.
References ATTR_DOMAIN_CURVE, and blender::bke::ATTR_SURFACE_UV_COORDINATE.
Referenced by blender::ed::sculpt_paint::SlideOperationExecutor::slide().
void CurvesGeometry::tag_normals_changed | ( | ) |
Call after changing the "tilt" or "up" attributes.
Definition at line 986 of file curves_geometry.cc.
void CurvesGeometry::tag_positions_changed | ( | ) |
Call after deforming the position attribute.
Definition at line 970 of file curves_geometry.cc.
Referenced by 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(), and blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute().
void CurvesGeometry::tag_topology_changed | ( | ) |
Call after any operation that changes the topology (number of points, evaluated points, or the total count).
Definition at line 977 of file curves_geometry.cc.
Referenced by blender::bke::copy_curves_geometry(), and fill_curve_types().
The angle used to rotate evaluated normals around the tangents after their calculation. Call tag_normals_changed after changes.
Definition at line 345 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_TILT.
MutableSpan< float > CurvesGeometry::tilt_for_write | ( | ) |
Definition at line 349 of file curves_geometry.cc.
References ATTR_DOMAIN_POINT, and blender::bke::ATTR_TILT.
Definition at line 1052 of file curves_geometry.cc.
References blender::bke::transform_positions().
Referenced by apply_objects_internal(), and blender::nodes::transform_geometry_set().
Definition at line 1040 of file curves_geometry.cc.
References blender::bke::translate_positions().
Referenced by blender::nodes::translate_geometry_set().
void CurvesGeometry::update_curve_types | ( | ) |
Update the cached count of curves of each type, necessary after curve_types_for_write.
Definition at line 295 of file curves_geometry.cc.
References blender::bke::calculate_type_counts().
Referenced by curves_blend_read_data(), and fill_curve_types().
|
inlinestatic |
Definition at line 138 of file BKE_curves.hh.
Referenced by apply_objects_internal(), BKE_curves_boundbox_get(), blender::nodes::node_geo_curve_sample_cc::SampleCurveFunction::call(), blender::nodes::node_geo_input_spline_length_cc::construct_curve_point_count_gvarray(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_radius(), blender::nodes::node_geo_curve_primitive_bezier_segment_cc::create_bezier_segment_curve(), blender::nodes::node_geo_string_to_curves_cc::create_curve_instances(), blender::nodes::node_geo_curve_primitive_line_cc::create_direction_line_curve(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), blender::nodes::node_geo_curve_primitive_line_cc::create_point_line_curve(), blender::nodes::node_geo_curve_primitive_quadratic_bezier_cc::create_quadratic_bezier_curve(), blender::nodes::node_geo_curve_primitive_circle_cc::create_radius_circle_curve(), blender::nodes::node_geo_curve_primitive_spiral_cc::create_spiral_curve(), blender::nodes::node_geo_curve_primitive_star_cc::create_star_curve(), curve_create_curves_lines(), curve_create_curves_pos(), curve_eval_to_curves(), blender::nodes::node_geo_curve_fill_cc::curve_fill_calculate(), blender::bke::curve_legacy_to_curves(), curve_render_data_create(), curves_batch_cache_fill_segments_proc_pos(), curves_batch_cache_fill_strands_data(), curves_batch_ensure_attribute(), curves_blend_read_data(), curves_copy_data(), curves_free_data(), blender::bke::curves_new_nomain(), blender::bke::curves_new_nomain_single(), curves_to_curve_eval(), blender::nodes::node_geo_delete_geometry_cc::delete_curves_selection(), DRW_shgroup_curves_create_sub(), everything_selected(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::sculpt_paint::DensityAddOperationExecutor::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::gather_point_attributes_to_interpolate(), blender::nodes::node_geo_curve_to_mesh_cc::geometry_set_curve_to_mesh(), blender::bke::get_attribute_accessor_for_write(), blender::ed::sculpt_paint::get_curves_selection(), blender::bke::crazyspace::get_evaluated_curves_deformation(), blender::ed::sculpt_paint::get_point_selection(), blender::nodes::node_geo_curve_handle_type_selection_cc::HandleTypeFieldInput::get_varray_for_context(), blender::nodes::node_geo_curve_endpoint_selection_cc::EndpointFieldInput::get_varray_for_context(), mesh_new_from_evaluated_curve_type_object(), modifier_apply_obdata(), blender::nodes::node_geo_curve_fillet_cc::node_geo_exec(), blender::nodes::node_geo_curve_length_cc::node_geo_exec(), blender::nodes::node_geo_curve_primitive_quadrilateral_cc::node_geo_exec(), blender::nodes::node_geo_curve_reverse_cc::node_geo_exec(), blender::nodes::node_geo_curve_sample_cc::node_geo_exec(), blender::nodes::node_geo_curve_spline_type_cc::node_geo_exec(), blender::nodes::node_geo_curve_subdivide_cc::node_geo_exec(), object_convert_exec(), object_curves_random_add_exec(), object_origin_set_exec(), request_attribute(), blender::geometry::resample_to_uniform(), blender::ed::sculpt_paint::select_end::select_end_exec(), blender::ed::sculpt_paint::select_random::select_random_exec(), blender::nodes::node_geo_set_curve_handles_cc::set_position_in_component(), blender::nodes::node_geo_curve_set_handle_type_cc::set_type_in_component(), blender::nodes::transform_geometry_set(), blender::nodes::translate_geometry_set(), and blender::ed::curves::convert_to_particle_system::try_convert_single_object().
|
inlinestatic |
Definition at line 143 of file BKE_curves.hh.