Blender  V3.3
deg_builder_relations_keys.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2013 Blender Foundation. All rights reserved. */
3 
11 
12 namespace blender::deg {
13 
15 /* Time source. */
16 
18 {
19 }
20 
22 {
23 }
24 
26 {
27  return string("TimeSourceKey");
28 }
29 
31 // Component.
32 
34 {
35 }
36 
37 ComponentKey::ComponentKey(ID *id, NodeType type, const char *name)
38  : id(id), type(type), name(name)
39 {
40 }
41 
43 {
44  const char *idname = (id) ? id->name : "<None>";
45  string result = string("ComponentKey(");
46  result += idname;
47  result += ", " + string(nodeTypeAsString(type));
48  if (name[0] != '\0') {
49  result += ", '" + string(name) + "'";
50  }
51  result += ')';
52  return result;
53 }
54 
56 // Operation.
57 
59  : id(nullptr),
60  component_type(NodeType::UNDEFINED),
61  component_name(""),
62  opcode(OperationCode::OPERATION),
63  name(""),
64  name_tag(-1)
65 {
66 }
67 
68 OperationKey::OperationKey(ID *id, NodeType component_type, const char *name, int name_tag)
69  : id(id),
70  component_type(component_type),
71  component_name(""),
72  opcode(OperationCode::OPERATION),
73  name(name),
74  name_tag(name_tag)
75 {
76 }
77 
79  ID *id, NodeType component_type, const char *component_name, const char *name, int name_tag)
80  : id(id),
81  component_type(component_type),
82  component_name(component_name),
83  opcode(OperationCode::OPERATION),
84  name(name),
85  name_tag(name_tag)
86 {
87 }
88 
90  : id(id),
91  component_type(component_type),
92  component_name(""),
93  opcode(opcode),
94  name(""),
95  name_tag(-1)
96 {
97 }
98 
100  NodeType component_type,
101  const char *component_name,
102  OperationCode opcode)
103  : id(id),
104  component_type(component_type),
105  component_name(component_name),
106  opcode(opcode),
107  name(""),
108  name_tag(-1)
109 {
110 }
111 
113  ID *id, NodeType component_type, OperationCode opcode, const char *name, int name_tag)
114  : id(id),
115  component_type(component_type),
116  component_name(""),
117  opcode(opcode),
118  name(name),
119  name_tag(name_tag)
120 {
121 }
122 
124  NodeType component_type,
125  const char *component_name,
126  OperationCode opcode,
127  const char *name,
128  int name_tag)
129  : id(id),
130  component_type(component_type),
131  component_name(component_name),
132  opcode(opcode),
133  name(name),
134  name_tag(name_tag)
135 {
136 }
137 
139 {
140  string result = string("OperationKey(");
141  result += "type: " + string(nodeTypeAsString(component_type));
142  result += ", component name: '" + string(component_name) + "'";
143  result += ", operation code: " + string(operationCodeAsString(opcode));
144  if (name[0] != '\0') {
145  result += ", '" + string(name) + "'";
146  }
147  result += ")";
148  return result;
149 }
150 
152 // RNA path.
153 
154 RNAPathKey::RNAPathKey(ID *id, const char *path, RNAPointerSource source) : id(id), source(source)
155 {
156  /* Create ID pointer for root of path lookup. */
157  PointerRNA id_ptr;
158  RNA_id_pointer_create(id, &id_ptr);
159  /* Try to resolve path. */
160  int index;
161  if (!RNA_path_resolve_full(&id_ptr, path, &ptr, &prop, &index)) {
163  prop = nullptr;
164  }
165 }
166 
168  : id(id), ptr(ptr), prop(prop), source(source)
169 {
170 }
171 
173 {
174  const char *id_name = (id) ? id->name : "<No ID>";
175  const char *prop_name = (prop) ? RNA_property_identifier(prop) : "<No Prop>";
176  return string("RnaPathKey(") + "id: " + id_name + ", prop: '" + prop_name + "')";
177 }
178 
179 } // 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:39
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
Definition: rna_access.c:112
const char * RNA_property_identifier(const PropertyRNA *prop)
Definition: rna_access.c:1000
const PointerRNA PointerRNA_NULL
Definition: rna_access.c:61
bool RNA_path_resolve_full(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
Definition: rna_path.cc:515
Definition: DNA_ID.h:368
char name[66]
Definition: DNA_ID.h:378
RNAPathKey(ID *id, const char *path, RNAPointerSource source)
PointerRNA * ptr
Definition: wm_files.c:3480