Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
PoBaseView.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-2022 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24#ifndef _PO_BASE_VIEW_
25#define _PO_BASE_VIEW_
26
30#include <Inventor/Gui/SoGui.h>
31
32class SoGuiViewer;
33
100class PoBaseView : public SoBaseKit
101{
103
104 /* Define fields for new parts */
106
107 public:
108
117
127
132 SbBool isPointWithinViewport(float x, float y) const;
133
144 void setCamera( SoGuiViewer* viewer );
145
150 { m_isSensitiveOnEvents = flag; }
151
156 { return m_isSensitiveOnEvents; }
157
173 static PoBaseView* getView( SoGuiViewer* viewer, int mouseX, int mouseY );
174
175#if 1 SoDEPRECATED
181 static SbBool viewingEventCB( void* SO_UNUSED_PARAM(viewer), void* SO_UNUSED_PARAM(anyEvent) ) { return FALSE; }
182
183#endif
185 /*----------------------------------------------------------------------------*/
186 private:
187 static void initClasses();
188 static void initClass();
189 static void exitClass() ;
190 static void exitClasses() ;
191
192 // this is an internal getView method that can get the PoBaseView without testing if it is sensible to events
193 static PoBaseView* getViewCore(SoGuiViewer* viewer, int mouseX, int mouseY, bool testSensitiveToEvents = true);
194
195 virtual SbBool getViewportIsEnabled() const;
196 virtual const SbVec2f getViewportOrigin() const;
197 virtual const SbVec2f getViewportSize() const;
198
199 private:
200 // Methods
201 virtual void setDefaultOnNonWritingFields();
202
203 // Constructor
204 PoBaseView();
205
206 // Destructor
207 virtual ~PoBaseView();
208
209 private:
210 // Define fields for new parts
211 SO_KIT_CATALOG_ENTRY_HEADER(catchActionCallback);
212
213 // Methods
214 static void catchActionCB(void *, SoAction *);
215 static void normalizeMousePoint( SoGuiViewer* viewer,
216 int mouseX, int mouseY,
217 float& x, float& y );
218
219 // Variables
220 static SbVec4f m_vvPortion;
221 static SbVec2s m_currentLogicalViewportSize;
222 SbBool m_isSensitiveOnEvents;
223};
224
225/*----------------------------------------------------------------------------*/
226
227#endif /* _PO_BASE_VIEW_ */
228
229
#define FALSE
Possible value of SbBool.
Definition SbBase.h:75
#define SO_KIT_CATALOG_ENTRY_HEADER(partName)
Definition SoSubKit.h:107
#define SO_KIT_ABSTRACT_HEADER(className)
Definition SoSubKit.h:95
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
Definition PoBaseView.h:101
static PoBaseView * getView(SoGuiViewer *viewer, int mouseX, int mouseY)
Returns the view (if any) that contains the given mouse cursor position.
SbBool isSensitiveOnEvents() const
Returns true if the view is sensitive to events.
Definition PoBaseView.h:155
void setCamera(SoGuiViewer *viewer)
Sets the camera of the view on the viewer.
void sensitiveOnEvents(SbBool flag)
Specifies if the view is sensitive to events.
Definition PoBaseView.h:149
SoSFVec2f viewportOrigin
Lower-left corner coordinates of the viewport of the view.
Definition PoBaseView.h:116
SoSFVec2f viewportSize
Size of the viewport of the view.
Definition PoBaseView.h:126
static SoDEPRECATED SbBool viewingEventCB(void *viewer, void *anyEvent)
The callback is automatically registered in the So<XXX>Viewer classes.
Definition PoBaseView.h:181
SbBool isPointWithinViewport(float x, float y) const
Indicates if a point defined in the normalized space [0-1]x[0-1] is in the viewport of the view.
2D vector class.
Definition SbVec.h:76
2D vector class.
Definition SbVec.h:700
4D vector class.
Definition SbVec.h:2214
Abstract base class for all actions.
Definition SoAction.h:132
Base class for all node kits.
Definition SoBaseKit.h:302
Field containing a two-dimensional vector.
Definition SoSFVec2f.h:78
int SbBool
Boolean type.
Definition SbBase.h:87