VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtBasicEditingEventProcessor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvUtil/signalslib.h>
15 #include <vrvCore/DtIntersector.h>
18 
19 #include <matrix/vlVector.h>
20 
21 namespace makVrv
22 {
23  class DtInputDriver;
24  class DtDe;
25  class DtMouseEvent;
26  class DtIntersectorsContainer;
27  class DtCoordinateSystem;
28 
49  {
50  public:
51 
55  DtBasicEditingEventProcessor(DtInputDriver& inputDriver, DtDe& de, const std::string& className);
56 
59 
62  virtual const std::string& className();
63 
64  double currentAltitude() const;
65  void setCurrentAltitude(double);
66  void setCurrentGroundLocation(const DtVector&);
67 
69  virtual void changeAltitude( double mouseX, double mouseY );
70 
72  virtual void changeAltitudeWithWheel( int wheelSteps );
73 
75  virtual bool dragging() const;
76 
81  virtual void setAllowDragDrop(bool);
82  bool allowDragDrop() const;
83 
85  virtual void setCreating(bool);
86  bool creating() const;
87 
89  virtual bool allowEdit(const DtSelectionManager::IdSet&, bool doubleClick) const;
90 
93  virtual bool allowContinueDrag(const DtVector&) const;
94 
96  virtual void cancel();
97 
99  virtual void setEnabled(bool);
100 
102  double mouseX() const;
103  double mouseY() const;
104 
107  boost::signalslib::signal<void (DtVector, double altAboveGround)> signal_locationChanged;
108 
110  boost::signalslib::signal<void ()> signal_cancel;
111 
114  boost::signalslib::signal<void (DtUniqueID, DtVector, double altAboveGround)> signal_place;
115 
117  boost::signalslib::signal<void (DtVector, double)> signal_altitudeChanged;
118 
120  boost::signalslib::signal<void (const DtSelectionManager::IdSet&, const DtVector&)> signal_dragStart;
121 
123  boost::signalslib::signal<void (bool)> signal_altitudeIsDragging;
124 
125  protected:
127  virtual DtIntersector::IntersectProperties intersectorPickMask() const;
128 
132  virtual bool processMouseEvent( const DtMouseEvent& ev, DtChannel& channel);
133 
137  virtual bool processKeyboardEvent( const DtKeyEvent& ev, DtChannel& channel);
138 
139  virtual void processMouseMove(DtChannel& channel, const DtMouseEvent& ev);
140 
142  virtual bool pick(DtChannel& channel, double x, double y, DtIntersectorResult& result,
144 
146  virtual void slot_coordinateSystemChanged();
147 
148  protected:
151  std::string myClassName;
157 
158  double myLastMouseX;
159  double myLastMouseY;
160 
161  // These are used for dragging
164  double myLastDeltaY;
165 
167 
169 
170  DtIntersectorsContainer* myIntersectors = nullptr;
171 
172 
174 
177  DtCoordinateSystem* myCoordinateSystem = nullptr;
178  };
179 }
double myLastMouseX
Definition: DtBasicEditingEventProcessor.h:158
IntersectProperties
The IntersectProperties enum is a flag set that indicates the types of nodes to be considered for int...
Definition: DtIntersector.h:31
DtSignalConnectionManager myConnections
Definition: DtBasicEditingEventProcessor.h:173
boost::signalslib::signal< void(DtVector, double)> signal_altitudeChanged
Signal sent when the altitude has changed.
Definition: DtBasicEditingEventProcessor.h:117
This class encapsulates a Key event.
Definition: DtKeyEvent.h:16
DtInputDriver & myInputDriver
Definition: DtBasicEditingEventProcessor.h:150
std::string myClassName
Definition: DtBasicEditingEventProcessor.h:151
Utility class that contains intersectors for all model sets in the system (3d, xr, 2d) Use an object of this class when all models sets can be possibly needed. When you know which model set you need, you can just use the DtIntersectorCreator to create an intersector for a model set Models sets corresponding to 3d, xr and 2d are created by default (these correspond to values of 0, 1 and 5) Additional model sets can be registered with DtIntersectorsContainer::registerModelSet.
Definition: DtIntersectorsContainer.h:37
bool myCreating
Definition: DtBasicEditingEventProcessor.h:166
Descriptor for a single intersection result.
Definition: DtIntersectorResult.h:21
Contains makVrv:DtSelectionManager class.
The Simple event processor will emit signals whenever a mouse or keyboard event occurs that would cau...
Definition: DtBasicEditingEventProcessor.h:48
boost::signalslib::signal< void(const DtSelectionManager::IdSet &, const DtVector &)> signal_dragStart
Signal sent when dragging is starting.
Definition: DtBasicEditingEventProcessor.h:120
boost::signalslib::signal< void(DtUniqueID, DtVector, double altAboveGround)> 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.
Definition: DtBasicEditingEventProcessor.h:114
This class encapsulates a mouse button event.
Definition: DtMouseEvent.h:19
boost::signalslib::signal< void(bool)> signal_altitudeIsDragging
Signal send when altitude has stopped/started changing by mouse movement.
Definition: DtBasicEditingEventProcessor.h:123
boost::signalslib::signal< void()> signal_cancel
Signal sent when the user wants to cancel the operation.
Definition: DtBasicEditingEventProcessor.h:110
DtDe & myDe
Definition: DtBasicEditingEventProcessor.h:149
The abstract Channel Class.
Definition: DtChannel.h:35
boost::signalslib::signal< void(DtVector, double altAboveGround)> signal_locationChanged
Signal sent when the mouse location has changed via a mouse move. Vector is in local database coordin...
Definition: DtBasicEditingEventProcessor.h:107
Contains makVrv::DtVirtualBaseClass class.
Contains makVrv:DtIntersector class.
Interface for an event processor for a channel.
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
This class&#39;s main responsibility is to handle keyboard and mouse events from OSG (Qt events are route...
Definition: DtInputDriver.h:43
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
double myLastDeltaY
Definition: DtBasicEditingEventProcessor.h:164
double myMousePositionY
Definition: DtBasicEditingEventProcessor.h:163
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
double myCurrentAltitude
Definition: DtBasicEditingEventProcessor.h:154
Base class to provide boost signal/slot management.
bool myDragging
Definition: DtBasicEditingEventProcessor.h:155
bool myIgnoreNextLeftButtonRelease
Definition: DtBasicEditingEventProcessor.h:168
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
bool myIsAltitudeDragging
Definition: DtBasicEditingEventProcessor.h:152
bool myAllowDragDrop
Definition: DtBasicEditingEventProcessor.h:156
The DtEventProcessorInterface defines the generic interface for classes which handle input events...
Definition: DtEventProcessorInterface.h:34
std::set< DtUniqueID > IdSet
Definition: DtSelectionManager.h:32
double myLastMouseY
Definition: DtBasicEditingEventProcessor.h:159
DtVector myCurrentGroundLocation
Definition: DtBasicEditingEventProcessor.h:153
double myMousePositionX
Definition: DtBasicEditingEventProcessor.h:162

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)