Cumulia Illustrator Rendering Engine v1.1.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-10-31
15// Version V1.1.0
16//##################################################################################################
17
18#pragma once
19
20#include "abstractlocator.h"
21
22#include <cilcore.h>
23
24#include <string>
25#include <vector>
26#include <map>
27
28namespace cil
29{
30 class Handler;
32 class Locator : public AbstractLocator
33 {
34 public:
36 enum class Modifier
37 {
38 None = 0x0000,
39 Shift = 0x0200,
40 Ctrl = 0x0400,
41 Alt = 0x0800,
42 Meta = 0x1000
43 };
44
45 public:
47 static std::map<std::string, Vector3f> trans;
49 static std::map<std::string, Matrix4f> rot;
50
51 public:
53 std::vector<std::shared_ptr<Handler>> handlers;
54
55 public:
57 virtual ~Locator();
58
61 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
62 };
64 class ArrowLocator : public Locator
65 {
66 public:
68 virtual ~ArrowLocator();
69 };
71 class PositionLocator : public Locator
72 {
73 public:
76 };
79 {
80 public:
83 };
85 class PlaneLocator : public Locator
86 {
87 public:
89 virtual ~PlaneLocator();
90 };
93 {
94 public:
96 virtual ~DiskLocator();
97 };
99 class ShapeLocator : public Locator
100 {
101 protected:
102 std::shared_ptr<Matrix4f> m_local;
103 std::vector<std::string> m_names;
104
105 public:
108 virtual ~ShapeLocator();
109
111 std::shared_ptr<Matrix4f> local();
113 void setLocal(const std::shared_ptr<Matrix4f>& local);
116 };
119 {
120 public:
122 virtual ~BoxLocator();
123
127 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
128 };
131 {
132 public:
135
136 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
137 };
140 {
141 public:
144
148 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
149 };
152 {
153 public:
156
157 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
158 };
161 {
162 public:
164 virtual ~SphereLocator();
165
169 virtual void update(const Handler& handler, Modifier modifier = Modifier::None);
170 };
171
172 std::shared_ptr<ArrowLocator> _arrowLocator();
173 std::shared_ptr<PositionLocator> _positionLocator();
174 std::shared_ptr<OrientationLocator> _orientationLocator();
175 std::shared_ptr<PlaneLocator> _planeLocator();
176 std::shared_ptr<DiskLocator> _diskLocator();
177 std::shared_ptr<BoxLocator> _boxLocator();
178 std::shared_ptr<BottomBoxLocator> _bottomBoxLocator();
179 std::shared_ptr<CylinderLocator> _cylinderLocator();
180 std::shared_ptr<BottomCylinderLocator> _bottomCylinderLocator();
181 std::shared_ptr<SphereLocator> _sphereLocator();
182}
The AbstractLocator class inheriting from Node class and EventWatcher class, representing the abstrac...
Definition abstractlocator.h:29
This class, inheriting from Locator, is constructed with one line handler, specifically designed for ...
Definition locator.h:65
virtual ~ArrowLocator()
The BottomBoxLocator, inheriting from the BoxLocator, lacks the shape handler for the negative z-axis...
Definition locator.h:131
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:152
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:119
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:140
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:93
virtual ~DiskLocator()
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:33
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:49
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:47
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:53
Modifier
The Modifier enumeration defines various modifier keys for handling different keyboard events.
Definition locator.h:37
The Matrix4f class is 4 X 4 matrix.
Definition matrix.h:226
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:79
This class, inheriting from Locator, is constructed with two line handlers, specifically designed for...
Definition locator.h:86
virtual ~PlaneLocator()
This class, inheriting from Locator, is constructed with three perpendicular line handlers,...
Definition locator.h:72
virtual ~PositionLocator()
The ShapeLocator class, inheriting from the Locator class, is specifically designed for determining t...
Definition locator.h:100
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:102
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:103
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:161
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()
std::shared_ptr< PlaneLocator > _planeLocator()