[Bf-blender-cvs] [87b472e1f64] functions: use common prefix for type getters
Jacques Lucke
noreply at git.blender.org
Sat Apr 6 21:48:55 CEST 2019
Commit: 87b472e1f64962ede167a758b4974bba8a971d50
Author: Jacques Lucke
Date: Sat Apr 6 21:48:43 2019 +0200
Branches: functions
https://developer.blender.org/rB87b472e1f64962ede167a758b4974bba8a971d50
use common prefix for type getters
===================================================================
M source/blender/functions/frontends/data_flow_nodes/builder.cpp
M source/blender/functions/functions/lists.cpp
M source/blender/functions/functions/object_input.cpp
M source/blender/functions/functions/random.cpp
M source/blender/functions/functions/scalar_math.cpp
M source/blender/functions/functions/simple_conversions.cpp
M source/blender/functions/functions/switch.cpp
M source/blender/functions/functions/vectors.cpp
M source/blender/functions/types/boolean.cpp
M source/blender/functions/types/boolean.hpp
M source/blender/functions/types/numeric.cpp
M source/blender/functions/types/numeric.hpp
M source/blender/functions/types/numeric_lists.cpp
M source/blender/functions/types/numeric_lists.hpp
M source/blender/functions/types/types-c.cpp
===================================================================
diff --git a/source/blender/functions/frontends/data_flow_nodes/builder.cpp b/source/blender/functions/frontends/data_flow_nodes/builder.cpp
index f12da413abc..a680dbaec7e 100644
--- a/source/blender/functions/frontends/data_flow_nodes/builder.cpp
+++ b/source/blender/functions/frontends/data_flow_nodes/builder.cpp
@@ -227,25 +227,25 @@ namespace FN { namespace DataFlowNodes {
SharedType &BuilderContext::type_by_name(const char *data_type) const
{
if (STREQ(data_type, "Float")) {
- return Types::get_float_type();
+ return Types::GET_TYPE_float();
}
else if (STREQ(data_type, "Integer")) {
- return Types::get_int32_type();
+ return Types::GET_TYPE_int32();
}
else if (STREQ(data_type, "Vector")) {
- return Types::get_fvec3_type();
+ return Types::GET_TYPE_fvec3();
}
else if (STREQ(data_type, "Boolean")) {
- return Types::get_bool_type();
+ return Types::GET_TYPE_bool();
}
else if (STREQ(data_type, "Float List")) {
- return Types::get_float_list_type();
+ return Types::GET_TYPE_float_list();
}
else if (STREQ(data_type, "Vector List")) {
- return Types::get_fvec3_list_type();
+ return Types::GET_TYPE_fvec3_list();
}
else if (STREQ(data_type, "Integer List")) {
- return Types::get_int32_list_type();
+ return Types::GET_TYPE_int32_list();
}
else {
BLI_assert(false);
diff --git a/source/blender/functions/functions/lists.cpp b/source/blender/functions/functions/lists.cpp
index d44f5ea02f1..e799e368786 100644
--- a/source/blender/functions/functions/lists.cpp
+++ b/source/blender/functions/functions/lists.cpp
@@ -116,7 +116,7 @@ namespace FN { namespace Functions {
std::string name = "Get " + base_type->name() + " List Element";
auto fn = SharedFunction::New(name, Signature({
InputParameter("List", list_type),
- InputParameter("Index", get_int32_type()),
+ InputParameter("Index", GET_TYPE_int32()),
InputParameter("Fallback", base_type),
}, {
OutputParameter("Element", base_type),
@@ -176,7 +176,7 @@ namespace FN { namespace Functions {
auto fn = SharedFunction::New(name, Signature({
InputParameter("List", list_type),
}, {
- OutputParameter("Length", get_int32_type()),
+ OutputParameter("Length", GET_TYPE_int32()),
}));
fn->add_body(new ListLength<T>());
return fn;
@@ -225,11 +225,11 @@ namespace FN { namespace Functions {
{
ListFunctions functions;
insert_list_functions_for_type<float>(
- functions, get_float_type(), get_float_list_type());
+ functions, GET_TYPE_float(), GET_TYPE_float_list());
insert_list_functions_for_type<Vector>(
- functions, get_fvec3_type(), get_fvec3_list_type());
+ functions, GET_TYPE_fvec3(), GET_TYPE_fvec3_list());
insert_list_functions_for_type<int32_t>(
- functions, get_int32_type(), get_int32_list_type());
+ functions, GET_TYPE_int32(), GET_TYPE_int32_list());
return functions;
}
diff --git a/source/blender/functions/functions/object_input.cpp b/source/blender/functions/functions/object_input.cpp
index 23ca705890a..f107d44a948 100644
--- a/source/blender/functions/functions/object_input.cpp
+++ b/source/blender/functions/functions/object_input.cpp
@@ -47,7 +47,7 @@ namespace FN { namespace Functions {
SharedFunction GET_FN_object_location(Object *object)
{
auto fn = SharedFunction::New("Object Transforms", Signature({}, {
- OutputParameter("Location", get_fvec3_type()),
+ OutputParameter("Location", GET_TYPE_fvec3()),
}));
fn->add_body(new ObjectTransforms(object));
fn->add_body(new ObjectTransformsDependency(object));
diff --git a/source/blender/functions/functions/random.cpp b/source/blender/functions/functions/random.cpp
index 512ad7162ae..1930e9072b4 100644
--- a/source/blender/functions/functions/random.cpp
+++ b/source/blender/functions/functions/random.cpp
@@ -35,11 +35,11 @@ namespace FN { namespace Functions {
LAZY_INIT_REF__NO_ARG(SharedFunction, GET_FN_random_number)
{
auto fn = SharedFunction::New("Random Number", Signature({
- InputParameter("Seed", get_int32_type()),
- InputParameter("Min", get_float_type()),
- InputParameter("Max", get_float_type()),
+ InputParameter("Seed", GET_TYPE_int32()),
+ InputParameter("Min", GET_TYPE_float()),
+ InputParameter("Max", GET_TYPE_float()),
}, {
- OutputParameter("Value", get_float_type()),
+ OutputParameter("Value", GET_TYPE_float()),
}));
fn->add_body(new RandomNumber());
return fn;
diff --git a/source/blender/functions/functions/scalar_math.cpp b/source/blender/functions/functions/scalar_math.cpp
index 0e2972d9427..8f6de75aff3 100644
--- a/source/blender/functions/functions/scalar_math.cpp
+++ b/source/blender/functions/functions/scalar_math.cpp
@@ -14,9 +14,9 @@ namespace FN { namespace Functions {
static SharedFunction get_math_function__one_input(std::string name)
{
auto fn = SharedFunction::New(name, Signature({
- InputParameter("Value", get_float_type()),
+ InputParameter("Value", GET_TYPE_float()),
}, {
- OutputParameter("Result", get_float_type()),
+ OutputParameter("Result", GET_TYPE_float()),
}));
return fn;
}
@@ -24,10 +24,10 @@ namespace FN { namespace Functions {
static SharedFunction get_math_function__two_inputs(std::string name)
{
auto fn = SharedFunction::New(name, Signature({
- InputParameter("A", get_float_type()),
- InputParameter("B", get_float_type()),
+ InputParameter("A", GET_TYPE_float()),
+ InputParameter("B", GET_TYPE_float()),
}, {
- OutputParameter("Result", get_float_type()),
+ OutputParameter("Result", GET_TYPE_float()),
}));
return fn;
}
@@ -158,13 +158,13 @@ namespace FN { namespace Functions {
LAZY_INIT_REF__NO_ARG(SharedFunction, GET_FN_map_range)
{
auto fn = SharedFunction::New("Map Range", Signature({
- InputParameter("Value", get_float_type()),
- InputParameter("From Min", get_float_type()),
- InputParameter("From Max", get_float_type()),
- InputParameter("To Min", get_float_type()),
- InputParameter("To Max", get_float_type()),
+ InputParameter("Value", GET_TYPE_float()),
+ InputParameter("From Min", GET_TYPE_float()),
+ InputParameter("From Max", GET_TYPE_float()),
+ InputParameter("To Min", GET_TYPE_float()),
+ InputParameter("To Max", GET_TYPE_float()),
}, {
- OutputParameter("Value", get_float_type()),
+ OutputParameter("Value", GET_TYPE_float()),
}));
fn->add_body(new MapRange());
return fn;
diff --git a/source/blender/functions/functions/simple_conversions.cpp b/source/blender/functions/functions/simple_conversions.cpp
index 42d2ecee8ec..d5720564b50 100644
--- a/source/blender/functions/functions/simple_conversions.cpp
+++ b/source/blender/functions/functions/simple_conversions.cpp
@@ -32,7 +32,7 @@ namespace FN { namespace Functions {
LAZY_INIT_REF__NO_ARG(SharedFunction, GET_FN_int32_to_float)
{
- auto fn = get_simple_conversion_function(get_int32_type(), get_float_type());
+ auto fn = get_simple_conversion_function(GET_TYPE_int32(), GET_TYPE_float());
fn->add_body(new Int32ToFloat());
return fn;
}
@@ -48,7 +48,7 @@ namespace FN { namespace Functions {
LAZY_INIT_REF__NO_ARG(SharedFunction, GET_FN_float_to_int32)
{
- auto fn = get_simple_conversion_function(get_float_type(), get_int32_type());
+ auto fn = get_simple_conversion_function(GET_TYPE_float(), GET_TYPE_int32());
fn->add_body(new FloatToInt32());
return fn;
}
diff --git a/source/blender/functions/functions/switch.cpp b/source/blender/functions/functions/switch.cpp
index cf0d46c503e..48b67327eb7 100644
--- a/source/blender/functions/functions/switch.cpp
+++ b/source/blender/functions/functions/switch.cpp
@@ -55,7 +55,7 @@ namespace FN { namespace Functions {
{
std::string name = "Switch " + data_type->name();
auto fn = SharedFunction::New(name, Signature({
- InputParameter("Condition", get_bool_type()),
+ InputParameter("Condition", GET_TYPE_bool()),
InputParameter("True", data_type),
InputParameter("False", data_type),
}, {
diff --git a/source/blender/functions/functions/vectors.cpp b/source/blender/functions/functions/vectors.cpp
index bfa79d21c81..fb78d00a470 100644
--- a/source/blender/functions/functions/vectors.cpp
+++ b/source/blender/functions/functions/vectors.cpp
@@ -17,7 +17,7 @@ namespace FN { namespace Functions {
const BuildIRSettings &UNUSED(settings)) const override
{
llvm::Type *vector_ty = get_llvm_type(
- get_fvec3_type(), builder.getContext());
+ GET_TYPE_fvec3(), builder.getContext());
llvm::Value *vector = llvm::UndefValue::get(vector_ty);
vector = builder.CreateInsertValue(vector, interface.get_input(0), 0);
@@ -30,11 +30,11 @@ namespace FN { namespace Functions {
LAZY_INIT_REF__NO_ARG(SharedFunction, GET_FN_combine_vector)
{
auto fn = SharedFunction::New("Combine Vector", Signature({
- InputParameter("X", get_float_type()),
- InputParameter("Y", get_float_type()),
- InputParameter("Z", get_float_type()),
+ InputParameter("X", GET_TYPE_float()),
+ InputParameter("Y", GET_TYPE_float()),
+ InputParameter("Z", GET_TYPE_float()),
}, {
- OutputParameter("Vector", get_fvec3_type()),
+ OutputParameter("Vector", GET_TYPE_fvec3()),
}));
fn->add_body(new CombineVectorGen());
return fn;
@@ -56,11 +56,11 @@ namespace FN { namespace Functions {
LAZY_INIT_REF__NO_ARG(SharedFunction, GET_FN_separate_vector)
{
auto fn = SharedFunction::New("Separate Vector", Signature({
- InputParameter("Vector", get_fvec3_type()),
+ InputParameter("Vector", GET_TYPE_fvec3()),
}, {
- OutputParameter("X", get_float_type()),
- OutputParameter("Y", get_float_type()),
- OutputParameter("Z", get_float_type()),
+ OutputParameter("X", GET_TYPE_float()),
+ OutputParameter("Y", GET_TYPE_float()),
+ OutputParameter("Z", GET_TYPE_float()),
}));
fn->add_body(new SeparateVector());
return fn;
@@ -80,10 +80,10 @@ namespace FN { namespace Functions {
LAZY_INIT_REF__NO_ARG(SharedFunction, GET_FN_vector_distance)
{
auto fn = SharedFunction::New("Vector Distance", Signature({
- InputParameter("A", get_fvec3_type()),
- InputParameter("B", get_fvec3_type()),
+ InputParameter("A", GET_TYPE_fvec3()),
+ InputParameter("B", GET
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list