OpenSceneGraph 3.6.5
ClipNode
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_CLIPNODE
15#define OSG_CLIPNODE 1
16
17#include <osg/Group>
18#include <osg/ClipPlane>
19
20namespace osg {
21
24{
25
26 public:
27
28 typedef std::vector<ref_ptr<ClipPlane> > ClipPlaneList;
29
30
32
33 ClipNode(const ClipNode& es, const CopyOp& copyop=CopyOp::SHALLOW_COPY);
34
36
42
55
57
58
60 void createClipBox(const BoundingBox& bb,unsigned int clipPlaneNumberBase=0);
61
64 bool addClipPlane(ClipPlane* clipplane);
65
68 bool removeClipPlane(ClipPlane* clipplane);
69
72 bool removeClipPlane(unsigned int pos);
73
75 inline unsigned int getNumClipPlanes() const { return _planes.size(); }
76
77
79 inline ClipPlane* getClipPlane(unsigned int pos) { return _planes[pos].get(); }
80
82 inline const ClipPlane* getClipPlane(unsigned int pos) const { return _planes[pos].get(); }
83
85 inline void setClipPlaneList(const ClipPlaneList& cpl) { _planes=cpl; }
86
89
91 inline const ClipPlaneList& getClipPlaneList() const { return _planes; }
92
95
98
100
101 protected:
102
103 virtual ~ClipNode();
104
107
109};
110
111}
112
113#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
BoundingSphered BoundingSphere
Definition BoundingSphere:308
bool removeClipPlane(ClipPlane *clipplane)
Removes the clipplane.
ClipPlaneList & getClipPlaneList()
Get the ClipPlaneList.
Definition ClipNode:88
void setClipPlaneList(const ClipPlaneList &cpl)
Set the ClipPlaneList.
Definition ClipNode:85
ReferenceFrame getReferenceFrame() const
Definition ClipNode:56
std::vector< ref_ptr< ClipPlane > > ClipPlaneList
Definition ClipNode:28
ReferenceFrame _referenceFrame
Definition ClipNode:108
void createClipBox(const BoundingBox &bb, unsigned int clipPlaneNumberBase=0)
Creates six clip planes corresponding to the given BoundingBox.
const ClipPlaneList & getClipPlaneList() const
Get the const ClipPlaneList.
Definition ClipNode:91
void setStateSetModes(StateSet &, StateAttribute::GLModeValue) const
Set the GLModes for all ClipPlanes, on the StateSet.
bool addClipPlane(ClipPlane *clipplane)
Adds the clipplane.
void setLocalStateSetModes(StateAttribute::GLModeValue=StateAttribute::ON)
Set up the local StateSet.
ReferenceFrame
Definition ClipNode:38
@ RELATIVE_RF
Definition ClipNode:39
@ ABSOLUTE_RF
Definition ClipNode:40
virtual ~ClipNode()
virtual BoundingSphere computeBound() const
Compute the bounding sphere around Node's geometry or children.
META_Node(osg, ClipNode)
bool removeClipPlane(unsigned int pos)
Remove the ClipPlane with the given index.
ClipPlaneList _planes
Definition ClipNode:106
unsigned int getNumClipPlanes() const
Returns the number of ClipPlanes.
Definition ClipNode:75
void setReferenceFrame(ReferenceFrame rf)
Set the ClipNode's ReferenceFrame, either to be relative to its parent reference frame,...
ClipNode(const ClipNode &es, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
ClipPlane * getClipPlane(unsigned int pos)
Get ClipPlane at the given index position.
Definition ClipNode:79
StateAttribute::GLModeValue _value
Definition ClipNode:105
const ClipPlane * getClipPlane(unsigned int pos) const
Get const ClipPlane at the given index position.
Definition ClipNode:82
Encapsulates OpenGL glClipPlane().
Definition ClipPlane:35
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
@ ON
means that associated GLMode is enabled and Override is disabled.
Definition StateAttribute:103
unsigned int GLModeValue
GLModeValue is used to specify whether a mode is enabled (ON) or disabled (OFF).
Definition StateAttribute:85
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
#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.