ClipNode
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSG_CLIPNODE
#define OSG_CLIPNODE 1
#include <osg/Group>
#include <osg/ClipPlane>
namespace osg {
class OSG_EXPORT ClipNode : public Group
{
public:
typedef std::vector<ref_ptr<ClipPlane> > ClipPlaneList;
ClipNode();
ClipNode(const ClipNode& es, const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(osg, ClipNode);
enum ReferenceFrame
{
RELATIVE_RF,
ABSOLUTE_RF
};
void setReferenceFrame(ReferenceFrame rf);
ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
void createClipBox(const BoundingBox& bb,unsigned int clipPlaneNumberBase=0);
bool addClipPlane(ClipPlane* clipplane);
bool removeClipPlane(ClipPlane* clipplane);
bool removeClipPlane(unsigned int pos);
inline unsigned int getNumClipPlanes() const { return _planes.size(); }
inline ClipPlane* getClipPlane(unsigned int pos) { return _planes[pos].get(); }
inline const ClipPlane* getClipPlane(unsigned int pos) const { return _planes[pos].get(); }
inline void setClipPlaneList(const ClipPlaneList& cpl) { _planes=cpl; }
inline ClipPlaneList& getClipPlaneList() { return _planes; }
inline const ClipPlaneList& getClipPlaneList() const { return _planes; }
void setStateSetModes(StateSet&,StateAttribute::GLModeValue) const;
void setLocalStateSetModes(StateAttribute::GLModeValue=StateAttribute::ON);
virtual BoundingSphere computeBound() const;
protected:
virtual ~ClipNode();
StateAttribute::GLModeValue _value;
ClipPlaneList _planes;
ReferenceFrame _referenceFrame;
};
}
#endif
ClipPlane
Group
osg::ClipNode::removeClipPlane
bool removeClipPlane(ClipPlane *clipplane)
osg::ClipNode::getClipPlaneList
ClipPlaneList & getClipPlaneList()
Definition ClipNode:88
osg::ClipNode::setClipPlaneList
void setClipPlaneList(const ClipPlaneList &cpl)
Definition ClipNode:85
osg::ClipNode::getReferenceFrame
ReferenceFrame getReferenceFrame() const
Definition ClipNode:56
osg::ClipNode::ClipPlaneList
std::vector< ref_ptr< ClipPlane > > ClipPlaneList
Definition ClipNode:28
osg::ClipNode::_referenceFrame
ReferenceFrame _referenceFrame
Definition ClipNode:108
osg::ClipNode::createClipBox
void createClipBox(const BoundingBox &bb, unsigned int clipPlaneNumberBase=0)
osg::ClipNode::getClipPlaneList
const ClipPlaneList & getClipPlaneList() const
Definition ClipNode:91
osg::ClipNode::setStateSetModes
void setStateSetModes(StateSet &, StateAttribute::GLModeValue) const
osg::ClipNode::addClipPlane
bool addClipPlane(ClipPlane *clipplane)
osg::ClipNode::setLocalStateSetModes
void setLocalStateSetModes(StateAttribute::GLModeValue=StateAttribute::ON)
osg::ClipNode::ReferenceFrame
ReferenceFrame
Definition ClipNode:38
osg::ClipNode::RELATIVE_RF
@ RELATIVE_RF
Definition ClipNode:39
osg::ClipNode::ABSOLUTE_RF
@ ABSOLUTE_RF
Definition ClipNode:40
osg::ClipNode::ClipNode
ClipNode()
osg::ClipNode::~ClipNode
virtual ~ClipNode()
osg::ClipNode::computeBound
virtual BoundingSphere computeBound() const
osg::ClipNode::META_Node
META_Node(osg, ClipNode)
osg::ClipNode::removeClipPlane
bool removeClipPlane(unsigned int pos)
osg::ClipNode::_planes
ClipPlaneList _planes
Definition ClipNode:106
osg::ClipNode::getNumClipPlanes
unsigned int getNumClipPlanes() const
Definition ClipNode:75
osg::ClipNode::setReferenceFrame
void setReferenceFrame(ReferenceFrame rf)
osg::ClipNode::ClipNode
ClipNode(const ClipNode &es, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
osg::ClipNode::getClipPlane
ClipPlane * getClipPlane(unsigned int pos)
Definition ClipNode:79
osg::ClipNode::_value
StateAttribute::GLModeValue _value
Definition ClipNode:105
osg::ClipNode::getClipPlane
const ClipPlane * getClipPlane(unsigned int pos) const
Definition ClipNode:82
osg::ClipPlane
Definition ClipPlane:35
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::Group::Group
Group()
osg::StateAttribute::ON
@ ON
Definition StateAttribute:103
osg::StateAttribute::GLModeValue
unsigned int GLModeValue
Definition StateAttribute:85
osg::StateSet
Definition StateSet:46
osg
Definition AlphaFunc:19
osg::BoundingBox
BoundingBoxd BoundingBox
Definition BoundingBox:257
osg::BoundingSphere
BoundingSphered BoundingSphere
Definition BoundingSphere:314
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39