osgEarth 2.1.1

/home/cube/sources/osgearth/src/osgEarthSymbology/TextSymbol

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 OSGEARTHSYMBOLOGY_TEXT_SYMBOL_H
00021 #define OSGEARTHSYMBOLOGY_TEXT_SYMBOL_H 1
00022 
00023 #include <osgEarthSymbology/Symbol>
00024 #include <osgEarthSymbology/Expression>
00025 #include <osg/Referenced>
00026 #include <vector>
00027 
00028 namespace osgEarth { namespace Symbology
00029 {
00033     class OSGEARTHSYMBOLOGY_EXPORT TextSymbol : public Symbol
00034     {
00035     public:
00036         enum SizeMode {
00037             SIZEMODE_SCREEN,
00038             SIZEMODE_OBJECT
00039         };
00040 
00041         enum LineOrientation {
00042             LINEORIENTATION_PARALLEL,
00043             LINEORIENTATION_PERPENDICULAR,
00044             LINEORIENTATION_HORIZONTAL
00045         };
00046 
00047         enum LinePlacement {
00048             LINEPLACEMENT_ALONG_LINE,
00049             LINEPLACEMENT_CENTROID
00050         };
00051 
00052         TextSymbol( const Config& conf =Config() );
00053 
00055         optional<Fill>& fill() { return _fill; }
00056         const optional<Fill>& fill() const { return _fill; }
00057 
00059         optional<Stroke>& halo() { return _halo; }
00060         const optional<Stroke>& halo() const { return _halo; }
00061 
00063         optional<std::string>& font() { return _font; }
00064         const optional<std::string>& font() const { return _font; }
00065 
00067         optional<StringExpression>& content() { return _content; }
00068         const optional<StringExpression>& content() const { return _content; }
00069 
00071         optional<NumericExpression>& priority() { return _priority; }
00072         const optional<NumericExpression>& priority() const { return _priority; }
00073 
00075         optional<float>& size() { return _size; }
00076         const optional<float>& size() const { return _size; }
00077 
00079         optional<bool>& rotateToScreen() { return _rotateToScreen; }
00080         const optional<bool>& rotateToScreen() const { return _rotateToScreen; }
00081 
00083         optional<osg::Vec2s>& pixelOffset() { return _pixelOffset; }
00084         const optional<osg::Vec2s>& pixelOffset() const { return _pixelOffset; }
00085 
00087         optional<bool>& removeDuplicateLabels() { return _removeDuplicateLabels; }
00088         const optional<bool>& removeDuplicateLabels() const { return _removeDuplicateLabels; }
00089 
00091         optional<SizeMode>& sizeMode() { return _sizeMode; }
00092         const optional<SizeMode>& sizeMode() const { return _sizeMode; }
00093 
00095         optional<LineOrientation>& lineOrientation() { return _lineOrientation; }
00096         const optional<LineOrientation>& lineOrientation() const { return _lineOrientation; }
00097 
00099         optional<LinePlacement>& linePlacement() { return _linePlacement; }
00100         const optional<LinePlacement>& linePlacement() const { return _linePlacement; }
00101 
00103         optional<std::string>& provider() { return _provider; }
00104         const optional<std::string>& provider() const { return _provider; }
00105 
00106     public:
00107         virtual Config getConfig() const;
00108         virtual void mergeConfig( const Config& conf );
00109 
00110     protected:
00111         optional<Fill>              _fill;
00112         optional<Stroke>            _halo;
00113         optional<std::string>       _font;
00114         optional<float>             _size;
00115         optional<StringExpression>  _content;
00116         optional<NumericExpression> _priority;
00117         optional<bool>              _rotateToScreen;
00118         optional<bool>              _removeDuplicateLabels;
00119         optional<SizeMode>          _sizeMode;
00120         optional<LineOrientation>   _lineOrientation;
00121         optional<LinePlacement>     _linePlacement;
00122         optional<std::string>       _theme;
00123         optional<osg::Vec2s>        _pixelOffset;
00124         optional<std::string>       _provider;
00125     };
00126 
00127 } } // namespace osgEarth::Symbology
00128 
00129 #endif // OSGEARTHSYMBOLOGY_TEXT_SYMBOL_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines