VR-Forces 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)
21 #include <vrvCoreQt/DtDockable.h>
22 #include <vrvCoreQt/DtMenuItem.h>
26 #endif
27 
28 #include <QtGui/QIcon>
29 #include <QtGui/QPixmap>
30 #include <QtWidgets/QWidget>
31 #include <QtWidgets/QDockWidget>
32 #include <QtWidgets/QPushButton>
33 #include <QtWidgets/QToolButton>
34 #include <QtWidgets/QHeaderView>
35 #include <QtCore/QTimer>
36 #include <map>
37 
38 class QVBoxLayout;
39 
40 namespace makVrv
41 {
42  class DtDe;
43  class DtChannelManager;
44  class DtChannel;
45  class DtObserverObject;
46 }
47 
48 namespace makVrf
49 {
50  class DtAutoHidePanelItem;
51  class DtPropCreatePalette;
52  class DtCreateObjectPalette;
53 
58  {
59 
60  Q_OBJECT
61 
62  public:
63 
65  DtAutoHideDockViewItem(makVrv::DtDe& de, const std::string& dockName, DtAutoHidePanelItem* item);
66 
68  virtual ~DtAutoHideDockViewItem();
69 
71  virtual QAction* createAction(makVrv::DtDe& de, QWidget* parent);
72 
73  protected:
74 
76  virtual void on_triggered();
77 
79  virtual void on_aboutToShow();
80 
81  protected:
82 
86  };
87 
93  {
94  Q_OBJECT
95 
96  public:
97 
100  DtAutoHidePanelItem(makVrv::DtDe& de, QWidget* parent, QString title, const std::string& className);
101 
103  virtual ~DtAutoHidePanelItem();
104 
106  DtAutoHideDock* dockToManage();
107  virtual void setDockToManage(DtAutoHideDock* widget);
108 
110  virtual const makVrv::DtQIconConfigurations& icon() const;
111  virtual void setIcon(const makVrv::DtQIconConfigurations& p);
112 
114  const std::string& className() const { return myClassName; };
115 
117  virtual QString iconText();
118  virtual void setIconText(const QString& s);
119 
122  virtual bool toggled() const;
123  virtual void setToggled(bool flag);
124 
127  virtual void setAvailable(bool visible, bool updateVisibilityState = true);
128  virtual bool available() const;
129 
131  virtual void setAboutToBeShown(bool flag);
132 
135  virtual void refreshSize(int minsize=-1);
136 
138  virtual void setToggle(bool flag);
139 
140  protected:
141  virtual bool eventFilter(QObject* o, QEvent* e) override;
142 
144  virtual void enterEvent(QEvent* e);
145 
147  virtual void leaveEvent(QEvent *);
148 
150  virtual void paintEvent(QPaintEvent* p);
151 
152  virtual void refreshIcon();
153 
154  signals:
155 
157  void signal_enter(DtAutoHidePanelItem*);
158 
160  void signal_leave(DtAutoHidePanelItem*);
161 
164  void signal_toggled(DtAutoHidePanelItem*);
165 
168  void signal_clicked(DtAutoHidePanelItem*);
169 
171  void signal_availabilityChanged(DtAutoHidePanelItem*);
172 
173  protected slots:
175  virtual void toggleItem();
176 
177  protected:
178 
180  QIcon myIcon;
182  QString myIconText;
193  std::string myClassName;
195  };
196 
198  {
199  public:
201  virtual ~DtAutoHidePanelItemCreator();
202 
204  static DtAutoHidePanelItemCreator& instance(makVrv::DtDe&);
205 
207  static void registerInstance(makVrv::DtDe& de, DtAutoHidePanelItemCreator* instance);
208 
209  virtual DtAutoHidePanelItem* create(makVrv::DtDe&, QWidget* parent, const QString& title, const std::string& className);
210  };
211 
217  {
218  Q_OBJECT
219 
220  public:
221 
223  {
224  Hidden = 0,
227  Floating
228  };
229 
230  typedef std::list<DtAutoHidePanelItem*> DtAutoHidePanelItemList;
231  typedef DtAutoHidePanelItemList::iterator DtAutoHidePanelItemListIterator;
232 
233  typedef std::list<DtAutoHideDock*> DtAutoHideDockList;
234  typedef DtAutoHideDockList::iterator DtAutoHideDockListIterator;
235 
236  typedef std::map<std::string, DtAppearanceOptions> DtAppearanceList;
237  typedef std::map<std::string, DtAppearanceOptions>::iterator DtAppearanceListIterator;
238 
239  public:
240 
241  DtAutoHidePanel(makVrv::DtDe& de, const std::string& name, makVrv::DtQtDeMainWindow* parent);
242 
243  virtual ~DtAutoHidePanel();
244 
248  virtual DtAutoHidePanelItem* addItem(DtAutoHideDock* dock, bool forceVisible=false, bool initiallVisible = true) ;
249 
251  virtual void clear();
252 
254  virtual DtAutoHidePanelItem* findItemForClass( const std::string& s );
255  virtual DtAutoHidePanelItem* findItemForDock( const DtAutoHideDock* dock );
256 
258  virtual void setPanelItemVisible(const std::string& panelClassName, bool, bool updateVisibilityState = false);
259 
262  virtual void hideAllDocks();
263 
265  virtual int itemCount();
266 
268  virtual void placeItems();
269 
271  virtual void removeItem(DtAutoHidePanelItem* item);
272 
274  virtual void showDockForItem( DtAutoHidePanelItem* item, bool animate=true);
275 
277  virtual void hideDockForItem( DtAutoHidePanelItem* item, bool animate=true);
278 
280  static DtAutoHidePanel* instance(makVrv::DtDe&);
281 
284  virtual std::vector< std::pair<DtString, QString> > panelsThatCanBeUsedOnCreateMenu() const;
285 
286  virtual void changeVisibility(bool);
287 
289  virtual bool findDock(DtAutoHideDock* dock);
290 
292 
295 
297  virtual void changeFloatingGeometry(int px, int py, int width, int height) {};
298 
301 
303  virtual void changeDockedGeometry(int px, int py, int width, int height) {};
304 
307 
309  virtual void selectPage(const std::string& pageClassName) {};
310 
311  const DtAutoHideDockList& docks() const
312  {
313  return myDocks;
314  }
315 
316  template <typename PaletteClass>
317  PaletteClass* createPalette()
318  {
319  DtAutoHideDockList::iterator iter = myDocks.begin();
320 
321  while (iter != myDocks.end())
322  {
323  PaletteClass* p = dynamic_cast<PaletteClass*>((*iter)->widget());
324 
325  if (p)
326  {
327  return p;
328  }
329 
330  ++iter;
331  }
332 
333  return 0;
334  }
335 
336  template <typename PaletteClass>
338  {
339  DtAutoHideDockList::iterator iter = myDocks.begin();
340 
341  while (iter != myDocks.end())
342  {
343  PaletteClass* p = dynamic_cast<PaletteClass*>((*iter)->widget());
344 
345  if (p)
346  {
347  return *iter;
348  }
349 
350  ++iter;
351  }
352 
353  return 0;
354  }
355 
358  {
359  return createPalette<DtCreateObjectPalette>();
360  }
361 
363  {
364  return creationDock<DtCreateObjectPalette>();
365  }
366 
369  {
370  return createPalette<DtPropCreatePalette>();
371  }
372 
374  {
375  return creationDock<DtPropCreatePalette>();
376  }
377 
380  virtual void setItemPinned( DtAutoHidePanelItem*, bool );
381 
383  virtual int maxItemWidth();
384 
385  protected:
386 
388  virtual void setupGui();
389 
391  virtual bool eventFilter(QObject* p, QEvent* e);
392 
394  virtual void installEventFilters();
395 
397  virtual void removeDock(DtAutoHideDock* dock);
398 
400  virtual void relocateAnyPinnedDock();
401 
403  virtual void refreshItems(int minsize);
404 
406  virtual void refreshAppearanceOfItem(DtAutoHidePanelItem* autoHideItemWidget, bool forceVisible);
407 
409  virtual void addPageToGui(makVrv::DtPage*);
410 
412  virtual void removePageFromGui(makVrv::DtPage*);
413 
415  virtual void selectPageInGui(makVrv::DtPage* page) {};
416 
417  protected slots:
418 
421  virtual void slot_onItemToggled(DtAutoHidePanelItem*);
422 
425  virtual void slot_onItemClicked(DtAutoHidePanelItem*);
426 
428  virtual void slot_dockClosed(DtAutoHideDock* dockWidget);
429 
431  virtual void slot_dockEntered(DtAutoHideDock* dockWidget);
432 
434  virtual void slot_dockLeft(DtAutoHideDock* dockWidget);
435 
437  virtual void slot_dockResized(DtAutoHideDock* dockWidget);
438 
440  virtual void slot_dockDestroyed(DtAutoHideDock* dockWidget);
441 
443  virtual void slot_showDockOfCurrentItem(bool lockIt=false);
444 
446  virtual void slot_closeTimerTimeout();
447 
449  virtual void slot_onItemAvailabilityChanged(DtAutoHidePanelItem* dockWidget);
450 
451  virtual void slot_observerModeSettingChanged( makVrv::DtObserverObject*, int setting, bool value );
452  virtual void placeCompass();
453 
454  virtual void finalizeSetup();
455 
456  protected:
458  QWidget* myCentralWidget;
465  QTimer myTimer;
466  QTimer myCloseTimer;
467 
470  };
471 
474  {
475  public:
478 
480  virtual ~DtAutoHidePanelCreator();
481 
483  static DtAutoHidePanelCreator& instance(makVrv::DtDe&);
484 
486  static void registerInstance(makVrv::DtDe&, DtAutoHidePanelCreator*);
487 
489  virtual DtAutoHidePanel* create(const std::string& name, QWidget* parent);
490 
491  protected:
493  };
494 }
int myTopMargin
Definition: autoHidePanel.h:185
std::list< DtAutoHidePanelItem * > DtAutoHidePanelItemList
Definition: autoHidePanel.h:230
Definition: autoHidePanel.h:225
std::string myClassName
Definition: autoHidePanel.h:193
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:337
DtAutoHideDockList myDocks
List with all the items currently on display.
Definition: autoHidePanel.h:460
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:465
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:35
virtual DtAutoHideDock * propCreationDock()
Definition: autoHidePanel.h:373
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:469
makVrv::DtSignalConnectionManager myConnections
Definition: autoHidePanel.h:194
bool myIsToggleType
Definition: autoHidePanel.h:190
makVrv::DtQIconConfigurations myIconConfigurations
Definition: autoHidePanel.h:179
Represents a menu item associated with an autoHidePanelItem widget.
Definition: autoHidePanel.h:57
virtual void selectPageInGui(makVrv::DtPage *page)
Implement selecting a page in the GUI.
Definition: autoHidePanel.h:415
Contains makVrv::DtWidgetIconStyleManager class declaration.
Represents an element of the autoHidePanel. This element is represented as an icon + an icon text...
Definition: autoHidePanel.h:92
virtual DtPropCreatePalette * propCreatePalette()
Return the prop create palette.
Definition: autoHidePanel.h:368
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:215
QTimer myCloseTimer
Controls the 1 second delay before showing a dock.
Definition: autoHidePanel.h:466
QWidget * myCentralWidget
Definition: autoHidePanel.h:458
bool myAboutToBeShown
Definition: autoHidePanel.h:189
virtual void changeFloatingGeometry(int px, int py, int width, int height)
Implement changing the floating geometry of the collection.
Definition: autoHidePanel.h:297
virtual DtAutoHideDock * createObjectDock()
Definition: autoHidePanel.h:362
DtAutoHideDock * myAutoHideDock
Definition: autoHidePanel.h:188
int myRightMargin
Definition: autoHidePanel.h:184
QIcon myIcon
Definition: autoHidePanel.h:180
QString myIconText
Definition: autoHidePanel.h:182
Contains makVrv::DtVirtualBaseClass class.
std::map< std::string, DtAppearanceOptions >::iterator DtAppearanceListIterator
Definition: autoHidePanel.h:237
DtAutoHidePanelItem * myPanelItem
Definition: autoHidePanel.h:83
DtAutoHidePanelItem * myCurrentItem
Animates the display of a dock.
Definition: autoHidePanel.h:463
Contains makVrv::DtDockable class.
int myIconSize
Definition: autoHidePanel.h:181
Creator for the auto hide panel.
Definition: autoHidePanel.h:473
This abstract base class defines the interface for OS-specific keyboard and mouse event listeners...
Definition: DtObserverObject.h:32
makVrv::DtDe & myDe
Definition: autoHidePanel.h:492
bool myIsAvailable
Definition: autoHidePanel.h:191
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
makVrv::DtDe & myDe
Definition: autoHidePanel.h:85
DtAutoHidePanelItemList::iterator DtAutoHidePanelItemListIterator
Definition: autoHidePanel.h:231
QAction * myAction
Definition: autoHidePanel.h:84
int myBottomMargin
Definition: autoHidePanel.h:186
The page is a single widget component which is viewed in a page collection.
Definition: DtPage.h:30
DtAutoHidePanelItemList myItems
Definition: autoHidePanel.h:459
const DtAutoHideDockList & docks() const
Definition: autoHidePanel.h:311
Definition: autoHidePanel.h:197
makVrv::DtSignalConnectionManager myConnections
Controls the 1 second delay before hiding a dock.
Definition: autoHidePanel.h:468
DtWidgetAnimator * myWidgetAnimator
Keeps track of the last appearance of the items (hidden, pinned, docked, floating) ...
Definition: autoHidePanel.h:462
DtAutoHideDockList::iterator DtAutoHideDockListIterator
Definition: autoHidePanel.h:234
Represents a widget that can animate the movement of other widgets.
Definition: widgetAnimator.h:54
makVrv::DtDe & myDe
Definition: autoHidePanel.h:192
A widget class for showing different items of supplied types to the logic tthat can be created...
Definition: createObjectPalette.h:71
std::list< DtAutoHideDock * > DtAutoHideDockList
Definition: autoHidePanel.h:233
Base class to provide boost signal/slot management.
virtual void changeDockedGeometry(const makVrv::DtPageConfiguration::PageCollectionGeometry &geometry)
Implement changing the docked geometry of the collection.
Definition: autoHidePanel.h:306
int mySpacing
Definition: autoHidePanel.h:187
virtual void changeLocation(makVrv::DtPageConfiguration::PageCollectionLocation)
No-op. Cannot change location or geometry.
Definition: autoHidePanel.h:294
virtual void changeDockedGeometry(int px, int py, int width, int height)
Implement changing the docked geometry of the collection.
Definition: autoHidePanel.h:303
const std::string & className() const
Class name.
Definition: autoHidePanel.h:114
std::map< std::string, DtAppearanceOptions > DtAppearanceList
Definition: autoHidePanel.h:236
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:72
virtual void changeFloatingGeometry(const makVrv::DtPageConfiguration::PageCollectionGeometry &geometry)
Implement changing the floating geometry of the collection.
Definition: autoHidePanel.h:300
A collection of icon configurations. The collection maintains flags indicating whether to generate ic...
Definition: DtQIconConfiguration.h:131
PaletteClass * createPalette()
Definition: autoHidePanel.h:317
QMainWindow * myMainWindow
Definition: autoHidePanel.h:457
virtual void selectPage(const std::string &pageClassName)
Implement selecting a page by name.
Definition: autoHidePanel.h:309
DtAppearanceOptions
Definition: autoHidePanel.h:222
virtual DtCreateObjectPalette * createObjectPalette()
Return the entity create palette.
Definition: autoHidePanel.h:357
Definition: autoHidePanel.h:226
The Qt main window. There will be only one of these per DtDe instance. Note, this window will be dest...
Definition: DtQtDeMainWindow.h:44
int myLeftMargin
Definition: autoHidePanel.h:183
DtAppearanceList myItemsAppearance
List with all the docks registered with this panel.
Definition: autoHidePanel.h:461
DtAutoHidePanelItem * myDockToClose
Current item to be shown.
Definition: autoHidePanel.h:464
A widget class for managing different camera views the currently selected observer can be placed in...
Definition: propCreatePalette.h:39

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)