VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtCreateNewEntityEventProcessor Class Reference

Detailed Description

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>

Inheritance diagram for makVre::DtCreateNewEntityEventProcessor:
[legend]

Public Member Functions

 DtCreateNewEntityEventProcessor (makVrv::DtDe &de, DtPlayerStationApp &app)
 
virtual ~DtCreateNewEntityEventProcessor () override
 
virtual const std::string & className () override
 
virtual void setEnabled (bool enabled) override
 
virtual bool pick (makVrv::DtChannel &channel, double x, double y, makVrv::DtIntersectorResult &result, makVrv::DtIntersector::IntersectProperties props) const override
 
virtual void setElementsToIgnore (const std::vector< makVrv::DtElementID > &ids)
 

Public Attributes

boost::signalslib::signal< void(bool)> signal_cancel
 

Protected Member Functions

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
 

Protected Attributes

makVrv::DtSignalConnectionManager myConnections
 
int myMouseLastX
 
int myMouseLastY
 
int myMouseDownTravel
 
makVrv::DtSelectionManager::IdSet mySavedSelection
 
DtPlayerStationAppmyApp
 
std::vector< makVrv::DtElementID > myElementsToIgnore
 

Constructor & Destructor Documentation

◆ DtCreateNewEntityEventProcessor()

makVre::DtCreateNewEntityEventProcessor::DtCreateNewEntityEventProcessor ( makVrv::DtDe & de,
DtPlayerStationApp & app )

Constructor.

Parameters
deReference to the display engine
appReference 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.

Member Function Documentation

◆ 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
enabledTrue 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
evMouse event to process
channelDisplay 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
evKeyboard event to process
channelDisplay 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
escPressedTrue 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.

Member Data Documentation

◆ signal_cancel

boost::signalslib::signal<void(bool)> makVre::DtCreateNewEntityEventProcessor::signal_cancel

Signal emitted when creation is canceled.

Parameters
escPressedBoolean 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

DtPlayerStationApp& makVre::DtCreateNewEntityEventProcessor::myApp
protected

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: