| 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/TeQuerierDB.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_QUERIER_DB_H
    00027 #define  __TERRALIB_INTERNAL_QUERIER_DB_H
    00028
    00029 #include "TeQuerierImpl.h"
    00030 #include "TeRepresentation.h"
    00031
    00032 class TeDatabasePortal;
    00033 class TeTimeInterval;
    00034 class TeTSEntry;
    00035
    00037 TL_DLL bool addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeSTInstance& sto, const int& linkIndex, const int& gIdIndex);
    00038 TL_DLL bool addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeSTInstance& sto, const int& linkIndex,
    00039                                  const int& geomIdIndex, TeTimeInterval time, const int& initTimeIndex, const int& finalTimeIndex);
    00040 TL_DLL bool addGeometry(TeDatabasePortal* portal, TeGeomRep geomRep, TeMultiGeometry& geometries);
    00041
    00042
    00044 class TL_DLL TeQuerierDB : public TeQuerierImpl
    00045 {
    00046 protected:
    00048            vector<TeDatabasePortal*>        portals_;
    00050            vector<TeRepresentation>         geomRepr_;
    00052            TeTable                                                           attrTable_;
    00054            bool                                                              flagPortal_;
    00055
    00057            map<int, vector<int> >                      uniqueIndex_;
    00058
    00060            vector<int>                      linkIndex_;
    00061
    00063            int                                         attrIndex1_;
    00065            int                                         attrIndex2_;
    00067            int                                         groupIndex_;
    00069            vector<int>                                            geomIndex1_;
    00071            vector<int>                                            geomIndex2_;
    00073            vector<int>                                            timeIndex1_;
    00075            vector<int>                                            timeIndex2_;
    00076
    00078            map<int, int>                               legendIdGroup_;
    00079
    00081            void clearVectors();
    00082
    00084            virtual string sqlWhereRestrictions(TeRepresentation* rep=0);
    00085
    00087            string sqlFrom(string geomTable="");
    00088
    00089 public:
    00091            TeQuerierDB(TeQuerierParams* params): TeQuerierImpl(params), flagPortal_(false)
    00092            {}
    00093
    00095            virtual ~TeQuerierDB();
    00096
    00098            TeTheme* theme() {    return params_->theme();         }
    00099
    00101            TeLayer* layer() {    return  params_->theme()->layer(); }
    00102
    00104            TeGeomRep geometryRep();
    00105
    00107            virtual bool loadInstances(TeTSEntry* ent=0) = 0;
    00108
    00110            virtual bool fetchInstance(TeSTInstance& stoi) = 0;
    00111
    00113            virtual bool loadGeometries(TeMultiGeometry& geometries, unsigned int& index);
    00114
    00116            virtual bool loadGeometries(TeMultiGeometry& geometries);
    00117
    00119            void clear();
    00120 };
    00121
    00122 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines