VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
makVrv::DtBasicEditingEventProcessor Class Reference

The Simple event processor will emit signals whenever a mouse or keyboard event occurs that would cause an editable object to want to be changed. More...

Inheritance diagram for makVrv::DtBasicEditingEventProcessor:
Inheritance graph
[legend]

Public Member Functions

 DtBasicEditingEventProcessor (DtInputDriver &inputDriver, DtDe &de, const std::string &className)
 DTOR This class is created by the DtSimpleManager.
virtual ~DtBasicEditingEventProcessor ()
 CTOR.
virtual const std::string & className ()
 Returns the name of the processor class, to be used for identifying an event processor.
double currentAltitude () const
void setCurrentAltitude (double)
void setCurrentGroundLocation (const DtVector &)
virtual void changeAltitude (double mouseX, double mouseY)
 do the work on alt-drag
virtual void changeAltitudeWithWheel (int wheelSteps)
 change altitude with alt-mousewheel
virtual bool dragging () const
 Returns true if currently in dragging mode.
virtual void setAllowDragDrop (bool)
 If true (default false) will send out signals when a drag/drop would start (based on tolerance for left mouse down and mouse move).
bool allowDragDrop () const
virtual void setCreating (bool)
 Sets whether or not in creation mode.
bool creating () const
virtual bool allowEdit (const DtSelectionManager::IdSet &, bool doubleClick) const
 Return true if the items can be edited (by double click if flag is true). Default is false.
virtual bool allowContinueDrag (const DtVector &) const
 Return true if can still drag object (if in drag mode).
virtual void cancel ()
 Call to cancel current operation.
virtual void setEnabled (bool)
 If enabled is false and was enabled before, signal cancel. Should not call directly.
double mouseX () const
 Mouse X and Y positions as recorded the last time through the processEvent.
double mouseY () const
- Public Member Functions inherited from makVrv::DtEventProcessorInterface
 DtEventProcessorInterface ()
 CTOR.
virtual ~DtEventProcessorInterface ()
 DTOR.
virtual bool processPinchGesture (const DtPinchGesture &ev, DtChannel &channel)
 Don't require a handler for pinch gestures, but make them available.
bool enabled () const

Public Attributes

boost::signal< void(DtVector,
double altAboveGround)> 
signal_locationChanged
 Signal sent when the mouse location has changed via a mouse move.
boost::signal< void()> signal_cancel
 Signal sent when the user wants to cancel the operation.
boost::signal< void(DtUniqueID,
DtVector, double
altAboveGround)> 
signal_place
 Signal sent on left click of mouse on terrain or object.
boost::signal< void(DtVector,
double)> 
signal_altitudeChanged
 Signal sent when the altitude has changed.
boost::signal< void(const
DtSelectionManager::IdSet
&, const DtVector &)> 
signal_dragStart
 Signal sent when dragging is starting.
boost::signal< void(bool)> signal_altitudeIsDragging
 Signal send when altitude has stopped/started changing by mouse movement.

Protected Member Functions

virtual
DtIntersector::IntersectProperties 
intersectorPickMask () const
 Mask to use when picking into the scene.
virtual bool processMouseEvent (const DtMouseEvent &ev, DtChannel &channel)
 Processes a mouse event on the channel.
virtual bool processKeyboardEvent (const DtKeyEvent &ev, DtChannel &channel)
 Processes a keyboard event on the channel.
virtual void processMouseMove (DtChannel &channel, const DtMouseEvent &ev)
virtual bool pick (DtChannel &channel, double x, double y, DtIntersectorResult &result, DtIntersector::IntersectProperties props) const
 Call intersector to pick into scene to get terrain intersection.

Protected Attributes

DtDemyDe
DtInputDrivermyInputDriver
std::string myClassName
bool myIsAltitudeDragging
DtVector myCurrentGroundLocation
double myCurrentAltitude
bool myDragging
bool myAllowDragDrop
double myLastMouseX
double myLastMouseY
double myMousePositionX
double myMousePositionY
double myLastDeltaY
bool myCreating
bool myIgnoreNextLeftButtonRelease
- Protected Attributes inherited from makVrv::DtEventProcessorInterface
bool myEnabled

Detailed Description

