Coin Logo http://www.sim.no
http://www.coin3d.org

SoQtViewer.h
1 #ifndef SOQT_VIEWER_H
2 #define SOQT_VIEWER_H
3 
4 // src/Inventor/Qt/viewers/SoQtViewer.h. Generated from SoGuiViewer.h.in by configure.
5 
6 /**************************************************************************\
7  *
8  * This file is part of the Coin 3D visualization library.
9  * Copyright (C) by Kongsberg Oil & Gas Technologies.
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * ("GPL") version 2 as published by the Free Software Foundation.
14  * See the file LICENSE.GPL at the root directory of this source
15  * distribution for additional information about the GNU GPL.
16  *
17  * For using Coin with software that can not be combined with the GNU
18  * GPL, and for taking advantage of the additional benefits of our
19  * support services, please contact Kongsberg Oil & Gas Technologies
20  * about acquiring a Coin Professional Edition License.
21  *
22  * See http://www.coin3d.org/ for more information.
23  *
24  * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
25  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
26  *
27 \**************************************************************************/
28 
29 /**************************************************************************\
30  *
31  * A WORD OF ADVICE
32  *
33  * It is fruitless to modify the contents of the SoQtViewer.h file
34  * because it is autogenerated by configure from the SoAnyViewer.h.in
35  * file which you will find in the src/Inventor/Qt/common/ directory.
36  * Do your modifications to that file instead.
37  *
38 \**************************************************************************/
39 
40 // Include this first, as a workaround for building on top of SGI and
41 // TGS Inventor on some Linux distributions. (The bug is in SGI/TGS
42 // Inventor.)
43 #include <math.h>
44 
45 #include <Inventor/SbTime.h>
46 #include <Inventor/SoType.h>
47 #include <Inventor/SbLinear.h>
48 
49 #include <Inventor/Qt/SoQtRenderArea.h>
50 
51 #ifndef SOQT_INTERNAL
52 #include <Inventor/events/SoKeyboardEvent.h>
53 #endif // SOQT_INTERNAL
54 
55 class SoCallbackList;
56 class SoBaseColor;
57 class SoCamera;
58 class SoComplexity;
59 class SoDirectionalLight;
60 class SoDrawStyle;
61 class SoGetBoundingBoxAction;
62 class SoGroup;
63 class SoLightModel;
64 class SoMaterialBinding;
65 class SoNode;
66 class SoPolygonOffset;
67 class SoSensor;
68 class SoSeparator;
69 class SoSwitch;
70 class SoTimerSensor;
71 
72 class SoQtViewer;
73 
74 typedef void SoQtViewerCB(void * data, SoQtViewer * viewer);
75 typedef void SoQtViewerFPSCB(float fps, void * data, SoQtViewer * viewer);
76 
77 typedef SbVec2f SoQtAutoClippingCB(void * data, const SbVec2f & nearfar);
78 
79 // *************************************************************************
80 
81 class SOQT_DLL_API SoQtViewer : public SoQtRenderArea {
82  SOQT_OBJECT_ABSTRACT_HEADER(SoQtViewer, SoQtRenderArea);
83 
84 public:
85  enum Type {
87  EDITOR
88  };
89 
90  enum DrawStyle {
101  VIEW_WIREFRAME_OVERLAY
102  };
103 
104  enum DrawType {
105  STILL = 0,
106  INTERACTIVE
107  };
108 
109  enum BufferType {
112  BUFFER_INTERACTIVE
113  };
114 
117  CONSTANT_NEAR_PLANE
118  };
119 
120  virtual void setCamera(SoCamera * camera);
121  SoCamera * getCamera(void) const;
122 
123  virtual void setCameraType(SoType type);
124  SoType getCameraType(void) const;
125 
126  virtual void toggleCameraType(void);
127 
128  virtual void viewAll(void);
129 
130  virtual void saveHomePosition(void);
131  virtual void resetToHomePosition(void);
132 
133  virtual void setHeadlight(SbBool enable);
134  SbBool isHeadlight(void) const;
135  SoDirectionalLight * getHeadlight(void) const;
136 
137  virtual void setDrawStyle(SoQtViewer::DrawType type, SoQtViewer::DrawStyle style);
138  SoQtViewer::DrawStyle getDrawStyle(const SoQtViewer::DrawType type) const;
139 
140  virtual void setBufferingType(SoQtViewer::BufferType type);
141  SoQtViewer::BufferType getBufferingType(void) const;
142 
143  virtual void setViewing(SbBool enable);
144  SbBool isViewing(void) const;
145 
146  virtual void setCursorEnabled(SbBool enable);
147  SbBool isCursorEnabled(void) const;
148 
149  void setAutoClipping(SbBool enable);
150  SbBool isAutoClipping(void) const;
151 
152  void setAutoClippingStrategy(const AutoClippingStrategy strategy,
153  const float value = 0.6f,
154  SoQtAutoClippingCB * cb = NULL,
155  void * cbuserdata = NULL);
156 
157  virtual void setStereoViewing(SbBool enable);
158  SbBool isStereoViewing(void) const;
159 
160  virtual void setStereoOffset(const float dist);
161  float getStereoOffset(void) const;
162 
163  enum StereoType {
164  STEREO_NONE, STEREO_ANAGLYPH, STEREO_QUADBUFFER,
165  STEREO_INTERLEAVED_ROWS, STEREO_INTERLEAVED_COLUMNS
166  };
167 
168  SbBool setStereoType(SoQtViewer::StereoType s);
169  SoQtViewer::StereoType getStereoType(void) const;
170 
171  void setAnaglyphStereoColorMasks(const SbBool left[3], const SbBool right[3]);
172  void getAnaglyphStereoColorMasks(SbBool left[3], SbBool right[3]);
173 
174  void setDetailSeek(const SbBool enable);
175  SbBool isDetailSeek(void) const;
176 
177  void setSeekTime(const float seconds);
178  float getSeekTime(void) const;
179 
180  void addStartCallback(SoQtViewerCB * func, void * data = NULL);
181  void addFinishCallback(SoQtViewerCB * func, void * data = NULL);
182  void removeStartCallback(SoQtViewerCB * func, void * data = NULL);
183  void removeFinishCallback(SoQtViewerCB * func, void * data = NULL);
184 
185  void setWireframeOverlayColor(const SbColor & color);
186  const SbColor & getWireframeOverlayColor(void) const;
187 
188  virtual void setDoubleBuffer(const SbBool enable);
189 
190  virtual void setSceneGraph(SoNode * root);
191  virtual SoNode * getSceneGraph(void);
192 
193 protected:
194  SoQtViewer(QWidget * parent,
195  const char * name,
196  SbBool embed,
197  Type type,
198  SbBool build);
199  ~SoQtViewer();
200 
201  virtual void sizeChanged(const SbVec2s & size);
202  virtual void setSeekMode(SbBool enable);
203  SbBool isSeekMode(void) const;
204  SbBool seekToPoint(const SbVec2s screenpos);
205  void seekToPoint(const SbVec3f & scenepos);
206  virtual void computeSeekFinalOrientation(void);
207 
208  virtual void actualRedraw(void);
209  virtual SbBool processSoEvent(const SoEvent * const event);
210 
211  void interactiveCountInc(void);
212  void interactiveCountDec(void);
213  int getInteractiveCount(void) const;
214 
215  void setSeekDistance(const float distance);
216  float getSeekDistance(void) const;
217  void setSeekValueAsPercentage(const SbBool on);
218  SbBool isSeekValuePercentage(void) const;
219 
220  virtual void changeCameraValues(SoCamera * camera);
221 
222  void addSuperimposition(SoNode * scene);
223  void removeSuperimposition(SoNode * scene);
224  void setSuperimpositionEnabled(SoNode * scene, const SbBool enable);
225  SbBool getSuperimpositionEnabled(SoNode * scene) const;
226 
227 private:
228  class SoQtViewerP * pimpl;
229  friend class SoQtViewerP;
230  friend class SoQtPlaneViewer;
231 };
232 
233 // *************************************************************************
234 
235 #endif // ! SOQT_VIEWER_H
Definition: SoQtViewer.h:99
Definition: SoQtViewer.h:86
BufferType
Definition: SoQtViewer.h:109
Definition: SoQtViewer.h:97
Definition: SoQtViewer.h:92
AutoClippingStrategy
Definition: SoQtViewer.h:115
virtual SoNode * getSceneGraph(void)
Definition: SoQtRenderArea.cpp:994
virtual void actualRedraw(void)
Definition: SoQtRenderArea.cpp:1860
Definition: SoQtViewer.h:165
The SoQtViewer class is the top level base viewer class.This is an abstract class, which adds the following features to it's SoQtRenderArea superclass: convenient methods for camera handling, an automatic headlight configuration.
Definition: SoQtViewer.h:81
Definition: SoQtViewer.h:96
Definition: SoQtViewer.h:93
StereoType
Definition: SoQtViewer.h:163
DrawStyle
Definition: SoQtViewer.h:90
Type
Definition: SoQtViewer.h:85
virtual void setSceneGraph(SoNode *scene)
Definition: SoQtRenderArea.cpp:982
virtual SbBool processSoEvent(const SoEvent *const event)
Definition: SoQtRenderArea.cpp:2112
The SoQtRenderArea class adds scenegraph handling and event management.The SoQtRenderArea class is a ...
Definition: SoQtRenderArea.h:50
Definition: SoQtViewer.h:91
Definition: SoQtViewer.h:164
The SoQtPlaneViewer class is for examining 3D models by moving the camera in orthogonal planes...
Definition: SoQtPlaneViewer.h:33
Definition: SoQtViewer.h:110
Definition: SoQtViewer.h:111
virtual void setDoubleBuffer(const SbBool enable)
Definition: SoQtGLWidget.cpp:312
Definition: SoQtViewer.h:100
Definition: SoQtViewer.h:95
Definition: SoQtViewer.h:94
Definition: SoQtViewer.h:98
DrawType
Definition: SoQtViewer.h:104
virtual void sizeChanged(const SbVec2s &size)
Definition: SoQtRenderArea.cpp:1942
Definition: SoQtViewer.h:116

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Fri Aug 15 2014 for SoQt by Doxygen 1.8.7.