OpenCOVER
coCullVisitor.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef COCULLVISITOR
9#define COCULLVISITOR
10
20/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield
21 *
22 * This library is open source and may be redistributed and/or modified under
23 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
24 * (at your option) any later version. The full license is in LICENSE file
25 * included with this distribution, and on the openscenegraph.org website.
26 *
27 * This library is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * OpenSceneGraph Public License for more details.
31*/
32
33#include <util/coExport.h>
34#include <osgUtil/CullVisitor>
35
36namespace opencover
37{
46class COVEREXPORT coCullVisitor : public osgUtil::CullVisitor
47{
48public:
49 typedef osg::Matrix::value_type value_type;
50
52 virtual ~coCullVisitor();
53
54 virtual coCullVisitor *cloneType() const
55 {
56 return new coCullVisitor();
57 }
58
59 virtual osg::Vec3 getEyePoint() const
60 {
61 return getEyeLocal();
62 }
63 virtual float getDistanceToEyePoint(const osg::Vec3 &pos, bool withLODScale) const;
64 virtual float getDistanceFromEyePoint(const osg::Vec3 &pos, bool withLODScale) const;
65 virtual float getDistanceToViewPoint(const osg::Vec3& pos, bool withLODScale) const;
66
67 // we do need our own version of apply and distance() for depth sorting to work correctly
68 virtual void apply(osg::Drawable &drawable);
69 virtual void apply(osg::Billboard &node);
70
71 value_type computeNearestPointInFrustum(const osg::Matrix &matrix, const osg::Polytope::PlaneList &planes, const osg::Drawable &drawable);
72 value_type computeFurthestPointInFrustum(const osg::Matrix &matrix, const osg::Polytope::PlaneList &planes, const osg::Drawable &drawable);
73
74 bool updateCalculatedNearFar(const osg::Matrix &matrix, const osg::BoundingBox &bb);
75
76 bool updateCalculatedNearFar(const osg::Matrix &matrix, const osg::Drawable &drawable, bool isBillboard = false);
77
78 void updateCalculatedNearFar(const osg::Vec3 &pos);
79
80protected:
83 {
84 return *this;
85 }
86};
87}
88#endif
Definition: ARToolKit.h:33
Definition: coCullVisitor.h:47
virtual osg::Vec3 getEyePoint() const
Definition: coCullVisitor.h:59
void updateCalculatedNearFar(const osg::Vec3 &pos)
virtual float getDistanceToViewPoint(const osg::Vec3 &pos, bool withLODScale) const
virtual void apply(osg::Billboard &node)
bool updateCalculatedNearFar(const osg::Matrix &matrix, const osg::Drawable &drawable, bool isBillboard=false)
osg::Matrix::value_type value_type
Definition: coCullVisitor.h:49
coCullVisitor & operator=(const coCullVisitor &)
Definition: coCullVisitor.h:82
virtual coCullVisitor * cloneType() const
Definition: coCullVisitor.h:54
value_type computeFurthestPointInFrustum(const osg::Matrix &matrix, const osg::Polytope::PlaneList &planes, const osg::Drawable &drawable)
virtual void apply(osg::Drawable &drawable)
bool updateCalculatedNearFar(const osg::Matrix &matrix, const osg::BoundingBox &bb)
virtual float getDistanceFromEyePoint(const osg::Vec3 &pos, bool withLODScale) const
value_type computeNearestPointInFrustum(const osg::Matrix &matrix, const osg::Polytope::PlaneList &planes, const osg::Drawable &drawable)
virtual float getDistanceToEyePoint(const osg::Vec3 &pos, bool withLODScale) const