Cumulia Illustrator Rendering Engine v1.0.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
locatorpass.h
1#pragma once
2
3#include "../utils/event.h"
4#include "locator.h"
5#include "handler.h"
6
7#include <cilcore.h>
8
9#include <memory>
10#include <tuple>
11
12namespace cil
13{
15 class LocatorPass : public EventWatcher, public Pass
16 {
17 private:
18 Modifier m_modifier = Modifier::None;
19 std::shared_ptr<Locator> m_actived;
20 std::shared_ptr<Handler> m_hilited;
21 Matrix4f m_initial;
22
23 public:
24 LocatorPass(const std::shared_ptr<Background>& background, const std::shared_ptr<Camera>& camera);
25 virtual ~LocatorPass();
26
28 void add(const std::shared_ptr<AbstractLocator>& locator) const;
30 void remove(const std::shared_ptr<AbstractLocator>& locator) const;
31 void clear() const;
35 bool begin(const Ray& r, Modifier modifier = Modifier::None);
37 bool update(const Ray& r);
39 bool end(const Ray& r);
40
41 private:
42 Ray findRay(const Ray& r, const Matrix4f& m);
43 std::tuple<std::shared_ptr<Locator>, std::shared_ptr<Handler>> hit(const Ray& r);
44 bool hilite(const Ray& r);
45 };
46
47 std::shared_ptr<LocatorPass> _locatorPass(const std::shared_ptr<Background>& background, const std::shared_ptr<Camera>& camera);
48}
The EventWatcher class defines a mechanism for managing events and callbacks.
Definition event.h:30
The LocatorPass class inheriting from EventWatcher class and Pass class, representing a rendering pas...
Definition locatorpass.h:16
void remove(const std::shared_ptr< AbstractLocator > &locator) const
Removes a locator from this rendering pass.
LocatorPass(const std::shared_ptr< Background > &background, const std::shared_ptr< Camera > &camera)
void add(const std::shared_ptr< AbstractLocator > &locator) const
Adds a locator to this rendering pass.
bool begin(const Ray &r, Modifier modifier=Modifier::None)
Initiates the update process if there exists highlighted handler in this locator pass.
void clear() const
virtual ~LocatorPass()
bool end(const Ray &r)
Ends the update process.
bool update(const Ray &r)
Synchronizes the locator pass's active locator and highlighted handler with the cursor position.
The Matrix4f class is 4 X 4 matrix.
Definition matrix.h:226
The Pass class represents a rendering pass within a graphics pipeline.
Definition pass.h:34
std::shared_ptr< Background > background
This member holds a shared pointer to a Background object which defines the scene background.
Definition pass.h:38
std::shared_ptr< Camera > camera
This member holds a shared pointer to a Camera object which the current pass uses for rendering.
Definition pass.h:39
The Ray class inherits from the Tuple class, specilizing the templated parameter to float for element...
Definition ray.h:29
Definition decal.h:23
std::shared_ptr< LocatorPass > _locatorPass(const std::shared_ptr< Background > &background, const std::shared_ptr< Camera > &camera)
Modifier
The Modifier enumeration defines various modifier keys for handling different keyboard events.
Definition locator.h:33