[Bf-blender-cvs] [586210c437a] functions: use common prefix for function getters
Jacques Lucke
noreply at git.blender.org
Sat Apr 6 21:48:52 CEST 2019
Commit: 586210c437a0c6fc8763e4c73539affdd2e82a77
Author: Jacques Lucke
Date: Sat Apr 6 21:44:10 2019 +0200
Branches: functions
https://developer.blender.org/rB586210c437a0c6fc8763e4c73539affdd2e82a77
use common prefix for function getters
===================================================================
M source/blender/functions/frontends/data_flow_nodes/inserters/conversions.cpp
M source/blender/functions/frontends/data_flow_nodes/inserters/nodes.cpp
M source/blender/functions/functions/auto_vectorization.cpp
M source/blender/functions/functions/auto_vectorization.hpp
M source/blender/functions/functions/lists.cpp
M source/blender/functions/functions/lists.hpp
M source/blender/functions/functions/object_input.cpp
M source/blender/functions/functions/object_input.hpp
M source/blender/functions/functions/random.cpp
M source/blender/functions/functions/random.hpp
M source/blender/functions/functions/scalar_math.cpp
M source/blender/functions/functions/scalar_math.hpp
M source/blender/functions/functions/simple_conversions.cpp
M source/blender/functions/functions/simple_conversions.hpp
M source/blender/functions/functions/switch.cpp
M source/blender/functions/functions/switch.hpp
M source/blender/functions/functions/vectors.cpp
M source/blender/functions/functions/vectors.hpp
===================================================================
diff --git a/source/blender/functions/frontends/data_flow_nodes/inserters/conversions.cpp b/source/blender/functions/frontends/data_flow_nodes/inserters/conversions.cpp
index e897abd017b..9d7f1398731 100644
--- a/source/blender/functions/frontends/data_flow_nodes/inserters/conversions.cpp
+++ b/source/blender/functions/frontends/data_flow_nodes/inserters/conversions.cpp
@@ -12,7 +12,7 @@ namespace FN { namespace DataFlowNodes {
struct bNodeLink *UNUSED(source_link))
{
SharedType &base_type = from.type();
- auto fn = Functions::list_from_element(base_type);
+ auto fn = Functions::GET_FN_list_from_element(base_type);
Node *node = builder.insert_function(fn);
builder.insert_link(from, node->input(0));
builder.insert_link(node->output(0), to);
@@ -21,8 +21,8 @@ namespace FN { namespace DataFlowNodes {
void register_conversion_inserters(GraphInserters &inserters)
{
- inserters.reg_conversion_function("Integer", "Float", Functions::int32_to_float);
- inserters.reg_conversion_function("Float", "Integer", Functions::float_to_int32);
+ inserters.reg_conversion_function("Integer", "Float", Functions::GET_FN_int32_to_float);
+ inserters.reg_conversion_function("Float", "Integer", Functions::GET_FN_float_to_int32);
inserters.reg_conversion_inserter("Float", "Float List", insert_base_to_list_conversion);
inserters.reg_conversion_inserter("Vector", "Vector List", insert_base_to_list_conversion);
diff --git a/source/blender/functions/frontends/data_flow_nodes/inserters/nodes.cpp b/source/blender/functions/frontends/data_flow_nodes/inserters/nodes.cpp
index f204cd70c08..88d608bb291 100644
--- a/source/blender/functions/frontends/data_flow_nodes/inserters/nodes.cpp
+++ b/source/blender/functions/frontends/data_flow_nodes/inserters/nodes.cpp
@@ -21,7 +21,7 @@ namespace FN { namespace DataFlowNodes {
RNA_pointer_create(ctx.btree_id(), &RNA_Node, bnode, &ptr);
Object *object = (Object *)RNA_pointer_get(&ptr, "object").id.data;
- auto fn = Functions::object_location(object);
+ auto fn = Functions::GET_FN_object_location(object);
Node *node = builder.insert_function(fn, ctx.btree(), bnode);
builder.map_sockets(ctx, node, bnode);
}
@@ -30,11 +30,11 @@ namespace FN { namespace DataFlowNodes {
{
switch (operation)
{
- case 1: return Functions::add_floats();
- case 2: return Functions::multiply_floats();
- case 3: return Functions::min_floats();
- case 4: return Functions::max_floats();
- case 5: return Functions::sin_float();
+ case 1: return Functions::GET_FN_add_floats();
+ case 2: return Functions::GET_FN_multiply_floats();
+ case 3: return Functions::GET_FN_min_floats();
+ case 4: return Functions::GET_FN_max_floats();
+ case 5: return Functions::GET_FN_sin_float();
default:
BLI_assert(false);
return *(SharedFunction *)nullptr;
@@ -59,7 +59,7 @@ namespace FN { namespace DataFlowNodes {
{
switch (operation)
{
- case 1: return Functions::add_vectors();
+ case 1: return Functions::GET_FN_add_vectors();
default:
BLI_assert(false);
return *(SharedFunction *)nullptr;
@@ -85,8 +85,8 @@ namespace FN { namespace DataFlowNodes {
const BuilderContext &ctx,
bNode *bnode)
{
- SharedFunction &max_fn = Functions::max_floats();
- SharedFunction &min_fn = Functions::min_floats();
+ SharedFunction &max_fn = Functions::GET_FN_max_floats();
+ SharedFunction &min_fn = Functions::GET_FN_min_floats();
Node *max_node = builder.insert_function(max_fn, ctx.btree(), bnode);
Node *min_node = builder.insert_function(min_fn, ctx.btree(), bnode);
@@ -104,7 +104,7 @@ namespace FN { namespace DataFlowNodes {
bNode *bnode)
{
SharedType &base_type = ctx.type_from_rna(bnode, "active_type");
- SharedFunction &fn = Functions::get_list_element(base_type);
+ SharedFunction &fn = Functions::GET_FN_get_list_element(base_type);
Node *node = builder.insert_function(fn, ctx.btree(), bnode);
builder.map_sockets(ctx, node, bnode);
}
@@ -115,7 +115,7 @@ namespace FN { namespace DataFlowNodes {
bNode *bnode)
{
SharedType &base_type = ctx.type_from_rna(bnode, "active_type");
- SharedFunction &fn = Functions::list_length(base_type);
+ SharedFunction &fn = Functions::GET_FN_list_length(base_type);
Node *node = builder.insert_function(fn, ctx.btree(), bnode);
builder.map_sockets(ctx, node, bnode);
}
@@ -128,7 +128,7 @@ namespace FN { namespace DataFlowNodes {
const char *prop_name,
uint start_index)
{
- auto &empty_fn = Functions::empty_list(base_type);
+ auto &empty_fn = Functions::GET_FN_empty_list(base_type);
Node *node = builder.insert_function(empty_fn, ctx.btree(), bnode);
PointerRNA ptr;
@@ -141,14 +141,14 @@ namespace FN { namespace DataFlowNodes {
int state = RNA_enum_get(&itemptr, "state");
if (state == 0) {
/* single value case */
- auto &append_fn = Functions::append_to_list(base_type);
+ auto &append_fn = Functions::GET_FN_append_to_list(base_type);
new_node = builder.insert_function(append_fn, ctx.btree(), bnode);
builder.insert_link(node->output(0), new_node->input(0));
builder.map_input(ctx, new_node->input(1), bnode, index);
}
else if (state == 1) {
/* list case */
- auto &combine_fn = Functions::combine_lists(base_type);
+ auto &combine_fn = Functions::GET_FN_combine_lists(base_type);
new_node = builder.insert_function(combine_fn, ctx.btree(), bnode);
builder.insert_link(node->output(0), new_node->input(0));
builder.map_input(ctx, new_node->input(1), bnode, index);
@@ -206,7 +206,7 @@ namespace FN { namespace DataFlowNodes {
bNode *bnode)
{
SharedType &data_type = ctx.type_from_rna(bnode, "data_type");
- auto fn = Functions::bool_switch(data_type);
+ auto fn = Functions::GET_FN_bool_switch(data_type);
Node *node = builder.insert_function(fn);
builder.map_sockets(ctx, node, bnode);
}
@@ -224,7 +224,7 @@ namespace FN { namespace DataFlowNodes {
SharedFunction &fn, const SmallVector<bool> vectorized_inputs)
{
if (vectorized_inputs.contains(true)) {
- return Functions::auto_vectorization(fn, vectorized_inputs);
+ return Functions::to_vectorized_function(fn, vectorized_inputs);
}
else {
return fn;
@@ -245,7 +245,7 @@ namespace FN { namespace DataFlowNodes {
vectorized_socket_is_list(&ptr, "use_list__z"),
};
- SharedFunction &original_fn = Functions::combine_vector();
+ SharedFunction &original_fn = Functions::GET_FN_combine_vector();
SharedFunction final_fn = original_or_vectorized(
original_fn, vectorized_inputs);
@@ -265,7 +265,7 @@ namespace FN { namespace DataFlowNodes {
vectorized_socket_is_list(&ptr, "use_list__vector"),
};
- SharedFunction &original_fn = Functions::separate_vector();
+ SharedFunction &original_fn = Functions::GET_FN_separate_vector();
SharedFunction final_fn = original_or_vectorized(
original_fn, vectorized_inputs);
@@ -275,9 +275,9 @@ namespace FN { namespace DataFlowNodes {
void register_node_inserters(GraphInserters &inserters)
{
- inserters.reg_node_function("fn_VectorDistanceNode", Functions::separate_vector);
- inserters.reg_node_function("fn_RandomNumberNode", Functions::random_number);
- inserters.reg_node_function("fn_MapRangeNode", Functions::map_range);
+ inserters.reg_node_function("fn_VectorDistanceNode", Functions::GET_FN_vector_distance);
+ inserters.reg_node_function("fn_RandomNumberNode", Functions::GET_FN_random_number);
+ inserters.reg_node_function("fn_MapRangeNode", Functions::GET_FN_map_range);
inserters.reg_node_inserter("fn_SeparateVectorNode", insert_separate_vector_node);
inserters.reg_node_inserter("fn_CombineVectorNode", insert_combine_vector_node);
diff --git a/source/blender/functions/functions/auto_vectorization.cpp b/source/blender/functions/functions/auto_vectorization.cpp
index 7b57bd663c1..6cfdafe3ed0 100644
--- a/source/blender/functions/functions/auto_vectorization.cpp
+++ b/source/blender/functions/functions/auto_vectorization.cpp
@@ -37,8 +37,8 @@ namespace FN { namespace Functions {
}
for (uint i : m_list_inputs) {
SharedType &base_type = main->signature().inputs()[i].type();
- m_get_length_bodies.append(list_length(base_type)->body<TupleCallBody>());
- m_get_element_bodies.append(get_list_element(base_type)->body<TupleCallBody>());
+ m_get_length_bodies.append(GET_FN_list_length(base_type)->body<TupleCallBody>());
+ m_get_element_bodies.append(GET_FN_get_list_element(base_type)->body<TupleCallBody>());
}
m_max_len_in_size = 0;
@@ -50,8 +50,8 @@ namespace FN { namespace Functions {
for (auto output : main->signature().outputs()) {
SharedType &base_type = output.type();
- m_create_empty_bodies.append(empty_list(base_type)->body<TupleCallBody>());
- m_append_bodies.append(append_to_list(base_type)->body<TupleCallBody>());
+ m_create_empty_bodies.append(GET_FN_empty_list(base_type)->body<TupleCallBody>());
+ m_append_bodies.append(GET_FN_append_to_list(base_type)->body<TupleCallBody>());
}
}
@@ -163,7 +163,7 @@ namespace FN { namespace Functions {
return false;
}
- SharedFunction auto_vectorization(
+ SharedFunction to_vectorized_function(
SharedFunction &original_fn,
const SmallVector<bool> &vectorize_input)
{
diff --git a/source/blender/functions/functions/auto_vectorization.hpp b/source/blender/functions/functions/auto_vectorization.hpp
index 7567f364bee..85ef6a03586 100644
--- a/source/blender/functions/functions/auto_vectorization.hpp
+++ b/source/blender/functions/functions/auto_vectorization.hpp
@@ -4,7 +4,7 @@
namespace FN { namespace Functions {
- SharedFunction auto_vectorization(
+ SharedFunction to_vectorized_function(
SharedFunction &fn,
const SmallVector<bool> &vectorize_input);
diff --git a/source/blender/functions/functions/lists.cpp b/source/blender/functions/functions/lists.cpp
index 44f72ee8fdf..d44f5ea02f1 100644
--- a/source/blender/functions/functions/lists.cpp
+++ b/source/blender/functions/functions/lists.cpp
@@ -237,42 +237,42 @@ namespace FN { namespace Functions {
/* Access List Functions
*************************************/
- SharedFunction
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list