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 );
941 void setMSNumSamples(
int numSamples);
963 void setRestrictObjectRenderingMode(
const RenderMode mode = ALL_OBJECTS )
964 { m_restrictObjectRendering = mode; };
966 int getRestrictObjectRenderingMode()
const
967 {
return m_restrictObjectRendering; };
969 SoGLRenderActionSync* getSynchronizer()
const;
970 void setSynchronizer( SoGLRenderActionSync* );
979 SoGLRenderActionImpl* getImpl();
983 SoGLDepthPeeling* setDepthPeelingInterface(SoGLDepthPeeling*);
985 bool isFastEditManipulating();
994 bool isLazyEvaluating()
const {
return m_lazyEvaluating; }
995 void setLazyEvaluating(
bool value) { m_lazyEvaluating = value; }
1001 return m_viewport.
ptr();
1008 TRANSPARENCY_TYPE = 0x01,
1011 FASTEDIT_SAVE_POLICY = 0x08,
1013 ANTIALIASING = 0x20,
1019 virtual void beginTraversal(
SoNode *node);
1024 { m_fastEditPolicy = policy; }
1028 { m_transpType = type; }
1030 uint32_t getWhatChanged()
const
1038 template<
typename ApplyType>
void commonApply(ApplyType applyObject,
SbBool obeysRules);
1041 template<
typename ApplyType>
void applyTo(ApplyType applyObject,
SbBool obeysRules);
1043 SoGLRenderActionSync* m_synchronizer;
1051 void removeInvalidPaths();
1054 bool m_isDoingDepthPeeling;
1056 SbBool m_hasDrawnTransparentObjs;
1060 SbBool m_firstStereoPass;
1061 int m_lastStereoMode;
1064 int m_useCompactPaths;
1101 uint32_t whatChanged;
1104 void enableBlending(
SbBool enable);
1107 void enableSmoothing(
SbBool enable);
1116 SbBool m_delayedObjDepthWrite;
1119 SbBool m_renderingFromOffscreen;
1124 uint32_t m_frameCounter;
1128 bool m_lazyEvaluating;
1132 int m_sortedLayersNumPasses ;
1135 void renderSortedLayers(
SoNode *node) ;
1136 void initDepthPeeling(
SoNode *node);
1139 static void renderSortedLayersCB(
void *userData, SoGLDepthPeeling *mgr) ;
1141 SoGLDepthPeeling *m_glDepthPeeling ;
1144 bool m_ignoreCameraPostCB;
1149 RenderMode m_restrictObjectRendering;
1151 bool m_floatingPointFramebuffer;
1155 int m_fsaaFilterMask;
1156 int m_fsaaNumSamples;
1158 SoGLRenderActionImpl* m_impl;
1163inline SoGLRenderActionSync* SoGLRenderAction::getSynchronizer()
const
1165 return m_synchronizer;
1168inline SoGLRenderActionImpl* SoGLRenderAction::getImpl()
1174#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...