49#ifndef _SO_GL_RENDER_ACTION_
50#define _SO_GL_RENDER_ACTION_
52#include <Inventor/SbViewportRegion.h>
53#include <Inventor/nodes/SoViewport.h>
54#include <Inventor/actions/SoSubAction.h>
55#include <Inventor/elements/SoShapeStyleElement.h>
56#include <Inventor/elements/SoDecimationTypeElement.h>
57#include <Inventor/lists/SoPathList.h>
58#include <Inventor/lists/SoSensorList.h>
61#pragma warning( push )
62#pragma warning(disable:4251)
67class SoGLDepthPeeling;
71class SoGLRenderActionSync;
72class SoGLRenderActionImpl;
431#ifndef HIDDEN_FROM_DOC
481 { abortCB = func; abortData = userData; }
523 {
return m_transpType; }
540 {
return m_fastEditPolicy; }
603 { passCB = func; passData = userData; }
657 { m_sortedLayersNumPasses = num; }
666 {
return m_sortedLayersNumPasses ; }
697 {
return m_alphaTest; }
726 float percentage = 1.0);
808 inline bool isDoingDepthPeeling()
const {
return m_isDoingDepthPeeling; }
813 int getDepthPeelingPass();
819 void enableDepthPeeling3D(
bool flag)
const;
821 SoGLDepthPeeling* getDepthPeelingInterface()
const;
824 int getCurPass()
const {
return curPass; }
828 {
return (
hasTerminated() || (abortCB != NULL && checkAbort())); }
837 virtual SbBool handleTransparency(
SbBool isTransparent = FALSE,
SbBool isLinesOrPoints = FALSE);
840 virtual void setUpState();
846 void setDelayedObjDepthWrite(
SbBool flag ) { m_delayedObjDepthWrite = flag; }
852 SbBool getDelayedObjDepthWrite()
const {
return m_delayedObjDepthWrite; }
860 virtual bool preDelayedTraversal();
868 virtual void postDelayedTraversal();
875 void setCache( SoCache* cache );
878 SoCache* getCache()
const;
881 static void initClass();
882 static void exitClass();
885 inline bool isFloatingPointFramebuffer()
const {
return m_floatingPointFramebuffer; }
886 inline void setFloatingPointFramebuffer(
bool flag) { m_floatingPointFramebuffer = flag; }
889 SbBool isDelaying()
const {
return delayObjs; }
892 bool stateContainsTransparency()
const;
895 void removeAllDelayedPath();
897 bool isTraversalPassTransparent()
const;
901 int getCullTestResults() {
return cullBits; }
902 void setCullTestResults(
int b) { cullBits = b; }
904 SbBool isLogicalRegionSet()
const;
906 void setTiledViewportRegion(
const SbVec4f& region,
int info = 0);
912 void setMaxDepthOffset(
float maxDepthOffset);
916 void setDoubleBuffer(
SbBool db);
918 void setForceRender();
920 void setViewing(
SbBool viewing);
922 SbBool hasDelayedNodesToRender()
const;
924 void setFirstStereoPass(
SbBool first);
928 void setRenderingFromOffscreen(
SbBool renderFromOffscreen)
929 { m_renderingFromOffscreen = renderFromOffscreen; }
931 SbBool getRenderingFromOffscreen()
const
932 {
return m_renderingFromOffscreen; }
936 SbBool hasDrawnTransparentObjs()
const
937 {
return m_hasDrawnTransparentObjs; }
940 void setFullSceneAntialiasingElement(
SbBool enable,
int filterMask );
943 void setMSNumSamples(
int numSamples);
965 void setRestrictObjectRenderingMode(
const RenderMode mode = ALL_OBJECTS )
966 { m_restrictObjectRendering = mode; };
968 int getRestrictObjectRenderingMode()
const
969 {
return m_restrictObjectRendering; };
971 SoGLRenderActionSync* getSynchronizer()
const;
972 void setSynchronizer( SoGLRenderActionSync* );
981 SoGLRenderActionImpl* getImpl();
985 SoGLDepthPeeling* setDepthPeelingInterface(SoGLDepthPeeling*);
987 bool isFastEditManipulating();
996 bool isLazyEvaluating()
const {
return m_lazyEvaluating; }
997 void setLazyEvaluating(
bool value) { m_lazyEvaluating = value; }
1003 return m_viewport.
ptr();
1010 TRANSPARENCY_TYPE = 0x01,
1013 FASTEDIT_SAVE_POLICY = 0x08,
1015 ANTIALIASING = 0x20,
1021 virtual void beginTraversal(
SoNode *node);
1026 { m_fastEditPolicy = policy; }
1030 { m_transpType = type; }
1032 uint32_t getWhatChanged()
const
1040 template<
typename ApplyType>
void commonApply(ApplyType applyObject,
SbBool obeysRules);
1043 template<
typename ApplyType>
void applyTo(ApplyType applyObject,
SbBool obeysRules);
1045 SoGLRenderActionSync* m_synchronizer;
1053 void removeInvalidPaths();
1056 bool m_isDoingDepthPeeling;
1058 SbBool m_hasDrawnTransparentObjs;
1062 SbBool m_firstStereoPass;
1063 int m_lastStereoMode;
1066 int m_useCompactPaths;
1103 uint32_t whatChanged;
1106 void enableBlending(
SbBool enable);
1109 void enableSmoothing(
SbBool enable);
1118 SbBool m_delayedObjDepthWrite;
1121 SbBool m_renderingFromOffscreen;
1126 uint32_t m_frameCounter;
1130 bool m_lazyEvaluating;
1134 int m_sortedLayersNumPasses ;
1137 void renderSortedLayers(
SoNode *node) ;
1138 void initDepthPeeling(
SoNode *node);
1141 static void renderSortedLayersCB(
void *userData, SoGLDepthPeeling *mgr) ;
1143 SoGLDepthPeeling *m_glDepthPeeling ;
1146 bool m_ignoreCameraPostCB;
1151 RenderMode m_restrictObjectRendering;
1153 bool m_floatingPointFramebuffer;
1157 int m_fsaaFilterMask;
1158 int m_fsaaNumSamples;
1160 SoGLRenderActionImpl* m_impl;
1165inline SoGLRenderActionSync* SoGLRenderAction::getSynchronizer()
const
1167 return m_synchronizer;
1170inline SoGLRenderActionImpl* SoGLRenderAction::getImpl()
1176#pragma warning( pop )
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.
void SoGLRenderPassCB(void *userData)
Callback functions used between rendering passes should be of this type.
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...