DtCreateNewEntityEventProcessor handles user interactions during entity creation and placement operations. It processes mouse and keyboard events to allow users to position, rotate, and configure new entities being added to the simulation. This processor is typically active during the entity creation workflow in the choose role state.
#include <createNewEntityEventProcessor.h>
|
| virtual bool | processMouseEvent (const makVrv::DtMouseEvent &ev, makVrv::DtChannel &channel) override |
| |
| virtual bool | processKeyboardEvent (const makVrv::DtKeyEvent &ev, makVrv::DtChannel &channel) override |
| |
| virtual void | cancel (bool escPressed) |
| |
| virtual void | cancel () override |
| |
◆ DtCreateNewEntityEventProcessor()
| makVre::DtCreateNewEntityEventProcessor::DtCreateNewEntityEventProcessor |
( |
makVrv::DtDe & | de, |
|
|
DtPlayerStationApp & | app ) |
Constructor.
- Parameters
-
| de | Reference to the display engine |
| app | Reference to the player station application |
Creates a new entity creation event processor associated with the specified display engine and player station application.
References de().
◆ ~DtCreateNewEntityEventProcessor()
| virtual makVre::DtCreateNewEntityEventProcessor::~DtCreateNewEntityEventProcessor |
( |
| ) |
|
|
overridevirtual |
Virtual destructor.
Ensures proper cleanup of processor resources.
◆ className()
| virtual const std::string & makVre::DtCreateNewEntityEventProcessor::className |
( |
| ) |
|
|
overridevirtual |
Gets the class name of this processor.
- Returns
- Reference to the class name string
Returns the name of this event processor class. Used for identification and debugging purposes.
◆ setEnabled()
| virtual void makVre::DtCreateNewEntityEventProcessor::setEnabled |
( |
bool | enabled | ) |
|
|
overridevirtual |
Enables or disables the event processor.
- Parameters
-
| enabled | True to enable processing, false to disable |
Controls whether this processor is active and handling events. When disabled, it will ignore events and pass them to the next handler in the processing chain. This allows the processor to be temporarily deactivated without removing it from the processing chain.
◆ pick()
| virtual bool makVre::DtCreateNewEntityEventProcessor::pick |
( |
makVrv::DtChannel & | channel, |
|
|
double | x, |
|
|
double | y, |
|
|
makVrv::DtIntersectorResult & | result, |
|
|
makVrv::DtIntersector::IntersectProperties | props ) const |
|
overridevirtual |
Derived to use this class's myElementsToIgnore list.
◆ setElementsToIgnore()
| virtual void makVre::DtCreateNewEntityEventProcessor::setElementsToIgnore |
( |
const std::vector< makVrv::DtElementID > & | ids | ) |
|
|
virtual |
◆ processMouseEvent()
| virtual bool makVre::DtCreateNewEntityEventProcessor::processMouseEvent |
( |
const makVrv::DtMouseEvent & | ev, |
|
|
makVrv::DtChannel & | channel ) |
|
overrideprotectedvirtual |
Processes mouse events during entity creation.
- Parameters
-
| ev | Mouse event to process |
| channel | Display channel receiving the event |
- Returns
- True if the event was handled, false to allow further processing
Handles mouse events like movement, clicks, and drags during entity creation. These events are used to position and orient the entity being placed.
◆ processKeyboardEvent()
| virtual bool makVre::DtCreateNewEntityEventProcessor::processKeyboardEvent |
( |
const makVrv::DtKeyEvent & | ev, |
|
|
makVrv::DtChannel & | channel ) |
|
overrideprotectedvirtual |
Processes keyboard events during entity creation.
- Parameters
-
| ev | Keyboard event to process |
| channel | Display channel receiving the event |
- Returns
- True if the event was handled, false to allow further processing
Handles keyboard events during entity creation, such as escape to cancel or other keys that might modify the creation process.
◆ cancel() [1/2]
| virtual void makVre::DtCreateNewEntityEventProcessor::cancel |
( |
bool | escPressed | ) |
|
|
protectedvirtual |
Cancels the entity creation process.
- Parameters
-
| escPressed | True if cancellation was via Escape key |
Cancels the current entity creation operation, emitting the signal_cancel signal with the escPressed parameter. This is typically called when the user presses Escape or performs another cancellation action.
◆ cancel() [2/2]
| virtual void makVre::DtCreateNewEntityEventProcessor::cancel |
( |
| ) |
|
|
overrideprotectedvirtual |
Cancels the entity creation process.
Convenience method that calls cancel(false), indicating that cancellation was not via the Escape key.
◆ signal_cancel
| boost::signalslib::signal<void(bool)> makVre::DtCreateNewEntityEventProcessor::signal_cancel |
Signal emitted when creation is canceled.
- Parameters
-
| escPressed | Boolean indicating if cancellation was via Escape key |
This signal is emitted when entity creation is canceled, either by user action (right-click or Escape key) or programmatically. The boolean parameter indicates whether the cancellation was triggered by the Escape key (true) or by another method (false).
◆ myConnections
| makVrv::DtSignalConnectionManager makVre::DtCreateNewEntityEventProcessor::myConnections |
|
protected |
Manager for signal connections.
Manages connections to various signals that need to be tracked for proper disconnection when the processor is destroyed.
◆ myMouseLastX
| int makVre::DtCreateNewEntityEventProcessor::myMouseLastX |
|
protected |
Last recorded X position of the mouse.
Used to track mouse movement for entity positioning and rotation.
◆ myMouseLastY
| int makVre::DtCreateNewEntityEventProcessor::myMouseLastY |
|
protected |
Last recorded Y position of the mouse.
Used to track mouse movement for entity positioning and rotation.
◆ myMouseDownTravel
| int makVre::DtCreateNewEntityEventProcessor::myMouseDownTravel |
|
protected |
Distance the mouse has traveled during a drag operation.
Used to detect small movements versus significant drags.
◆ mySavedSelection
| makVrv::DtSelectionManager::IdSet makVre::DtCreateNewEntityEventProcessor::mySavedSelection |
|
protected |
Set of objects that were selected before entity creation began.
Stored to restore selection state if entity creation is canceled.
◆ myApp
Reference to the player station application.
Provides access to application services and state during entity creation.
◆ myElementsToIgnore
| std::vector<makVrv::DtElementID> makVre::DtCreateNewEntityEventProcessor::myElementsToIgnore |
|
protected |
The documentation for this class was generated from the following file: