[Bf-blender-cvs] [023f477bdd9] functions: rename AttributesInfoBuilder to AttributesDeclaration

Jacques Lucke noreply at git.blender.org
Thu Jul 18 18:19:30 CEST 2019


Commit: 023f477bdd9529ca0910ec9e8191f0e252fffd2f
Author: Jacques Lucke
Date:   Thu Jul 18 15:04:23 2019 +0200
Branches: functions
https://developer.blender.org/rB023f477bdd9529ca0910ec9e8191f0e252fffd2f

rename AttributesInfoBuilder to AttributesDeclaration

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

M	source/blender/simulations/bparticles/attributes.cpp
M	source/blender/simulations/bparticles/attributes.hpp
M	source/blender/simulations/bparticles/core.hpp
M	source/blender/simulations/bparticles/events.cpp
M	source/blender/simulations/bparticles/events.hpp
M	source/blender/simulations/bparticles/integrator.cpp
M	source/blender/simulations/bparticles/simulate.cpp
M	source/blender/simulations/bparticles/step_description.hpp

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

diff --git a/source/blender/simulations/bparticles/attributes.cpp b/source/blender/simulations/bparticles/attributes.cpp
index 4bcba019d99..8ed3fc6f9e9 100644
--- a/source/blender/simulations/bparticles/attributes.cpp
+++ b/source/blender/simulations/bparticles/attributes.cpp
@@ -2,7 +2,7 @@
 
 namespace BParticles {
 
-AttributesInfo::AttributesInfo(AttributesInfoBuilder &builder)
+AttributesInfo::AttributesInfo(AttributesDeclaration &builder)
     : AttributesInfo(builder.m_byte_names,
                      builder.m_float_names,
                      builder.m_float3_names,
diff --git a/source/blender/simulations/bparticles/attributes.hpp b/source/blender/simulations/bparticles/attributes.hpp
index 125cdd64fac..5f7f010255a 100644
--- a/source/blender/simulations/bparticles/attributes.hpp
+++ b/source/blender/simulations/bparticles/attributes.hpp
@@ -55,7 +55,7 @@ inline uint size_of_attribute_type(AttributeType type)
 
 class AttributesInfo;
 
-class AttributesInfoBuilder {
+class AttributesDeclaration {
  private:
   SmallSetVector<std::string> m_byte_names;
   SmallSetVector<std::string> m_float_names;
@@ -67,11 +67,11 @@ class AttributesInfoBuilder {
   friend AttributesInfo;
 
  public:
-  AttributesInfoBuilder() = default;
+  AttributesDeclaration() = default;
 
-  void use_byte(StringRef name, uint8_t default_value);
-  void use_float(StringRef name, float default_value);
-  void use_float3(StringRef name, float3 default_value);
+  void add_byte(StringRef name, uint8_t default_value);
+  void add_float(StringRef name, float default_value);
+  void add_float3(StringRef name, float3 default_value);
 };
 
 /**
@@ -96,7 +96,7 @@ class AttributesInfo {
 
  public:
   AttributesInfo() = default;
-  AttributesInfo(AttributesInfoBuilder &builder);
+  AttributesInfo(AttributesDeclaration &builder);
   AttributesInfo(ArrayRef<std::string> byte_names,
                  ArrayRef<std::string> float_names,
                  ArrayRef<std::string> float3_names,
@@ -400,21 +400,21 @@ class AttributeArrays {
 /* Attribute Info Builder
  *****************************************/
 
-inline void AttributesInfoBuilder::use_byte(StringRef name, uint8_t default_value)
+inline void AttributesDeclaration::add_byte(StringRef name, uint8_t default_value)
 {
   if (m_byte_names.add(name.to_std_string())) {
     m_byte_defaults.append(default_value);
   }
 }
 
-inline void AttributesInfoBuilder::use_float(StringRef name, float default_value)
+inline void AttributesDeclaration::add_float(StringRef name, float default_value)
 {
   if (m_float_names.add(name.to_std_string())) {
     m_float_defaults.append(default_value);
   }
 }
 
-inline void AttributesInfoBuilder::use_float3(StringRef name, float3 default_value)
+inline void AttributesDeclaration::add_float3(StringRef name, float3 default_value)
 {
   if (m_float3_names.add(name.to_std_string())) {
     m_float3_defaults.append(default_value);
diff --git a/source/blender/simulations/bparticles/core.hpp b/source/blender/simulations/bparticles/core.hpp
index 27941ae8ba2..7bc90cca030 100644
--- a/source/blender/simulations/bparticles/core.hpp
+++ b/source/blender/simulations/bparticles/core.hpp
@@ -72,7 +72,7 @@ class Event {
   /**
    * Allows to define which attributes are required by the event.
    */
-  virtual void attributes(AttributesInfoBuilder &interface);
+  virtual void attributes(AttributesDeclaration &interface);
 };
 
 /**
@@ -148,7 +148,7 @@ class ParticleType {
   /**
    * Allows to define which attributes should exist for the type.
    */
-  virtual void attributes(AttributesInfoBuilder &interface);
+  virtual void attributes(AttributesDeclaration &interface);
 };
 
 /**
@@ -599,14 +599,14 @@ class OffsetHandlerInterface {
 /* Event inline functions
  ********************************************/
 
-inline void Event::attributes(AttributesInfoBuilder &UNUSED(builder))
+inline void Event::attributes(AttributesDeclaration &UNUSED(builder))
 {
 }
 
 /* ParticleType inline functions
  ********************************************/
 
-inline void ParticleType::attributes(AttributesInfoBuilder &UNUSED(builder))
+inline void ParticleType::attributes(AttributesDeclaration &UNUSED(builder))
 {
 }
 
diff --git a/source/blender/simulations/bparticles/events.cpp b/source/blender/simulations/bparticles/events.cpp
index bd2034fe42f..adaf39883ec 100644
--- a/source/blender/simulations/bparticles/events.cpp
+++ b/source/blender/simulations/bparticles/events.cpp
@@ -2,9 +2,9 @@
 
 namespace BParticles {
 
-void AgeReachedEvent::attributes(AttributesInfoBuilder &builder)
+void AgeReachedEvent::attributes(AttributesDeclaration &builder)
 {
-  builder.use_byte(m_identifier, 0);
+  builder.add_byte(m_identifier, 0);
 }
 
 void AgeReachedEvent::filter(EventFilterInterface &interface)
@@ -57,9 +57,9 @@ void AgeReachedEvent::execute(EventExecuteInterface &interface)
   ActionInterface::RunFromEvent(m_action, interface);
 }
 
-void MeshCollisionEvent::attributes(AttributesInfoBuilder &builder)
+void MeshCollisionEvent::attributes(AttributesDeclaration &builder)
 {
-  builder.use_float(m_identifier, 0.0f);
+  builder.add_float(m_identifier, 0.0f);
 }
 
 uint MeshCollisionEvent::storage_size()
diff --git a/source/blender/simulations/bparticles/events.hpp b/source/blender/simulations/bparticles/events.hpp
index 831b8110f7f..e125dedd4f2 100644
--- a/source/blender/simulations/bparticles/events.hpp
+++ b/source/blender/simulations/bparticles/events.hpp
@@ -34,7 +34,7 @@ class AgeReachedEvent : public Event {
     m_compute_age_body = compute_age_fn->body<TupleCallBody>();
   }
 
-  void attributes(AttributesInfoBuilder &builder) override;
+  void attributes(AttributesDeclaration &builder) override;
   void filter(EventFilterInterface &interface) override;
   void execute(EventExecuteInterface &interface) override;
 };
@@ -90,7 +90,7 @@ class MeshCollisionEvent : public Event {
     free_bvhtree_from_mesh(&m_bvhtree_data);
   }
 
-  void attributes(AttributesInfoBuilder &builder) override;
+  void attributes(AttributesDeclaration &builder) override;
   uint storage_size() override;
   void filter(EventFilterInterface &interface) override;
   void execute(EventExecuteInterface &interface) override;
diff --git a/source/blender/simulations/bparticles/integrator.cpp b/source/blender/simulations/bparticles/integrator.cpp
index 061d4770118..927d68153fe 100644
--- a/source/blender/simulations/bparticles/integrator.cpp
+++ b/source/blender/simulations/bparticles/integrator.cpp
@@ -4,9 +4,9 @@ namespace BParticles {
 
 EulerIntegrator::EulerIntegrator()
 {
-  AttributesInfoBuilder builder;
-  builder.use_float3("Position", {0, 0, 0});
-  builder.use_float3("Velocity", {0, 0, 0});
+  AttributesDeclaration builder;
+  builder.add_float3("Position", {0, 0, 0});
+  builder.add_float3("Velocity", {0, 0, 0});
   m_offset_attributes_info = AttributesInfo(builder);
 }
 
diff --git a/source/blender/simulations/bparticles/simulate.cpp b/source/blender/simulations/bparticles/simulate.cpp
index 951aaf8335f..c4589ffa548 100644
--- a/source/blender/simulations/bparticles/simulate.cpp
+++ b/source/blender/simulations/bparticles/simulate.cpp
@@ -548,15 +548,15 @@ BLI_NOINLINE static void ensure_required_containers_exist(ParticlesState &state,
 BLI_NOINLINE static AttributesInfo build_attribute_info_for_type(ParticleType &type,
                                                                  AttributesInfo &UNUSED(last_info))
 {
-  AttributesInfoBuilder builder;
+  AttributesDeclaration builder;
   type.attributes(builder);
 
   for (Event *event : type.events()) {
     event->attributes(builder);
   }
 
-  builder.use_byte("Kill State", 0);
-  builder.use_float("Birth Time", 0);
+  builder.add_byte("Kill State", 0);
+  builder.add_float("Birth Time", 0);
 
   return AttributesInfo(builder);
 }
diff --git a/source/blender/simulations/bparticles/step_description.hpp b/source/blender/simulations/bparticles/step_description.hpp
index 92f6985bc4b..5e06e796613 100644
--- a/source/blender/simulations/bparticles/step_description.hpp
+++ b/source/blender/simulations/bparticles/step_description.hpp
@@ -34,12 +34,12 @@ class ModifierParticleType : public ParticleType {
     return *m_integrator;
   }
 
-  void attributes(AttributesInfoBuilder &builder) override
+  void attributes(AttributesDeclaration &builder) override
   {
-    builder.use_float3("Position", {0, 0, 0});
-    builder.use_float3("Velocity", {0, 0, 0});
-    builder.use_float("Size", 0.01f);
-    builder.use_float3("Color", {1.0f, 1.0f, 1.0f});
+    builder.add_float3("Position", {0, 0, 0});
+    builder.add_float3("Velocity", {0, 0, 0});
+    builder.add_float("Size", 0.01f);
+    builder.add_float3("Color", {1.0f, 1.0f, 1.0f});
   }
 };



More information about the Bf-blender-cvs mailing list