diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
15 files changed, 63 insertions, 70 deletions
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index f79e8ee7653..50e35c3c7c2 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -28,14 +28,14 @@ static CLG_LogRef LOG = {"bke.attribute_access"}; using blender::float3; +using blender::GMutableSpan; +using blender::GSpan; +using blender::GVArrayImpl_For_GSpan; using blender::Set; using blender::StringRef; using blender::StringRefNull; using blender::bke::AttributeIDRef; using blender::bke::OutputAttribute; -using blender::fn::GMutableSpan; -using blender::fn::GSpan; -using blender::fn::GVArrayImpl_For_GSpan; namespace blender::bke { @@ -191,14 +191,14 @@ AttributeDomain attribute_domain_highest_priority(Span<AttributeDomain> domains) return highest_priority_domain; } -fn::GMutableSpan OutputAttribute::as_span() +GMutableSpan OutputAttribute::as_span() { if (!optional_span_varray_) { const bool materialize_old_values = !ignore_old_values_; - optional_span_varray_ = std::make_unique<fn::GVMutableArray_GSpan>(varray_, - materialize_old_values); + optional_span_varray_ = std::make_unique<GVMutableArray_GSpan>(varray_, + materialize_old_values); } - fn::GVMutableArray_GSpan &span_varray = *optional_span_varray_; + GVMutableArray_GSpan &span_varray = *optional_span_varray_; return span_varray; } @@ -917,8 +917,8 @@ blender::bke::ReadAttributeLookup GeometryComponent::attribute_try_get_for_read( return {}; } -blender::fn::GVArray GeometryComponent::attribute_try_adapt_domain_impl( - const blender::fn::GVArray &varray, +blender::GVArray GeometryComponent::attribute_try_adapt_domain_impl( + const blender::GVArray &varray, const AttributeDomain from_domain, const AttributeDomain to_domain) const { @@ -1101,15 +1101,15 @@ std::optional<AttributeMetaData> GeometryComponent::attribute_get_meta_data( return result; } -static blender::fn::GVArray try_adapt_data_type(blender::fn::GVArray varray, - const blender::CPPType &to_type) +static blender::GVArray try_adapt_data_type(blender::GVArray varray, + const blender::CPPType &to_type) { const blender::bke::DataTypeConversions &conversions = blender::bke::get_implicit_type_conversions(); return conversions.try_convert(std::move(varray), to_type); } -blender::fn::GVArray GeometryComponent::attribute_try_get_for_read( +blender::GVArray GeometryComponent::attribute_try_get_for_read( const AttributeIDRef &attribute_id, const AttributeDomain domain, const CustomDataType data_type) const @@ -1119,7 +1119,7 @@ blender::fn::GVArray GeometryComponent::attribute_try_get_for_read( return {}; } - blender::fn::GVArray varray = std::move(attribute.varray); + blender::GVArray varray = std::move(attribute.varray); if (!ELEM(domain, ATTR_DOMAIN_AUTO, attribute.domain)) { varray = this->attribute_try_adapt_domain(std::move(varray), attribute.domain, domain); if (!varray) { @@ -1139,8 +1139,8 @@ blender::fn::GVArray GeometryComponent::attribute_try_get_for_read( return varray; } -blender::fn::GVArray GeometryComponent::attribute_try_get_for_read( - const AttributeIDRef &attribute_id, const AttributeDomain domain) const +blender::GVArray GeometryComponent::attribute_try_get_for_read(const AttributeIDRef &attribute_id, + const AttributeDomain domain) const { if (!this->attribute_domain_supported(domain)) { return {}; @@ -1175,12 +1175,12 @@ blender::bke::ReadAttributeLookup GeometryComponent::attribute_try_get_for_read( return {conversions.try_convert(std::move(attribute.varray), *type), attribute.domain}; } -blender::fn::GVArray GeometryComponent::attribute_get_for_read(const AttributeIDRef &attribute_id, - const AttributeDomain domain, - const CustomDataType data_type, - const void *default_value) const +blender::GVArray GeometryComponent::attribute_get_for_read(const AttributeIDRef &attribute_id, + const AttributeDomain domain, + const CustomDataType data_type, + const void *default_value) const { - blender::fn::GVArray varray = this->attribute_try_get_for_read(attribute_id, domain, data_type); + blender::GVArray varray = this->attribute_try_get_for_read(attribute_id, domain, data_type); if (varray) { return varray; } @@ -1189,10 +1189,10 @@ blender::fn::GVArray GeometryComponent::attribute_get_for_read(const AttributeID default_value = type->default_value(); } const int domain_size = this->attribute_domain_size(domain); - return blender::fn::GVArray::ForSingle(*type, domain_size, default_value); + return blender::GVArray::ForSingle(*type, domain_size, default_value); } -class GVMutableAttribute_For_OutputAttribute : public blender::fn::GVArrayImpl_For_GSpan { +class GVMutableAttribute_For_OutputAttribute : public blender::GVArrayImpl_For_GSpan { public: GeometryComponent *component; std::string attribute_name; @@ -1201,7 +1201,7 @@ class GVMutableAttribute_For_OutputAttribute : public blender::fn::GVArrayImpl_F GVMutableAttribute_For_OutputAttribute(GMutableSpan data, GeometryComponent &component, const AttributeIDRef &attribute_id) - : blender::fn::GVArrayImpl_For_GSpan(data), component(&component) + : blender::GVArrayImpl_For_GSpan(data), component(&component) { if (attribute_id.is_named()) { this->attribute_name = attribute_id.name(); diff --git a/source/blender/blenkernel/intern/curve_catmull_rom.cc b/source/blender/blenkernel/intern/curve_catmull_rom.cc index a247c67066b..27687eb736f 100644 --- a/source/blender/blenkernel/intern/curve_catmull_rom.cc +++ b/source/blender/blenkernel/intern/curve_catmull_rom.cc @@ -96,10 +96,10 @@ static void interpolate_to_evaluated(const Span<T> src, }); } -void interpolate_to_evaluated(const fn::GSpan src, +void interpolate_to_evaluated(const GSpan src, const bool cyclic, const int resolution, - fn::GMutableSpan dst) + GMutableSpan dst) { attribute_math::convert_to_static_type(src.type(), [&](auto dummy) { using T = decltype(dummy); diff --git a/source/blender/blenkernel/intern/curve_eval.cc b/source/blender/blenkernel/intern/curve_eval.cc index 191a510947e..b2399f25638 100644 --- a/source/blender/blenkernel/intern/curve_eval.cc +++ b/source/blender/blenkernel/intern/curve_eval.cc @@ -20,6 +20,8 @@ using blender::Array; using blender::float3; using blender::float4x4; +using blender::GVArray; +using blender::GVArray_GSpan; using blender::IndexRange; using blender::Map; using blender::MutableSpan; @@ -32,8 +34,6 @@ using blender::bke::AttributeIDRef; using blender::bke::OutputAttribute; using blender::bke::OutputAttribute_Typed; using blender::bke::ReadAttributeLookup; -using blender::fn::GVArray; -using blender::fn::GVArray_GSpan; blender::Span<SplinePtr> CurveEval::splines() const { diff --git a/source/blender/blenkernel/intern/curve_nurbs.cc b/source/blender/blenkernel/intern/curve_nurbs.cc index 3bec01520e8..a4cdbbca654 100644 --- a/source/blender/blenkernel/intern/curve_nurbs.cc +++ b/source/blender/blenkernel/intern/curve_nurbs.cc @@ -230,8 +230,8 @@ static void interpolate_to_evaluated_rational(const BasisCache &basis_cache, void interpolate_to_evaluated(const BasisCache &basis_cache, const int8_t order, const Span<float> control_weights, - const fn::GSpan src, - fn::GMutableSpan dst) + const GSpan src, + GMutableSpan dst) { BLI_assert(dst.size() == basis_cache.start_indices.size()); diff --git a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc index 5d80ef47908..9b22a4c9726 100644 --- a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc +++ b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc @@ -16,9 +16,6 @@ #include "BKE_curve_to_mesh.hh" -using blender::fn::GMutableSpan; -using blender::fn::GSpan; - namespace blender::bke { /** Information about the creation of one curve spline and profile spline combination. */ diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc index ff24720e5e5..45f3bf36381 100644 --- a/source/blender/blenkernel/intern/curves_geometry.cc +++ b/source/blender/blenkernel/intern/curves_geometry.cc @@ -1055,9 +1055,9 @@ static GVArray adapt_curve_domain_curve_to_point(const CurvesGeometry &curves, return new_varray; } -fn::GVArray CurvesGeometry::adapt_domain(const fn::GVArray &varray, - const AttributeDomain from, - const AttributeDomain to) const +GVArray CurvesGeometry::adapt_domain(const GVArray &varray, + const AttributeDomain from, + const AttributeDomain to) const { if (!varray) { return {}; diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index 0926d65b306..f409389e463 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -14,10 +14,10 @@ #include "attribute_access_intern.hh" -using blender::fn::GMutableSpan; -using blender::fn::GSpan; -using blender::fn::GVArray; -using blender::fn::GVArray_GSpan; +using blender::GMutableSpan; +using blender::GSpan; +using blender::GVArray; +using blender::GVArray_GSpan; /* -------------------------------------------------------------------- */ /** \name Geometry Component Implementation diff --git a/source/blender/blenkernel/intern/geometry_component_curves.cc b/source/blender/blenkernel/intern/geometry_component_curves.cc index 86cbea9a9bb..7cf6fc5a03e 100644 --- a/source/blender/blenkernel/intern/geometry_component_curves.cc +++ b/source/blender/blenkernel/intern/geometry_component_curves.cc @@ -15,7 +15,7 @@ #include "attribute_access_intern.hh" -using blender::fn::GVArray; +using blender::GVArray; /* -------------------------------------------------------------------- */ /** \name Geometry Component Implementation diff --git a/source/blender/blenkernel/intern/geometry_component_instances.cc b/source/blender/blenkernel/intern/geometry_component_instances.cc index 75384b5c420..0dc6f486d28 100644 --- a/source/blender/blenkernel/intern/geometry_component_instances.cc +++ b/source/blender/blenkernel/intern/geometry_component_instances.cc @@ -23,13 +23,13 @@ #include "BLI_cpp_type_make.hh" using blender::float4x4; +using blender::GSpan; using blender::IndexMask; using blender::Map; using blender::MutableSpan; using blender::Set; using blender::Span; using blender::VectorSet; -using blender::fn::GSpan; BLI_CPP_TYPE_MAKE(InstanceReference, InstanceReference, CPPTypeFlags::None) @@ -164,7 +164,7 @@ void InstancesComponent::remove_instances(const IndexMask mask) GSpan src = *src_attributes.get_for_read(id); dst_attributes.create(id, meta_data.data_type); - fn::GMutableSpan dst = *dst_attributes.get_for_write(id); + GMutableSpan dst = *dst_attributes.get_for_write(id); attribute_math::convert_to_static_type(src.type(), [&](auto dummy) { using T = decltype(dummy); diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc index a07957e999c..76c8a0054b3 100644 --- a/source/blender/blenkernel/intern/geometry_component_mesh.cc +++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc @@ -746,8 +746,8 @@ static GVArray adapt_mesh_domain_edge_to_face(const Mesh &mesh, const GVArray &v } // namespace blender::bke -blender::fn::GVArray MeshComponent::attribute_try_adapt_domain_impl( - const blender::fn::GVArray &varray, +blender::GVArray MeshComponent::attribute_try_adapt_domain_impl( + const blender::GVArray &varray, const AttributeDomain from_domain, const AttributeDomain to_domain) const { diff --git a/source/blender/blenkernel/intern/spline_base.cc b/source/blender/blenkernel/intern/spline_base.cc index dc5b1d28539..eecb374cd63 100644 --- a/source/blender/blenkernel/intern/spline_base.cc +++ b/source/blender/blenkernel/intern/spline_base.cc @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include "BLI_array.hh" +#include "BLI_generic_virtual_array.hh" #include "BLI_span.hh" #include "BLI_task.hh" #include "BLI_timeit.hh" @@ -9,19 +10,17 @@ #include "BKE_attribute_math.hh" #include "BKE_spline.hh" -#include "FN_generic_virtual_array.hh" - using blender::Array; using blender::float3; +using blender::GMutableSpan; +using blender::GSpan; +using blender::GVArray; using blender::IndexRange; using blender::MutableSpan; using blender::Span; using blender::VArray; using blender::attribute_math::convert_to_static_type; using blender::bke::AttributeIDRef; -using blender::fn::GMutableSpan; -using blender::fn::GSpan; -using blender::fn::GVArray; CurveType Spline::type() const { @@ -100,7 +99,7 @@ void Spline::reverse() this->attributes.foreach_attribute( [&](const AttributeIDRef &id, const AttributeMetaData &meta_data) { - std::optional<blender::fn::GMutableSpan> attribute = this->attributes.get_for_write(id); + std::optional<blender::GMutableSpan> attribute = this->attributes.get_for_write(id); if (!attribute) { BLI_assert_unreachable(); return false; diff --git a/source/blender/blenkernel/intern/spline_bezier.cc b/source/blender/blenkernel/intern/spline_bezier.cc index e9ae51b16f8..8e207f93bf5 100644 --- a/source/blender/blenkernel/intern/spline_bezier.cc +++ b/source/blender/blenkernel/intern/spline_bezier.cc @@ -8,11 +8,11 @@ using blender::Array; using blender::float3; +using blender::GVArray; using blender::IndexRange; using blender::MutableSpan; using blender::Span; using blender::VArray; -using blender::fn::GVArray; void BezierSpline::copy_settings(Spline &dst) const { diff --git a/source/blender/blenkernel/intern/spline_nurbs.cc b/source/blender/blenkernel/intern/spline_nurbs.cc index a8a17b7aee6..9d1d5a53a43 100644 --- a/source/blender/blenkernel/intern/spline_nurbs.cc +++ b/source/blender/blenkernel/intern/spline_nurbs.cc @@ -9,11 +9,11 @@ using blender::Array; using blender::float3; +using blender::GVArray; using blender::IndexRange; using blender::MutableSpan; using blender::Span; using blender::VArray; -using blender::fn::GVArray; void NURBSpline::copy_settings(Spline &dst) const { diff --git a/source/blender/blenkernel/intern/spline_poly.cc b/source/blender/blenkernel/intern/spline_poly.cc index a5d3fd47ede..122f7f6c059 100644 --- a/source/blender/blenkernel/intern/spline_poly.cc +++ b/source/blender/blenkernel/intern/spline_poly.cc @@ -6,9 +6,9 @@ #include "BKE_spline.hh" using blender::float3; +using blender::GVArray; using blender::MutableSpan; using blender::Span; -using blender::fn::GVArray; void PolySpline::copy_settings(Spline &UNUSED(dst)) const { diff --git a/source/blender/blenkernel/intern/type_conversions.cc b/source/blender/blenkernel/intern/type_conversions.cc index 2e8b5b3433b..d10979eeee9 100644 --- a/source/blender/blenkernel/intern/type_conversions.cc +++ b/source/blender/blenkernel/intern/type_conversions.cc @@ -288,8 +288,7 @@ void DataTypeConversions::convert_to_uninitialized(const CPPType &from_type, functions->convert_single_to_uninitialized(from_value, to_value); } -void DataTypeConversions::convert_to_initialized_n(fn::GSpan from_span, - fn::GMutableSpan to_span) const +void DataTypeConversions::convert_to_initialized_n(GSpan from_span, GMutableSpan to_span) const { const CPPType &from_type = from_span.type(); const CPPType &to_type = to_span.type(); @@ -305,19 +304,17 @@ void DataTypeConversions::convert_to_initialized_n(fn::GSpan from_span, fn->call_auto(IndexRange(from_span.size()), params, context); } -class GVArray_For_ConvertedGVArray : public fn::GVArrayImpl { +class GVArray_For_ConvertedGVArray : public GVArrayImpl { private: - fn::GVArray varray_; + GVArray varray_; const CPPType &from_type_; ConversionFunctions old_to_new_conversions_; public: - GVArray_For_ConvertedGVArray(fn::GVArray varray, + GVArray_For_ConvertedGVArray(GVArray varray, const CPPType &to_type, const DataTypeConversions &conversions) - : fn::GVArrayImpl(to_type, varray.size()), - varray_(std::move(varray)), - from_type_(varray_.type()) + : GVArrayImpl(to_type, varray.size()), varray_(std::move(varray)), from_type_(varray_.type()) { old_to_new_conversions_ = *conversions.get_conversion_functions(from_type_, to_type); } @@ -340,18 +337,18 @@ class GVArray_For_ConvertedGVArray : public fn::GVArrayImpl { } }; -class GVMutableArray_For_ConvertedGVMutableArray : public fn::GVMutableArrayImpl { +class GVMutableArray_For_ConvertedGVMutableArray : public GVMutableArrayImpl { private: - fn::GVMutableArray varray_; + GVMutableArray varray_; const CPPType &from_type_; ConversionFunctions old_to_new_conversions_; ConversionFunctions new_to_old_conversions_; public: - GVMutableArray_For_ConvertedGVMutableArray(fn::GVMutableArray varray, + GVMutableArray_For_ConvertedGVMutableArray(GVMutableArray varray, const CPPType &to_type, const DataTypeConversions &conversions) - : fn::GVMutableArrayImpl(to_type, varray.size()), + : GVMutableArrayImpl(to_type, varray.size()), varray_(std::move(varray)), from_type_(varray_.type()) { @@ -384,7 +381,7 @@ class GVMutableArray_For_ConvertedGVMutableArray : public fn::GVMutableArrayImpl } }; -fn::GVArray DataTypeConversions::try_convert(fn::GVArray varray, const CPPType &to_type) const +GVArray DataTypeConversions::try_convert(GVArray varray, const CPPType &to_type) const { const CPPType &from_type = varray.type(); if (from_type == to_type) { @@ -393,11 +390,11 @@ fn::GVArray DataTypeConversions::try_convert(fn::GVArray varray, const CPPType & if (!this->is_convertible(from_type, to_type)) { return {}; } - return fn::GVArray::For<GVArray_For_ConvertedGVArray>(std::move(varray), to_type, *this); + return GVArray::For<GVArray_For_ConvertedGVArray>(std::move(varray), to_type, *this); } -fn::GVMutableArray DataTypeConversions::try_convert(fn::GVMutableArray varray, - const CPPType &to_type) const +GVMutableArray DataTypeConversions::try_convert(GVMutableArray varray, + const CPPType &to_type) const { const CPPType &from_type = varray.type(); if (from_type == to_type) { @@ -406,7 +403,7 @@ fn::GVMutableArray DataTypeConversions::try_convert(fn::GVMutableArray varray, if (!this->is_convertible(from_type, to_type)) { return {}; } - return fn::GVMutableArray::For<GVMutableArray_For_ConvertedGVMutableArray>( + return GVMutableArray::For<GVMutableArray_For_ConvertedGVMutableArray>( std::move(varray), to_type, *this); } |