| http://www.sim.no/ http://www.coin3d.org/

SoGLRenderAction.h
1 #ifndef COIN_SOGLRENDERACTION_H
2 #define COIN_SOGLRENDERACTION_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/actions/SoAction.h>
28 #include <Inventor/actions/SoSubAction.h>
29 #include <Inventor/SbBasic.h>
30 #include <Inventor/SbViewportRegion.h>
31 #include <Inventor/system/inttypes.h>
32 #include <Inventor/lists/SoPathList.h>
33 #include <Inventor/lists/SbList.h>
34
35 typedef void SoGLRenderPassCB(void * userdata);
36 typedef void SoGLPreRenderCB(void * userdata, class SoGLRenderAction * action);
37 typedef float SoGLSortedObjectOrderCB(void * userdata, SoGLRenderAction * action);
38
39 class SoGLRenderActionP;
40
41 class COIN_DLL_API SoGLRenderAction : public SoAction {
42 typedef SoAction inherited;
43
44 SO_ACTION_HEADER(SoGLRenderAction);
45
46 public:
47 static void initClass(void);
48
49 SoGLRenderAction(const SbViewportRegion & viewportregion);
50 virtual ~SoGLRenderAction(void);
51
52 enum TransparencyType {
53 SCREEN_DOOR,
54 ADD, DELAYED_ADD, SORTED_OBJECT_ADD,
55 BLEND, DELAYED_BLEND, SORTED_OBJECT_BLEND,
56 // The remaining are Coin extensions to the common Inventor API
57 SORTED_OBJECT_SORTED_TRIANGLE_ADD,
58 SORTED_OBJECT_SORTED_TRIANGLE_BLEND,
59 NONE, SORTED_LAYERS_BLEND
60 };
61
62 enum TransparentDelayedObjectRenderType {
63 ONE_PASS,
64 NONSOLID_SEPARATE_BACKFACE_PASS
65 };
66
67 enum AbortCode {
68 CONTINUE, ABORT, PRUNE, DELAY
69 };
70
71 enum SortedObjectOrderStrategy {
72 BBOX_CENTER,
73 BBOX_CLOSEST_CORNER,
74 BBOX_FARTHEST_CORNER,
75 CUSTOM_CALLBACK
76 };
77
78 typedef AbortCode SoGLRenderAbortCB(void * userdata);
79
80 void setViewportRegion(const SbViewportRegion & newregion);
81 const SbViewportRegion & getViewportRegion(void) const;
82 void setUpdateArea(const SbVec2f & origin, const SbVec2f & size);
83 void getUpdateArea(SbVec2f & origin, SbVec2f & size) const;
84 void setAbortCallback(SoGLRenderAbortCB * const func, void * const userdata);
85 void getAbortCallback(SoGLRenderAbortCB * & func_out, void * & userdata_out) const;
86 void setTransparencyType(const TransparencyType type);
87 TransparencyType getTransparencyType(void) const;
88 void setTransparentDelayedObjectRenderType(TransparentDelayedObjectRenderType type);
89 TransparentDelayedObjectRenderType getTransparentDelayedObjectRenderType(void) const;
90 void setSmoothing(const SbBool smooth);
91 SbBool isSmoothing(void) const;
92 void setNumPasses(const int num);
93 int getNumPasses(void) const;
94 void setPassUpdate(const SbBool flag);
95 SbBool isPassUpdate(void) const;
96 void setPassCallback(SoGLRenderPassCB * const func, void * const userdata);
97 void setCacheContext(const uint32_t context);
98 uint32_t getCacheContext(void) const;
99
100 void addDelayedPath(SoPath * path);
101 SbBool isRenderingDelayedPaths(void) const;
102
103 SbBool handleTransparency(SbBool istransparent = FALSE);
104 void setCurPass(const int passnum, const int numpasses);
105 int getCurPass(void) const;
106 SbBool abortNow(void);
107
108 void setRenderingIsRemote(SbBool isremote);
109 SbBool getRenderingIsRemote(void) const;
110
111 virtual void invalidateState(void);
112
113 void addPreRenderCallback(SoGLPreRenderCB * func, void * userdata);
114 void removePreRenderCallback(SoGLPreRenderCB * func, void * userdata);
115
116 void setSortedLayersNumPasses(int num);
117 int getSortedLayersNumPasses(void) const;
118
119 void setSortedObjectOrderStrategy(const SortedObjectOrderStrategy strategy,
120 SoGLSortedObjectOrderCB * cb = NULL,
121 void * closure = NULL);
122
123 void setDelayedObjDepthWrite(SbBool write);
124 SbBool getDelayedObjDepthWrite(void) const;
125
126 SbBool isRenderingTranspPaths(void) const;
127 SbBool isRenderingTranspBackfaces(void) const;
128
129 protected:
130 friend class SoGLRenderActionP; // calls beginTraversal
131 virtual void beginTraversal(SoNode * node);
132 virtual void endTraversal(SoNode * node);
133
134 private:
135 SbPimplPtr<SoGLRenderActionP> pimpl;
136
137 SoGLRenderAction(const SoGLRenderAction & rhs);
138 SoGLRenderAction & operator = (const SoGLRenderAction & rhs);
139
140 }; // SoGLRenderAction
141
142 #endif // !COIN_SOGLRENDERACTION_H
SbVec2f
The SbVec2f class is a 2 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec2f.h:39
SoAction::initClass
static void initClass(void)
Definition: SoAction.cpp:366
SoGLRenderAction::AbortCode
AbortCode
Definition: SoGLRenderAction.h:67
SoGLRenderAction::SORTED_OBJECT_ADD
Definition: SoGLRenderAction.h:54
SoNode
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
SoAction::invalidateState
virtual void invalidateState(void)
Definition: SoAction.cpp:815
SoGLRenderAction::ONE_PASS
Definition: SoGLRenderAction.h:63
SoGLRenderAction::TransparentDelayedObjectRenderType
TransparentDelayedObjectRenderType
Definition: SoGLRenderAction.h:62
SoGLRenderAction::PRUNE
Definition: SoGLRenderAction.h:68
SoPath
The SoPath class is a container class for traversal path descriptions.SoPath objects contain a list o...
Definition: SoPath.h:43
SoGLRenderAction::TransparencyType
TransparencyType
Definition: SoGLRenderAction.h:52
SoAction
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:68
SoGLRenderAction::BBOX_FARTHEST_CORNER
Definition: SoGLRenderAction.h:74
SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND
Definition: SoGLRenderAction.h:58
SoGLRenderAction::BBOX_CENTER
Definition: SoGLRenderAction.h:72
SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_ADD
Definition: SoGLRenderAction.h:57
SoGLRenderAction::SoGLRenderAbortCB
AbortCode SoGLRenderAbortCB(void *userdata)
Definition: SoGLRenderAction.h:78
SoAction::endTraversal
virtual void endTraversal(SoNode *node)
Definition: SoAction.cpp:1273
SoAction::beginTraversal
virtual void beginTraversal(SoNode *node)
Definition: SoAction.cpp:1263
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.The SbViewportRegion class contains inf...
Definition: SbViewportRegion.h:31
SoGLRenderAction::SORTED_OBJECT_BLEND
Definition: SoGLRenderAction.h:55
SoGLRenderAction::SortedObjectOrderStrategy
SortedObjectOrderStrategy
Definition: SoGLRenderAction.h:71
SoGLRenderAction::SCREEN_DOOR
Definition: SoGLRenderAction.h:53
SoGLRenderAction
The SoGLRenderAction class renders the scene graph with OpenGL calls.Applying this method at a root n...
Definition: SoGLRenderAction.h:41

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