[Bf-blender-cvs] [30b50638a03] functions: rename index_iterator to index_range

Jacques Lucke noreply at git.blender.org
Thu Jan 2 16:38:23 CET 2020


Commit: 30b50638a03ff29b342d9d42c28c94fba5fe422b
Author: Jacques Lucke
Date:   Thu Jan 2 15:22:20 2020 +0100
Branches: functions
https://developer.blender.org/rB30b50638a03ff29b342d9d42c28c94fba5fe422b

rename index_iterator to index_range

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

M	source/blender/blenlib/BLI_array_cxx.h
M	source/blender/blenlib/BLI_array_ref.h
M	source/blender/blenlib/BLI_float_interval.h
M	source/blender/blenlib/BLI_index_mask.h
M	source/blender/blenlib/BLI_vector.h
M	source/blender/blenlib/BLI_virtual_list_ref.h
M	source/blender/functions/FN_multi_function_context.h
M	source/blender/functions/FN_node_tree_multi_function_network.h
M	source/blender/functions/intern/attributes_ref.cc
M	source/blender/functions/intern/multi_function_network.cc
M	source/blender/functions/intern/multi_functions/mixed.cc
M	source/blender/functions/intern/multi_functions/network.cc
M	source/blender/functions/intern/multi_functions/sampling_util.cc
M	source/blender/functions/intern/multi_functions/surface_hook.cc
M	source/blender/functions/intern/multi_functions/util.h
M	source/blender/functions/intern/node_tree.cc
M	source/blender/functions/intern/node_tree_multi_function_network/builder.cc
M	source/blender/functions/intern/node_tree_multi_function_network/builder.h
M	source/blender/simulations/bparticles/c_wrapper.cpp
M	source/blender/simulations/bparticles/emitters.cpp
M	source/blender/simulations/bparticles/node_frontend.cpp
M	source/blender/simulations/bparticles/simulate.cpp
M	source/blender/simulations/bparticles/world_state.hpp

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

diff --git a/source/blender/blenlib/BLI_array_cxx.h b/source/blender/blenlib/BLI_array_cxx.h
index 7292c94616b..e5ee9412a19 100644
--- a/source/blender/blenlib/BLI_array_cxx.h
+++ b/source/blender/blenlib/BLI_array_cxx.h
@@ -195,7 +195,7 @@ template<typename T, uint N = 4, typename Allocator = GuardedAllocator> class Ar
     return m_data + m_size;
   }
 
-  IndexRange index_iterator() const
+  IndexRange index_range() const
   {
     return IndexRange(m_size);
   }
