49#ifndef _SO_GL_RENDER_ACTION_
50#define _SO_GL_RENDER_ACTION_
61#pragma warning( push )
62#pragma warning(disable:4251)
67class SoGLDepthPeeling;
71class SoGLRenderActionSync;
72class SoGLRenderActionImpl;
427#ifndef HIDDEN_FROM_DOC
477 { abortCB = func; abortData = userData; }
519 {
return m_transpType; }
536 {
return m_fastEditPolicy; }
599 { passCB = func; passData = userData; }
653 { m_sortedLayersNumPasses = num; }
662 {
return m_sortedLayersNumPasses ; }
693 {
return m_alphaTest; }
722 float percentage = 1.0);
804 inline bool isDoingDepthPeeling()
const {
return m_isDoingDepthPeeling; }
809 int getDepthPeelingPass();
815 void enableDepthPeeling3D(
bool flag)
const;
817 SoGLDepthPeeling* getDepthPeelingInterface()
const;
820 int getCurPass()
const {
return curPass; }
824 {
return (
hasTerminated() || (abortCB != NULL && checkAbort())); }
836 virtual void setUpState();
842 void setDelayedObjDepthWrite(
SbBool flag ) { m_delayedObjDepthWrite = flag; }
848 SbBool getDelayedObjDepthWrite()
const {
return m_delayedObjDepthWrite; }
856 virtual bool preDelayedTraversal();
864 virtual void postDelayedTraversal();
871 void setCache( SoCache* cache );
874 SoCache* getCache()
const;
877 static void initClass();
878 static void exitClass();
881 inline bool isFloatingPointFramebuffer()
const {
return m_floatingPointFramebuffer; }
882 inline void setFloatingPointFramebuffer(
bool flag) { m_floatingPointFramebuffer = flag; }
885 SbBool isDelaying()
const {
return delayObjs; }
888 bool stateContainsTransparency()
const;
891 void removeAllDelayedPath();
893 bool isTraversalPassTransparent()
const;
897 int getCullTestResults() {
return cullBits; }
898 void setCullTestResults(
int b) { cullBits = b; }
900 SbBool isLogicalRegionSet()
const;
902 void setTiledViewportRegion(
const SbVec4f& region,
int info = 0);
908 void setMaxDepthOffset(
float maxDepthOffset);
912 void setDoubleBuffer(
SbBool db);
914 void setForceRender();
916 void setViewing(
SbBool viewing);
918 SbBool hasDelayedNodesToRender()
const;
920 void setFirstStereoPass(
SbBool first);
924 void setRenderingFromOffscreen(
SbBool renderFromOffscreen)
925 { m_renderingFromOffscreen = renderFromOffscreen; }
927 SbBool getRenderingFromOffscreen()
const
928 {
return m_renderingFromOffscreen; }
932 SbBool hasDrawnTransparentObjs()
const
933 {
return m_hasDrawnTransparentObjs; }
936 void setFullSceneAntialiasingElement(
SbBool enable,
int filterMask );
958 void setRestrictObjectRenderingMode(
const RenderMode mode = ALL_OBJECTS )
959 { m_restrictObjectRendering = mode; };
961 int getRestrictObjectRenderingMode()
const
962 {
return m_restrictObjectRendering; };
964 SoGLRenderActionSync* getSynchronizer()
const;
965 void setSynchronizer( SoGLRenderActionSync* );
974 SoGLRenderActionImpl* getImpl();
978 SoGLDepthPeeling* setDepthPeelingInterface(SoGLDepthPeeling*);
980 bool isFastEditManipulating();
989 bool isLazyEvaluating()
const {
return m_lazyEvaluating; }
990 void setLazyEvaluating(
bool value) { m_lazyEvaluating = value; }
996 return m_viewport.
ptr();
1003 TRANSPARENCY_TYPE = 0x01,
1006 FASTEDIT_SAVE_POLICY = 0x08,
1008 ANTIALIASING = 0x20,
1014 virtual void beginTraversal(
SoNode *node);
1019 { m_fastEditPolicy = policy; }
1023 { m_transpType = type; }
1025 uint32_t getWhatChanged()
const
1033 template<
typename ApplyType>
void commonApply(ApplyType applyObject,
SbBool obeysRules);
1036 template<
typename ApplyType>
void applyTo(ApplyType applyObject,
SbBool obeysRules);
1038 SoGLRenderActionSync* m_synchronizer;
1046 void removeInvalidPaths();
1049 bool m_isDoingDepthPeeling;
1051 SbBool m_hasDrawnTransparentObjs;
1055 SbBool m_firstStereoPass;
1056 int m_lastStereoMode;
1059 int m_useCompactPaths;
1096 uint32_t whatChanged;
1111 SbBool m_delayedObjDepthWrite;
1114 SbBool m_renderingFromOffscreen;
1119 uint32_t m_frameCounter;
1123 bool m_lazyEvaluating;
1127 int m_sortedLayersNumPasses ;
1130 void renderSortedLayers(
SoNode *node) ;
1131 void initDepthPeeling(
SoNode *node);
1134 static void renderSortedLayersCB(
void *userData, SoGLDepthPeeling *mgr) ;
1136 SoGLDepthPeeling *m_glDepthPeeling ;
1139 bool m_ignoreCameraPostCB;
1144 RenderMode m_restrictObjectRendering;
1146 bool m_floatingPointFramebuffer;
1150 int m_fsaaFilterMask;
1152 SoGLRenderActionImpl* m_impl;
1157inline SoGLRenderActionSync* SoGLRenderAction::getSynchronizer()
const
1159 return m_synchronizer;
1162inline SoGLRenderActionImpl* SoGLRenderAction::getImpl()
1168#pragma warning( pop )
#define FALSE
Possible value of SbBool.
void SoGLRenderPassCB(void *userData)
Callback functions used between rendering passes should be of this type.
#define SO_ACTION_HEADER(className)
Class for representing a viewport.
Abstract base class for all actions.
SbBool hasTerminated() const
Returns TRUE if the traversal has reached a termination condition.
Abstract base class for camera nodes.
Type
These are the available decimation types.
Renders a scene graph using Open Inventor's Render Engine.
AbortCode
Possible return codes from a render abort callback.
@ DELAY
Delay rendering of this node until the second pass.
@ ABORT
Stop traversing the rest of the graph.
@ PRUNE
Do not traverse this node or its children, but continue.
@ CONTINUE
Continue traversal as usual.
FastEditSavePolicy
Fast edit traversal types.
@ DISABLE
Fast editing is disabled.
@ WHEN_NEEDED
The fast edit feature is available.
@ EACH_FRAME
The fast edit feature is available.
float getDecimationPercentage()
Gets decimation percentage, the value should be a number between 0.0 and 1.0.
void setAlphaTest(SbBool flag)
Enable or disable the OpenGL alpha test for rendering.
int getSortedLayersNumPasses() const
Returns the number of rendering passes used when transparency type is SORTED_PIXEL.
AutoCacheMode
Two bits are stored.
InvalidateCacheMode
Invalidate cache mode.
@ OFF
(Default) Render caches are handled normally.
@ ONCE
Render caches are invalidated for each SoSeparator node before its children are traversed.
@ ALWAYS
Render caches are invalidated for each SoSeparator node before its children are traversed.
virtual void invalidateState()
Invalidate the state, forcing it to be recreated at the next apply.
const SbViewportRegion & getLogicalViewportRegion() const
Returns current logical viewport region.
static uint32_t generateCacheContext()
Generates and returns a new cache context id.
TransparencyType getTransparencyType() const
Returns transparency quality level to use when rendering.
virtual void apply(SoNode *node)
Initiates an action on the graph defined by a node.
SoDEPRECATED void setSmoothing(SbBool smooth)
Sets smoothing flag.
void setDecimationValue(SoDecimationTypeElement::Type type, float percentage=1.0)
Sets decimation percentage, the value should be a number between 0.0 and 1.0 Useful for reducing the ...
void setTransparencyType(TransparencyType type)
Sets global transparency algorithm to use when rendering.
SbBool isAlphaTest() const
Returns whether the OpenGL alpha test is enabled for rendering.
void setSortedLayersNumPasses(int num)
Sets the number of rendering passes used when transparency type is SORTED_PIXEL.
void setFastEditSavePolicy(FastEditSavePolicy policy, SbBool fastEditDelayedObjects=FALSE)
Sets fast editing save policy to use when rendering.
AbortCode SoGLRenderAbortCB(void *userData)
Callback functions for render abort should be of this type.
void setPassUpdate(SbBool flag)
Sets a flag indicating whether intermediate results are displayed after each antialiasing pass for pr...
void setAbortCallback(SoGLRenderAbortCB *func, void *userData)
Sets callback to call during rendering to test for an abort condition.
void setCacheContext(uint32_t context)
Sets the OpenGL cache context.
SoGLRenderAction(const SbViewportRegion &viewportRegion)
Constructor.
virtual void apply(const SoPathList &pathList, SbBool obeysRules=FALSE)
Initiates an action on the graph defined by a list of paths.
SoDEPRECATED SbBool isSmoothing() const
Returns smoothing flag.
void shouldAutoCache(AutoCacheMode mode)
Called by nodes to say that they should/shouldn't be auto-cached (pass TRUE if should,...
SbBool getRenderingIsRemote() const
Returns TRUE if remote rendering is being done.
void setLogicalViewportRegion(const SbViewportRegion &newLogicalRegion)
Sets current logical viewport region to use for rendering.
const SbViewportRegion & getViewportRegion() const
Returns viewport region to use for rendering.
void resetFrameCounter(uint32_t count=0)
Reset the frame counter.
TransparencyType
Transparency rendering algorithm.
@ OPAQUE_FIRST
Same as NO_SORT, but the rendering of opaque objects is performed before the rendering of semi-transp...
@ SORTED_PIXEL
Same as OPAQUE_FIRST, but uses a fragment-level depth sorting technique during the rendering of semi-...
@ NO_SORT
The simplest transparency mode.
@ SORTED_OBJECT
Same as OPAQUE_FIRST, but sorts semi-transparent objects by distances of bounding boxes from camera.
virtual void apply(SoPath *path)
Initiates an action on the graph defined by a path.
SoDecimationTypeElement::Type getDecimationType()
Gets decimation type.
uint32_t getCacheContext() const
Returns the OpenGL cache context id for this action.
uint32_t getFrameCounter() const
Returns the current frame counter.
void setPassCallback(SoGLRenderPassCB *func, void *userData)
Sets a callback function to invoke between passes when antialiasing.
static bool isUsedCacheContext(uint32_t context)
Returns TRUE if the specified cache context id is currently used by any SoGLRenderAction.
static SbBool isSortedLayersSupported(SoState *state=NULL)
Indicates if SORTED_PIXEL transparency is supported by your graphics board on the current context.
void setRenderingIsRemote(SbBool flag)
Sets whether or not "remote" rendering is done.
FastEditSavePolicy getFastEditSavePolicy() const
Returns fast editing save policy used when rendering.
SbBool isPassUpdate() const
Returns a flag indicating whether intermediate results are displayed after each antialiasing pass for...
InvalidateCacheMode getInvalidateCacheMode()
Returns the current cache invalidation mode.
void getUpdateArea(SbVec2f &origin, SbVec2f &size) const
Returns the current update area.
void setViewportRegion(const SbViewportRegion &newRegion)
Changes viewport region to use for rendering.
int getNumPasses() const
Gets number of rendering passes for multipass rendering.
void setNumPasses(int num)
Sets number of rendering passes for multipass antialiasing.
void setInvalidateCacheMode(InvalidateCacheMode icm)
Enables or disables the invalidation of render caches.
void setUpdateArea(const SbVec2f &origin, const SbVec2f &size)
Sets the current update area, which is the rectangular area of the viewport region that will actually...
Computes bounding box of a scene.
Abstract base class for all database nodes.
Path that points to a list of hierarchical nodes.
Maintains a list of pointers to paths.
Smart pointer for any class inheriting SoRefCounter.
T * ptr() const
Cast to C pointer.
Group node that saves and restores traversal state.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Viewport paramet...