Blender  V3.3
BLI_dot_export_attribute_enums.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
5 #include "BLI_string_ref.hh"
6 
7 namespace blender ::dot {
8 
9 enum class Attr_rankdir {
12 };
13 
14 inline StringRef rankdir_to_string(Attr_rankdir value)
15 {
16  switch (value) {
17  case Attr_rankdir::LeftToRight:
18  return "LR";
19  case Attr_rankdir::TopToBottom:
20  return "TB";
21  }
22  return "";
23 }
24 
25 enum class Attr_shape {
26  Rectangle,
27  Ellipse,
28  Circle,
29  Point,
30  Diamond,
31  Square,
32 };
33 
34 inline StringRef shape_to_string(Attr_shape value)
35 {
36  switch (value) {
37  case Attr_shape::Rectangle:
38  return "rectangle";
39  case Attr_shape::Ellipse:
40  return "ellipse";
41  case Attr_shape::Circle:
42  return "circle";
43  case Attr_shape::Point:
44  return "point";
45  case Attr_shape::Diamond:
46  return "diamond";
47  case Attr_shape::Square:
48  return "square";
49  }
50  return "";
51 }
52 
53 enum class Attr_arrowType {
54  Normal,
55  Inv,
56  Dot,
57  None,
58  Empty,
59  Box,
60  Vee,
61 };
62 
63 inline StringRef arrowType_to_string(Attr_arrowType value)
64 {
65  switch (value) {
67  return "normal";
68  case Attr_arrowType::Inv:
69  return "inv";
71  return "dot";
72  case Attr_arrowType::None:
73  return "none";
74  case Attr_arrowType::Empty:
75  return "empty";
77  return "box";
78  case Attr_arrowType::Vee:
79  return "vee";
80  }
81  return "";
82 }
83 
84 enum class Attr_dirType {
85  Forward,
86  Back,
87  Both,
88  None,
89 };
90 
91 inline StringRef dirType_to_string(Attr_dirType value)
92 {
93  switch (value) {
94  case Attr_dirType::Forward:
95  return "forward";
96  case Attr_dirType::Back:
97  return "back";
98  case Attr_dirType::Both:
99  return "both";
100  case Attr_dirType::None:
101  return "none";
102  }
103  return "";
104 }
105 
106 } // namespace blender::dot
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Normal
static btScalar Dot(const btScalar *a, const btScalar *b, int ndof)
#define Square(a, x, y)
struct Box Box
StringRef dirType_to_string(Attr_dirType value)
StringRef shape_to_string(Attr_shape value)
StringRef rankdir_to_string(Attr_rankdir value)
StringRef arrowType_to_string(Attr_arrowType value)