[Bf-blender-cvs] [17d5450eafa] temp-pbvh-split: Cleanup: use '_num' suffix, mostly for curves & spline code
Campbell Barton
noreply at git.blender.org
Fri Jun 3 01:16:26 CEST 2022
Commit: 17d5450eafacb0709fc679911be66748b417f5dc
Author: Campbell Barton
Date: Wed May 11 12:59:58 2022 +1000
Branches: temp-pbvh-split
https://developer.blender.org/rB17d5450eafacb0709fc679911be66748b417f5dc
Cleanup: use '_num' suffix, mostly for curves & spline code
Replace tot/amount & size with num, in keeping with T85728.
===================================================================
M source/blender/blenkernel/BKE_curves.hh
M source/blender/blenkernel/BKE_geometry_set.hh
M source/blender/blenkernel/BKE_spline.hh
M source/blender/blenkernel/intern/attribute_access.cc
M source/blender/blenkernel/intern/attribute_access_intern.hh
M source/blender/blenkernel/intern/curve_catmull_rom.cc
M source/blender/blenkernel/intern/curve_eval.cc
M source/blender/blenkernel/intern/curve_nurbs.cc
M source/blender/blenkernel/intern/curve_to_mesh_convert.cc
M source/blender/blenkernel/intern/curves_geometry.cc
M source/blender/blenkernel/intern/geometry_component_curve.cc
M source/blender/blenkernel/intern/geometry_component_curves.cc
M source/blender/blenkernel/intern/geometry_component_instances.cc
M source/blender/blenkernel/intern/geometry_component_mesh.cc
M source/blender/blenkernel/intern/geometry_component_pointcloud.cc
M source/blender/blenkernel/intern/geometry_set.cc
M source/blender/blenkernel/intern/spline_base.cc
M source/blender/blenkernel/intern/spline_bezier.cc
M source/blender/blenkernel/intern/spline_nurbs.cc
M source/blender/blenkernel/intern/spline_poly.cc
M source/blender/blenlib/BLI_length_parameterize.hh
M source/blender/draw/intern/draw_cache_impl_curve.cc
M source/blender/editors/space_node/node_draw.cc
M source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
M source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.cc
M source/blender/geometry/intern/realize_instances.cc
M source/blender/modifiers/intern/MOD_nodes.cc
M source/blender/nodes/NOD_geometry_nodes_eval_log.hh
M source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc
M source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_reverse.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_subdivide.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc
M source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc
M source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
M source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc
M source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
M source/blender/nodes/geometry/nodes/node_geo_edge_split.cc
M source/blender/nodes/geometry/nodes/node_geo_field_at_index.cc
M source/blender/nodes/geometry/nodes/node_geo_flip_faces.cc
M source/blender/nodes/geometry/nodes/node_geo_input_mesh_island.cc
M source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc
M source/blender/nodes/geometry/nodes/node_geo_instances_to_points.cc
M source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
M source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc
M source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc
M source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc
M source/blender/nodes/geometry/nodes/node_geo_points_to_vertices.cc
M source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
M source/blender/nodes/geometry/nodes/node_geo_raycast.cc
M source/blender/nodes/geometry/nodes/node_geo_rotate_instances.cc
M source/blender/nodes/geometry/nodes/node_geo_scale_instances.cc
M source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc
M source/blender/nodes/geometry/nodes/node_geo_set_curve_radius.cc
M source/blender/nodes/geometry/nodes/node_geo_set_curve_tilt.cc
M source/blender/nodes/geometry/nodes/node_geo_set_id.cc
M source/blender/nodes/geometry/nodes/node_geo_set_material_index.cc
M source/blender/nodes/geometry/nodes/node_geo_set_point_radius.cc
M source/blender/nodes/geometry/nodes/node_geo_set_position.cc
M source/blender/nodes/geometry/nodes/node_geo_set_shade_smooth.cc
M source/blender/nodes/geometry/nodes/node_geo_set_spline_cyclic.cc
M source/blender/nodes/geometry/nodes/node_geo_set_spline_resolution.cc
M source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc
M source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc
M source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc
M source/blender/nodes/geometry/nodes/node_geo_translate_instances.cc
M source/blender/nodes/geometry/nodes/node_geo_triangulate.cc
M source/blender/nodes/intern/geometry_nodes_eval_log.cc
M source/blender/nodes/intern/node_geometry_exec.cc
===================================================================
diff --git a/source/blender/blenkernel/BKE_curves.hh b/source/blender/blenkernel/BKE_curves.hh
index 3e57041dec3..87fa26a4f73 100644
--- a/source/blender/blenkernel/BKE_curves.hh
+++ b/source/blender/blenkernel/BKE_curves.hh
@@ -50,7 +50,7 @@ struct BasisCache {
Vector<int> start_indices;
/**
- * The result of #check_valid_size_and_order, to avoid retrieving its inputs later on.
+ * The result of #check_valid_num_and_order, to avoid retrieving its inputs later on.
* If this is true, the data above will be invalid, and original data should be copied
* to the evaluated result.
*/
@@ -418,7 +418,7 @@ namespace curves {
* The number of segments between control points, accounting for the last segment of cyclic
* curves. The logic is simple, but this function should be used to make intentions clearer.
*/
-inline int curve_segment_size(const int points_num, const bool cyclic)
+inline int curve_segment_num(const int points_num, const bool cyclic)
{
BLI_assert(points_num > 0);
return (cyclic && points_num > 1) ? points_num : points_num - 1;
@@ -585,11 +585,11 @@ namespace catmull_rom {
* \param points_num: The number of points in the curve.
* \param resolution: The resolution for each segment.
*/
-int calculate_evaluated_size(int points_num, bool cyclic, int resolution);
+int calculate_evaluated_num(int points_num, bool cyclic, int resolution);
/**
* Evaluate the Catmull Rom curve. The length of the #dst span should be calculated with
- * #calculate_evaluated_size and is expected to divide evenly by the #src span's segment size.
+ * #calculate_evaluated_num and is expected to divide evenly by the #src span's segment size.
*/
void interpolate_to_evaluated(GSpan src, bool cyclic, int resolution, GMutableSpan dst);
@@ -606,7 +606,7 @@ namespace nurbs {
/**
* Checks the conditions that a NURBS curve needs to evaluate.
*/
-bool check_valid_size_and_order(int points_num, int8_t order, bool cyclic, KnotsMode knots_mode);
+bool check_valid_num_and_order(int points_num, int8_t order, bool cyclic, KnotsMode knots_mode);
/**
* Calculate the standard evaluated size for a NURBS curve, using the standard that
@@ -616,7 +616,7 @@ bool check_valid_size_and_order(int points_num, int8_t order, bool cyclic, Knots
* for predictability and so that cached basis weights of NURBS curves with these properties can be
* shared.
*/
-int calculate_evaluated_size(
+int calculate_evaluated_num(
int points_num, int8_t order, bool cyclic, int resolution, KnotsMode knots_mode);
/**
@@ -624,7 +624,7 @@ int calculate_evaluated_size(
* The knots must be longer for a cyclic curve, for example, in order to provide weights for the
* last evaluated points that are also influenced by the first control points.
*/
-int knots_size(int points_num, int8_t order, bool cyclic);
+int knots_num(int points_num, int8_t order, bool cyclic);
/**
* Calculate the knots for a curve given its properties, based on built-in standards defined by
@@ -644,7 +644,7 @@ void calculate_knots(
* and a weight for each control point.
*/
void calculate_basis_cache(int points_num,
- int evaluated_size,
+ int evaluated_num,
int8_t order,
bool cyclic,
Span<float> knots,
@@ -770,7 +770,7 @@ inline IndexRange CurvesGeometry::lengths_range_for_curve(const int curve_index,
BLI_assert(cyclic == this->cyclic()[curve_index]);
const IndexRange points = this->evaluated_points_for_curve(curve_index);
const int start = points.start() + curve_index;
- return {start, curves::curve_segment_size(points.size(), cyclic)};
+ return {start, curves::curve_segment_num(points.size(), cyclic)};
}
inline Span<float> CurvesGeometry::evaluated_lengths_for_curve(const int curve_index,
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh
index dfd9fccebbd..849c430fd7b 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geometry_set.hh
@@ -98,7 +98,7 @@ class GeometryComponent {
/**
* Return the length of a specific domain, or 0 if the domain is not supported.
*/
- virtual int attribute_domain_size(AttributeDomain domain) const;
+ virtual int attribute_domain_num(AttributeDomain domain) const;
/**
* Return true if the attribute name corresponds to a built-in attribute with a hardcoded domain
@@ -560,7 +560,7 @@ class MeshComponent : public GeometryComponent {
*/
Mesh *get_for_write();
- int attribute_domain_size(AttributeDomain domain) const final;
+ int attribute_domain_num(AttributeDomain domain) const final;
bool is_empty() const final;
@@ -623,7 +623,7 @@ class PointCloudComponent : public GeometryComponent {
*/
PointCloud *get_for_write();
- int attribute_domain_size(AttributeDomain domain) const final;
+ int attribute_domain_num(AttributeDomain domain) const final;
bool is_empty() const final;
@@ -664,7 +664,7 @@ class CurveComponentLegacy : public GeometryComponent {
const CurveEval *get_for_read() const;
CurveEval *get_for_write();
- int attribute_domain_size(AttributeDomain domain) const final;
+ int attribute_domain_num(AttributeDomain domain) const final;
bool is_empty() const final;
@@ -715,7 +715,7 @@ class CurveComponent : public GeometryComponent {
const Curves *get_for_read() const;
Curves *get_for_write();
- int attribute_domain_size(AttributeDomain domain) const final;
+ int attribute_domain_num(AttributeDomain domain) const final;
bool is_empty() const final;
@@ -949,8 +949,8 @@ class InstancesComponent : public GeometryComponent {
blender::MutableSpan<blender::float4x4> instance_transforms();
blender::Span<blender::float4x4> instance_transforms() const;
- int instances_amount() const;
- int references_amount() const;
+ int instances_num() const;
+ int references_num() const;
/**
* Remove the indices that are not contained in the mask input, and remove unused instance
@@ -963,7 +963,7 @@ class InstancesComponent : public GeometryComponent {
blender::bke::CustomDataAttributes &attributes();
const blender::bke::CustomDataAttributes &attributes() const;
- int attribute_domain_size(AttributeDomain domain) const final;
+ int attribute_domain_num(AttributeDomain domain) const final;
void foreach_referenced_geometry(
blender::FunctionRef<void(const GeometrySet &geometry_set)> callback) const;
diff --git a/source/blender/blenkernel/BKE_spline.hh b/source/blender/blenkernel/BKE_spline.hh
index 6cbb47dc709..28f326a4ad4 100644
--- a/source/blender/blenkernel/BKE_spline.hh
+++ b/source/blender/blenkernel/BKE_spline.hh
@@ -102,7 +102,7 @@ class Spline {
/** Return the number of control points. */
virtual int size() const = 0;
- int segments_size() const;
+ int segments_num() const;
bool is_cyclic() const;
void set_cyclic(bool value);
@@ -127,8 +127,8 @@ class Spline {
* change the generated positions, tangents, normals, mapping, etc. of the evaluated points.
*/
virtual void mark_cache_invalid() = 0;
- virtual int evaluated_points_size() const = 0;
- int evaluated_edges_size() const;
+ virtual int evaluated_points_num() const = 0;
+ int evaluated_edges_num() const;
float length() const;
@@ -164,7 +164,7 @@ class Spline {
/**
* The index of the evaluated point after the result location, accounting for wrapping when
* the spline is cyclic. If the sampled factor/length is the very end of the spline, this will
- * be the last index (#evaluated_points_size - 1).
+ * be the last index (#evaluated_points_num - 1).
*/
int next_evaluated_index;
/**
@@ -191,7 +191,7 @@ class Spline {
* indices and factors to the next index encoded in floats. The logic for converting from the
* float values to interpolation data is in #lookup_data_from_index_factor.
*/
- blender::Array<float> sample_uniform_index_factors(int samples_size) const;
+ blender::Array<float> sample_uniform_index_factors(int samples_num) const;
LookupResult lookup_data_from_index_factor(float index_factor) const;
/**
@@ -344,7 +344,7 @@ class BezierSpline final : public Spline {
bool point_is_sharp(int index) const;
void mark_cache_invalid() final;
- int evaluated_points_size() const final;
+ int evaluated_points_num() const final;
/**
* Returns access to a cache of offsets into the evaluated point array for each control point.
@@ -472,7 +472,7 @@ class NURBSpline final : public Spline {
/**
* Determines where and how the control points affect the evaluated points. The length should
- * always be the value returned by #knots_size(), and each value should be greater than or equal
+ * always be the value returned by #knots_num(), and each value should be greater than or equal
* to the previous. Only invalidated when a point is added or removed.
*/
mutable blender::Vector<float> knots_;
@@ -514,8 +514,8 @@ class NURBSpline final : public Spline {
uint8_t order() const;
void set_order(uint8_t value);
- bool check_valid_size_and_order() const;
- int knots_size() const;
+ bool check_valid_num_and_order() const;
+ int knots_num() const;
void resize(int size) final;
blender::MutableSpan<blender::float3> positions() final;
@@ -530,7 +530,7 @@ class NURBSpline final : public Spline {
blender::Span<float> weights() const;
void mark_cache_invalid() final;
- int evaluated_points_size() const final;
+ int evaluated_points_num() const final;
blender::Span<blender::float3> evaluated_positions() const final;
@@ -582,7 +582,7 @@ class PolySpline final : public Spline {
blender::Span<float> tilts() const final;
void mark_cache_invalid() final;
- int evaluated_points_size() const final;
+ int evaluated_points_num() const final;
blender::Span<blender::float3> evaluated_positions() const final;
@@ -665,7 +665,7 @@ struct CurveEval {
blender::Array<float> accumulated_spline_lengths() const;
float total_length() const;
- int total_control_point_size() c
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list