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;
429#ifndef HIDDEN_FROM_DOC
479 { abortCB = func; abortData = userData; }
521 {
return m_transpType; }
538 {
return m_fastEditPolicy; }
601 { passCB = func; passData = userData; }
655 { m_sortedLayersNumPasses = num; }
664 {
return m_sortedLayersNumPasses ; }
695 {
return m_alphaTest; }
724 float percentage = 1.0);
806 inline bool isDoingDepthPeeling()
const {
return m_isDoingDepthPeeling; }
811 int getDepthPeelingPass();
817 void enableDepthPeeling3D(
bool flag)
const;
819 SoGLDepthPeeling* getDepthPeelingInterface()
const;
822 int getCurPass()
const {
return curPass; }
826 {
return (
hasTerminated() || (abortCB != NULL && checkAbort())); }
835 virtual SbBool handleTransparency(
SbBool isTransparent = FALSE,
SbBool isLinesOrPoints = FALSE);
838 virtual void setUpState();
844 void setDelayedObjDepthWrite(
SbBool flag ) { m_delayedObjDepthWrite = flag; }
850 SbBool getDelayedObjDepthWrite()
const {
return m_delayedObjDepthWrite; }
858 virtual bool preDelayedTraversal();
866 virtual void postDelayedTraversal();
873 void setCache( SoCache* cache );
876 SoCache* getCache()
const;
879 static void initClass();
880 static void exitClass();
883 inline bool isFloatingPointFramebuffer()
const {
return m_floatingPointFramebuffer; }
884 inline void setFloatingPointFramebuffer(
bool flag) { m_floatingPointFramebuffer = flag; }
887 SbBool isDelaying()
const {
return delayObjs; }
890 bool stateContainsTransparency()
const;
893 void removeAllDelayedPath();
895 bool isTraversalPassTransparent()
const;
899 int getCullTestResults() {
return cullBits; }
900 void setCullTestResults(
int b) { cullBits = b; }
902 SbBool isLogicalRegionSet()
const;
904 void setTiledViewportRegion(
const SbVec4f& region,
int info = 0);
910 void setMaxDepthOffset(
float maxDepthOffset);
914 void setDoubleBuffer(
SbBool db);
916 void setForceRender();
918 void setViewing(
SbBool viewing);
920 SbBool hasDelayedNodesToRender()
const;
922 void setFirstStereoPass(
SbBool first);
926 void setRenderingFromOffscreen(
SbBool renderFromOffscreen)
927 { m_renderingFromOffscreen = renderFromOffscreen; }
929 SbBool getRenderingFromOffscreen()
const
930 {
return m_renderingFromOffscreen; }
934 SbBool hasDrawnTransparentObjs()
const
935 {
return m_hasDrawnTransparentObjs; }
938 void setFullSceneAntialiasingElement(
SbBool enable,
int filterMask );
960 void setRestrictObjectRenderingMode(
const RenderMode mode = ALL_OBJECTS )
961 { m_restrictObjectRendering = mode; };
963 int getRestrictObjectRenderingMode()
const
964 {
return m_restrictObjectRendering; };
966 SoGLRenderActionSync* getSynchronizer()
const;
967 void setSynchronizer( SoGLRenderActionSync* );
976 SoGLRenderActionImpl* getImpl();
980 SoGLDepthPeeling* setDepthPeelingInterface(SoGLDepthPeeling*);
982 bool isFastEditManipulating();
991 bool isLazyEvaluating()
const {
return m_lazyEvaluating; }
992 void setLazyEvaluating(
bool value) { m_lazyEvaluating = value; }
998 return m_viewport.
ptr();
1005 TRANSPARENCY_TYPE = 0x01,
1008 FASTEDIT_SAVE_POLICY = 0x08,
1010 ANTIALIASING = 0x20,
1016 virtual void beginTraversal(
SoNode *node);
1021 { m_fastEditPolicy = policy; }
1025 { m_transpType = type; }
1027 uint32_t getWhatChanged()
const
1035 template<
typename ApplyType>
void commonApply(ApplyType applyObject,
SbBool obeysRules);
1038 template<
typename ApplyType>
void applyTo(ApplyType applyObject,
SbBool obeysRules);
1040 SoGLRenderActionSync* m_synchronizer;
1048 void removeInvalidPaths();
1051 bool m_isDoingDepthPeeling;
1053 SbBool m_hasDrawnTransparentObjs;
1057 SbBool m_firstStereoPass;
1058 int m_lastStereoMode;
1061 int m_useCompactPaths;
1098 uint32_t whatChanged;
1101 void enableBlending(
SbBool enable);
1104 void enableSmoothing(
SbBool enable);
1113 SbBool m_delayedObjDepthWrite;
1116 SbBool m_renderingFromOffscreen;
1121 uint32_t m_frameCounter;
1125 bool m_lazyEvaluating;
1129 int m_sortedLayersNumPasses ;
1132 void renderSortedLayers(
SoNode *node) ;
1133 void initDepthPeeling(
SoNode *node);
1136 static void renderSortedLayersCB(
void *userData, SoGLDepthPeeling *mgr) ;
1138 SoGLDepthPeeling *m_glDepthPeeling ;
1141 bool m_ignoreCameraPostCB;
1146 RenderMode m_restrictObjectRendering;
1148 bool m_floatingPointFramebuffer;
1152 int m_fsaaFilterMask;
1154 SoGLRenderActionImpl* m_impl;
1159inline SoGLRenderActionSync* SoGLRenderAction::getSynchronizer()
const
1161 return m_synchronizer;
1164inline SoGLRenderActionImpl* SoGLRenderAction::getImpl()
1170#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...