Coin Logo http://www.sim.no
http://www.coin3d.org

SoGLRenderAction.h
1 #ifndef COIN_SOGLRENDERACTION_H
2 #define COIN_SOGLRENDERACTION_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/actions/SoAction.h>
28 #include <Inventor/actions/SoSubAction.h>
29 #include <Inventor/SbBasic.h>
30 #include <Inventor/SbViewportRegion.h>
31 #include <Inventor/system/inttypes.h>
32 #include <Inventor/lists/SoPathList.h>
33 #include <Inventor/lists/SbList.h>
34 
35 typedef void SoGLRenderPassCB(void * userdata);
36 typedef void SoGLPreRenderCB(void * userdata, class SoGLRenderAction * action);
37 typedef float SoGLSortedObjectOrderCB(void * userdata, SoGLRenderAction * action);
38 
39 class COIN_DLL_API SoGLRenderAction : public SoAction {
40  typedef SoAction inherited;
41 
42  SO_ACTION_HEADER(SoGLRenderAction);
43 
44 public:
45  SoGLRenderAction(const SbViewportRegion & viewportregion);
46  virtual ~SoGLRenderAction(void);
47 
48  static void initClass(void);
49 
52  ADD, DELAYED_ADD, SORTED_OBJECT_ADD,
53  BLEND, DELAYED_BLEND, SORTED_OBJECT_BLEND,
54  // The remaining are Coin extensions to the common Inventor API
57  NONE, SORTED_LAYERS_BLEND
58  };
59 
60  enum AbortCode {
61  CONTINUE, ABORT, PRUNE, DELAY
62  };
65  BBOX_CLOSEST_CORNER,
67  CUSTOM_CALLBACK
68  };
69 
70  typedef AbortCode SoGLRenderAbortCB(void * userdata);
71 
72  void setViewportRegion(const SbViewportRegion & newregion);
73  const SbViewportRegion & getViewportRegion(void) const;
74  void setUpdateArea(const SbVec2f & origin, const SbVec2f & size);
75  void getUpdateArea(SbVec2f & origin, SbVec2f & size) const;
76  void setAbortCallback(SoGLRenderAbortCB * const func, void * const userdata);
77  void setTransparencyType(const TransparencyType type);
78  TransparencyType getTransparencyType(void) const;
79  void setSmoothing(const SbBool smooth);
80  SbBool isSmoothing(void) const;
81  void setNumPasses(const int num);
82  int getNumPasses(void) const;
83  void setPassUpdate(const SbBool flag);
84  SbBool isPassUpdate(void) const;
85  void setPassCallback(SoGLRenderPassCB * const func, void * const userdata);
86  void setCacheContext(const uint32_t context);
87  uint32_t getCacheContext(void) const;
88 
89  void addDelayedPath(SoPath * path);
90  SbBool isRenderingDelayedPaths(void) const;
91 
92  SbBool handleTransparency(SbBool istransparent = FALSE);
93  int getCurPass(void) const;
94  SbBool abortNow(void);
95 
96  void setRenderingIsRemote(SbBool isremote);
97  SbBool getRenderingIsRemote(void) const;
98 
99  virtual void invalidateState(void);
100 
101  void addPreRenderCallback(SoGLPreRenderCB * func, void * userdata);
102  void removePreRenderCallback(SoGLPreRenderCB * func, void * userdata);
103 
104  void setSortedLayersNumPasses(int num);
105  int getSortedLayersNumPasses(void) const;
106 
107  void setSortedObjectOrderStrategy(const SortedObjectOrderStrategy strategy,
108  SoGLSortedObjectOrderCB * cb = NULL,
109  void * closure = NULL);
110 
111 protected:
112  virtual void beginTraversal(SoNode * node);
113  virtual void endTraversal(SoNode * node);
114 
115 private:
116  void addTransPath(SoPath * path);
117  void doPathSort(void);
118 
119  class SoGLRenderActionP * pimpl;
120  friend class SoGLRenderActionP;
121 };
122 
123 #endif // !COIN_SOGLRENDERACTION_H
124 
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
static void initClass(void)
Definition: SoAction.cpp:392
AbortCode
Definition: SoGLRenderAction.h:60
Definition: SoGLRenderAction.h:52
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
virtual void invalidateState(void)
Definition: SoAction.cpp:783
Definition: SoGLRenderAction.h:61
The SoPath class is a container class for traversal path descriptions.SoPath objects contain a list o...
Definition: SoPath.h:43
TransparencyType
Definition: SoGLRenderAction.h:50
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:67
Definition: SoGLRenderAction.h:66
Definition: SoGLRenderAction.h:64
AbortCode SoGLRenderAbortCB(void *userdata)
Definition: SoGLRenderAction.h:70
virtual void endTraversal(SoNode *node)
Definition: SoAction.cpp:1218
virtual void beginTraversal(SoNode *node)
Definition: SoAction.cpp:1208
The SbViewportRegion class is a viewport within a full window.The SbViewportRegion class contains inf...
Definition: SbViewportRegion.h:31
Definition: SoGLRenderAction.h:53
SortedObjectOrderStrategy
Definition: SoGLRenderAction.h:63
Definition: SoGLRenderAction.h:51
The SoGLRenderAction class renders the scene graph with OpenGL calls.Applying this method at a root n...
Definition: SoGLRenderAction.h:39

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Jul 20 2018 for Coin by Doxygen. 1.8.14