Editor API
UnigineEditor public API
PlacementTools.h
1 // Copyright (C), UNIGINE. All rights reserved.
2 #pragma once
3 
4 #include <UnigineNode.h>
5 #include <UnigineVector.h>
6 #include <editor/EditorGlobal.h>
7 
8 namespace Editor
9 {
10 
11 class EDITOR_API PlacementTools final
12 {
13 public:
14  enum class TransformType
15  {
16  SELECT,
17  TRANSLATE,
18  ROTATE,
19  SCALE,
20  };
21 
22  enum class BasisType
23  {
24  WORLD,
25  PARENT,
26  LOCAL,
27  };
28 
29  enum class PivotPointType
30  {
31  CENTER,
32  OBJECT,
33  };
34 
35  enum class GridMode
36  {
37  BOUND_BOX,
38  UNIFORM,
39  };
40 
41  enum class DropDirection
42  {
43  UP,
44  DOWN,
45  UP_AND_DOWN,
46  };
47 
48 public:
49  // Manipulators
50  static bool isManipulatorsEnabled();
51  static void setManipulatorsEnabled(bool enabled);
52 
53  static bool isTransformTypeEnabled(TransformType type);
54 
55  static bool isBasisEnabled();
56 
57  static TransformType getTransformType();
58  static void setTransformType(TransformType type);
59 
60  static BasisType getBasisType();
61  static void setBasisType(BasisType type);
62 
63  static PivotPointType getPivotPointType();
64  static void setPivotPointType(PivotPointType type);
65 
66  static bool isPositionSnappingEnabled();
67  static void setPositionSnappingEnabled(bool enabled);
68 
69  static GridMode getPositionSnappingMode();
70  static void setPositionSnappingMode(GridMode mode);
71 
72  static float getPositionSnappingByGridStep();
73  static void setPositionSnappingByGridStep(float step);
74 
75  static bool isRotationSnappingEnabled();
76  static void setRotationSnappingEnabled(bool enabled);
77 
78  static float getRotationSnappingStep();
79  static void setRotationSnappingStep(float step);
80 
81  static bool isScaleSnappingEnabled();
82  static void setScaleSnappingEnabled(bool enabled);
83 
84  static float getScaleSnappingStep();
85  static void setScaleSnappingStep(float step);
86 
87  // Snap to Surface
88  static bool isSnapToSurfaceEnabled();
89 
90  static float getSnapToSurfaceOffset();
91  static void setSnapToSurfaceOffset(float offset);
92 
93  static bool isSnapToSurfaceOrientByNormal();
94  static void setSnapToSurfaceOrientByNormal(bool value);
95 
96  static void snapToSurfaceNode(const Unigine::NodePtr &node);
97  static void snapToSurfaceNodeList(const Unigine::Vector<Unigine::NodePtr> &nodes);
98 
99  // Drop to Ground
100  static DropDirection getDropToGroundDirection();
101  static void setDropToGroundDirection(DropDirection direction);
102 
103  static float getDropToGroundOffset();
104  static void setDropToGroundOffset(float offset);
105 
106  static bool getDropToGroundOrientByNormal();
107  static void setDropToGroundOrientByNormal(bool value);
108 
109  static int getDropToGroundMask();
110  static void setDropToGroundMask(int mask);
111 
112  static void dropToGroundNode(const Unigine::NodePtr &node);
113  static void dropToGroundNodeList(const Unigine::Vector<Unigine::NodePtr> &nodes);
114 
115 };
116 
117 } // namespace Editor
TransformType
Definition: PlacementTools.h:14
PivotPointType
Definition: PlacementTools.h:29
Definition: Actions.h:11
Definition: PlacementTools.h:11
BasisType
Definition: PlacementTools.h:22
GridMode
Definition: PlacementTools.h:35
DropDirection
Definition: PlacementTools.h:41