Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoScreenDrawer.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Thibaut Andrieu (Jan 2011)
22**=======================================================================*/
23
24#if !defined _SO_SCREEN_DRAWER_H_
25#define _SO_SCREEN_DRAWER_H_
26
28#include <Inventor/SbVec.h>
30#include <Inventor/SbBox.h>
31
34class SoSeparator;
36
84class SoScreenDrawer : public SoNode
85{
87
88public:
89
92
95
101 virtual void reset();
102
103private:
104
106 static void initClass();
107
109 static void exitClass();
110
112 virtual void notify( SoNotList *list );
113
114private:
119 virtual void handleEvent( SoHandleEventAction* action );
120
121 // Implement actions to redirect to m_root
122
124 virtual void doAction( SoAction *action );
125
127 virtual void callback( SoCallbackAction *action );
128
130 virtual void GLRender( SoGLRenderAction *action );
131
133 virtual void rayPick( SoRayPickAction *action );
134
136 virtual void getBoundingBox( SoGetBoundingBoxAction *action );
137
139 virtual void getPrimitiveCount( SoGetPrimitiveCountAction *action );
140
142 SbVec2f normalizePoint(const SbVec2f& point, const SbViewportRegion& viewport);
143
145
147 virtual void onKeyDown( SoHandleEventAction* ) {};
148
150 virtual void onMouseDown( SoHandleEventAction* ) {};
151
153 virtual void onMouseMove( SoHandleEventAction* ) {};
154
156 virtual void onMouseDblClick( SoHandleEventAction* ) {};
157
159 virtual void onMouseDragging( SoHandleEventAction* ) {};
160
162 virtual void onMouseUp( SoHandleEventAction* ) {};
163
165 inline const SbVec2f& getLastMouseDown() const { return m_lastMouseDown; }
166
167private:
168
170 virtual ~SoScreenDrawer();
171
172private:
173
178 SoSeparator* m_root;
179
184 SoSeparator* m_userGraphContainer;
185
187 SoOrthographicCamera* m_camera;
188
190 bool m_mouseLeftDown;
191
193 SbVec2f m_lastMouseDown;
194
195};
196
197
198#endif // _SO_SCREEN_DRAWER_H_
199
200
#define SoEXTENDER_Documented
#define SO_NODE_HEADER(className)
Definition SoSubNode.h:151
2D vector class.
Definition SbVec.h:76
Class for representing a viewport.
Abstract base class for all actions.
Definition SoAction.h:132
Performs a generic traversal of a scene graph or path.
Renders a scene graph using Open Inventor's Render Engine.
Computes bounding box of a scene.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Counts number of...
Allows nodes in a graph to receive input events.
Abstract base class for all database nodes.
Definition SoNode.h:145
Orthographic camera node.
Intersects objects with a ray cast into scene.
Field containing a a node.
Definition SoSFNode.h:97
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Base class to dr...
SoSFNode sceneGraph
Scene graph to render.
virtual void reset()
Resets internal state to initial values.
SoScreenDrawer()
Constructor.
Group node that saves and restores traversal state.