OpenCOVER
coPanel.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_PANEL_H
9#define CO_PANEL_H
10
11#include <OpenVRUI/coAction.h>
13
14namespace vrui
15{
16
17class coPanelGeometry;
18
19class vruiTransformNode;
20
28class OPENVRUIEXPORT coPanel : public coAction, public coUIContainer
29{
30public:
32 virtual ~coPanel();
33
34 // hit is called whenever the button
35 // with this action is intersected
36 // return ACTION_CALL_ON_MISS if you want miss to be called
37 // otherwise return ACTION_DONE
38 virtual int hit(vruiHit *hit);
39
40 // miss is called once after a hit, if the button is not intersected
41 // anymore
42 virtual void miss();
43
44 void resize();
45 virtual void addElement(coUIElement *element);
46 void hide(coUIElement *element);
47 void show(coUIElement *element);
48 virtual void showElement(coUIElement *element);
49
50 void setPos(float x, float y, float z = 0.0f);
51 virtual float getWidth() const
52 {
53 return myWidth * scale;
54 }
55 virtual float getHeight() const
56 {
57 return myHeight * scale;
58 }
59 virtual float getXpos() const
60 {
61 return myX;
62 }
63 virtual float getYpos() const
64 {
65 return myY;
66 }
67 virtual float getZpos() const
68 {
69 return myZ;
70 }
71
72 virtual void setScale(float s);
74
76 virtual const char *getClassName() const;
78 virtual bool isOfClassName(const char *) const;
79
80protected:
84 float scale;
85 float myX;
86 float myY;
87 float myZ;
88 float myWidth;
89 float myHeight;
93};
94}
95#endif
collaborative interface manager
Definition: coVRCommunication.h:41
Definition: coAction.h:26
Definition: coPanel.h:29
float contentWidth
Content width.
Definition: coPanel.h:90
float myWidth
Panel width.
Definition: coPanel.h:88
vruiTransformNode * myDCS
Definition: coPanel.h:81
float myX
Panel position X.
Definition: coPanel.h:85
float scale
scale factor, scales all children
Definition: coPanel.h:84
void show(coUIElement *element)
virtual float getYpos() const
Returns element y position.
Definition: coPanel.h:63
virtual ~coPanel()
vruiTransformNode * myPosDCS
Transformation of the panel geometry.
Definition: coPanel.h:82
virtual void miss()
virtual float getXpos() const
Returns element x position.
Definition: coPanel.h:59
virtual float getWidth() const
Returns element width.
Definition: coPanel.h:51
virtual vruiTransformNode * getDCS()
coPanel(coPanelGeometry *geom)
virtual void setScale(float s)
float myZ
Panel position Z.
Definition: coPanel.h:87
virtual const char * getClassName() const
get the Element's classname
void hide(coUIElement *element)
virtual bool isOfClassName(const char *) const
check if the Element or any ancestor is this classname
virtual void showElement(coUIElement *element)
Adds the specified element to the scenegraph.
float myY
Panel position Y.
Definition: coPanel.h:86
virtual float getHeight() const
Returns element height.
Definition: coPanel.h:55
void setPos(float x, float y, float z=0.0f)
float myHeight
Panel height.
Definition: coPanel.h:89
virtual float getZpos() const
Definition: coPanel.h:67
virtual void addElement(coUIElement *element)
Appends a child to this container.
virtual int hit(vruiHit *hit)
vruiTransformNode * myChildDCS
Children origin.
Definition: coPanel.h:83
coPanelGeometry * myGeometry
Panel geometry.
Definition: coPanel.h:92
float contentHeight
Content height.
Definition: coPanel.h:91
Definition: coPanelGeometry.h:22
Definition: coUIContainer.h:24
Definition: coUIElement.h:53
Definition: vruiHit.h:21
Definition: vruiTransformNode.h:18