15#ifndef OSG_OCCLUSION_QUERY_NODE
16#define OSG_OCCLUSION_QUERY_NODE 1
96 typedef std::map< const osg::Camera*, osg::ref_ptr<osg::TestResult> >
ResultMap;
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
osg::StateSet * initOQDebugState()
BoundingSphered BoundingSphere
Definition BoundingSphere:308
osg::StateSet * initOQState()
Camera - is a subclass of Transform which represents encapsulates the settings of a Camera.
Definition Camera:45
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
General group node which maintains a list of children.
Definition Group:29
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
bool _init
Definition OcclusionQueryNode:46
TestResult()
Definition OcclusionQueryNode:43
~TestResult()
Definition OcclusionQueryNode:44
bool _active
Definition OcclusionQueryNode:55
unsigned int _contextID
Definition OcclusionQueryNode:51
GLuint _id
Definition OcclusionQueryNode:49
GLint _numPixels
Definition OcclusionQueryNode:58
Definition OcclusionQueryNode:64
QueryGeometry(const std::string &oqnName=std::string(""))
ResultMap _results
Definition OcclusionQueryNode:97
std::map< const osg::Camera *, osg::ref_ptr< osg::TestResult > > ResultMap
Definition OcclusionQueryNode:96
OpenThreads::Mutex _mapMutex
Definition OcclusionQueryNode:98
virtual void releaseGLObjects(osg::State *state=0) const
If State is non-zero, this function releases OpenGL objects for the specified graphics context.
static void flushDeletedQueryObjects(unsigned int contextID, double currentTime, double &availableTime)
unsigned int getNumPixels(const osg::Camera *cam) const
QueryResult getQueryResult(const osg::Camera *cam) const
return a QueryResult for specified Camera, where the QueryResult.valid is true when query results are...
std::string _oqnName
Definition OcclusionQueryNode:101
static void discardDeletedQueryObjects(unsigned int contextID)
static void deleteQueryObject(unsigned int contextID, GLuint handle)
virtual void drawImplementation(osg::RenderInfo &renderInfo) const
Draw Geometry directly ignoring an OpenGL display list which could be attached.
Definition OcclusionQueryNode:76
unsigned int numPixels
Definition OcclusionQueryNode:81
QueryResult()
Definition OcclusionQueryNode:77
bool valid
Definition OcclusionQueryNode:80
QueryResult(bool v, unsigned int p)
Definition OcclusionQueryNode:78
QueryGeometryState
Definition OcclusionQueryNode:195
@ INVALID
Definition OcclusionQueryNode:196
@ USER_DEFINED
Definition OcclusionQueryNode:198
@ VALID
Definition OcclusionQueryNode:197
static void discardDeletedQueryObjects(unsigned int contextID)
void traverseQuery(const osg::Camera *camera, osg::NodeVisitor &nv)
bool getDebugDisplay() const
void setQueryGeometry(osg::QueryGeometry *geom)
osg::ref_ptr< osg::Geode > _queryGeode
Definition OcclusionQueryNode:213
void setDebugStateSet(osg::StateSet *ss)
bool _debugBB
Definition OcclusionQueryNode:232
const osg::StateSet * getQueryStateSet() const
void setQueriesEnabled(bool enable=true)
osg::StateSet * getDebugStateSet()
virtual bool getPassed(const osg::Camera *camera, osg::NodeVisitor &nv)
OpenThreads::Mutex _computeBoundMutex
Definition OcclusionQueryNode:236
unsigned int _visThreshold
Definition OcclusionQueryNode:230
void setQueryStateSet(osg::StateSet *ss)
const osg::StateSet * getDebugStateSet() const
bool _passed
Definition OcclusionQueryNode:227
osg::ref_ptr< osg::Geode > _debugGeode
Definition OcclusionQueryNode:214
osg::StateSet * getQueryStateSet()
bool getQueriesEnabled() const
Definition OcclusionQueryNode:127
bool _enabled
Definition OcclusionQueryNode:216
QueryGeometryState _queryGeometryState
Definition OcclusionQueryNode:218
FrameCountMap _frameCountMap
Definition OcclusionQueryNode:223
META_Node(osg, OcclusionQueryNode)
void setDebugDisplay(bool enable)
OcclusionQueryNode(const OcclusionQueryNode &oqn, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
void setQueryGeometryInternal(osg::QueryGeometry *queryGeom, osg::Geometry *debugQueryGeom, QueryGeometryState state)
static void flushDeletedQueryObjects(unsigned int contextID, double currentTime, double &availableTime)
unsigned int _queryFrameCount
Definition OcclusionQueryNode:231
virtual osg::BoundingSphere computeBound() const
Compute the bounding sphere around Node's geometry or children.
void traverseDebug(osg::NodeVisitor &nv)
bool isQueryGeometryValid() const
Definition OcclusionQueryNode:205
void setVisibilityThreshold(unsigned int pixels)
Definition OcclusionQueryNode:133
virtual void releaseGLObjects(osg::State *state=0) const
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics...
void setQueryFrameCount(unsigned int frames)
Definition OcclusionQueryNode:137
virtual void createSupportNodes()
virtual ~OcclusionQueryNode()
unsigned int getVisibilityThreshold() const
Definition OcclusionQueryNode:134
std::map< const osg::Camera *, unsigned int > FrameCountMap
Definition OcclusionQueryNode:222
const osg::QueryGeometry * getQueryGeometry() const
OpenThreads::Mutex _frameCountMutex
Definition OcclusionQueryNode:224
unsigned int getQueryFrameCount() const
Definition OcclusionQueryNode:138
void updateDefaultQueryGeometry()
Base class for providing reference counted objects.
Definition Referenced:44
virtual void setThreadSafeRefUnref(bool)
Deprecated, Referenced is always theadsafe so there method now has no effect and does not need to be ...
Definition Referenced:59
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
#define OSG_EXPORT
Definition Export:39