18 Node *node =
new Node(*
this);
19 nodes_.append(std::unique_ptr<Node>(node));
20 top_level_nodes_.add_new(node);
27 Cluster *cluster =
new Cluster(*
this);
28 clusters_.append(std::unique_ptr<Cluster>(cluster));
29 top_level_clusters_.add_new(cluster);
37 edges_.append(std::unique_ptr<UndirectedEdge>(edge));
44 edges_.append(std::unique_ptr<DirectedEdge>(edge));
50 if (parent_ == new_parent) {
53 if (parent_ ==
nullptr) {
54 graph_.top_level_clusters_.remove(
this);
55 new_parent->children_.add_new(
this);
57 else if (new_parent ==
nullptr) {
58 parent_->children_.remove(
this);
59 graph_.top_level_clusters_.add_new(
this);
62 parent_->children_.remove(
this);
63 new_parent->children_.add_new(
this);
70 if (cluster_ == cluster) {
73 if (cluster_ ==
nullptr) {
74 graph_.top_level_nodes_.remove(
this);
75 cluster->nodes_.add_new(
this);
77 else if (cluster ==
nullptr) {
78 cluster_->nodes_.remove(
this);
79 graph_.top_level_nodes_.add_new(
this);
82 cluster_->nodes_.remove(
this);
83 cluster->nodes_.add_new(
this);
93 for (Cluster *cluster : top_level_clusters_) {
94 cluster->set_random_cluster_bgcolors();
100 float hue = rand() /
float(RAND_MAX);
101 float staturation = 0.3f;
105 for (
Cluster *cluster : children_) {
106 cluster->set_random_cluster_bgcolors();
113 while (current !=
nullptr) {
114 if (current ==
this) {
117 current = current->parent_;
127 std::stringstream ss;
132 for (
const std::unique_ptr<DirectedEdge> &edge : edges_) {
133 edge->export__as_edge_statement(ss);
143 std::stringstream ss;
148 for (
const std::unique_ptr<UndirectedEdge> &edge : edges_) {
149 edge->export__as_edge_statement(ss);
163 for (Node *node : top_level_nodes_) {
164 node->export__as_declaration(ss);
167 for (Cluster *cluster : top_level_clusters_) {
168 cluster->export__declare_nodes_and_clusters(ss);
174 ss <<
"subgraph " << this->
name() <<
" {\n";
180 for (Node *node : nodes_) {
181 node->export__as_declaration(ss);
184 for (
Cluster *cluster : children_) {
185 cluster->export__declare_nodes_and_clusters(ss);
193 a_.to_dot_string(ss);
195 b_.to_dot_string(ss);
202 a_.to_dot_string(ss);
204 b_.to_dot_string(ss);
215 ss << key <<
"=" << value <<
", ";
219 for (
char c : value) {
247 node_->export__as_id(ss);
248 if (port_name_.has_value()) {
249 ss <<
":" << *port_name_;
251 if (port_position_.has_value()) {
252 ss <<
":" << *port_position_;
258 std::stringstream ss;
259 ss << std::setprecision(4) << h <<
' ' << s <<
' ' <<
v;
265 std::stringstream ss;
267 ss << R
"(<<table border="0" cellspacing="3">)";
270 ss << R
"(<tr><td colspan="3" align="center"><b>)";
271 ss << (data.node_name.empty() ? "No Name" :
data.node_name);
272 ss <<
"</b></td></tr>";
275 int socket_max_amount = std::max(
data.inputs.size(),
data.outputs.size());
276 for (
int i = 0; i < socket_max_amount; i++) {
278 if (i <
data.inputs.size()) {
280 ss << R
"(<td align="left" port="in)" << i << "\">";
281 if (
input.fontcolor) {
282 ss << R
"(<font color=")" << *input.fontcolor << "\">";
284 ss << (
input.name.empty() ?
"No Name" :
input.name);
285 if (
input.fontcolor) {
294 if (i <
data.outputs.size()) {
296 ss << R
"(<td align="right" port="out)" << i << "\">";
298 ss << R
"(<font color=")" << *output.fontcolor << "\">";
314 node_->attributes.set(
"label", ss.str());
315 node_->set_shape(Attr_shape::Rectangle);
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its hue
ATTR_WARN_UNUSED_RESULT const BMVert * v
void export__as_bracket_list(std::stringstream &ss) const
void set(StringRef key, StringRef value)
void set_parent_cluster(Cluster *new_parent)
bool contains(Node &node) const
void export__declare_nodes_and_clusters(std::stringstream &ss) const
void set_random_cluster_bgcolors()
void export__as_edge_statement(std::stringstream &ss) const
DirectedEdge & new_edge(NodePort from, NodePort to)
std::string to_dot_string() const
Cluster & new_cluster(StringRef label="")
void set_random_cluster_bgcolors()
Node & new_node(StringRef label)
void export__declare_nodes_and_clusters(std::stringstream &ss) const
void to_dot_string(std::stringstream &ss) const
NodePort output(int index) const
NodeWithSocketsRef(Node &node, const NodeWithSockets &data)
NodePort input(int index) const
void export__as_declaration(std::stringstream &ss) const
Cluster * parent_cluster()
void export__as_id(std::stringstream &ss) const
void set_parent_cluster(Cluster *cluster)
void export__as_edge_statement(std::stringstream &ss) const
UndirectedEdge & new_edge(NodePort a, NodePort b)
std::string to_dot_string() const
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
std::string color_attr_from_hsv(float h, float s, float v)
_W64 unsigned int uintptr_t