diff --git a/source/blender/blenlib/BLI_array_ref.h b/source/blender/blenlib/BLI_array_ref.h
index 5428bba6e70..265e75a2bf9 100644
--- a/source/blender/blenlib/BLI_array_ref.h
+++ b/source/blender/blenlib/BLI_array_ref.h
@@ -324,7 +324,7 @@ template<typename T> class ArrayRef {
    * Utility to make it more convenient to iterate over all indices that can be used with this
    * array.
    */
-  IndexRange index_iterator() const
+  IndexRange index_range() const
   {
     return IndexRange(m_size);
   }
@@ -494,7 +494,7 @@ template<typename T> class MutableArrayRef {
     return ArrayRef<T>(m_start, m_size);
   }
 
-  IndexRange index_iterator() const
+  IndexRange index_range() const
   {
     return IndexRange(m_size);
   }
diff --git a/source/blender/blenlib/BLI_float_interval.h b/source/blender/blenlib/BLI_float_interval.h
index 53e3a181ec7..3ad3a56a412 100644
--- a/source/blender/blenlib/BLI_float_interval.h
+++ b/source/blender/blenlib/BLI_float_interval.h
@@ -39,7 +39,7 @@ class FloatInterval {
   void value_at(ArrayRef<float> factors, MutableArrayRef<float> r_values)
   {
     BLI_assert(factors.size() == r_values.size());
-    for (uint i : factors.index_iterator()) {
+    for (uint i : factors.index_range()) {
       r_values[i] = this->value_at(factors[i]);
     }
   }
@@ -52,7 +52,7 @@ class FloatInterval {
     if (r_values.size() == 1) {
       r_values[0] = this->value_at(0.5f);
     }
-    for (uint i : r_values.index_iterator()) {
+    for (uint i : r_values.index_range()) {
       float factor = (i - 1) / (float)r_values.size();
       r_values[i] = this->value_at(factor);
     }
diff --git a/source/blender/blenlib/BLI_index_mask.h b/source/blender/blenlib/BLI_index_mask.h
index f80c85a2556..85cb3025fae 100644
--- a/source/blender/blenlib/BLI_index_mask.h
+++ b/source/blender/blenlib/BLI_index_mask.h
@@ -102,9 +102,9 @@ class IndexMask {
     }
   }
 
-  IndexRange index_iterator() const
+  IndexRange index_range() const
   {
-    return m_indices.index_iterator();
+    return m_indices.index_range();
   }
 
   uint last() const
diff --git a/source/blender/blenlib/BLI_vector.h b/source/blender/blenlib/BLI_vector.h
index e65ce287be1..8c1ac4380c1 100644
--- a/source/blender/blenlib/BLI_vector.h
+++ b/source/blender/blenlib/BLI_vector.h
@@ -559,7 +559,7 @@ template<typename T, uint N = 4, typename Allocator = GuardedAllocator> class Ve
     return (uint)(m_capacity_end - m_begin);
   }
 
-  IndexRange index_iterator() const
+  IndexRange index_range() const
   {
     return IndexRange(this->size());
   }
diff --git a/source/blender/blenlib/BLI_virtual_list_ref.h b/source/blender/blenlib/BLI_virtual_list_ref.h
index 7826181a509..3f9cfab1f4d 100644
--- a/source/blender/blenlib/BLI_virtual_list_ref.h
+++ b/source/blender/blenlib/BLI_virtual_list_ref.h
@@ -176,7 +176,7 @@ template<typename T> class VirtualListRef {
     return false;
   }
 
-  IndexRange index_iterator() const
+  IndexRange index_range() const
   {
     return IndexRange(m_virtual_size);
   }
diff --git a/source/blender/functions/FN_multi_function_context.h b/source/blender/functions/FN_multi_function_context.h
index b32e869ec17..fd17d335b9b 100644
--- a/source/blender/functions/FN_multi_function_context.h
+++ b/source/blender/functions/FN_multi_function_context.h
@@ -60,7 +60,7 @@ class MFElementContexts {
   template<typename T> Optional<TypedContext<T>> try_find() const
   {
     BLI::class_id_t context_id = BLI::get_class_id<T>();
-    for (uint i : m_contexts.index_iterator()) {
+    for (uint i : m_contexts.index_range()) {
       if (m_ids[i] == context_id) {
         const T *context = (const T *)m_contexts[i];
         return TypedContext<T>{context, m_indices[i]};
@@ -83,7 +83,7 @@ class MFGlobalContexts {
   template<typename T> const T *try_find() const
   {
     BLI::class_id_t context_id = BLI::get_class_id<T>();
-    for (uint i : m_contexts.index_iterator()) {
+    for (uint i : m_contexts.index_range()) {
       if (m_ids[i] == context_id) {
         const T *context = (const T *)m_contexts[i];
         return context;
@@ -154,7 +154,7 @@ inline void MFContextBuilder::add_global_contexts(const MFContext &other)
 {
   const MFGlobalContexts &global_contexts = other.m_builder->m_global_contexts;
 
-  for (uint i : global_contexts.m_ids.index_iterator()) {
+  for (uint i : global_contexts.m_ids.index_range()) {
     BLI::class_id_t id = other.m_builder->m_global_contexts.m_ids[i];
     const void *context = other.m_builder->m_global_contexts.m_contexts[i];
 
diff --git a/source/blender/functions/FN_node_tree_multi_function_network.h b/source/blender/functions/FN_node_tree_multi_function_network.h
index 4316068349e..4ef35342df2 100644
--- a/source/blender/functions/FN_node_tree_multi_function_network.h
+++ b/source/blender/functions/FN_node_tree_multi_function_network.h
@@ -167,7 +167,7 @@ class FunctionTreeMFNetwork {
                             MutableArrayRef<const MFOutputSocket *> r_result) const
   {
     BLI_assert(fsockets.size() == r_result.size());
-    for (uint i : fsockets.index_iterator()) {
+    for (uint i : fsockets.index_range()) {
       r_result[i] = &this->lookup_socket(*fsockets[i]);
     }
   }
@@ -176,7 +176,7 @@ class FunctionTreeMFNetwork {
                             MutableArrayRef<const MFInputSocket *> r_result) const
   {
     BLI_assert(fsockets.size() == r_result.size());
-    for (uint i : fsockets.index_iterator()) {
+    for (uint i : fsockets.index_range()) {
       r_result[i] = &this->lookup_dummy_socket(*fsockets[i]);
     }
   }
diff --git a/source/blender/functions/intern/attributes_ref.cc b/source/blender/functions/intern/attributes_ref.cc
index 93c54a407ac..9571a58a19f 100644
--- a/source/blender/functions/intern/attributes_ref.cc
+++ b/source/blender/functions/intern/attributes_ref.cc
@@ -63,7 +63,7 @@ void MutableAttributesRef::destruct_and_reorder(IndexMask index_mask)
 
     array.destruct_indices(index_mask);
 
-    for (uint i : index_mask.index_iterator()) {
+    for (uint i : index_mask.index_range()) {
       uint last_index = m_range.size() - 1 - i;
       uint index_to_remove = index_mask[index_mask.size() - 1 - i];
       if (index_to_remove == last_index) {
diff --git a/source/blender/functions/intern/multi_function_network.cc b/source/blender/functions/intern/multi_function_network.cc
index 8e5ffc97f63..a8171bc2d3b 100644
--- a/source/blender/functions/intern/multi_function_network.cc
+++ b/source/blender/functions/intern/multi_function_network.cc
@@ -66,7 +66,7 @@ MFBuilderFunctionNode &MFNetworkBuilder::add_function(const MultiFunction &funct
   node.m_output_param_indices = output_param_indices;
   node.m_id = m_node_by_id.size();
 
-  for (uint i : input_param_indices.index_iterator()) {
+  for (uint i : input_param_indices.index_range()) {
     uint param_index = input_param_indices[i];
     MFParamType param = function.param_type(param_index);
     BLI_assert(param.is_input_or_mutable());
@@ -82,7 +82,7 @@ MFBuilderFunctionNode &MFNetworkBuilder::add_function(const MultiFunction &funct
     m_input_sockets.append(&input_socket);
   }
 
-  for (uint i : output_param_indices.index_iterator()) {
+  for (uint i : output_param_indices.index_range()) {
     uint param_index = output_param_indices[i];
     MFParamType param = function.param_type(param_index);
     BLI_assert(param.is_output_or_mutable());
@@ -116,7 +116,7 @@ MFBuilderDummyNode &MFNetworkBuilder::add_dummy(StringRef name,
   node.m_id = m_node_by_id.size();
   node.m_name = m_allocator.copy_string(name);
 
-  for (uint i : input_types.index_iterator()) {
+  for (uint i : input_types.index_range()) {
     auto &input_socket = *m_allocator.construct<MFBuilderInputSocket>().release();
     input_socket.m_data_type = input_types[i];
     input_socket.m_node = &node;
@@ -128,7 +128,7 @@ MFBuilderDummyNode &MFNetworkBuilder::add_dummy(StringRef name,
     m_socket_by_id.append(&input_socket);
     m_input_sockets.append(&input_socket);
   }
-  for (uint i : output_types.index_iterator()) {
+  for (uint i : output_types.index_range()) {
     auto &output_socket = *m_allocator.construct<MFBuilderOutputSocket>().release();
     output_socket.m_data_type = output_types[i];
     output_socket.m_node = &node;
diff --git a/source/blender/functions/intern/multi_functions/mixed.cc b/source/blender/functions/intern/multi_functions/mixed.cc
index fb229a66680..93b3659be4e 100644
--- a/source/blender/functions/intern/multi_functions/mixed.cc
+++ b/source/blender/functions/intern/multi_functions/mixed.cc
@@ -847,7 +847,7 @@ static BLI_NOINLINE Vector<int> find_non_close_indices(VirtualListRef<float3> po
   BLI_kdtree_3d_free(kdtree);
 
   Vector<int> indices;
-  for (uint i : keep_index.index_iterator()) {
+  for (uint i : keep_index.index_range()) {
     if (keep_index[i]) {
       indices.append(i);
     }
@@ -885,7 +885,7 @@ void MF_JoinTextList::call(IndexMask mask, MFParams params, MFContext UNUSED(con
   for (uint index : mask.indices()) {
     VirtualListRef<std::string> texts = text_lists[index];
     std::string r_text = "";
-    for (uint i : texts.index_iterator()) {
+    for (uint i : texts.index_range()) {
       r_text += texts[i];
     }
     new (&r_texts[index]) std::string(std::move(r_text));
diff --git a/source/blender/functions/intern/multi_functions/network.cc b/source/blender/functions/intern/multi_functions/network.cc
index 12fcba390a1..96afd293f54 100644
--- a/source/blender/functions/intern/multi_functions/network.cc
+++ b/source/blender/functions/intern/multi_functions/network.cc
@@ -257,7 +257,7 @@ void MF_EvaluateNetwork::call(IndexMask mask, MFParams params, MFContext context
 BLI_NOINLINE void MF_EvaluateNetwork::copy_inputs_to_storage(MFParams params,
       

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list