Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SmCameraControlKit.h
Go to the documentation of this file.
1 #ifndef SMALLCHANGE_SMCAMERACONTROLKIT_H
2 #define SMALLCHANGE_SMCAMERACONTROLKIT_H
3 
4 /**************************************************************************\
5  * Copyright (c) Kongsberg Oil & Gas Technologies AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from
21  * this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 \**************************************************************************/
35 
36 #include <Inventor/nodekits/SoSubKit.h>
37 #include <Inventor/nodekits/SoBaseKit.h>
38 #include <Inventor/fields/SoSFBool.h>
39 #include <Inventor/fields/SoSFEnum.h>
40 #include <Inventor/fields/SoSFFloat.h>
41 #include <Inventor/fields/SoSFVec3f.h>
42 #include <SmallChange/basic.h>
43 
44 class SmCameraControlKitP;
45 class SoCamera;
46 class SbMatrix;
47 class SbViewportRegion;
48 class SbRotation;
49 class SoEvent;
50 
51 class SMALLCHANGE_DLL_API SmCameraControlKit : public SoBaseKit {
52  typedef SoBaseKit inherited;
53 
54  SO_KIT_HEADER(SmCameraControlKit);
55 
56  SO_KIT_CATALOG_ENTRY_HEADER(topSeparator);
57  SO_KIT_CATALOG_ENTRY_HEADER(camera);
58  SO_KIT_CATALOG_ENTRY_HEADER(headlightNode);
59  SO_KIT_CATALOG_ENTRY_HEADER(scene);
60 
61 public:
62  SmCameraControlKit(void);
63  static void initClass(void);
64 
65  virtual void GLRender(SoGLRenderAction * action);
66  virtual void handleEvent(SoHandleEventAction * action);
67 
70  CONSTANT_NEAR_PLANE
71  };
72 
73  SbBool isAnimating(void);
74  SbBool isBusy(void) const;
75  SbBool seek(const SoEvent * event, const SbViewportRegion & vp);
76  SbBool seekToPoint(const SbVec3d & point,
77  const SbRotation & orientation,
78  const SbViewportRegion & vp);
79  void viewAll(const SbViewportRegion & vp, const float slack = 1.0f);
80  void pointDir(const SbVec3f & dir, const SbBool resetroll = TRUE);
81  void resetCameraRoll(void);
82 
83  void resetCameraFocalDistance(const SbViewportRegion & vpr);
84 
85 protected:
86 
87  virtual SbBool setAnyPart(const SbName & partname, SoNode * from,
88  SbBool anypart = TRUE);
89 
90  virtual void notify(SoNotList * list);
91  virtual ~SmCameraControlKit();
92 
93 public:
101 
102 private:
103  void setClippingPlanes(void);
104  void getCameraCoordinateSystem(SoCamera * camera,
105  SoNode * root,
106  SbMatrix & matrix,
107  SbMatrix & inverse);
108 
109  friend class SmCameraControlKitP;
110  SmCameraControlKitP * pimpl;
111 };
112 
113 #endif // SMALLCHANGE_SMCAMERACONTROLKIT_H
Definition: SmCameraControlKit.h:69
SoSFBool handleInheritedEventFirst
Definition: SmCameraControlKit.h:100
virtual void notify(SoNotList *l)
virtual SbBool setAnyPart(const SbName &partname, SoNode *from, SbBool anypart=TRUE)
virtual void handleEvent(SoHandleEventAction *action)
SoSFBool autoClipping
Definition: SmCameraControlKit.h:95
SoSFBool headlight
Definition: SmCameraControlKit.h:94
virtual void GLRender(SoGLRenderAction *action)
SoSFVec3f viewUp
Definition: SmCameraControlKit.h:99
static void initClass(void)
The SmCameraControlKit class...FIXME: doc.
Definition: SmCameraControlKit.h:51
SoSFEnum autoClippingStrategy
Definition: SmCameraControlKit.h:96
AutoClippingStrategy
Definition: SmCameraControlKit.h:68
SoSFFloat autoClippingValue
Definition: SmCameraControlKit.h:97
SoSFNode eventHandler
Definition: SmCameraControlKit.h:98