OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ClusterCullingCallback.h
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_CLUSTERCULLINGCALLBACK
15 #define OSG_CLUSTERCULLINGCALLBACK 1
16 
17 #include <osg/Drawable>
18 #include <osg/Callback>
19 
20 namespace osg {
21 
26 {
27  public:
28 
30  ClusterCullingCallback(const ClusterCullingCallback& ccc,const CopyOp& copyop);
31  ClusterCullingCallback(const osg::Vec3& controlPoint, const osg::Vec3& normal, float deviation);
32  ClusterCullingCallback(const osg::Drawable* drawable);
33 
35 
36  // use the NodeCallbacks implementation of run.
37  virtual bool run(osg::Object* object, osg::Object* data) { return NodeCallback::run(object, data); }
38 
41  void computeFrom(const osg::Drawable* drawable);
42 
44  void transform(const osg::Matrixd& matrix);
45 
46  void set(const osg::Vec3& controlPoint, const osg::Vec3& normal, float deviation, float radius);
47 
48  void setControlPoint(const osg::Vec3& controlPoint) { _controlPoint = controlPoint; }
49  const osg::Vec3& getControlPoint() const { return _controlPoint; }
50 
51  void setNormal(const osg::Vec3& normal) { _normal = normal; }
52  const osg::Vec3& getNormal() const { return _normal; }
53 
54  void setRadius(float radius) { _radius = radius; }
55  float getRadius() const { return _radius; }
56 
57  void setDeviation(float deviation) { _deviation = deviation; }
58  float getDeviation() const { return _deviation; }
59 
60  virtual bool cull(osg::NodeVisitor*, osg::Drawable*, osg::State*) const;
61 
63  virtual void operator()(Node* node, NodeVisitor* nv);
64 
65  protected:
66 
68 
71  float _radius;
72  float _deviation;
73 };
74 
75 
76 }
77 
78 #endif
#define OSG_EXPORT
Definition: Export.h:43
#define META_Object(library, name)
Definition: Object.h:42
const osg::Vec3 & getControlPoint() const
void setControlPoint(const osg::Vec3 &controlPoint)
void setDeviation(float deviation)
virtual bool run(osg::Object *object, osg::Object *data)
void setNormal(const osg::Vec3 &normal)
Definition: Node.h:71
Definition: AlphaFunc.h:19
virtual bool run(osg::Object *object, osg::Object *data)
const osg::Vec3 & getNormal() const