Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://coin3d.github.io
https://www.kongsberg.com/en/kogt/
SoSceneManager.h
Go to the documentation of this file.
1 #ifndef COIN_SOSCENEMANAGER_H
2 #define COIN_SOSCENEMANAGER_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/SbVec2s.h>
37 
38 class SbViewportRegion;
39 class SoEvent;
40 class SoGLRenderAction;
43 class SoNode;
44 class SoCamera;
45 class SoNodeSensor;
46 class SoOneShotSensor;
47 class SoSensor;
48 class Superimposition;
49 class SbColor;
50 
51 typedef void SoSceneManagerRenderCB(void * userdata, class SoSceneManager * mgr);
52 
53 class COIN_DLL_API SoSceneManager {
54 public:
55  SoSceneManager(void);
56  virtual ~SoSceneManager();
57 
58  virtual void render(const SbBool clearwindow = TRUE,
59  const SbBool clearzbuffer = TRUE);
60  virtual void render(SoGLRenderAction * action,
61  const SbBool initmatrices = TRUE,
62  const SbBool clearwindow = TRUE,
63  const SbBool clearzbuffer = TRUE);
64 
65  void setCamera(SoCamera * camera);
66  SoCamera * getCamera(void) const;
67  virtual SbBool processEvent(const SoEvent * const event);
68  void reinitialize(void);
69  void scheduleRedraw(void);
70  virtual void setSceneGraph(SoNode * const sceneroot);
71  virtual SoNode * getSceneGraph(void) const;
72  void setWindowSize(const SbVec2s & newsize);
73  const SbVec2s & getWindowSize(void) const;
74  void setSize(const SbVec2s & newsize);
75  const SbVec2s & getSize(void) const;
76  void setOrigin(const SbVec2s & newOrigin);
77  const SbVec2s & getOrigin(void) const;
78  void setViewportRegion(const SbViewportRegion & newRegion);
79  const SbViewportRegion & getViewportRegion(void) const;
80  void setBackgroundColor(const SbColor & color);
81  const SbColor & getBackgroundColor(void) const;
82  void setBackgroundIndex(const int index);
83  int getBackgroundIndex(void) const;
84  void setRGBMode(const SbBool onOrOff);
85  SbBool isRGBMode(void) const;
86  virtual void activate(void);
87  virtual void deactivate(void);
88  void setRenderCallback(SoSceneManagerRenderCB * f,
89  void * const userData = NULL);
90  SbBool isAutoRedraw(void) const;
91  void setRedrawPriority(const uint32_t priority);
92  uint32_t getRedrawPriority(void) const;
93  void setAntialiasing(const SbBool smoothing, const int numPasses);
94  void getAntialiasing(SbBool & smoothing, int & numPasses) const;
95  void setGLRenderAction(SoGLRenderAction * const action);
96  SoGLRenderAction * getGLRenderAction(void) const;
97  void setAudioRenderAction(SoAudioRenderAction * const action);
98  SoAudioRenderAction * getAudioRenderAction(void) const;
99  void setHandleEventAction(SoHandleEventAction * hea);
100  SoHandleEventAction * getHandleEventAction(void) const;
101 
102  static uint32_t getDefaultRedrawPriority(void);
103  static void enableRealTimeUpdate(const SbBool flag);
104  static SbBool isRealTimeUpdateEnabled(void);
105 
106 protected:
107  int isActive(void) const;
108  void redraw(void);
109 
110 private:
111  friend class SoSceneManagerP;
112  class SoSceneManagerP * pimpl;
113 
114 }; // SoSceneManager
115 
116 #endif // !COIN_SOSCENEMANAGER_H
The SbColor class contains the red, green and blue components which make up a color value...
Definition: SbColor.h:39
The SoCamera class is the abstract base class for camera definition nodes.
Definition: SoCamera.h:64
The SoNode class is the base class for nodes used in scene graphs.
Definition: SoNode.h:56
The SoNodeSensor class detects changes to nodes.
Definition: SoNodeSensor.h:38
The SoSensor class is the abstract base class for all sensors.
Definition: SoSensor.h:43
void SoSceneManagerRenderCB(void *userdata, class SoSceneManager *mgr)
Definition: SoSceneManager.h:51
The SoAudioRenderAction class renders the aural parts of the scene graph.
Definition: SoAudioRenderAction.h:42
The SoOneShotSensor class is a sensor which will trigger once.
Definition: SoOneShotSensor.h:38
The SoHandleEventAction class distributes user events to the scene.
Definition: SoHandleEventAction.h:46
The SoEvent class is the base class for all Coin events.
Definition: SoEvent.h:45
The SoSceneManager class provides the main interface between the scene graph and the GUI toolkit...
Definition: SoSceneManager.h:53
The SbViewportRegion class is a viewport within a full window.
Definition: SbViewportRegion.h:40
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition: SbVec2s.h:51
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition: SoGLRenderAction.h:50