| 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/TeExternalTheme.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002  TerraLib - a library for developing GIS applications.
    00003 Copyright © 2001-2006 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 *************************************************************************************/
    00028 #ifndef  __TERRALIB_INTERNAL_EXTERNALTHEME_H
    00029 #define  __TERRALIB_INTERNAL_EXTERNALTHEME_H
    00030
    00031 #include <map>
    00032 #include <string>
    00033
    00034 #include "TeTheme.h"
    00035
    00040 TL_DLL bool TeLoadConnectionsInfo(TeDatabase* sourceDB);
    00041
    00042
    00044
    00052 class TL_DLL TeExternalTheme : public TeTheme
    00053 {
    00054            public:
    00055
    00057                       TeExternalTheme(TeDatabase* sourceDb, TeTheme* remoteTheme, const int& viewId,
    00058                                  const string& name = "");
    00059
    00061                       virtual ~TeExternalTheme();
    00062
    00064                       TeExternalTheme& operator=(TeExternalTheme& rhs);
    00065
    00070
    00071                       virtual TeViewNode* clone();
    00072
    00073         virtual TeTheme* getRemoteTheme() const;
    00074
    00075                       virtual void setRemoteTheme(TeTheme* theme);
    00076
    00077         virtual TeDatabase* getSourceDatabase();
    00078
    00079                       virtual void setSourceDatabase(TeDatabase* srcDB);
    00080
    00081                       virtual string getRemoteThemeName();
    00083
    00084
    00089                       virtual void loadObjectLegendMap();
    00090
    00091                       virtual int getGridStatus(const int uniqueId, const std::string objectId);
    00092
    00093                       virtual int getObjectStatus(const std::string objectId);
    00094
    00095                       virtual bool setObjectLegendStatusMap(const std::string objId, const int status);
    00096
    00097                       virtual bool setObjectGridStatusMap(const std::string objId, const int uniqueId, const int status);
    00099
    00104
    00108                       virtual int layerId();
    00109
    00114                       virtual void layerId(int i);
    00115
    00119                       virtual void layer(TeLayer* layer);
    00120
    00124                       virtual TeLayer* layer();
    00125
    00127                       virtual TeProjection* getThemeProjection();
    00128
    00130
    00135
    00139                       virtual bool hasRestriction();
    00140
    00144                       virtual bool hasAttrRest();
    00145
    00149                       virtual bool hasTemporalRest();
    00150
    00154                       virtual bool hasSpatialRest();
    00155
    00159                       virtual string sqlWhereRestrictions(TeRepresentation* rep = 0);
    00160
    00162
    00167
    00171                       virtual void loadTablesJoin(const string& geomTable = "");
    00172
    00178                       virtual string sqlGridJoin();
    00179
    00185                       virtual string sqlGridFrom(const string& geomTable="");
    00186
    00187                       virtual bool save();
    00188
    00189         virtual bool save(const bool& copyExternalCollection);
    00191                       virtual bool save(TeDatabase* db, const bool& copyExternalCollection = true);
    00192
    00196                       virtual bool createCollectionAuxTable();
    00197
    00201                       virtual bool populateCollectionAux(std::string objectId = "");
    00202
    00204
    00206                       virtual bool buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll,
    00207                                                         vector<double>* dValuesVec = 0);
    00208
    00210                       virtual bool buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec);
    00211
    00213                       virtual bool saveGrouping(TeSelectedObjects selectedObjects = TeAll);
    00214
    00216                       virtual bool saveLegendInCollection(TeSelectedObjects selectedObjects = TeAll, std::string objectId = "");
    00217
    00219                       virtual bool saveLegendInCollection(TeDatabase* db, TeSelectedObjects selectedObjects = TeAll, std::string objectId = "");
    00220
    00222                       virtual void setLegendsForObjects();
    00223
    00225                       virtual bool generateLabelPositions(const std::string& objectId = "");
    00226
    00228                       virtual bool deleteGrouping();
    00229
    00231                       virtual void createRasterVisual(TeRaster* rst = 0);
    00232
    00238
    00240                       virtual bool addThemeTable(TeTable& table);
    00241
    00243                       virtual void addThemeTable(string tableName);
    00244
    00246                       virtual bool isThemeTable(int tableId);
    00247
    00249                       virtual bool isThemeTable(string tableName);
    00250
    00252                       virtual TeAttrTableVector& attrTables();
    00253
    00255                       virtual bool setAttTables(TeAttrTableVector& attrs);
    00256
    00258                       virtual bool getAttTables(TeAttrTableVector& attrs, TeAttrTableType attType = TeAllAttrTypes);
    00259
    00261                       virtual bool getTable(TeTable& table, const string tableName);
    00262
    00264                       virtual void clearAttTableVector();
    00265
    00269                       virtual bool getTemporalTable(TeTable& table);
    00270
    00272                       virtual bool removeThemeTable(unsigned int index);
    00273
    00275                       virtual string getTableName(const string& attrName);
    00276
    00278                       virtual string getAttribute(unsigned int index);
    00279
    00281                       virtual bool loadThemeTables();
    00282
    00284                       virtual  TeAttributeList sqlAttList();
    00285
    00287                       virtual void clearAttList();
    00288
    00290                       virtual TeAttributeList sqlNumAttList();
    00291
    00293                       virtual void clearNumAttList();
    00294
    00296                       virtual string sqlJoin();
    00297
    00299                       virtual string sqlFrom();
    00300
    00302                       virtual vector<string>&          aliasVector();
    00303
    00305                       virtual void loadAliasVector();
    00306
    00310                       virtual void loadAttrLists();
    00312
    00317
    00318                       virtual bool locatePolygon(TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0);
    00319                       virtual bool locatePolygonSet(TeCoord2D &pt, double tol, TePolygonSet &polygons);
    00320                       virtual bool locateLine(TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0);
    00321                       virtual bool locatePoint(TeCoord2D &pt, TePoint &point, const double& tol = 0.0);
    00322                       virtual bool locateCell(TeCoord2D &pt, TeCell &c, const double& tol = 0.0);
    00323
    00325
    00328                       virtual bool hasObjectsWithoutGeometries(TeGeomRep geomRep);
    00329
    00332                       virtual bool removeObjectsWithoutGeometries(TeGeomRep geomRep);
    00333
    00338                       static int createExternalThemeTable(TeDatabase* sourceDB);
    00339
    00341                       virtual bool saveMetadata(TeDatabase* db);
    00342
    00345                       bool getRemoteThemeInfo(int& remoteThemeId, int& databaseId);
    00346
    00349                       void setRemoteDbId(const int& removeDbId);
    00350
    00351            protected:
    00352
    00355                       //virtual void loadThemeTablesJoin();
    00356
    00359                       virtual bool populateCollection(std::string objectId = "", const bool& sincronize = true);
    00360
    00363                       virtual void createLegendMapId(std::map<int, int>& mapIdLegend);
    00364
    00367                       virtual bool copyRemoteCollection(std::map<int, int>& mapIdLegend);
    00368
    00370                       virtual bool loadMetadata(TeDatabase* db);
    00371
    00373                       virtual bool eraseMetadata(TeDatabase* db);
    00374
    00376                       virtual bool beforeCopyThemeTo(TeAbstractTheme* absThemeCopy, TeDatabase* outputDatabase);
    00377
    00378            protected:
    00380                       TeTheme* remoteTheme_;
    00381         TeDatabase* sourceDB_;
    00382         int remoteDbId_;
    00383 };
    00384
    00385
    00387 class TL_DLL TeExternalThemeFactory : public TeViewNodeFactory
    00388 {
    00389 public:
    00391            TeExternalThemeFactory() : TeViewNodeFactory((int)TeEXTERNALTHEME)
    00392            {}
    00393
    00395            TeViewNode* build(TeViewNodeParams* params)
    00396            {
    00397                       TeViewNodeParams auxParams = *params;
    00398         return new TeExternalTheme(NULL, NULL, params->viewId_, params->name_);
    00399            }
    00400
    00402            TeViewNode* build()
    00403            {
    00404                       return new TeExternalTheme(NULL, NULL, -1);
    00405            }
    00406 };
    00407
    00408 namespace
    00409 {
    00410   static TeExternalThemeFactory externalThemeFactory;
    00411 };
    00412
    00413 #endif     // __TERRALIB_INTERNAL_REMOTETHEME_H
    00414

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines