Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_spreadsheet/spreadsheet_column.cc
| Show All 12 Lines | |||||
| * along with this program; if not, write to the Free Software Foundation, | * along with this program; if not, write to the Free Software Foundation, | ||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| */ | */ | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_color.hh" | |||||
| #include "BLI_float2.hh" | |||||
| #include "BLI_float3.hh" | |||||
| #include "BLI_hash.hh" | #include "BLI_hash.hh" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_string_ref.hh" | #include "BLI_string_ref.hh" | ||||
| #include "BKE_geometry_set.hh" | |||||
| #include "FN_cpp_type.hh" | |||||
| #include "spreadsheet_column.hh" | #include "spreadsheet_column.hh" | ||||
| namespace blender::ed::spreadsheet { | namespace blender::ed::spreadsheet { | ||||
| eSpreadsheetColumnValueType cpp_type_to_column_type(const fn::CPPType &type) | |||||
| { | |||||
| if (type.is<bool>()) { | |||||
| return SPREADSHEET_VALUE_TYPE_BOOL; | |||||
| } | |||||
| if (type.is<int>()) { | |||||
| return SPREADSHEET_VALUE_TYPE_INT32; | |||||
| } | |||||
| if (type.is<float>()) { | |||||
| return SPREADSHEET_VALUE_TYPE_FLOAT; | |||||
| } | |||||
| if (type.is<float2>()) { | |||||
| return SPREADSHEET_VALUE_TYPE_FLOAT2; | |||||
| } | |||||
| if (type.is<float3>()) { | |||||
| return SPREADSHEET_VALUE_TYPE_FLOAT3; | |||||
| } | |||||
| if (type.is<ColorGeometry4f>()) { | |||||
| return SPREADSHEET_VALUE_TYPE_COLOR; | |||||
| } | |||||
| if (type.is<std::string>()) { | |||||
| return SPREADSHEET_VALUE_TYPE_STRING; | |||||
| } | |||||
| if (type.is<InstanceReference>()) { | |||||
| return SPREADSHEET_VALUE_TYPE_INSTANCES; | |||||
| } | |||||
| return SPREADSHEET_VALUE_TYPE_UNKNOWN; | |||||
| } | |||||
| SpreadsheetColumnID *spreadsheet_column_id_new() | SpreadsheetColumnID *spreadsheet_column_id_new() | ||||
| { | { | ||||
| SpreadsheetColumnID *column_id = (SpreadsheetColumnID *)MEM_callocN(sizeof(SpreadsheetColumnID), | SpreadsheetColumnID *column_id = (SpreadsheetColumnID *)MEM_callocN(sizeof(SpreadsheetColumnID), | ||||
| __func__); | __func__); | ||||
| return column_id; | return column_id; | ||||
| } | } | ||||
| SpreadsheetColumnID *spreadsheet_column_id_copy(const SpreadsheetColumnID *src_column_id) | SpreadsheetColumnID *spreadsheet_column_id_copy(const SpreadsheetColumnID *src_column_id) | ||||
| ▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines | |||||