Cumulia Illustrator Rendering Engine v1.0.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
locator.h
1//##################################################################################################
2//
3// Copyright (c) 2024 Beijing Qiongqi Tech Co.,Ltd. All rights reserved.
4
5// This source code is confidential and proprietary to Beijing Qiongqi Tech Co.,Ltd(The Holder).
6// Any unauthorized use, copying, modification, or distribution of the code is strictly prohibited.
7// Any user shall obtain authorizaition from the Holder before modifying the source code. And the user shall not
8// sublicense, sell, distribute, or transfer the source code, whether in original or modified form, to any third party
9// without the prior written consent of the Holder.
10
11// This copyright notice and permission grant shall be included in all copies or substantial portions of the source code.
12
13// Author Cumulia Illustrator
14// Date 2024-05-01
15// Version V1.0.0
16//##################################################################################################
17
18#pragma once
19
20#include "../utils/event.h"
21
22#include <cilcore.h>
23
24#include <string>
25#include <vector>
26#include <map>
27
28namespace cil
29{
30 class Handler;
32 enum class Modifier
33 {
34 None = 0x0000,
35 Shift = 0x0200,
36 Ctrl = 0x0400,
37 Alt = 0x0800,
38 Meta = 0x1000
39 };
41 class AbstractLocator : public Node, public EventWatcher
42 {
43 public:
46 };
48 class Locator : public AbstractLocator
49 {
50 public:
52 static std::map<std::string, Vector3f> trans;
54 static std::map<std::string, Matrix4f> rot;
55
56 public:
58 std::vector<std::shared_ptr<Handler>> handlers;
59
60 public:
62 virtual ~Locator();
63
66 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
67 };
69 class ArrowLocator : public Locator
70 {
71 public:
73 virtual ~ArrowLocator();
74 };
76 class PositionLocator : public Locator
77 {
78 public:
81 };
84 {
85 public:
88 };
90 class PlaneLocator : public Locator
91 {
92 public:
94 virtual ~PlaneLocator();
95 };
98 {
99 public:
101 virtual ~DiskLocator();
102 };
104 class ShapeLocator : public Locator
105 {
106 protected:
107 std::shared_ptr<Matrix4f> m_local;
108 std::vector<std::string> m_names;
109
110 public:
113 virtual ~ShapeLocator();
114
116 std::shared_ptr<Matrix4f> local();
118 void setLocal(const std::shared_ptr<Matrix4f>& local);
121 };
124 {
125 public:
127 virtual ~BoxLocator();
128
132 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
133 };
136 {
137 public:
140
141 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
142 };
145 {
146 public:
149
153 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
154 };
157 {
158 public:
161
162 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
163 };
166 {
167 public:
169 virtual ~SphereLocator();
170
174 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
175 };
176
177 std::shared_ptr<ArrowLocator> _arrowLocator();
178 std::shared_ptr<PositionLocator> _positionLocator();
179 std::shared_ptr<OrientationLocator> _orientationLocator();
180 std::shared_ptr<PlaneLocator> _planeLocator();
181 std::shared_ptr<DiskLocator> _diskLocator();
182 std::shared_ptr<BoxLocator> _boxLocator();
183 std::shared_ptr<BottomBoxLocator> _bottomBoxLocator();
184 std::shared_ptr<CylinderLocator> _cylinderLocator();
185 std::shared_ptr<BottomCylinderLocator> _bottomCylinderLocator();
186 std::shared_ptr<SphereLocator> _sphereLocator();
187}
The AbstractLocator class inheriting from Node class and EventWatcher class, representing the abstrac...
Definition locator.h:42
virtual ~AbstractLocator()
This class, inheriting from Locator, is constructed with one line handler, specifically designed for ...
Definition locator.h:70
virtual ~ArrowLocator()
The BottomBoxLocator, inheriting from the BoxLocator, lacks the shape handler for the negative z-axis...
Definition locator.h:136
virtual void update(const Handler &handler, Modifier modifier=Modifier::None)
Scaling the box geometry boundaries based on the translation of its shape handlers and keyboard modif...
virtual ~BottomBoxLocator()
The BottomCylinderLocator, inheriting from the CylinderLocator, lacks the shape handler for the botto...
Definition locator.h:157
virtual void update(const Handler &handler, Modifier modifier=Modifier::None)
Scaling the cylinder geometry boundaries based on the translation of its shape handlers and keyboard ...
BoxLocator class, inheriting from the ShapeLocator class, is specifically designed for bounding boxes...
Definition locator.h:124
virtual void update(const Handler &handler, Modifier modifier=Modifier::None)
Scaling the box geometry boundaries based on the translation of its shape handlers and keyboard modif...
virtual ~BoxLocator()
The CylinderLocator class, inheriting from the ShapeLocator class, is constructed with a cylinder geo...
Definition locator.h:145
virtual void update(const Handler &handler, Modifier modifier=Modifier::None)
Scaling the cylinder geometry boundaries based on the translation of its shape handlers and keyboard ...
virtual ~CylinderLocator()
This class, inheriting from the PlaneLocator, adds an arc handler to the parent class,...
Definition locator.h:98
virtual ~DiskLocator()
The EventWatcher class defines a mechanism for managing events and callbacks.
Definition event.h:30
The Handler class, inheriting from Node, represents a draggable element within a Locator object....
Definition handler.h:29
The Locator class defines . It has specialized subclasses with methods for interacting with specific ...
Definition locator.h:49
virtual ~Locator()
static std::map< std::string, Matrix4f > rot
Similar to the map of trans, the vector3f value in this map represents a 3D vector defining the rotat...
Definition locator.h:54
virtual void update(const Handler &handler, Modifier modifier=Modifier::None)
void setTransform(const Matrix4f &transform)
Sets the transform matrix of this locator node.
static std::map< std::string, Vector3f > trans
This declaration defines a map object named trans which associates string keys with Vector3f values....
Definition locator.h:52
std::vector< std::shared_ptr< Handler > > handlers
Handler is the draggable part of a Locator. A locator has one or multiple handlers which prodivde dif...
Definition locator.h:58
The Matrix4f class is 4 X 4 matrix.
Definition matrix.h:226
The Node class represents a node in a scene graph. A scene graph is a hierarchicaldata stucture used ...
Definition node.h:35
std::shared_ptr< Matrix4f > transform
This member is a shared pointer to a Matrix4f object. This matrix represents the transformation(posit...
Definition node.h:40
This class inherits from the PositionLocator class and it adds three perpendicular arc handlers on th...
Definition locator.h:84
This class, inheriting from Locator, is constructed with two line handlers, specifically designed for...
Definition locator.h:91
virtual ~PlaneLocator()
This class, inheriting from Locator, is constructed with three perpendicular line handlers,...
Definition locator.h:77
virtual ~PositionLocator()
The ShapeLocator class, inheriting from the Locator class, is specifically designed for determining t...
Definition locator.h:105
std::shared_ptr< Matrix4f > local()
This function can return the local matrix of the current shape locator.
void updateHandler()
Update the transformation matrix of the shape locator's other handlers once upon the shape locator is...
virtual ~ShapeLocator()
std::shared_ptr< Matrix4f > m_local
Definition locator.h:107
void setLocal(const std::shared_ptr< Matrix4f > &local)
Sets the local matrix of the current shape locator.
std::vector< std::string > m_names
Definition locator.h:108
ShapeLocator()
Builds a shape locator with an initialized local matrix which represents the geometric extent in 3D s...
The SphereLocator class, inheriting from the ShapeLocator class, is constructed with a sphere geometr...
Definition locator.h:166
virtual void update(const Handler &handler, Modifier modifier=Modifier::None)
Scaling the sphere geometry boundaries based on the translation of its shape handler.
virtual ~SphereLocator()
Definition decal.h:23
std::shared_ptr< PositionLocator > _positionLocator()
std::shared_ptr< ArrowLocator > _arrowLocator()
std::shared_ptr< CylinderLocator > _cylinderLocator()
std::shared_ptr< BottomBoxLocator > _bottomBoxLocator()
std::shared_ptr< DiskLocator > _diskLocator()
std::shared_ptr< OrientationLocator > _orientationLocator()
std::shared_ptr< BoxLocator > _boxLocator()
std::shared_ptr< BottomCylinderLocator > _bottomCylinderLocator()
std::shared_ptr< SphereLocator > _sphereLocator()
Modifier
The Modifier enumeration defines various modifier keys for handling different keyboard events.
Definition locator.h:33
std::shared_ptr< PlaneLocator > _planeLocator()