OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
coPopupHandle.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef CO_POPUPHANDLE_H
9 #define CO_POPUPHANDLE_H
10 
12 #include <OpenVRUI/coAction.h>
13 #include <OpenVRUI/coButton.h>
15 #include <string>
16 
17 namespace vrui
18 {
19 
20 class coLabel;
21 class coButton;
22 class coBackground;
23 class coFrame;
24 class coMenuContainer;
25 class coCombinedButtonInteraction;
26 class vruiHit;
27 class vruiMatrix;
28 
30 class OPENVRUIEXPORT coPopupHandle
31  : public coRowContainer,
32  public coAction,
33  public coUpdateable,
34  public coButtonActor
35 {
36 public:
37  coPopupHandle(const std::string &title);
38  virtual ~coPopupHandle();
39  virtual void setTransformMatrix(vruiMatrix *matrix);
40  virtual void setTransformMatrix(vruiMatrix *matrix, float scale);
41  virtual void setScale(float scale);
42  virtual float getScale() const;
43  virtual bool update();
44 
45  virtual void resizeToParent(float, float, float, bool shrink = true);
46  virtual void shrinkToMin();
47 
48  virtual void createGeometry()
49  {
50  }
51  // hit is called whenever the button
52  // with this action is intersected
53  // return ACTION_CALL_ON_MISS if you want miss to be called
54  // otherwise return ACTION_DONE
55  virtual int hit(vruiHit *hit);
56 
57  // miss is called once after a hit, if the button is not intersected
58  // anymore
59  virtual void miss();
60 
62  virtual const char *getClassName() const;
64  virtual bool isOfClassName(const char *) const;
65 
66 protected:
67  virtual void buttonEvent(coButton *source);
69 
73 
74  bool unregister;
80  coVector pickPosition;
84  float lastRoll;
86  float myScale;
87 
88 private:
89  //
90  coLabel *titleLabel;
91  coButton *closeButton;
92  coButton *minmaxButton;
93  coBackground *titleBackground;
94  coMenuContainer *titleContainer;
95  coFrame *titleFrame;
96  std::string title;
97  bool minimized;
98 };
99 }
100 #endif
Action listener for events triggered by coButton.
Definition: coButton.h:23
coCombinedButtonInteraction * interactionB
interaction for second button
Definition: coPopupHandle.h:71
Definition: vruiHit.h:20
Definition: coButton.h:36
float lastRoll
roll angle during the last frame
Definition: coPopupHandle.h:84
Definition: coBackground.h:22
coCombinedButtonInteraction * interactionC
interaction for third button
Definition: coPopupHandle.h:72
vruiMatrix * startPosition
transformation matrix at the beginning of an interaction
Definition: coPopupHandle.h:76
Popup Handler.
Definition: coPopupHandle.h:30
Definition: coAction.h:25
vruiMatrix * invStartHandTrans
inverse transformation of the pointer at the beginning of an interaction
Definition: coPopupHandle.h:82
virtual void createGeometry()
Definition: coPopupHandle.h:48
Definition: coLabel.h:25
Definition: vruiMatrix.h:19
Definition: coCombinedButtonInteraction.h:20
float myScale
the size
Definition: coPopupHandle.h:86
Definition: coMenuContainer.h:19
bool unregister
Definition: coPopupHandle.h:74
Definition: coFrame.h:28
coVector pickPosition
point in world coordinates where the titlebar was picked
Definition: coPopupHandle.h:80
coVector localPickPosition
point in local menu coordinates where the titlebar was picked
Definition: coPopupHandle.h:78
Container class that aligns its children in a row.
Definition: coRowContainer.h:18
objects that are derived from this class are called once per frame
Definition: coUpdateManager.h:19
coCombinedButtonInteraction * interactionA
true, if the pointer could be grabbed for an interaction
Definition: coPopupHandle.h:70