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
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
39class SoEvent;
43class SoNode;
44class SoCamera;
45class SoNodeSensor;
46class SoOneShotSensor;
47class SoSensor;
48class Superimposition;
49class SbColor;
50
51typedef void SoSceneManagerRenderCB(void * userdata, class SoSceneManager * mgr);
52
53class COIN_DLL_API SoSceneManager {
54public:
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);
97 void setAudioRenderAction(SoAudioRenderAction * const action);
101
102 static uint32_t getDefaultRedrawPriority(void);
103 static void enableRealTimeUpdate(const SbBool flag);
104 static SbBool isRealTimeUpdateEnabled(void);
105
106protected:
107 int isActive(void) const;
108 void redraw(void);
109
110private:
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 SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition SbVec2s.h:51
The SbViewportRegion class is a viewport within a full window.
Definition SbViewportRegion.h:40
The SoAudioRenderAction class renders the aural parts of the scene graph.
Definition SoAudioRenderAction.h:42
The SoCamera class is the abstract base class for camera definition nodes.
Definition SoCamera.h:64
The SoEvent class is the base class for all Coin events.
Definition SoEvent.h:45
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition SoGLRenderAction.h:50
The SoHandleEventAction class distributes user events to the scene.
Definition SoHandleEventAction.h:46
The SoNodeSensor class detects changes to nodes.
Definition SoNodeSensor.h:38
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:56
The SoOneShotSensor class is a sensor which will trigger once.
Definition SoOneShotSensor.h:38
The SoSceneManager class provides the main interface between the scene graph and the GUI toolkit.
Definition SoSceneManager.h:53
virtual SoNode * getSceneGraph(void) const
Definition SoSceneManager.cpp:283
void reinitialize(void)
Definition SoSceneManager.cpp:214
virtual void render(const SbBool clearwindow=TRUE, const SbBool clearzbuffer=TRUE)
Definition SoSceneManager.cpp:142
const SbVec2s & getWindowSize(void) const
Definition SoSceneManager.cpp:308
virtual SbBool processEvent(const SoEvent *const event)
Definition SoSceneManager.cpp:180
virtual void setSceneGraph(SoNode *const sceneroot)
Definition SoSceneManager.cpp:258
void getAntialiasing(SbBool &smoothing, int &numPasses) const
Definition SoSceneManager.cpp:555
void setAntialiasing(const SbBool smoothing, const int numPasses)
Definition SoSceneManager.cpp:544
static void enableRealTimeUpdate(const SbBool flag)
Definition SoSceneManager.cpp:638
static SbBool isRealTimeUpdateEnabled(void)
Definition SoSceneManager.cpp:648
void setAudioRenderAction(SoAudioRenderAction *const action)
Definition SoSceneManager.cpp:584
const SbColor & getBackgroundColor(void) const
Definition SoSceneManager.cpp:421
SbBool isAutoRedraw(void) const
Definition SoSceneManager.cpp:510
void setSize(const SbVec2s &newsize)
Definition SoSceneManager.cpp:318
void setRenderCallback(SoSceneManagerRenderCB *f, void *const userData=NULL)
Definition SoSceneManager.cpp:494
SoGLRenderAction * getGLRenderAction(void) const
Definition SoSceneManager.cpp:574
void setOrigin(const SbVec2s &newOrigin)
Definition SoSceneManager.cpp:345
int getBackgroundIndex(void) const
Definition SoSceneManager.cpp:446
void setCamera(SoCamera *camera)
Definition SoSceneManager.cpp:189
SoSceneManager(void)
Definition SoSceneManager.cpp:99
void setBackgroundColor(const SbColor &color)
Definition SoSceneManager.cpp:411
int isActive(void) const
Definition SoSceneManager.cpp:235
static uint32_t getDefaultRedrawPriority(void)
Definition SoSceneManager.cpp:624
uint32_t getRedrawPriority(void) const
Definition SoSceneManager.cpp:532
const SbViewportRegion & getViewportRegion(void) const
Definition SoSceneManager.cpp:402
virtual void deactivate(void)
Definition SoSceneManager.cpp:483
void setRedrawPriority(const uint32_t priority)
Definition SoSceneManager.cpp:523
const SbVec2s & getOrigin(void) const
Definition SoSceneManager.cpp:362
void setViewportRegion(const SbViewportRegion &newRegion)
Definition SoSceneManager.cpp:376
SoHandleEventAction * getHandleEventAction(void) const
Definition SoSceneManager.cpp:612
void setHandleEventAction(SoHandleEventAction *hea)
Definition SoSceneManager.cpp:603
void setGLRenderAction(SoGLRenderAction *const action)
Definition SoSceneManager.cpp:565
void setRGBMode(const SbBool onOrOff)
Definition SoSceneManager.cpp:456
SoCamera * getCamera(void) const
Definition SoSceneManager.cpp:204
SoAudioRenderAction * getAudioRenderAction(void) const
Definition SoSceneManager.cpp:593
SbBool isRGBMode(void) const
Definition SoSceneManager.cpp:465
void redraw(void)
Definition SoSceneManager.cpp:244
const SbVec2s & getSize(void) const
Definition SoSceneManager.cpp:333
virtual void activate(void)
Definition SoSceneManager.cpp:474
void setBackgroundIndex(const int index)
Definition SoSceneManager.cpp:435
void scheduleRedraw(void)
Definition SoSceneManager.cpp:226
void setWindowSize(const SbVec2s &newsize)
Definition SoSceneManager.cpp:297
The SoSensor class is the abstract base class for all sensors.
Definition SoSensor.h:43