osgEarth 2.1.1
|
00001 /* -*-c++-*- */ 00002 /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph 00003 * Copyright 2010 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 00020 #ifndef SEAMLESS_GEOPATCH 00021 #define SEAMLESS_GEOPATCH 1 00022 // Patch subclass for the Geographic (whole earth) patch 00023 // implementation. 00024 00025 #include "Patch" 00026 00027 #include <osg/Vec3> 00028 #include <osg/Vec2d> 00029 00030 #include <osgEarth/TileKey> 00031 00032 namespace seamless 00033 { 00034 class Geographic; 00035 00036 class GeoPatch : public Patch 00037 { 00038 public: 00039 GeoPatch(); 00040 GeoPatch(const osgEarth::TileKey& key); 00041 GeoPatch(const GeoPatch& rhs, 00042 const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); 00043 00044 META_Node(seamless, GeoPatch); 00045 00046 virtual float getEdgeError(const osg::Vec3& eye, int edge); 00047 void setGeographic(Geographic*); 00048 Geographic* getGeographic() const; 00049 protected: 00050 int _face; 00051 double _edgeLengths[4]; 00052 osg::Vec2d _faceCoords[4]; 00053 }; 00054 00055 } 00056 #endif