| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeLegendEntry.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00026 #ifndef  __TERRALIB_INTERNAL_LEGENDENTRY_H
    00027 #define  __TERRALIB_INTERNAL_LEGENDENTRY_H
    00028
    00029 #include <string>
    00030 #include <vector>
    00031 #include <map>
    00032
    00033 using namespace std;
    00034
    00035 #include "TeUtils.h"
    00036 #include "TeDataTypes.h"
    00037 #include "TeSlice.h"
    00038 #include "TeVisual.h"
    00039
    00040 class TeTheme;
    00041 struct TeColor;
    00042
    00044 typedef map<TeGeomRep,TeVisual*> TeGeomRepVisualMap;
    00045
    00046
    00048
    00054 class TL_DLL TeLegendEntry
    00055 {
    00056 public:
    00057
    00059            TeLegendEntry () :
    00060                       label_(""),
    00061                       id_(-1),
    00062                       theme_(0),
    00063                       group_(0)
    00064                       {}
    00065
    00067            TeLegendEntry (const TeSlice& slice);
    00068
    00070            TeLegendEntry (const TeLegendEntry& leg);
    00071
    00073            TeLegendEntry& operator = (const TeLegendEntry& leg);
    00074
    00076            virtual ~TeLegendEntry()
    00077            {          clear(); }
    00078
    00080            void clear();
    00081
    00083            int        id ()
    00084            { return id_; }
    00086            void id (int i) { id_ = i; }
    00087
    00089            int        theme () { return theme_; }
    00091            void theme (int i) { theme_ = i; }
    00092
    00094            int        group () { return group_; }
    00096            void group (int i) { group_ = i; }
    00097
    00099            TeVisual* visual (TeGeomRep rep, const string& visualType="tevisual");
    00100
    00102            void setVisual (TeVisual* vis, TeGeomRep rep);
    00103
    00105            void setVisual (TeVisual& vis, TeGeomRep rep);
    00106
    00108            TeGeomRepVisualMap& getVisualMap()
    00109            {          return visualMap_; }
    00110
    00112            TeSlice& slice()
    00113            {  return slice_; }
    00114            // Sets the slice associated to this legend
    00115            void setSlice(const TeSlice& sl)
    00116            {          slice_ = sl; }
    00118            int count()
    00119            { return slice_.count_; }
    00121            void count(int n)
    00122            { slice_.count_ = n; }
    00124            void incCount(int n=1)
    00125            {          slice_.count_ += n; }
    00126
    00128            string from()
    00129            {          return slice_.from_; }
    00131            void from(string& s)
    00132            { slice_.from_ = s; }
    00133
    00135            string to()
    00136            {          return slice_.to_; }
    00138            void to(string& s)
    00139            {          slice_.to_ = s; }
    00140
    00142            string label();
    00143
    00145            void label(string& s)
    00146            {          label_ = s; }
    00147
    00149            void color(TeColor& color);
    00150
    00151 private:
    00152
    00153            TeGeomRepVisualMap    visualMap_;
    00154            TeSlice                                     slice_;
    00155            string                                      label_;
    00156            int                                                    id_;
    00157            int                                                    theme_;
    00158            int                                                    group_;
    00159 };
    00160
    00162 typedef vector<TeLegendEntry> TeLegendEntryVector;
    00163
    00165 typedef map<int, TeLegendEntry*> TeLegendEntryMap;
    00166
    00167 #endif
    00168

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines