[Bf-blender-cvs] [b4fa74e8129] master: Cleanup: Rename field input class name

Hans Goudey noreply at git.blender.org
Thu May 5 12:07:49 CEST 2022


Commit: b4fa74e812939fdfbcb430013b63020257cdac27
Author: Hans Goudey
Date:   Thu May 5 12:07:35 2022 +0200
Branches: master
https://developer.blender.org/rBb4fa74e812939fdfbcb430013b63020257cdac27

Cleanup: Rename field input class name

===================================================================

M	source/blender/nodes/geometry/node_geometry_util.hh
M	source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc
M	source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc

===================================================================

diff --git a/source/blender/nodes/geometry/node_geometry_util.hh b/source/blender/nodes/geometry/node_geometry_util.hh
index 7af3159bbf8..0ed75bcfa9b 100644
--- a/source/blender/nodes/geometry/node_geometry_util.hh
+++ b/source/blender/nodes/geometry/node_geometry_util.hh
@@ -81,9 +81,9 @@ void separate_geometry(GeometrySet &geometry_set,
 std::optional<CustomDataType> node_data_type_to_custom_data_type(eNodeSocketDatatype type);
 std::optional<CustomDataType> node_socket_to_custom_data_type(const bNodeSocket &socket);
 
-class SplineLengthFieldInput final : public GeometryFieldInput {
+class CurveLengthFieldInput final : public GeometryFieldInput {
  public:
-  SplineLengthFieldInput();
+  CurveLengthFieldInput();
   GVArray get_varray_for_context(const GeometryComponent &component,
                                  AttributeDomain domain,
                                  IndexMask mask) const final;
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc
index 2e5a94b0a63..aec6320d881 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc
@@ -535,7 +535,7 @@ static Field<int> get_curve_count_field(GeoNodeExecParams params,
 
     auto get_count_op = std::make_shared<FieldOperation>(
         FieldOperation(get_count_fn,
-                       {Field<float>(std::make_shared<SplineLengthFieldInput>()),
+                       {Field<float>(std::make_shared<CurveLengthFieldInput>()),
                         params.extract_input<Field<float>>("Length")}));
 
     return Field<int>(std::move(get_count_op));
diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc b/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc
index 6c24f86b63b..0b1bc03360e 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc
@@ -39,15 +39,15 @@ static VArray<float> construct_spline_length_gvarray(const CurveComponent &compo
   return {};
 }
 
-SplineLengthFieldInput::SplineLengthFieldInput()
+CurveLengthFieldInput::CurveLengthFieldInput()
     : GeometryFieldInput(CPPType::get<float>(), "Spline Length node")
 {
   category_ = Category::Generated;
 }
 
-GVArray SplineLengthFieldInput::get_varray_for_context(const GeometryComponent &component,
-                                                       const AttributeDomain domain,
-                                                       IndexMask UNUSED(mask)) const
+GVArray CurveLengthFieldInput::get_varray_for_context(const GeometryComponent &component,
+                                                      const AttributeDomain domain,
+                                                      IndexMask UNUSED(mask)) const
 {
   if (component.type() == GEO_COMPONENT_TYPE_CURVE) {
     const CurveComponent &curve_component = static_cast<const CurveComponent &>(component);
@@ -56,15 +56,15 @@ GVArray SplineLengthFieldInput::get_varray_for_context(const GeometryComponent &
   return {};
 }
 
-uint64_t SplineLengthFieldInput::hash() const
+uint64_t CurveLengthFieldInput::hash() const
 {
   /* Some random constant hash. */
   return 3549623580;
 }
 
-bool SplineLengthFieldInput::is_equal_to(const fn::FieldNode &other) const
+bool CurveLengthFieldInput::is_equal_to(const fn::FieldNode &other) const
 {
-  return dynamic_cast<const SplineLengthFieldInput *>(&other) != nullptr;
+  return dynamic_cast<const CurveLengthFieldInput *>(&other) != nullptr;
 }
 
 }  // namespace blender::nodes
@@ -136,7 +136,7 @@ class SplineCountFieldInput final : public GeometryFieldInput {
 
 static void node_geo_exec(GeoNodeExecParams params)
 {
-  Field<float> spline_length_field{std::make_shared<SplineLengthFieldInput>()};
+  Field<float> spline_length_field{std::make_shared<CurveLengthFieldInput>()};
   Field<int> spline_count_field{std::make_shared<SplineCountFieldInput>()};
 
   params.set_output("Length", std::move(spline_length_field));



More information about the Bf-blender-cvs mailing list