root/OpenSceneGraph/trunk/src/osgPlugins/geo/ClipRegion.h @ 13041

Revision 13041, 1.9 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
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_GEOCLIPREGION
15#define OSG_GEOCLIPREGION 1
16
17#include <osg/Group>
18#include <osg/Stencil>
19
20
21
22/** A ClipRegion is a group node for which all children are clipped
23  * by the projection into screen coordinates of the ClipGeode.
24  * Used for cutouts in instrumentation.
25  *
26  *
27*/
28class GeoClipRegion : public osg::Group
29{
30    public :
31
32        GeoClipRegion(int bin=osg::StateSet::TRANSPARENT_BIN+3);
33
34        /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
35        GeoClipRegion(const GeoClipRegion&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
36
37        // clip nodes define a screen region that is protected
38                void addClipNode(osg::Node *gd);
39   /* clipped children are only drawn inside the clip Node(s) protected screen area
40    * Obscured Nodes are (partly) hidden where the clipNodes overlap
41    */
42        virtual bool addClippedChild( osg::Node *child );
43        virtual bool addObscuredChild( osg::Node *child );
44        virtual bool addChild( osg::Node *child );
45        // drawClipNodes are special draw of geometry at the clip area which undoes the stencil value
46                void addDrawClipNode(osg::Node *ndclip);
47                void setBin(const int bin) { stencilbin=bin;}
48    protected :
49
50        virtual ~GeoClipRegion();
51                int stencilbin;
52};
53
54#endif // match OSG_GEOCLIPREGION
Note: See TracBrowser for help on using the browser.