Cumulia Illustrator Rendering Engine v2.1.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
cil::Handler Class Reference

The Handler class, inheriting from Node, represents a draggable element within a Locator object. Users can click upon the handler and drag it to a new location. More...

#include <handler.h>

Inheritance diagram for cil::Handler:
cil::Node cil::Object cil::ArcHandler cil::LineHandler cil::ShapeHandler

Public Member Functions

 Handler (const std::shared_ptr< Matrix4f > &matrix)
 
virtual ~Handler ()
 
virtual float hit (const Ray &r)
 Calculates and returns the distance between the cursor position and the geometry of the handler(in floating-point format).
 
virtual bool begin (const Ray &r)
 Initiates the update process and returns success(always true).
 
virtual bool update (const Ray &r)
 Moves the handler by adjusting its transformation matrix to match the cursor's position.
 
virtual bool end (const Ray &r)
 Completes the update process and returns success(always true).
 
bool hilited () const
 Indicates whether the Handler is currently highlighted by returning a boolean value(true for highlighted, false for not).
 
void setHilited (bool hilited)
 Sets the highlighted state of the Handler to either true(highlighted) or false(not highlighted).
 
void updateColor ()
 
- Public Member Functions inherited from cil::Object
 Object ()
 
virtual ~Object ()
 

Static Public Attributes

static float s_handlerScale
 This member variable holds the length scale factor of the Handler geometry.
 

Protected Attributes

bool m_hilited = false
 
std::shared_ptr< HandlerBuilder > m_builder
 
std::shared_ptr< Matrix4fm_matrix
 
Matrix4f m_initial
 
Vector3f m_initialPoint
 
Vector3f m_initialDir
 

Additional Inherited Members

- Public Attributes inherited from cil::Node
std::string name
 This memeber stores the name of the node.
 
MeshPtr mesh
 This member is a shared pointer to a Mesh object, which means the node has a 3D object with its geometry defined by a mesh.
 
std::shared_ptr< std::vector< NodePtr > > children
 This member is a dynamic array of shared pointers to the child Node objects. This allows the node to have a tree-like hierarchical structure.
 
Matrix4fPtr transform
 This member is a shared pointer to a Matrix4f object. This matrix represents the transformation(position, rotation, scale) applied to the current node and its descendants.
 
BoundingBoxPtr boundingBox
 This member is a shared pointer to a BoundingBox.
 
MaterialPtr material
 This member is a shared pointer to a Mateiral object, which means the node can have its own material properties defining its appearance(color, texture, etc).
 
GeometryPtr geometry
 This member is a shared pointer to a Geometry object, which maybe used for specific geometric data relevant to the node, potentially associated with the mesh or for other rendering purposes.
 
QueryPtr query
 This member is a shared pointer to a Query object, and it is some type of query operation performed on the node or its descendants.
 

Detailed Description

The Handler class, inheriting from Node, represents a draggable element within a Locator object. Users can click upon the handler and drag it to a new location.

Constructor & Destructor Documentation

◆ Handler()

cil::Handler::Handler ( const std::shared_ptr< Matrix4f > & matrix)

◆ ~Handler()

virtual cil::Handler::~Handler ( )
virtual

Member Function Documentation

◆ begin()

virtual bool cil::Handler::begin ( const Ray & r)
virtual

Initiates the update process and returns success(always true).

◆ end()

virtual bool cil::Handler::end ( const Ray & r)
virtual

Completes the update process and returns success(always true).

◆ hilited()

bool cil::Handler::hilited ( ) const

Indicates whether the Handler is currently highlighted by returning a boolean value(true for highlighted, false for not).

◆ hit()

virtual float cil::Handler::hit ( const Ray & r)
virtual

Calculates and returns the distance between the cursor position and the geometry of the handler(in floating-point format).

Reimplemented in cil::ArcHandler, cil::LineHandler, and cil::ShapeHandler.

◆ setHilited()

void cil::Handler::setHilited ( bool hilited)

Sets the highlighted state of the Handler to either true(highlighted) or false(not highlighted).

◆ update()

virtual bool cil::Handler::update ( const Ray & r)
virtual

Moves the handler by adjusting its transformation matrix to match the cursor's position.

Reimplemented in cil::ArcHandler, cil::LineHandler, and cil::ShapeHandler.

◆ updateColor()

void cil::Handler::updateColor ( )

Member Data Documentation

◆ m_builder

std::shared_ptr<HandlerBuilder> cil::Handler::m_builder
protected

◆ m_hilited

bool cil::Handler::m_hilited = false
protected

◆ m_initial

Matrix4f cil::Handler::m_initial
protected

◆ m_initialDir

Vector3f cil::Handler::m_initialDir
protected

◆ m_initialPoint

Vector3f cil::Handler::m_initialPoint
protected

◆ m_matrix

std::shared_ptr<Matrix4f> cil::Handler::m_matrix
protected

◆ s_handlerScale

float cil::Handler::s_handlerScale
static

This member variable holds the length scale factor of the Handler geometry.