Cumulia Illustrator Rendering Engine v2.1.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
handler.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 2025-08-05
15// Version V2.1.0
16//##################################################################################################
17
18#pragma once
19
20#include <cilcore.h>
21
22#include <memory>
23
24namespace cil
25{
26 class HandlerBuilder;
28 class Handler : public Node
29 {
30 public:
31 static float s_handlerScale;
32
33 protected:
34 bool m_hilited = false;
35 std::shared_ptr<HandlerBuilder> m_builder;
36 std::shared_ptr<Matrix4f> m_matrix;
40
41 public:
42 Handler(const std::shared_ptr<Matrix4f>& matrix);
43 virtual ~Handler();
44
45 virtual float hit(const Ray& r);
46 virtual bool begin(const Ray& r);
47 virtual bool update(const Ray& r);
48 virtual bool end(const Ray& r);
50 bool hilited() const;
52 void setHilited(bool hilited);
54 };
56 class LineHandler : public Handler
57 {
58 public:
59 LineHandler(const std::shared_ptr<Matrix4f>& matrix);
60 virtual ~LineHandler();
61
62 virtual float hit(const Ray& r);
63 virtual bool update(const Ray& r);
64 };
66 class ArcHandler : public Handler
67 {
68 public:
69 ArcHandler(const std::shared_ptr<Matrix4f>& matrix);
70 virtual ~ArcHandler();
71
72 virtual float hit(const Ray& r);
73 virtual bool update(const Ray& r);
74 };
76 class ShapeHandler : public Handler
77 {
78 public:
79 ShapeHandler(const std::shared_ptr<Matrix4f>& matrix);
80 virtual ~ShapeHandler();
81
82 virtual float hit(const Ray& r);
83 virtual bool update(const Ray& r);
84 };
85
86 std::shared_ptr<LineHandler> _lineHandler(const std::shared_ptr<Matrix4f>& matrix);
87 std::shared_ptr<ArcHandler> _arcHandler(const std::shared_ptr<Matrix4f>& matrix);
88 std::shared_ptr<ShapeHandler> _shapeHandler(const std::shared_ptr<Matrix4f>& matrix);
89}
The ArcHandler class inherits from the Handler class, specifically designed for rotating operation.
Definition handler.h:67
virtual bool update(const Ray &r)
Moves the handler by adjusting its transformation matrix to match the cursor's position.
virtual ~ArcHandler()
ArcHandler(const std::shared_ptr< Matrix4f > &matrix)
virtual float hit(const Ray &r)
Calculates and returns the distance between the cursor position and the geometry of the handler(in fl...
The Handler class, inheriting from Node, represents a draggable element within a Locator object....
Definition handler.h:29
virtual bool begin(const Ray &r)
Initiates the update process and returns success(always true).
std::shared_ptr< Matrix4f > m_matrix
Definition handler.h:36
Vector3f m_initialPoint
Definition handler.h:38
void setHilited(bool hilited)
Sets the highlighted state of the Handler to either true(highlighted) or false(not highlighted).
std::shared_ptr< HandlerBuilder > m_builder
Definition handler.h:35
Handler(const std::shared_ptr< Matrix4f > &matrix)
static float s_handlerScale
This member variable holds the length scale factor of the Handler geometry.
Definition handler.h:31
Matrix4f m_initial
Definition handler.h:37
bool hilited() const
Indicates whether the Handler is currently highlighted by returning a boolean value(true for highligh...
virtual bool update(const Ray &r)
Moves the handler by adjusting its transformation matrix to match the cursor's position.
void updateColor()
virtual float hit(const Ray &r)
Calculates and returns the distance between the cursor position and the geometry of the handler(in fl...
Vector3f m_initialDir
Definition handler.h:39
virtual ~Handler()
bool m_hilited
Definition handler.h:34
virtual bool end(const Ray &r)
Completes the update process and returns success(always true).
The LineHandler class inherits from the Handler class, specifically designed for translating operatio...
Definition handler.h:57
virtual float hit(const Ray &r)
Calculates and returns the distance between the cursor position and the geometry of the handler(in fl...
virtual bool update(const Ray &r)
Moves the handler by adjusting its transformation matrix to match the cursor's position.
LineHandler(const std::shared_ptr< Matrix4f > &matrix)
virtual ~LineHandler()
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:31
The Ray class inherits from the Tuple class, specilizing the templated parameter to float for element...
Definition ray.h:31
The ShapeHandler class inherits from the Handler class, specifically designed for scaling operation.
Definition handler.h:77
virtual ~ShapeHandler()
ShapeHandler(const std::shared_ptr< Matrix4f > &matrix)
virtual float hit(const Ray &r)
Calculates and returns the distance between the cursor position and the geometry of the handler(in fl...
virtual bool update(const Ray &r)
Moves the handler by adjusting its transformation matrix to match the cursor's position.
The class Vector3f inherits from the templated class of Vector3, and the template parameters are spec...
Definition vector.h:322
Definition decal.h:23
std::shared_ptr< ArcHandler > _arcHandler(const std::shared_ptr< Matrix4f > &matrix)
std::shared_ptr< LineHandler > _lineHandler(const std::shared_ptr< Matrix4f > &matrix)
std::shared_ptr< ShapeHandler > _shapeHandler(const std::shared_ptr< Matrix4f > &matrix)