VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
autoHidePanel.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #if !defined(Q_MOC_RUN)
22 #include <vrvCoreQt/DtDockable.h>
23 #include <vrvCoreQt/DtMenuItem.h>
27 #endif
28 
29 #include <QtGui/QIcon>
30 #include <QtGui/QPixmap>
31 #include <QtWidgets/QWidget>
32 #include <QtWidgets/QDockWidget>
33 #include <QtWidgets/QPushButton>
34 #include <QtWidgets/QToolButton>
35 #include <QtWidgets/QHeaderView>
36 #include <QtCore/QTimer>
37 #include <map>
38 
39 class QVBoxLayout;
40 
41 namespace makVrv
42 {
43  class DtDe;
44  class DtChannelManager;
45  class DtChannel;
46  class DtObserverObject;
47 }
48 
49 namespace makVrf
50 {
51  class DtAutoHidePanelItem;
52  class DtPropCreatePalette;
53  class DtEntityCreatePalette;
54  class DtTacticalGraphicCreatePalette;
55 
60  {
61 
62  Q_OBJECT
63 
64  public:
65 
67  DtAutoHideDockViewItem(makVrv::DtDe& de, const std::string& dockName, DtAutoHidePanelItem* item);
68 
70  virtual ~DtAutoHideDockViewItem();
71 
73  virtual QAction* createAction(makVrv::DtDe& de, QWidget* parent);
74 
75  protected:
76 
78  virtual void on_triggered();
79 
81  virtual void on_aboutToShow();
82 
83  protected:
84 
88  };
89 
95  {
96  Q_OBJECT
97 
98  public:
99 
102  DtAutoHidePanelItem(makVrv::DtDe& de, QWidget* parent, QString title, const std::string& className);
103 
105  virtual ~DtAutoHidePanelItem();
106 
108  DtAutoHideDock* dockToManage();
109  virtual void setDockToManage(DtAutoHideDock* widget);
110 
112  virtual const makVrv::DtQIconConfigurations& icon() const;
113  virtual void setIcon(const makVrv::DtQIconConfigurations& p);
114 
116  const std::string& className() const { return myClassName; };
117 
119  virtual QString iconText();
120  virtual void setIconText(const QString& s);
121 
124  virtual bool toggled() const;
125  virtual void setToggled(bool flag);
126 
129  virtual void setAvailable(bool visible, bool updateVisibilityState = true);
130  virtual bool available() const;
131 
133  virtual void setAboutToBeShown(bool flag);
134 
137  virtual void refreshSize(int minsize=-1);
138 
140  virtual void setToggle(bool flag);
141 
142  protected:
143  virtual bool eventFilter(QObject* o, QEvent* e) override;
144 
146  virtual void enterEvent(QEvent* e);
147 
149  virtual void leaveEvent(QEvent *);
150 
152  virtual void paintEvent(QPaintEvent* p);
153 
154  virtual void refreshIcon();
155 
156  signals:
157 
159  void signal_enter(DtAutoHidePanelItem*);
160 
162  void signal_leave(DtAutoHidePanelItem*);
163 
166  void signal_toggled(DtAutoHidePanelItem*);
167 
170  void signal_clicked(DtAutoHidePanelItem*);
171 
173  void signal_availabilityChanged(DtAutoHidePanelItem*);
174 
175  protected slots:
177  virtual void toggleItem();
178 
179  protected:
180 
182  QIcon myIcon;
184  QString myIconText;
195  std::string myClassName;
197  };
198 
200  {
201  public:
203  virtual ~DtAutoHidePanelItemCreator();
204 
206  static DtAutoHidePanelItemCreator& instance(makVrv::DtDe&);
207 
209  static void registerInstance(makVrv::DtDe& de, DtAutoHidePanelItemCreator* instance);
210 
211  virtual DtAutoHidePanelItem* create(makVrv::DtDe&, QWidget* parent, const QString& title, const std::string& className);
212  };
213 
219  {
220  Q_OBJECT
221 
222  public:
223 
225  {
226  Hidden = 0,
229  Floating
230  };
231 
232  typedef std::list<DtAutoHidePanelItem*> DtAutoHidePanelItemList;
233  typedef DtAutoHidePanelItemList::iterator DtAutoHidePanelItemListIterator;
234 
235  typedef std::list<DtAutoHideDock*> DtAutoHideDockList;
236  typedef DtAutoHideDockList::iterator DtAutoHideDockListIterator;
237 
238  typedef std::map<std::string, DtAppearanceOptions> DtAppearanceList;
239  typedef std::map<std::string, DtAppearanceOptions>::iterator DtAppearanceListIterator;
240 
241  public:
242 
243  DtAutoHidePanel(makVrv::DtDe& de, const std::string& name, makVrv::DtQtDeMainWindow* parent);
244 
245  virtual ~DtAutoHidePanel();
246 
250  virtual DtAutoHidePanelItem* addItem(DtAutoHideDock* dock, bool forceVisible=false, bool initiallVisible = true) ;
251 
253  virtual void clear();
254 
256  virtual DtAutoHidePanelItem* findItemForClass( const std::string& s );
257  virtual DtAutoHidePanelItem* findItemForDock( const DtAutoHideDock* dock );
258 
260  virtual void setPanelItemVisible(const std::string& panelClassName, bool, bool updateVisibilityState = false);
261 
264  virtual void hideAllDocks();
265 
267  virtual int itemCount();
268 
270  virtual void placeItems();
271 
273  virtual void removeItem(DtAutoHidePanelItem* item);
274 
276  virtual void showDockForItem( DtAutoHidePanelItem* item, bool animate=true);
277 
279  virtual void hideDockForItem( DtAutoHidePanelItem* item, bool animate=true);
280 
282  static DtAutoHidePanel* instance(makVrv::DtDe&);
283 
286  virtual std::vector< std::pair<DtString, QString> > panelsThatCanBeUsedOnCreateMenu() const;
287 
288  virtual void changeVisibility(bool);
289 
291  virtual bool findDock(DtAutoHideDock* dock);
292 
294 
297 
299  virtual void changeFloatingGeometry(int px, int py, int width, int height) {};
300 
303 
305  virtual void changeDockedGeometry(int px, int py, int width, int height) {};
306 
309 
311  virtual void selectPage(const std::string& pageClassName) {};
312 
313  const DtAutoHideDockList& docks() const
314  {
315  return myDocks;
316  }
317 
318  template <typename PaletteClass>
319  PaletteClass* createPalette()
320  {
321  DtAutoHideDockList::iterator iter = myDocks.begin();
322 
323  while (iter != myDocks.end())
324  {
325  PaletteClass* p = dynamic_cast<PaletteClass*>((*iter)->widget());
326 
327  if (p)
328  {
329  return p;
330  }
331 
332  ++iter;
333  }
334 
335  return 0;
336  }
337 
338  template <typename PaletteClass>
340  {
341  DtAutoHideDockList::iterator iter = myDocks.begin();
342 
343  while (iter != myDocks.end())
344  {
345  PaletteClass* p = dynamic_cast<PaletteClass*>((*iter)->widget());
346 
347  if (p)
348  {
349  return *iter;
350  }
351 
352  ++iter;
353  }
354 
355  return 0;
356  }
357 
360  {
361  return createPalette<DtEntityCreatePalette>();
362  }
363 
365  {
366  return creationDock<DtEntityCreatePalette>();
367  }
368 
371  {
372  return createPalette<DtTacticalGraphicCreatePalette>();
373  }
374 
376  {
377  return creationDock<DtTacticalGraphicCreatePalette>();
378  }
379 
382  {
383  return createPalette<DtPropCreatePalette>();
384  }
385 
387  {
388  return creationDock<DtPropCreatePalette>();
389  }
390 
393  virtual void setItemPinned( DtAutoHidePanelItem*, bool );
394 
396  virtual int maxItemWidth();
397 
398  protected:
399 
401  virtual void setupGui();
402 
404  virtual bool eventFilter(QObject* p, QEvent* e);
405 
407  virtual void installEventFilters();
408 
410  virtual void removeDock(DtAutoHideDock* dock);
411 
413  virtual void relocateAnyPinnedDock();
414 
416  virtual void refreshItems(int minsize);
417 
419  virtual void refreshAppearanceOfItem(DtAutoHidePanelItem* autoHideItemWidget, bool forceVisible);
420 
422  virtual void addPageToGui(makVrv::DtPage*);
423 
425  virtual void removePageFromGui(makVrv::DtPage*);
426 
428  virtual void selectPageInGui(makVrv::DtPage* page) {};
429 
430  protected slots:
431 
434  virtual void slot_onItemToggled(DtAutoHidePanelItem*);
435 
438  virtual void slot_onItemClicked(DtAutoHidePanelItem*);
439 
441  virtual void slot_dockClosed(DtAutoHideDock* dockWidget);
442 
444  virtual void slot_dockEntered(DtAutoHideDock* dockWidget);
445 
447  virtual void slot_dockLeft(DtAutoHideDock* dockWidget);
448 
450  virtual void slot_dockResized(DtAutoHideDock* dockWidget);
451 
453  virtual void slot_dockDestroyed(DtAutoHideDock* dockWidget);
454 
456  virtual void slot_showDockOfCurrentItem(bool lockIt=false);
457 
459  virtual void slot_closeTimerTimeout();
460 
462  virtual void slot_onItemAvailabilityChanged(DtAutoHidePanelItem* dockWidget);
463 
464  virtual void slot_observerModeSettingChanged( makVrv::DtObserverObject*, int setting, bool value );
465  virtual void placeCompass();
466 
467  virtual void finalizeSetup();
468 
469  protected:
471  QWidget* myCentralWidget;
478  QTimer myTimer;
479  QTimer myCloseTimer;
480 
483  };
484 
487  {
488  public:
491 
493  virtual ~DtAutoHidePanelCreator();
494 
496  static DtAutoHidePanelCreator& instance(makVrv::DtDe&);
497 
499  static void registerInstance(makVrv::DtDe&, DtAutoHidePanelCreator*);
500 
502  virtual DtAutoHidePanel* create(const std::string& name, QWidget* parent);
503 
504  protected:
506  };
507 }
int myTopMargin
Definition: autoHidePanel.h:187
virtual DtAutoHideDock * tacticalGraphicCreationDock()
Definition: autoHidePanel.h:375
std::list< DtAutoHidePanelItem * > DtAutoHidePanelItemList
Definition: autoHidePanel.h:232
Definition: autoHidePanel.h:227
std::string myClassName
Definition: autoHidePanel.h:195
Contains makVrv::DtUserInterfaceAssembler class.
Builder for menu items.
Definition: DtMenuItem.h:23
The DtQtPageCollection is an abstract class which implements the page collection interface, and can be used extended by specific Qt implementations such as a tabbed panel or dialog.
Definition: DtQtPageCollection.h:23
DtAutoHideDock * creationDock()
Definition: autoHidePanel.h:339
DtAutoHideDockList myDocks
List with all the items currently on display.
Definition: autoHidePanel.h:473
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
QTimer myTimer
The item that wants to be closed.
Definition: autoHidePanel.h:478
Represents a new kind of dock widget: it has a &quot;pin&quot; button that allows the widget to pin/unpin from ...
Definition: autoHideDock.h:34
virtual DtAutoHideDock * propCreationDock()
Definition: autoHidePanel.h:386
A widget class for showing different items of supplied types to the logic tthat can be created...
Definition: entityCreatePalette.h:68
Contains makVrv::DtQtPageCollection class.
#define DT_DLL_VRFGUICOREQT
Definition: vrfGuiCoreQt.h:26
PageCollectionLocation
Definition: DtPageConfiguration.h:42
Definition: DtPageConfiguration.h:56
DtAutoHideDock * myCloseIfMousePressOutside
Definition: autoHidePanel.h:482
makVrv::DtSignalConnectionManager myConnections
Definition: autoHidePanel.h:196
bool myIsToggleType
Definition: autoHidePanel.h:192
makVrv::DtQIconConfigurations myIconConfigurations
Definition: autoHidePanel.h:181
Represents a menu item associated with an autoHidePanelItem widget.
Definition: autoHidePanel.h:59
virtual void selectPageInGui(makVrv::DtPage *page)
Implement selecting a page in the GUI.
Definition: autoHidePanel.h:428
Contains makVrv::DtWidgetIconStyleManager class declaration.
Represents an element of the autoHidePanel. This element is represented as an icon + an icon text...
Definition: autoHidePanel.h:94
virtual DtPropCreatePalette * propCreatePalette()
Return the prop create palette.
Definition: autoHidePanel.h:381
This class implements the panel where auto hide dialogs are placed when they are hidden. This panel is located on the right side of the app.
Definition: autoHidePanel.h:217
QTimer myCloseTimer
Controls the 1 second delay before showing a dock.
Definition: autoHidePanel.h:479
virtual DtTacticalGraphicCreatePalette * tacticalGraphicCreatePalette()
Return the tactical graphic create palette.
Definition: autoHidePanel.h:370
QWidget * myCentralWidget
Definition: autoHidePanel.h:471
bool myAboutToBeShown
Definition: autoHidePanel.h:191
virtual void changeFloatingGeometry(int px, int py, int width, int height)
Implement changing the floating geometry of the collection.
Definition: autoHidePanel.h:299
DtAutoHideDock * myAutoHideDock
Definition: autoHidePanel.h:190
int myRightMargin
Definition: autoHidePanel.h:186
QIcon myIcon
Definition: autoHidePanel.h:182
QString myIconText
Definition: autoHidePanel.h:184
Contains makVrv::DtVirtualBaseClass class.
std::map< std::string, DtAppearanceOptions >::iterator DtAppearanceListIterator
Definition: autoHidePanel.h:239
DtAutoHidePanelItem * myPanelItem
Definition: autoHidePanel.h:85
DtAutoHidePanelItem * myCurrentItem
Animates the display of a dock.
Definition: autoHidePanel.h:476
Contains makVrv::DtDockable class.
int myIconSize
Definition: autoHidePanel.h:183
Creator for the auto hide panel.
Definition: autoHidePanel.h:486
This abstract base class defines the interface for OS-specific keyboard and mouse event listeners...
Definition: DtObserverObject.h:29
makVrv::DtDe & myDe
Definition: autoHidePanel.h:505
bool myIsAvailable
Definition: autoHidePanel.h:193
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
makVrv::DtDe & myDe
Definition: autoHidePanel.h:87
DtAutoHidePanelItemList::iterator DtAutoHidePanelItemListIterator
Definition: autoHidePanel.h:233
QAction * myAction
Definition: autoHidePanel.h:86
int myBottomMargin
Definition: autoHidePanel.h:188
The page is a single widget component which is viewed in a page collection.
Definition: DtPage.h:30
DtAutoHidePanelItemList myItems
Definition: autoHidePanel.h:472
const DtAutoHideDockList & docks() const
Definition: autoHidePanel.h:313
Definition: autoHidePanel.h:199
makVrv::DtSignalConnectionManager myConnections
Controls the 1 second delay before hiding a dock.
Definition: autoHidePanel.h:481
DtWidgetAnimator * myWidgetAnimator
Keeps track of the last appearance of the items (hidden, pinned, docked, floating) ...
Definition: autoHidePanel.h:475
DtAutoHideDockList::iterator DtAutoHideDockListIterator
Definition: autoHidePanel.h:236
Represents a widget that can animate the movement of other widgets.
Definition: widgetAnimator.h:54
makVrv::DtDe & myDe
Definition: autoHidePanel.h:194
std::list< DtAutoHideDock * > DtAutoHideDockList
Definition: autoHidePanel.h:235
Base class to provide boost signal/slot management.
A widget class for creating TacticalGraphic objects.
Definition: tacticalGraphicCreatePalette.h:20
virtual void changeDockedGeometry(const makVrv::DtPageConfiguration::PageCollectionGeometry &geometry)
Implement changing the docked geometry of the collection.
Definition: autoHidePanel.h:308
int mySpacing
Definition: autoHidePanel.h:189
virtual void changeLocation(makVrv::DtPageConfiguration::PageCollectionLocation)
No-op. Cannot change location or geometry.
Definition: autoHidePanel.h:296
virtual DtEntityCreatePalette * entityCreatePalette()
Return the entity create palette.
Definition: autoHidePanel.h:359
virtual void changeDockedGeometry(int px, int py, int width, int height)
Implement changing the docked geometry of the collection.
Definition: autoHidePanel.h:305
const std::string & className() const
Class name.
Definition: autoHidePanel.h:116
std::map< std::string, DtAppearanceOptions > DtAppearanceList
Definition: autoHidePanel.h:238
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:70
virtual void changeFloatingGeometry(const makVrv::DtPageConfiguration::PageCollectionGeometry &geometry)
Implement changing the floating geometry of the collection.
Definition: autoHidePanel.h:302
A collection of icon configurations. The collection maintains flags indicating whether to generate ic...
Definition: DtQIconConfiguration.h:75
PaletteClass * createPalette()
Definition: autoHidePanel.h:319
QMainWindow * myMainWindow
Definition: autoHidePanel.h:470
virtual void selectPage(const std::string &pageClassName)
Implement selecting a page by name.
Definition: autoHidePanel.h:311
DtAppearanceOptions
Definition: autoHidePanel.h:224
Definition: autoHidePanel.h:228
The Qt main window. There will be only one of these per DtDe instance. Note, this window will be dest...
Definition: DtQtDeMainWindow.h:43
int myLeftMargin
Definition: autoHidePanel.h:185
DtAppearanceList myItemsAppearance
List with all the docks registered with this panel.
Definition: autoHidePanel.h:474
DtAutoHidePanelItem * myDockToClose
Current item to be shown.
Definition: autoHidePanel.h:477
virtual DtAutoHideDock * entityCreationDock()
Definition: autoHidePanel.h:364
A widget class for managing different camera views the currently selected observer can be placed in...
Definition: propCreatePalette.h:39

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)