Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
SoQtConstrainedViewer.h
1 //
2 
3 /**************************************************************************\
4  * Copyright (c) Kongsberg Oil & Gas Technologies AS
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  * Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the distribution.
17  *
18  * Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 \**************************************************************************/
34 
35 #ifndef SOQT_CONSTRAINEDVIEWER_H
36 #define SOQT_CONSTRAINEDVIEWER_H
37 
38 #include <Inventor/Qt/viewers/SoQtFullViewer.h>
39 
40 // ************************************************************************
41 
42 class SOQT_DLL_API SoQtConstrainedViewer : public SoQtFullViewer {
43  SOQT_OBJECT_ABSTRACT_HEADER(SoQtConstrainedViewer, SoQtFullViewer);
44 
45 public:
46  void setUpDirection(const SbVec3f & dir);
47  const SbVec3f & getUpDirection(void) const;
48 
49  virtual void setCamera(SoCamera * newcam);
50  virtual void saveHomePosition(void);
51  virtual void resetToHomePosition(void);
52 
53 protected:
54  SoQtConstrainedViewer(QWidget* parent,
55  const char * const name,
56  SbBool embed,
58  SoQtViewer::Type type,
59  SbBool build);
60 
62 
63  virtual void tiltCamera(float delta);
64  virtual void bottomWheelMotion(float value);
65  virtual void leftWheelMotion(float value);
66 
67  virtual void changeCameraValues(SoCamera * camera);
68  void findUpDirection(SbVec2s mouselocation);
69  void checkForCameraUpConstrain(void);
70 
71 private:
72  class SoQtConstrainedViewerP * pimpl;
73 };
74 
75 // ************************************************************************
76 
77 #endif // ! SOQT_CONSTRAINEDVIEWER_H
virtual void saveHomePosition(void)
Definition: SoQtViewer.cpp:1900
virtual void setCamera(SoCamera *camera)
Definition: SoQtViewer.cpp:1704
The SoQtConstrainedViewer class is the superclass for viewers with constrains on the viewpoint...
Definition: SoQtConstrainedViewer.h:42
virtual void bottomWheelMotion(float)
Definition: SoQtFullViewer.cpp:566
BuildFlag
Definition: SoQtFullViewer.h:48
virtual void resetToHomePosition(void)
Definition: SoQtViewer.cpp:1936
Type
Definition: SoQtViewer.h:94
virtual void leftWheelMotion(float)
Definition: SoQtFullViewer.cpp:499
virtual void changeCameraValues(SoCamera *camera)
Definition: SoQtViewer.cpp:3622
The SoQtFullViewer class adds some user interface components to the viewer canvas.
Definition: SoQtFullViewer.h:44