15 #define OSG_CLIPPLANE 1
19 #include <osg/StateAttribute>
21 #ifndef GL_CLIP_PLANE0
22 #define GL_CLIP_PLANE0 0x3000
23 #define GL_CLIP_PLANE1 0x3001
24 #define GL_CLIP_PLANE2 0x3002
25 #define GL_CLIP_PLANE3 0x3003
26 #define GL_CLIP_PLANE4 0x3004
27 #define GL_CLIP_PLANE5 0x3005
39 inline ClipPlane(
unsigned int no):_clipPlaneNum(no) {}
40 inline ClipPlane(
unsigned int no,
const Vec4d& plane):_clipPlaneNum(no) { setClipPlane(plane); }
41 inline ClipPlane(
unsigned int no,
const Plane& plane):_clipPlaneNum(no) { setClipPlane(plane); }
42 inline ClipPlane(
unsigned int no,
double a,
double b,
double c,
double d): _clipPlaneNum(no) { setClipPlane(a,b,c,d); }
59 virtual const char*
className()
const {
return "ClipPlane"; }
79 virtual unsigned int getMember()
const {
return _clipPlaneNum; }
91 _clipPlane.set(plane[0],plane[1],plane[2],plane[3]);
97 _clipPlane.set(a,b,c,d);
108 void setClipPlaneNum(
unsigned int num);
111 unsigned int getClipPlaneNum()
const;
114 virtual void apply(
State& state)
const;
virtual osg::Object * clone(const osg::CopyOp ©op) const
void setClipPlane(double a, double b, double c, double d)
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
void setClipPlane(const Plane &plane)
ClipPlane(const ClipPlane &cp, const CopyOp ©op=CopyOp::SHALLOW_COPY)
virtual bool getModeUsage(StateAttribute::ModeUsage &usage) const
virtual bool isSameKindAs(const osg::Object *obj) const
virtual void usesMode(GLMode mode)=0
void setClipPlane(const Vec4d &plane)
virtual Type getType() const
virtual osg::Object * cloneType() const
virtual const char * libraryName() const
virtual const char * className() const
A plane class. It can be used to represent an infinite plane.
#define COMPARE_StateAttribute_Parameter(parameter)
const Vec4d & getClipPlane() const
ClipPlane(unsigned int no, double a, double b, double c, double d)
virtual int compare(const StateAttribute &sa) const
ClipPlane(unsigned int no, const Vec4d &plane)
virtual unsigned int getMember() const
ClipPlane(unsigned int no, const Plane &plane)
unsigned int _clipPlaneNum
ClipPlane(unsigned int no)