osgEarth 2.1.1
|
00001 /* -*-c++-*- */ 00002 /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph 00003 * Copyright 2008-2009 Pelican Ventures, Inc. 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 OSGEARTH_DROAM_ENGINE_GEODETIC_MANIFOLD_H 00020 #define OSGEARTH_DROAM_ENGINE_GEODETIC_MANIFOLD_H 1 00021 00022 #include "Manifold" 00023 #include "MeshManager" 00024 #include "Diamond" 00025 #include <osg/CoordinateSystemNode> 00026 #include <osgEarth/Profile> 00027 00029 class GeodeticManifold : public Manifold 00030 { 00031 public: 00032 GeodeticManifold(); 00033 00034 public: 00036 void seed( Level maxLevel ); 00037 00039 void cull( osgUtil::CullVisitor* cv ); 00040 00041 public: // Manifold overrides 00042 00044 void initialize( MeshManager* mesh ); // override 00045 00047 osg::Vec3d midpoint( const osg::Vec3d& mapCoord0, const osg::Vec3d& mapCoord1 ) const; 00048 00050 osg::BoundingSphere initialBound() const; 00051 00053 MeshNode createNode( const osg::Vec3d& manifoldCoord ) const; 00054 00055 public: 00056 osg::BoundingSphere _bs; 00057 osg::ref_ptr<const Profile> _profile; 00058 osg::ref_ptr<const osg::EllipsoidModel> _ellipsoid; 00059 osg::ref_ptr<Diamond> _vd[6]; // vertex diamonds 00060 osg::ref_ptr<Diamond> _fd[4]; // intermediate base diamonds 00061 osg::ref_ptr<Diamond> _ed[8]; // first geometry diamonds 00062 00063 osg::Vec3d p(double x, double y, double z); 00064 }; 00065 00066 #endif // OSGEARTH_DROAM_ENGINE_GEODETIC_MANIFOLD_H