openscenegraph
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
38 {
40 ABSOLUTE_RF
41 };
42
55
56 ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
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
88 inline ClipPlaneList& getClipPlaneList() { return _planes; }
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
Definition BoundingBox:34
Definition BoundingSphere:35
Definition ClipNode:24
bool removeClipPlane(ClipPlane *clipplane)
ClipPlaneList & getClipPlaneList()
Definition ClipNode:88
void setClipPlaneList(const ClipPlaneList &cpl)
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)
const ClipPlaneList & getClipPlaneList() const
Definition ClipNode:91
void setStateSetModes(StateSet &, StateAttribute::GLModeValue) const
bool addClipPlane(ClipPlane *clipplane)
void setLocalStateSetModes(StateAttribute::GLModeValue=StateAttribute::ON)
ReferenceFrame
Definition ClipNode:38
@ RELATIVE_RF
Definition ClipNode:39
virtual ~ClipNode()
virtual BoundingSphere computeBound() const
META_Node(osg, ClipNode)
bool removeClipPlane(unsigned int pos)
ClipPlaneList _planes
Definition ClipNode:106
unsigned int getNumClipPlanes() const
Definition ClipNode:75
void setReferenceFrame(ReferenceFrame rf)
ClipNode(const ClipNode &es, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
ClipPlane * getClipPlane(unsigned int pos)
Definition ClipNode:79
StateAttribute::GLModeValue _value
Definition ClipNode:105
const ClipPlane * getClipPlane(unsigned int pos) const
Definition ClipNode:82
Definition ClipPlane:35
Definition CopyOp:41
Definition Group:29
unsigned int GLModeValue
Definition StateAttribute:85
Definition StateSet:46
author: Julien Valentin 2017 (mp3butcher@hotmail.com)
Definition AlphaFunc:19
#define OSG_EXPORT
Definition osg/Export:39