VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
mapFocusHandler.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
10 
11 #pragma once
12 
14 #include <vrvCoreQt/DtQtCursor.h>
15 #include <vrvCore/DtUniqueID.h>
16 
17 #include <vector>
18 
19 #include <QtCore/QString>
20 
21 namespace makVrv
22 {
23  class DtDe;
24 }
25 
26 namespace makVrf
27 {
28  class DtMapFocusHandler;
29 
32  {
33  public:
35  {
36  Unknown = 0,
37  Valid = 1,
38  Invalid = 2
39  };
40 
42  {
44  MapArea = 1
45  };
46 
49  {
50  }
51 
54  {
55  }
56 
60  virtual void setHasMapFocus(bool) = 0;
61  virtual void setCanTakeMapFocus(bool) = 0;
62  virtual bool canTakeMapFocus() const = 0;
63  virtual bool hasMapFocus() const = 0;
64 
66  virtual makVrv::DtQtCursor cursorForSelectionStatus(SelectionStatus, CursorOver) const = 0;
67 
69  virtual SelectionStatus selectionStatusFor(makVrv::DtUniqueID id, CursorOver) const = 0;
70 
71  virtual void setDescription(const QString& s)
72  {
73  myDescription = s;
74  }
75 
77  virtual QString operation() const
78  {
79  if (myDescription.length())
80  {
81  return myDescription;
82  }
83 
84  return generatedDescription();
85  }
86 
87  virtual QString generatedDescription() const
88  {
89  return "";
90  }
91 
92  virtual void setOneClickMode(bool b)
93  {
94  myOneClickMode = b;
95  }
96 
97  bool oneClickMode() const
98  {
99  return myOneClickMode;
100  }
101 
102  boost::signals2::signal<void (DtMapFocusHandlerInterface*, bool)> signal_canTakeMapFocusChanged;
103  boost::signals2::signal<void (DtMapFocusHandlerInterface*)> signal_selectionChangedByMapSelection;
105 
106  protected:
107  QString myDescription;
108  bool myOneClickMode = false;
109  };
110 
117  {
118  public:
119  //CTOR
121 
122  //DTOR
123  virtual ~DtMapFocusHandler();
124 
128  virtual void addMapFocusHandler(DtMapFocusHandlerInterface*, int index = -1);
129 
133  virtual void removeMapFocusHandler(DtMapFocusHandlerInterface*);
134 
137  virtual void focusToNext(bool becauseOfRightClick = false);
138 
140  virtual void removeAndDisconnectAll();
141 
144  typedef boost::function<makVrv::DtQtCursor ()> CursorOverride;
145 
146  virtual makVrv::DtQtCursor getOverrideCusror() const;
147  virtual void setCursorOverride(CursorOverride);
148  virtual CursorOverride cursorOverride() const;
149 
151  virtual void setAutoChangeToNext(bool);
152  bool autoChangeToNext() const
153  {
154  return myAutoChangeToNext;
155  }
156 
159  virtual void setTaskSetStatusTextPart(const QString&);
160  const QString& taskSetStatusPart() const
161  {
162  return myTaskSetStatusPart;
163  }
164 
166  virtual void resetFocus();
167 
169  virtual void takeMapFocus(DtMapFocusHandlerInterface*);
170 
171  std::vector<DtMapFocusHandlerInterface*>& managedViews() { return myManagedViews; };
172  const std::vector<DtMapFocusHandlerInterface*>& managedViews() const { return myManagedViews; };
173 
174  virtual DtMapFocusHandlerInterface* hasMapFocus() const;
175 
176  virtual void setAllowCursorChange(bool);
177  bool allowCursorChange() const
178  {
179  return myAllowCursorChange;
180  }
181 
182  virtual void setOneClickMode(bool b);
183 
184  bool oneClickMode() const
185  {
186  return myOneClickMode;
187  }
188 
191 
194 
195  boost::signals2::signal<void ()> signal_lostMapFocus;
196 
197  protected:
198  virtual void onCanTakeMapFocusChanged(DtMapFocusHandlerInterface*, bool);
199  virtual void onSelectionChangedByMapSelection(DtMapFocusHandlerInterface*);
200  virtual void updateMainMapFocusHandler();
201 
202  protected:
203  std::vector<DtMapFocusHandlerInterface*> myManagedViews;
209  bool myOneClickMode = false;
210  };
211 }
SelectionStatus
Definition: mapFocusHandler.h:34
makVrv::DtDe & myDe
Definition: mapFocusHandler.h:204
bool autoChangeToNext() const
Definition: mapFocusHandler.h:152
bool myAllowCursorChange
Definition: mapFocusHandler.h:205
std::vector< DtMapFocusHandlerInterface * > & managedViews()
Definition: mapFocusHandler.h:171
std::vector< DtMapFocusHandlerInterface * > myManagedViews
Definition: mapFocusHandler.h:203
boost::function< makVrv::DtQtCursor()> CursorOverride
If set, uset this method as a potential cursor override for the current widget. If the return is a nu...
Definition: mapFocusHandler.h:144
virtual ~DtMapFocusHandlerInterface()
DTOR.
Definition: mapFocusHandler.h:53
CursorOver
Definition: mapFocusHandler.h:41
QString myDescription
Definition: mapFocusHandler.h:107
DtMapFocusHandlerInterface()
CTOR.
Definition: mapFocusHandler.h:48
virtual QString operation() const
If supported, the string operation the handler is performing.
Definition: mapFocusHandler.h:77
CursorOverride myCursorOverride
Definition: mapFocusHandler.h:207
QString myTaskSetStatusPart
Definition: mapFocusHandler.h:208
boost::signals2::signal< void(DtMapFocusHandlerInterface *)> signal_selectionChangedByMapSelection
Methods implemented on behalf of being a map focus handler Sets whether or not the focus button has a...
Definition: mapFocusHandler.h:103
virtual QString generatedDescription() const
Methods implemented on behalf of being a map focus handler Sets whether or not the focus button has a...
Definition: mapFocusHandler.h:87
const QString & taskSetStatusPart() const
Definition: mapFocusHandler.h:160
boost::signals2::signal< void()> signal_lostMapFocus
Definition: mapFocusHandler.h:195
bool allowCursorChange() const
Definition: mapFocusHandler.h:177
virtual void setOneClickMode(bool b)
Methods implemented on behalf of being a map focus handler Sets whether or not the focus button has a...
Definition: mapFocusHandler.h:92
Qt implementation of the cursor class. Will keep track of the Qt cursor.
Definition: DtQtCursor.h:24
#define DT_DLL_VRFGUICOMMONQT
Definition: vrfGuiCommonQt.h:20
Base class that must be implemented by items that wish to be part of a map focus handler chain...
Definition: mapFocusHandler.h:31
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
bool oneClickMode() const
Methods implemented on behalf of being a map focus handler Sets whether or not the focus button has a...
Definition: mapFocusHandler.h:97
Contains makVrv::DtQtCursor class.
const std::vector< DtMapFocusHandlerInterface * > & managedViews() const
Definition: mapFocusHandler.h:172
bool oneClickMode() const
Definition: mapFocusHandler.h:184
std::vector< ObjectInformation * > ObjectList
Map by name of objects in the scenario.
Definition: createObjectParser.h:42
bool myAutoChangeToNext
Definition: mapFocusHandler.h:206
This class will manage filtered list views for the basic purpose of allowing a single list view in th...
Definition: mapFocusHandler.h:116
Contains makVrv::DtUniqueID type.
boost::signals2::signal< void(DtMapFocusHandlerInterface *, bool)> signal_canTakeMapFocusChanged
Methods implemented on behalf of being a map focus handler Sets whether or not the focus button has a...
Definition: mapFocusHandler.h:102
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
virtual void setDescription(const QString &s)
Methods implemented on behalf of being a map focus handler Sets whether or not the focus button has a...
Definition: mapFocusHandler.h:71

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)