Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoGLRenderAction.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2002 by Systems in Motion. All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public License
00008  *  version 2.1 as published by the Free Software Foundation. See the
00009  *  file LICENSE.LGPL at the root directory of the distribution for
00010  *  more details.
00011  *
00012  *  If you want to use Coin for applications not compatible with the
00013  *  LGPL, please contact SIM to acquire a Professional Edition license.
00014  *
00015  *  Systems in Motion, Prof Brochs gate 6, 7030 Trondheim, NORWAY
00016  *  http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097
00017  *
00018 \**************************************************************************/
00019 
00020 #ifndef COIN_SOGLRENDERACTION_H
00021 #define COIN_SOGLRENDERACTION_H
00022 
00023 #include <Inventor/actions/SoAction.h>
00024 #include <Inventor/actions/SoSubAction.h>
00025 #include <Inventor/SbBasic.h>
00026 #include <Inventor/SbViewportRegion.h>
00027 #include <Inventor/system/inttypes.h>
00028 #include <Inventor/lists/SoPathList.h>
00029 #include <Inventor/lists/SbList.h>
00030 
00031 typedef void SoGLRenderPassCB(void * userdata);
00032 typedef void SoGLPreRenderCB(void * userdata, class SoGLRenderAction * action);
00033 
00034 class COIN_DLL_API SoGLRenderAction : public SoAction {
00035   typedef SoAction inherited;
00036 
00037   SO_ACTION_HEADER(SoGLRenderAction);
00038 
00039 public:
00040   SoGLRenderAction(const SbViewportRegion & viewportregion);
00041   virtual ~SoGLRenderAction();
00042 
00043   static void initClass(void);
00044 
00045   enum TransparencyType {
00046     SCREEN_DOOR,
00047     ADD, DELAYED_ADD, SORTED_OBJECT_ADD,
00048     BLEND, DELAYED_BLEND, SORTED_OBJECT_BLEND,
00049     // The remaining are Coin extensions to the common Inventor API
00050     SORTED_OBJECT_SORTED_TRIANGLE_ADD,
00051     SORTED_OBJECT_SORTED_TRIANGLE_BLEND
00052   };
00053 
00054   enum AbortCode {
00055     CONTINUE, ABORT, PRUNE, DELAY
00056   };
00057 
00058   typedef AbortCode SoGLRenderAbortCB(void * userdata);
00059 
00060   void setViewportRegion(const SbViewportRegion & newregion);
00061   const SbViewportRegion & getViewportRegion(void) const;
00062   void setUpdateArea(const SbVec2f & origin, const SbVec2f & size);
00063   void getUpdateArea(SbVec2f & origin, SbVec2f & size) const;
00064   void setAbortCallback(SoGLRenderAbortCB * const func, void * const userdata);
00065   void setTransparencyType(const TransparencyType type);
00066   TransparencyType getTransparencyType(void) const;
00067   void setSmoothing(const SbBool smooth);
00068   SbBool isSmoothing(void) const;
00069   void setNumPasses(const int num);
00070   int getNumPasses(void) const;
00071   void setPassUpdate(const SbBool flag);
00072   SbBool isPassUpdate(void) const;
00073   void setPassCallback(SoGLRenderPassCB * const func, void * const userdata);
00074   void setCacheContext(const uint32_t context);
00075   uint32_t getCacheContext(void) const;
00076 
00077   void addDelayedPath(SoPath * path);
00078   SbBool isRenderingDelayedPaths(void) const;
00079 
00080   SbBool handleTransparency(SbBool istransparent = FALSE);
00081   int getCurPass(void) const;
00082   SbBool abortNow(void);
00083 
00084   void setRenderingIsRemote(SbBool isremote);
00085   SbBool getRenderingIsRemote(void) const;
00086 
00087   virtual void invalidateState(void);
00088 
00089   void addPreRenderCallback(SoGLPreRenderCB * func, void * userdata);
00090   void removePreRenderCallback(SoGLPreRenderCB * func, void * userdata);
00091 
00092 protected:
00093   virtual void beginTraversal(SoNode * node);
00094   virtual void endTraversal(SoNode * node);
00095 
00096 private:
00097   void addTransPath(SoPath * path);
00098   void doPathSort(void);
00099 
00100   class SoGLRenderActionP * pimpl;
00101   friend class SoGLRenderActionP;
00102 };
00103 
00104 #endif // !COIN_SOGLRENDERACTION_H

Generated at Tue Mar 5 03:31:13 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001