2
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
3
* Copyright 2008-2009 Pelican Ventures, Inc.
6
* osgEarth is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU Lesser General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>
19
#ifndef OSGEARTH_MODEL_FEATURE_STENCIL_STENCIL_UTILS_H
20
#define OSGEARTH_MODEL_FEATURE_STENCIL_STENCIL_UTILS_H 1
25
#include <osgEarthFeatures/Geometry>
26
#include <osgEarthFeatures/Filter>
27
#include <osgEarthFeatures/Styling>
29
using namespace osgEarth::Features;
33
static osg::Node* createGeometryPass(
37
static osg::Node* createMaskPass(
38
const osg::Vec4ub& color,
41
static osg::Geode* createVolume(
45
const FilterContext& context );
48
class StencilVolumeNode : public osg::Group
52
StencilVolumeNode( const StencilVolumeNode& rhs, const osg::CopyOp& op =osg::CopyOp::DEEP_COPY_ALL );
54
META_Node(osgEarth::Features,StencilVolumeNode);
56
// sets the render bins and returns the next available bin.
57
int setBaseRenderBin( int bin );
59
// sets the render color
60
void setColor( const osg::Vec4f& color );
62
// adds volume geometry to the node
63
void addVolumes( osg::Node* node );
68
osg::Group* _stencilGroup1;
69
osg::Group* _stencilGroup2;
70
osg::Group* _maskGroup;
71
osg::Vec4Array* _maskColorArray;
75
#endif // OSGEARTH_MODEL_FEATURE_STENCIL_STENCIL_UTILS_H