The Simple event processor will emit signals whenever a mouse or keyboard event occurs that would cause an editable object to want to be changed.

The DtBasicEditingEventProcessor is used in the case where an object of single or multiple points wants to be created or updated (see the exampleRangeLine).

This processor can be enabled for creating or for editing. If enabled for creatin will emit signals on mouse movement, altitude changes and mouse clicks. Once the creation is complete, the processor can be disabled for creating so that other processors can begin processing mouse methods

If enabled for editing, will emit the signal_dragStart when the object (signified by its selection id) is to start to be edited. The processor will then emit the locationChanged, altitudeChanged or place signals as necessary. Once placed, the processor will go out of movement mode and wait for the next double-click to start movement mode again

In either case, if right mouse click is sent, the cancel signal will be emitted

Constructor & Destructor Documentation

makVrv::DtBasicEditingEventProcessor::DtBasicEditingEventProcessor ( DtInputDriver inputDriver,
DtDe de,
const std::string &  className 
)

DTOR This class is created by the DtSimpleManager.

By default, disabled. Must be enabled for creating, editing or both

virtual makVrv::DtBasicEditingEventProcessor::~DtBasicEditingEventProcessor ( )
virtual

CTOR.

Member Function Documentation

virtual const std::string& makVrv::DtBasicEditingEventProcessor::className ( )
virtual

Returns the name of the processor class, to be used for identifying an event processor.

Implements makVrv::DtEventProcessorInterface.

Reimplemented in makVrf::DtVrfObjectManipulationEventProcessor, and makVrf::DtSphereEditor.

double makVrv::DtBasicEditingEventProcessor::currentAltitude ( ) const
void makVrv::DtBasicEditingEventProcessor::setCurrentAltitude ( double  )
void makVrv::DtBasicEditingEventProcessor::setCurrentGroundLocation ( const DtVector )
virtual void makVrv::DtBasicEditingEventProcessor::changeAltitude ( double  mouseX,
double  mouseY 
)
virtual
virtual void makVrv::DtBasicEditingEventProcessor::changeAltitudeWithWheel ( int  wheelSteps)
virtual
virtual bool makVrv::DtBasicEditingEventProcessor::dragging ( ) const
virtual

Returns true if currently in dragging mode.

virtual void makVrv::DtBasicEditingEventProcessor::setAllowDragDrop ( bool  )
virtual

If true (default false) will send out signals when a drag/drop would start (based on tolerance for left mouse down and mouse move).

The signal will contain the item(s) that are being dragged. The canEdit() method (default return true) will be called to make sure the items can be dragged. Override method to return false if cannot

bool makVrv::DtBasicEditingEventProcessor::allowDragDrop ( ) const
virtual void makVrv::DtBasicEditingEventProcessor::setCreating ( bool  )
virtual

Sets whether or not in creation mode.

Reimplemented in makVrf::DtVrfObjectManipulationEventProcessor.

bool makVrv::DtBasicEditingEventProcessor::creating ( ) const
virtual bool makVrv::DtBasicEditingEventProcessor::allowEdit ( const DtSelectionManager::IdSet ,
bool  doubleClick 
) const
virtual

Return true if the items can be edited (by double click if flag is true). Default is false.

Reimplemented in makVrv::DtIntervisibilityEditingEventProcessor.

virtual bool makVrv::DtBasicEditingEventProcessor::allowContinueDrag ( const DtVector ) const
virtual

Return true if can still drag object (if in drag mode).

Returning false will signal a cancel. The point given is in local database coordinates. Default returns true.

virtual void makVrv::DtBasicEditingEventProcessor::cancel ( )
virtual
virtual void makVrv::DtBasicEditingEventProcessor::setEnabled ( bool  )
virtual

If enabled is false and was enabled before, signal cancel. Should not call directly.

Reimplemented from makVrv::DtEventProcessorInterface.

Reimplemented in makVrf::DtVrfObjectManipulationEventProcessor.

double makVrv::DtBasicEditingEventProcessor::mouseX ( ) const

Mouse X and Y positions as recorded the last time through the processEvent.

double makVrv::DtBasicEditingEventProcessor::mouseY ( ) const
virtual DtIntersector::IntersectProperties makVrv::DtBasicEditingEventProcessor::intersectorPickMask ( ) const
protectedvirtual

Mask to use when picking into the scene.

Reimplemented in makVrf::DtVrfObjectManipulationEventProcessor, and makVrv::DtIntervisibilityEditingEventProcessor.

virtual bool makVrv::DtBasicEditingEventProcessor::processMouseEvent ( const DtMouseEvent ev,
DtChannel channel 
)
protectedvirtual

Processes a mouse event on the channel.

Should return true if the event is handled successfully, and false to reject it and pass it on to the next event processor.

Implements makVrv::DtEventProcessorInterface.

Reimplemented in makVrf::DtVrfIntervisibilityEditingEventProcessor, and makVrf::DtVrfObjectManipulationEventProcessor.

virtual bool makVrv::DtBasicEditingEventProcessor::processKeyboardEvent ( const DtKeyEvent ev,
DtChannel channel 
)
protectedvirtual

Processes a keyboard event on the channel.

Should return true if the event is handled successfully, and false to reject it and pass it on to the next event processor.

Implements makVrv::DtEventProcessorInterface.

Reimplemented in makVrf::DtVrfIntervisibilityEditingEventProcessor, and makVrf::DtVrfObjectManipulationEventProcessor.

virtual void makVrv::DtBasicEditingEventProcessor::processMouseMove ( DtChannel channel,
const DtMouseEvent ev 
)
protectedvirtual
virtual bool makVrv::DtBasicEditingEventProcessor::pick ( DtChannel channel,
double  x,
double  y,
DtIntersectorResult result,
DtIntersector::IntersectProperties  props 
) const
protectedvirtual

Call intersector to pick into scene to get terrain intersection.

Reimplemented in makVrf::DtVrfIntervisibilityEditingEventProcessor, and makVrf::DtVrfObjectManipulationEventProcessor.

Member Data Documentation

boost::signal<void (DtVector, double altAboveGround)> makVrv::DtBasicEditingEventProcessor::signal_locationChanged

Signal sent when the mouse location has changed via a mouse move.

Vector is in local database coordinates

boost::signal<void ()> makVrv::DtBasicEditingEventProcessor::signal_cancel

Signal sent when the user wants to cancel the operation.

boost::signal<void (DtUniqueID, DtVector, double altAboveGround)> makVrv::DtBasicEditingEventProcessor::signal_place

Signal sent on left click of mouse on terrain or object.

ID is the item clicked on. Vector is in local database coordinates

boost::signal<void (DtVector, double)> makVrv::DtBasicEditingEventProcessor::signal_altitudeChanged

Signal sent when the altitude has changed.

boost::signal<void (const DtSelectionManager::IdSet&, const DtVector&)> makVrv::DtBasicEditingEventProcessor::signal_dragStart

Signal sent when dragging is starting.

boost::signal<void (bool)> makVrv::DtBasicEditingEventProcessor::signal_altitudeIsDragging

Signal send when altitude has stopped/started changing by mouse movement.

DtDe& makVrv::DtBasicEditingEventProcessor::myDe
protected
DtInputDriver& makVrv::DtBasicEditingEventProcessor::myInputDriver
protected
std::string makVrv::DtBasicEditingEventProcessor::myClassName
protected
bool makVrv::DtBasicEditingEventProcessor::myIsAltitudeDragging
protected
DtVector makVrv::DtBasicEditingEventProcessor::myCurrentGroundLocation
protected
double makVrv::DtBasicEditingEventProcessor::myCurrentAltitude
protected
bool makVrv::DtBasicEditingEventProcessor::myDragging
protected
bool makVrv::DtBasicEditingEventProcessor::myAllowDragDrop
protected
double makVrv::DtBasicEditingEventProcessor::myLastMouseX
protected
double makVrv::DtBasicEditingEventProcessor::myLastMouseY
protected
double makVrv::DtBasicEditingEventProcessor::myMousePositionX
protected
double makVrv::DtBasicEditingEventProcessor::myMousePositionY
protected
double makVrv::DtBasicEditingEventProcessor::myLastDeltaY
protected
bool makVrv::DtBasicEditingEventProcessor::myCreating
protected
bool makVrv::DtBasicEditingEventProcessor::myIgnoreNextLeftButtonRelease
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)