Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_attribute_compare.cc
| Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | static void do_equal_operation_float3(const Float3ReadAttribute &input_a, | ||||
| const int size = input_a.size(); | const int size = input_a.size(); | ||||
| for (const int i : IndexRange(size)) { | for (const int i : IndexRange(size)) { | ||||
| const float3 a = input_a[i]; | const float3 a = input_a[i]; | ||||
| const float3 b = input_b[i]; | const float3 b = input_b[i]; | ||||
| span_result[i] = len_squared_v3v3(a, b) < threshold_squared; | span_result[i] = len_squared_v3v3(a, b) < threshold_squared; | ||||
| } | } | ||||
| } | } | ||||
| static void do_equal_operation_color4f(const Color4fReadAttribute &input_a, | static void do_equal_operation_color4f(const ColorGeometryReadAttribute &input_a, | ||||
| const Color4fReadAttribute &input_b, | const ColorGeometryReadAttribute &input_b, | ||||
| const float threshold, | const float threshold, | ||||
| MutableSpan<bool> span_result) | MutableSpan<bool> span_result) | ||||
| { | { | ||||
| const float threshold_squared = pow2f(threshold); | const float threshold_squared = pow2f(threshold); | ||||
| const int size = input_a.size(); | const int size = input_a.size(); | ||||
| for (const int i : IndexRange(size)) { | for (const int i : IndexRange(size)) { | ||||
| const Color4f a = input_a[i]; | const ColorGeometry a = input_a[i]; | ||||
| const Color4f b = input_b[i]; | const ColorGeometry b = input_b[i]; | ||||
| span_result[i] = len_squared_v4v4(a, b) < threshold_squared; | span_result[i] = len_squared_v4v4(a, b) < threshold_squared; | ||||
| } | } | ||||
| } | } | ||||
| static void do_equal_operation_bool(const BooleanReadAttribute &input_a, | static void do_equal_operation_bool(const BooleanReadAttribute &input_a, | ||||
| const BooleanReadAttribute &input_b, | const BooleanReadAttribute &input_b, | ||||
| const float UNUSED(threshold), | const float UNUSED(threshold), | ||||
| MutableSpan<bool> span_result) | MutableSpan<bool> span_result) | ||||
| Show All 28 Lines | static void do_not_equal_operation_float3(const Float3ReadAttribute &input_a, | ||||
| const int size = input_a.size(); | const int size = input_a.size(); | ||||
| for (const int i : IndexRange(size)) { | for (const int i : IndexRange(size)) { | ||||
| const float3 a = input_a[i]; | const float3 a = input_a[i]; | ||||
| const float3 b = input_b[i]; | const float3 b = input_b[i]; | ||||
| span_result[i] = len_squared_v3v3(a, b) >= threshold_squared; | span_result[i] = len_squared_v3v3(a, b) >= threshold_squared; | ||||
| } | } | ||||
| } | } | ||||
| static void do_not_equal_operation_color4f(const Color4fReadAttribute &input_a, | static void do_not_equal_operation_color4f(const ColorGeometryReadAttribute &input_a, | ||||
| const Color4fReadAttribute &input_b, | const ColorGeometryReadAttribute &input_b, | ||||
| const float threshold, | const float threshold, | ||||
| MutableSpan<bool> span_result) | MutableSpan<bool> span_result) | ||||
| { | { | ||||
| const float threshold_squared = pow2f(threshold); | const float threshold_squared = pow2f(threshold); | ||||
| const int size = input_a.size(); | const int size = input_a.size(); | ||||
| for (const int i : IndexRange(size)) { | for (const int i : IndexRange(size)) { | ||||
| const Color4f a = input_a[i]; | const ColorGeometry a = input_a[i]; | ||||
| const Color4f b = input_b[i]; | const ColorGeometry b = input_b[i]; | ||||
| span_result[i] = len_squared_v4v4(a, b) >= threshold_squared; | span_result[i] = len_squared_v4v4(a, b) >= threshold_squared; | ||||
| } | } | ||||
| } | } | ||||
| static void do_not_equal_operation_bool(const BooleanReadAttribute &input_a, | static void do_not_equal_operation_bool(const BooleanReadAttribute &input_a, | ||||
| const BooleanReadAttribute &input_b, | const BooleanReadAttribute &input_b, | ||||
| const float UNUSED(threshold), | const float UNUSED(threshold), | ||||
| MutableSpan<bool> span_result) | MutableSpan<bool> span_result) | ||||
| ▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines | |||||