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 
SoGLRenderAction::AbortCode
AbortCode
Definition: SoGLRenderAction.h:60
SoState
The SoState class manages the Coin scenegraph traversal state data.
Definition: SoState.h:35
SoGLRenderAction::BBOX_FARTHEST_CORNER
@ BBOX_FARTHEST_CORNER
Definition: SoGLRenderAction.h:66
SoGLRenderAction::getCurPass
int getCurPass(void) const
Definition: SoGLRenderAction.cpp:1100
SoGLRenderAction::endTraversal
virtual void endTraversal(SoNode *node)
Definition: SoGLRenderAction.cpp:992
SoAction::hasTerminated
SbBool hasTerminated(void) const
Definition: SoAction.cpp:1018
SoGLRenderAction::BBOX_CENTER
@ BBOX_CENTER
Definition: SoGLRenderAction.h:64
SbViewportRegion::getViewportSizePixels
const SbVec2s & getViewportSizePixels(void) const
Definition: SbViewportRegion.cpp:425
SoShape::computeBBox
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)=0
SoGLRenderAction::SortedObjectOrderStrategy
SortedObjectOrderStrategy
Definition: SoGLRenderAction.h:63
SbVec2f
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
SoState::pop
void pop(void)
Definition: SoState.cpp:284
SoShape
The SoShape class is the superclass for geometry shapes.
Definition: SoShape.h:43
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:37
SoShape::getBoundingBoxCache
const SoBoundingBoxCache * getBoundingBoxCache(void) const
Definition: SoShape.cpp:1537
SoOverrideElement::setTransparencyTypeOverride
static void setTransparencyTypeOverride(SoState *const state, SoNode *const node, const SbBool override)
Definition: SoOverrideElement.cpp:754
SoGLRenderAction::beginTraversal
virtual void beginTraversal(SoNode *node)
Definition: SoGLRenderAction.cpp:933
SoGLRenderAction::getSortedLayersNumPasses
int getSortedLayersNumPasses(void) const
Definition: SoGLRenderAction.cpp:924
SoGLRenderAction::SORTED_OBJECT_ADD
@ SORTED_OBJECT_ADD
Definition: SoGLRenderAction.h:52
SoGLRenderAction::setPassCallback
void setPassCallback(SoGLRenderPassCB *const func, void *const userdata)
Definition: SoGLRenderAction.cpp:868
SoGLRenderAction::NONE
@ NONE
Definition: SoGLRenderAction.h:57
SbPList::get
void * get(const int index) const
Definition: SbPList.h:135
SbMatrix::multVecMatrix
void multVecMatrix(const SbVec3f &src, SbVec3f &dst) const
Definition: SbMatrix.cpp:1357
SoState::push
void push(void)
Definition: SoState.cpp:265
SbPList
The SbPList class is a container class for void pointers.
Definition: SbPList.h:31
SoAction::beginTraversal
virtual void beginTraversal(SoNode *node)
Definition: SoAction.cpp:1208
SoBase::getName
virtual SbName getName(void) const
Definition: SoBase.cpp:730
SoGLRenderAction::getTransparencyType
TransparencyType getTransparencyType(void) const
Definition: SoGLRenderAction.cpp:782
SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND
@ SORTED_OBJECT_SORTED_TRIANGLE_BLEND
Definition: SoGLRenderAction.h:56
SbPlane::getDistance
float getDistance(const SbVec3f &point) const
Definition: SbPlane.cpp:242
SoGLRenderAction::~SoGLRenderAction
virtual ~SoGLRenderAction(void)
Definition: SoGLRenderAction.cpp:665
SoGLRenderAction::addDelayedPath
void addDelayedPath(SoPath *path)
Definition: SoGLRenderAction.cpp:1205
SbBox3f::getMin
const SbVec3f & getMin(void) const
Definition: SbBox3f.cpp:122
SoGLRenderAction::getCacheContext
uint32_t getCacheContext(void) const
Definition: SoGLRenderAction.cpp:902
SbBox3f
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3f.h:37
SoAction::getCurPath
const SoPath * getCurPath(void)
Definition: SoAction.cpp:1044
SoDebugError::postWarning
static void postWarning(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:324
SoAction
The SoAction class is the base class for all traversal actions.
Definition: SoAction.h:67
SoGLRenderAction::isSmoothing
SbBool isSmoothing(void) const
Definition: SoGLRenderAction.cpp:818
SoFullPath
The SoFullPath class allows examination of hidden children in paths.
Definition: SoFullPath.h:29
SoPathList
The SoPathList class is a container for pointers to SoPath objects.
Definition: SoPathList.h:31
SoGLRenderAction::PRUNE
@ PRUNE
Definition: SoGLRenderAction.h:61
SbPList::set
void set(const int index, void *item)
Definition: SbPList.h:141
SoFullPath::getTail
SoNode * getTail(void) const
Definition: SoFullPath.cpp:74
SoGLRenderAction::setCacheContext
void setCacheContext(const uint32_t context)
Definition: SoGLRenderAction.cpp:890
SoGLRenderAction::setSortedLayersNumPasses
void setSortedLayersNumPasses(int num)
Definition: SoGLRenderAction.cpp:914
SoCallbackList
The SoCallbackList is a container for callback function pointers.
Definition: SoCallbackList.h:35
SoGLRenderAction::abortNow
SbBool abortNow(void)
Definition: SoGLRenderAction.cpp:1112
SoGLRenderAction::setTransparencyType
void setTransparencyType(const TransparencyType type)
Definition: SoGLRenderAction.cpp:770
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition: SbVec2s.h:37
SoPath
The SoPath class is a container class for traversal path descriptions.
Definition: SoPath.h:43
SoGLRenderAction::setNumPasses
void setNumPasses(const int num)
Definition: SoGLRenderAction.cpp:829
SoGLRenderAction::SoGLRenderAction
SoGLRenderAction(const SbViewportRegion &viewportregion)
Definition: SoGLRenderAction.cpp:625
SbList< float >
SoGLRenderAction::invalidateState
virtual void invalidateState(void)
Definition: SoGLRenderAction.cpp:1237
SbName::getString
const char * getString(void) const
Definition: SbName.cpp:278
SoGLRenderAction::setViewportRegion
void setViewportRegion(const SbViewportRegion &newregion)
Definition: SoGLRenderAction.cpp:676
SbBox3f::getMax
const SbVec3f & getMax(void) const
Definition: SbBox3f.cpp:134
SoGLRenderAction::setPassUpdate
void setPassUpdate(const SbBool flag)
Definition: SoGLRenderAction.cpp:847
SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_ADD
@ SORTED_OBJECT_SORTED_TRIANGLE_ADD
Definition: SoGLRenderAction.h:55
SoGLRenderAction::setSortedObjectOrderStrategy
void setSortedObjectOrderStrategy(const SortedObjectOrderStrategy strategy, SoGLSortedObjectOrderCB *cb=NULL, void *closure=NULL)
Definition: SoGLRenderAction.cpp:1334
SoGLRenderAction::BLEND
@ BLEND
Definition: SoGLRenderAction.h:53
SoAction::getState
SoState * getState(void) const
Definition: SoAction.cpp:1028
SoGLRenderAction::DELAY
@ DELAY
Definition: SoGLRenderAction.h:61
SoGLRenderAction::setSmoothing
void setSmoothing(const SbBool smooth)
Definition: SoGLRenderAction.cpp:806
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SoGLRenderAction::SORTED_LAYERS_BLEND
@ SORTED_LAYERS_BLEND
Definition: SoGLRenderAction.h:57
SoGetBoundingBoxAction
The SoGetBoundingBoxAction class calculates bounding boxes for nodes and subgraphs.
Definition: SoGetBoundingBoxAction.h:34
SoGLRenderAction::addPreRenderCallback
void addPreRenderCallback(SoGLPreRenderCB *func, void *userdata)
Definition: SoGLRenderAction.cpp:1296
SoGLRenderAction::isRenderingDelayedPaths
SbBool isRenderingDelayedPaths(void) const
Definition: SoGLRenderAction.cpp:1218
SoGLRenderAction::TransparencyType
TransparencyType
Definition: SoGLRenderAction.h:50
SoGLRenderAction::getRenderingIsRemote
SbBool getRenderingIsRemote(void) const
Definition: SoGLRenderAction.cpp:1189
SoGLRenderAction::setUpdateArea
void setUpdateArea(const SbVec2f &origin, const SbVec2f &size)
Definition: SoGLRenderAction.cpp:702
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.
Definition: SbViewportRegion.h:31
SoGLRenderAction::CUSTOM_CALLBACK
@ CUSTOM_CALLBACK
Definition: SoGLRenderAction.h:67
SoBase::getTypeId
virtual SoType getTypeId(void) const =0
SoGLRenderAction::getNumPasses
int getNumPasses(void) const
Definition: SoGLRenderAction.cpp:838
SoAction::invalidateState
virtual void invalidateState(void)
Definition: SoAction.cpp:783
SoGLRenderAction::getViewportRegion
const SbViewportRegion & getViewportRegion(void) const
Definition: SoGLRenderAction.cpp:688
SoGLRenderAction::setRenderingIsRemote
void setRenderingIsRemote(SbBool isremote)
Definition: SoGLRenderAction.cpp:1176
SoAction::initClass
static void initClass(void)
Definition: SoAction.cpp:392
SoGLRenderAction::SCREEN_DOOR
@ SCREEN_DOOR
Definition: SoGLRenderAction.h:51
SoGLRenderAction::removePreRenderCallback
void removePreRenderCallback(SoGLPreRenderCB *func, void *userdata)
Definition: SoGLRenderAction.cpp:1309
SoOverrideElement
The SoOverrideElement maintains a list of overridable elements and a list over which elements should ...
Definition: SoOverrideElement.h:32
SoAction::endTraversal
virtual void endTraversal(SoNode *node)
Definition: SoAction.cpp:1218
SbBox3f::transform
void transform(const SbMatrix &matrix)
Definition: SbBox3f.cpp:524
SoBase::isOfType
SbBool isOfType(SoType type) const
Definition: SoBase.cpp:710
SoNode
The SoNode class is the base class for nodes used in scene graphs.
Definition: SoNode.h:47
SoGLRenderAction::getUpdateArea
void getUpdateArea(SbVec2f &origin, SbVec2f &size) const
Definition: SoGLRenderAction.cpp:713
SoType::getName
SbName getName(void) const
Definition: SoType.cpp:628
SoFullPath::getLength
int getLength(void) const
Definition: SoFullPath.cpp:106
SoGLRenderAction::handleTransparency
SbBool handleTransparency(SbBool istransparent=0)
Definition: SoGLRenderAction.cpp:1004
SoGLRenderAction::SoGLRenderAbortCB
AbortCode SoGLRenderAbortCB(void *userdata)
Definition: SoGLRenderAction.h:70
SoGLRenderAction::DELAYED_BLEND
@ DELAYED_BLEND
Definition: SoGLRenderAction.h:53
SoGLRenderAction::ABORT
@ ABORT
Definition: SoGLRenderAction.h:61
SoGLRenderAction::DELAYED_ADD
@ DELAYED_ADD
Definition: SoGLRenderAction.h:52
SbPlane
The SbPlane class represents a plane in 3D space.
Definition: SbPlane.h:34
SoGLRenderAction::CONTINUE
@ CONTINUE
Definition: SoGLRenderAction.h:61
SoGLRenderAction::SORTED_OBJECT_BLEND
@ SORTED_OBJECT_BLEND
Definition: SoGLRenderAction.h:53
SoGLRenderAction::ADD
@ ADD
Definition: SoGLRenderAction.h:52
SoGLRenderAction
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition: SoGLRenderAction.h:39
SoState::isCacheOpen
SbBool isCacheOpen(void) const
Definition: SoState.h:83
SoAction::setTerminated
void setTerminated(const SbBool flag)
Definition: SoAction.cpp:1233
SoGLRenderAction::setAbortCallback
void setAbortCallback(SoGLRenderAbortCB *const func, void *const userdata)
Definition: SoGLRenderAction.cpp:756
SoGLRenderAction::isPassUpdate
SbBool isPassUpdate(void) const
Definition: SoGLRenderAction.cpp:858

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

Generated on Wed Jul 24 2019 for Coin by Doxygen. 1.8.17