osgEarth 2.1.1

/home/cube/sources/osgearth/src/osgEarthFeatures/Filter

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 OSGEARTHFEATURES_FILTER_H
00020 #define OSGEARTHFEATURES_FILTER_H 1
00021 
00022 #include <osgEarthFeatures/Common>
00023 #include <osgEarthFeatures/Feature>
00024 #include <osgEarthFeatures/FilterContext>
00025 #include <osg/Matrixd>
00026 #include <list>
00027 
00028 
00029 namespace osgEarth { namespace Features
00030 {
00031     using namespace osgEarth;
00032 
00036     class Filter : public osg::Referenced
00037     {
00038     };
00039 
00043     class OSGEARTHFEATURES_EXPORT FeatureFilter : public Filter
00044     {
00045     public:
00046         virtual FilterContext push( FeatureList& input, FilterContext& context ) =0;
00047     };
00048 
00049     typedef std::list< osg::ref_ptr<FeatureFilter> > FeatureFilterList;
00050 
00054     class OSGEARTHFEATURES_EXPORT FeaturesToNodeFilter : public Filter
00055     {
00056     public:
00057         virtual osg::Node* push( FeatureList& input, FilterContext& context ) =0;
00058 
00059     public:
00060 
00061         const osg::Matrixd& local2world() const { return _local2world; }
00062 
00063         const osg::Matrixd& world2local() const { return _world2local; }
00064         
00065     protected:
00066 
00067         // computes the matricies required to localizer/delocalize double-precision coords
00068         void computeLocalizers( const FilterContext& context );
00069 
00071         osg::Node*  delocalize( osg::Node* node ) const;
00072         osg::Group* delocalizeAsGroup( osg::Node* node ) const;
00073         osg::Group* createDelocalizeGroup() const;
00074 
00075 
00076         osg::Matrixd _world2local, _local2world;   // for coordinate localization
00077     };
00078 
00079 } } // namespace osgEarth::Features
00080 
00081 #endif // OSGEARTHFEATURES_FILTER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines