osgEarth 2.1.1

/home/cube/sources/osgearth/src/osgEarthFeatures/FeatureListSource

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 
00020 #ifndef OSGEARTHFEATURES_FEATURELIST_SOURCE_H
00021 #define OSGEARTHFEATURES_FEATURELIST_SOURCE_H 1
00022 
00023 #include <osgEarthFeatures/Common>
00024 #include <osgEarthFeatures/Feature>
00025 #include <osgEarthFeatures/FeatureCursor>
00026 #include <osgEarthFeatures/FeatureSource>
00027 
00028 #include <osgEarth/Profile>
00029 #include <osgEarth/GeoData>
00030 
00031 namespace osgEarth { namespace Features
00032 {   
00033     class OSGEARTHFEATURES_EXPORT FeatureListSource : public osgEarth::Features::FeatureSource
00034     {
00035     public:
00036         FeatureListSource();
00037 
00038         virtual FeatureCursor* createFeatureCursor( const Symbology::Query& query );
00039 
00040         virtual bool isWritable() const { return true; }
00041         virtual bool deleteFeature(FeatureID fid);
00042         virtual int getFeatureCount() const { return _features.size(); }
00043         virtual Feature* getFeature( FeatureID fid );
00044         virtual bool insertFeature(Feature* feature);
00045         virtual Geometry::Type getGeometryType() const { return Geometry::TYPE_UNKNOWN; }
00046 
00047         FeatureList& getFeatures() { return _features; }
00048 
00049     public: // Styling
00050 
00051         virtual bool hasEmbeddedStyles() const { return false; }
00052 
00053 
00054     public: 
00055         virtual const char* className() const { return "FeatureListSource"; }
00056         virtual const char* libraryName() const { return "osgEarthFeatures"; }
00057 
00058         virtual void initialize( const std::string& referenceURI );
00059 
00060     protected:
00061         virtual const FeatureProfile* createFeatureProfile();
00062 
00063         FeatureList _features;
00064         osg::ref_ptr< FeatureProfile > _profile;
00065     };
00066 
00067 } } // namespace osgEarth::Features
00068 
00069 #endif // OSGEARTHFEATURES_FEATURELIST_SOURCE_H
00070 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines