Blender V5.3
workbench_enums.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BLI_assert.hh"
10#include "DNA_object_types.h"
11#include "DNA_view3d_enums.h"
12#include "draw_common_c.hh"
13
14namespace blender::workbench {
15
17static constexpr int geometry_type_len = static_cast<int>(eGeometryType::GSPLAT) + 1;
18
19static inline const char *get_name(eGeometryType type)
20{
21 switch (type) {
23 return "Mesh";
25 return "Curves";
27 return "PointCloud";
29 return "GSplat";
30 default:
32 return "";
33 }
34}
35
37{
38 switch (ob->type) {
39 case OB_CURVES:
41 case OB_POINTCLOUD:
43 default:
45 }
46}
47
48enum class ePipelineType {
49 OPAQUE = 0,
51};
52static constexpr int pipeline_type_len = static_cast<int>(ePipelineType::TRANSPARENT) + 1;
53
54enum class eLightingType {
55 FLAT = 0,
58};
59static constexpr int lighting_type_len = static_cast<int>(eLightingType::MATCAP) + 1;
60
62{
63 switch (lighting) {
70 default:
72 return static_cast<eLightingType>(-1);
73 }
74}
75
76enum class eShaderType {
79};
80static constexpr int shader_type_len = static_cast<int>(eShaderType::TEXTURE) + 1;
81
86
87static inline const char *get_name(eShaderType type)
88{
89 switch (type) {
91 return "Material";
93 return "Texture";
94 default:
96 return "";
97 }
98}
99
100} // namespace blender::workbench
Object is a sort of wrapper for general info.
#define BLI_assert_unreachable()
#define FLAT(type, name)
bool pointcloud_is_gsplat(Object *ob)
static eShaderType shader_type_from_v3d_shading(char shading)
static constexpr int geometry_type_len
static constexpr int lighting_type_len
static constexpr int shader_type_len
static constexpr int pipeline_type_len
static eGeometryType geometry_type_from_object(Object *ob)
static eLightingType lighting_type_from_v3d_lighting(char lighting)
static const char * get_name(eGeometryType type)
@ V3D_SHADING_TEXTURE_COLOR