OpenSceneGraph 3.6.5
ComputeBoundsVisitor
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_COMPUTEBOUNDSVISITOR
15#define OSG_COMPUTEBOUNDSVISITOR 1
16
17#include <osg/NodeVisitor>
18#include <osg/BoundingBox>
19#include <osg/Polytope>
20
21namespace osg {
22
24{
25public:
26
28
30
31 virtual void reset();
32
34
35 void getPolytope(osg::Polytope& polytope, float margin=0.1) const;
36
37 void getBase(osg::Polytope& polytope, float margin=0.1) const;
38
39 void apply(osg::Drawable& drawable);
40
41 void apply(osg::Transform& transform);
42
43 inline void pushMatrix(osg::Matrix& matrix) { _matrixStack.push_back(matrix); }
44
45 inline void popMatrix() { _matrixStack.pop_back(); }
46
47
49
50 typedef std::vector<osg::Matrix> MatrixStack;
51
52 const MatrixStack& getMatrixStack() const { return _matrixStack; }
53
54protected:
57};
58
59}
60
61#endif
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
BoundingBoxd BoundingBox
Definition BoundingBox:257
Matrixd Matrix
Definition Matrix:27
void getBase(osg::Polytope &polytope, float margin=0.1) const
void popMatrix()
Definition ComputeBoundsVisitor:45
void getPolytope(osg::Polytope &polytope, float margin=0.1) const
META_NodeVisitor(osg, ComputeBoundsVisitor) virtual void reset()
std::vector< osg::Matrix > MatrixStack
Definition ComputeBoundsVisitor:50
osg::BoundingBox & getBoundingBox()
Definition ComputeBoundsVisitor:33
osg::BoundingBox _bb
Definition ComputeBoundsVisitor:56
void pushMatrix(osg::Matrix &matrix)
Definition ComputeBoundsVisitor:43
MatrixStack _matrixStack
Definition ComputeBoundsVisitor:55
void apply(osg::Transform &transform)
void applyBoundingBox(const osg::BoundingBox &)
ComputeBoundsVisitor(TraversalMode traversalMode=TRAVERSE_ALL_CHILDREN)
const MatrixStack & getMatrixStack() const
Definition ComputeBoundsVisitor:52
void apply(osg::Drawable &drawable)
Pure virtual base class for drawable geometry.
Definition Drawable:89
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
TraversalMode
Definition NodeVisitor:86
@ TRAVERSE_ALL_CHILDREN
Definition NodeVisitor:89
virtual void reset()
Method to call to reset visitor.
Definition NodeVisitor:167
A Polytope class for representing convex clipping volumes made up of a set of planes.
Definition Polytope:26
A Transform is a group node for which all children are transformed by a 4x4 matrix.
Definition Transform:75
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.