osgEarth 2.1.1

/home/cube/sources/osgearth/src/osgEarthSymbology/MeshSubdivider

Go to the documentation of this file.
00001 /* -*-c++-*- */
00002 /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
00003  * Copyright 2008-2010 Pelican Mapping
00004  * http://osgearth.org
00005  *
00006  * osgEarth is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>
00018  */
00019 #ifndef OSGEARTHSYMBOLOGY_MESH_SUBDIVIDER
00020 #define OSGEARTHSYMBOLOGY_MESH_SUBDIVIDER
00021 
00022 #include <osgEarthSymbology/Common>
00023 #include <osgEarth/GeoMath>
00024 #include <osg/Geometry>
00025 #include <osg/PrimitiveSet>
00026 
00027 namespace osgEarth { namespace Symbology
00028 {
00034     class OSGEARTHSYMBOLOGY_EXPORT MeshSubdivider
00035     {
00036     public:
00042         MeshSubdivider(
00043             const osg::Matrixd& world2local =osg::Matrixd::identity(),
00044             const osg::Matrixd& local2world =osg::Matrixd::identity() );
00045 
00050         void setMaxElementsPerEBO( unsigned int value ) {
00051             _maxElementsPerEBO = value; }
00052 
00064         void run(
00065             osg::Geometry&   geom, 
00066             double           granurality_radians,
00067             GeoInterpolation interp =GEOINTERP_RHUMB_LINE );
00068 
00069     protected:
00070         osg::Matrixd _local2world, _world2local;
00071         unsigned int _maxElementsPerEBO;
00072     };
00073 
00074 } } // namespace osgEarth::Symbology
00075 
00076 #endif // OSGEARTHSYMBOLOGY_MESH_SUBDIVIDER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines