00001 #ifndef COIN_SOGLRENDERACTION_H
00002 #define COIN_SOGLRENDERACTION_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <Inventor/actions/SoAction.h>
00028 #include <Inventor/actions/SoSubAction.h>
00029 #include <Inventor/SbBasic.h>
00030 #include <Inventor/SbViewportRegion.h>
00031 #include <Inventor/system/inttypes.h>
00032 #include <Inventor/lists/SoPathList.h>
00033 #include <Inventor/lists/SbList.h>
00034
00035 typedef void SoGLRenderPassCB(void * userdata);
00036 typedef void SoGLPreRenderCB(void * userdata, class SoGLRenderAction * action);
00037
00038 class COIN_DLL_API SoGLRenderAction : public SoAction {
00039 typedef SoAction inherited;
00040
00041 SO_ACTION_HEADER(SoGLRenderAction);
00042
00043 public:
00044 SoGLRenderAction(const SbViewportRegion & viewportregion);
00045 virtual ~SoGLRenderAction();
00046
00047 static void initClass(void);
00048
00049 enum TransparencyType {
00050 SCREEN_DOOR,
00051 ADD, DELAYED_ADD, SORTED_OBJECT_ADD,
00052 BLEND, DELAYED_BLEND, SORTED_OBJECT_BLEND,
00053
00054 SORTED_OBJECT_SORTED_TRIANGLE_ADD,
00055 SORTED_OBJECT_SORTED_TRIANGLE_BLEND,
00056 NONE
00057 };
00058
00059 enum AbortCode {
00060 CONTINUE, ABORT, PRUNE, DELAY
00061 };
00062
00063 typedef AbortCode SoGLRenderAbortCB(void * userdata);
00064
00065 void setViewportRegion(const SbViewportRegion & newregion);
00066 const SbViewportRegion & getViewportRegion(void) const;
00067 void setUpdateArea(const SbVec2f & origin, const SbVec2f & size);
00068 void getUpdateArea(SbVec2f & origin, SbVec2f & size) const;
00069 void setAbortCallback(SoGLRenderAbortCB * const func, void * const userdata);
00070 void setTransparencyType(const TransparencyType type);
00071 TransparencyType getTransparencyType(void) const;
00072 void setSmoothing(const SbBool smooth);
00073 SbBool isSmoothing(void) const;
00074 void setNumPasses(const int num);
00075 int getNumPasses(void) const;
00076 void setPassUpdate(const SbBool flag);
00077 SbBool isPassUpdate(void) const;
00078 void setPassCallback(SoGLRenderPassCB * const func, void * const userdata);
00079 void setCacheContext(const uint32_t context);
00080 uint32_t getCacheContext(void) const;
00081
00082 void addDelayedPath(SoPath * path);
00083 SbBool isRenderingDelayedPaths(void) const;
00084
00085 SbBool handleTransparency(SbBool istransparent = FALSE);
00086 int getCurPass(void) const;
00087 SbBool abortNow(void);
00088
00089 void setRenderingIsRemote(SbBool isremote);
00090 SbBool getRenderingIsRemote(void) const;
00091
00092 virtual void invalidateState(void);
00093
00094 void addPreRenderCallback(SoGLPreRenderCB * func, void * userdata);
00095 void removePreRenderCallback(SoGLPreRenderCB * func, void * userdata);
00096
00097 protected:
00098 virtual void beginTraversal(SoNode * node);
00099 virtual void endTraversal(SoNode * node);
00100
00101 private:
00102 void addTransPath(SoPath * path);
00103 void doPathSort(void);
00104
00105 class SoGLRenderActionP * pimpl;
00106 friend class SoGLRenderActionP;
00107 };
00108
00109 #endif // !COIN_SOGLRENDERACTION_H