osgEarth 2.1.1
|
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 00020 #ifndef OSGEARTH_ENGINE_OSGTERRAIN_EXTENDED_TERRAIN_TECHNIQUE 00021 #define OSGEARTH_ENGINE_OSGTERRAIN_EXTENDED_TERRAIN_TECHNIQUE 1 00022 00023 #include "Common" 00024 #include <osg/CopyOp> 00025 #include <osg/NodeVisitor> 00026 #include <osgEarth/Progress> 00027 00028 using namespace osgEarth; 00029 00030 class Tile; 00031 class TileUpdate; 00032 00033 class TerrainTechnique : public osg::Object 00034 { 00035 public: 00036 virtual void init() =0; 00037 00038 virtual void traverse( osg::NodeVisitor& nv ) =0; 00039 00040 virtual void releaseGLObjects( osg::State* state ) const =0; 00041 00042 protected: 00043 TerrainTechnique() : _tile(0L) { } 00044 00045 TerrainTechnique( const TerrainTechnique& rhs, const osg::CopyOp& op ) : _tile(0L) { } 00046 00047 Tile* _tile; 00048 00049 friend class Tile; 00050 }; 00051 00052 class CustomTerrainTechnique : public TerrainTechnique 00053 { 00054 public: 00055 virtual void compile( const TileUpdate& updateSpec, ProgressCallback* progress ) =0; 00056 00057 virtual bool applyTileUpdates() =0; 00058 00059 virtual void setParentTile( class Tile* tile ) =0; 00060 00061 virtual void setOptimizeTriangleOrientation( bool optimizeTriangleOrientation ) =0; 00062 00063 virtual bool getOptimizeTriangleOrientation() const =0; 00064 00065 00066 protected: 00067 CustomTerrainTechnique() { } 00068 00069 CustomTerrainTechnique( const CustomTerrainTechnique& rhs, const osg::CopyOp& op ) 00070 : TerrainTechnique( rhs, op ) { } 00071 }; 00072 00073 #endif // OSGEARTH_ENGINE_OSGTERRAIN_EXTENDED_TERRAIN_TECHNIQUE