Blender  V2.93
deg_builder_relations_keys.cc
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2013 Blender Foundation.
17  * All rights reserved.
18  */
19 
27 
28 namespace blender::deg {
29 
31 // Time source.
32 
34 {
35 }
36 
38 {
39 }
40 
42 {
43  return string("TimeSourceKey");
44 }
45 
47 // Component.
48 
50 {
51 }
52 
53 ComponentKey::ComponentKey(ID *id, NodeType type, const char *name)
54  : id(id), type(type), name(name)
55 {
56 }
57 
59 {
60  const char *idname = (id) ? id->name : "<None>";
61  string result = string("ComponentKey(");
62  result += idname;
63  result += ", " + string(nodeTypeAsString(type));
64  if (name[0] != '\0') {
65  result += ", '" + string(name) + "'";
66  }
67  result += ')';
68  return result;
69 }
70 
72 // Operation.
73 
75  : id(nullptr),
76  component_type(NodeType::UNDEFINED),
77  component_name(""),
78  opcode(OperationCode::OPERATION),
79  name(""),
80  name_tag(-1)
81 {
82 }
83 
84 OperationKey::OperationKey(ID *id, NodeType component_type, const char *name, int name_tag)
85  : id(id),
86  component_type(component_type),
87  component_name(""),
88  opcode(OperationCode::OPERATION),
89  name(name),
90  name_tag(name_tag)
91 {
92 }
93 
95  ID *id, NodeType component_type, const char *component_name, const char *name, int name_tag)
96  : id(id),
97  component_type(component_type),
98  component_name(component_name),
99  opcode(OperationCode::OPERATION),
100  name(name),
101  name_tag(name_tag)
102 {
103 }
104 
106  : id(id),
107  component_type(component_type),
108  component_name(""),
109  opcode(opcode),
110  name(""),
111  name_tag(-1)
112 {
113 }
114 
116  NodeType component_type,
117  const char *component_name,
118  OperationCode opcode)
119  : id(id),
120  component_type(component_type),
121  component_name(component_name),
122  opcode(opcode),
123  name(""),
124  name_tag(-1)
125 {
126 }
127 
129  ID *id, NodeType component_type, OperationCode opcode, const char *name, int name_tag)
130  : id(id),
131  component_type(component_type),
132  component_name(""),
133  opcode(opcode),
134  name(name),
135  name_tag(name_tag)
136 {
137 }
138 
140  NodeType component_type,
141  const char *component_name,
142  OperationCode opcode,
143  const char *name,
144  int name_tag)
145  : id(id),
146  component_type(component_type),
147  component_name(component_name),
148  opcode(opcode),
149  name(name),
150  name_tag(name_tag)
151 {
152 }
153 
155 {
156  string result = string("OperationKey(");
157  result += "type: " + string(nodeTypeAsString(component_type));
158  result += ", component name: '" + string(component_name) + "'";
159  result += ", operation code: " + string(operationCodeAsString(opcode));
160  if (name[0] != '\0') {
161  result += ", '" + string(name) + "'";
162  }
163  result += ")";
164  return result;
165 }
166 
168 // RNA path.
169 
170 RNAPathKey::RNAPathKey(ID *id, const char *path, RNAPointerSource source) : id(id), source(source)
171 {
172  /* Create ID pointer for root of path lookup. */
173  PointerRNA id_ptr;
174  RNA_id_pointer_create(id, &id_ptr);
175  /* Try to resolve path. */
176  int index;
177  if (!RNA_path_resolve_full(&id_ptr, path, &ptr, &prop, &index)) {
179  prop = nullptr;
180  }
181 }
182 
184  : id(id), ptr(ptr), prop(prop), source(source)
185 {
186 }
187 
189 {
190  const char *id_name = (id) ? id->name : "<No ID>";
191  const char *prop_name = (prop) ? RNA_property_identifier(prop) : "<No Prop>";
192  return string("RnaPathKey(") + "id: " + id_name + ", prop: '" + prop_name + "')";
193 }
194 
195 } // namespace blender::deg
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
std::string id_name(void *id)
const char * operationCodeAsString(OperationCode opcode)
const char * nodeTypeAsString(NodeType type)
Definition: deg_node.cc:55
bool RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
Definition: rna_access.c:5416
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
Definition: rna_access.c:122
const char * RNA_property_identifier(const PropertyRNA *prop)
Definition: rna_access.c:1145
const PointerRNA PointerRNA_NULL
Definition: rna_access.c:71
Definition: DNA_ID.h:273
char name[66]
Definition: DNA_ID.h:283
RNAPathKey(ID *id, const char *path, RNAPointerSource source)
PointerRNA * ptr
Definition: wm_files.c:3157