TerraLib 4.1
E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeSTInstance.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 *************************************************************************************/
00028 #ifndef  __TERRALIB_INTERNAL_STINSTANCE_H
00029 #define  __TERRALIB_INTERNAL_STINSTANCE_H
00030 
00031 #include "TeTimeInterval.h"
00032 #include "TeMultiGeometry.h"
00033 #include "TeBaseSTInstance.h"
00034 
00035 #include <string>
00036 #include <map> 
00037 #include <vector>
00038 using namespace std;
00039 
00051 class TL_DLL TeSTInstance : public TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>
00052 {
00053 public:               
00054 
00056            TeSTInstance() : 
00057                       TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>() 
00058            { }
00059 
00061            TeSTInstance (const string& object_id, TeProperty& prop); 
00062 
00064            TeSTInstance (const string& object_id, vector<string>& prop, TeAttributeList* attList = 0, const int& s = -1) : 
00065                       TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>(object_id, prop, attList, s)
00066            { }
00067 
00069            TeSTInstance (const string& object_id, const TeMultiGeometry& geometries, 
00070                       const TeTimeInterval& time, const int& s = -1) : 
00071                       TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>(object_id, geometries, time, s)
00072            { }
00073 
00075            TeSTInstance (const string& object_id, vector<string>& prop, TeAttributeList* attList, 
00076                       TeMultiGeometry& geometries, int& slice, TeTimeInterval& time ) :
00077                       TeBaseSTInstance<TeMultiGeometry, TeTimeInterval>(object_id, prop, attList, geometries, slice, time)
00078            { }
00079 
00081            virtual void clear(); 
00082            
00084            virtual bool isTimeValid();
00085            
00087            bool hasPolygons();   
00089            bool hasLines();                 
00091            bool hasPoints();                
00093            bool hasCells();                 
00095            bool hasTexts();                 
00096            
00098            bool getGeometry(TePolygonSet& result); 
00100            bool getGeometry(TeLineSet& result);
00102            bool getGeometry(TePointSet& result);
00104            bool getGeometry(TeCellSet& result);
00106            bool getGeometry(TeTextSet& result);
00108            bool getGeometry(vector<TeGeometry*>& result);
00110            bool getGeometry(TeMultiGeometry& result);
00111 
00113            TePolygonSet&  getPolygons();
00115            TeLineSet&  getLines();
00117            TePointSet&  getPoints();
00119            TeCellSet&  getCells();
00121            TeTextSet&  getTexts();
00122 
00124            void setGeometry(const TePolygonSet& result); 
00126            void setGeometry(const TeLineSet& result);
00128            void setGeometry(const TePointSet& result);
00130            void setGeometry(const TeCellSet& result);
00132            void setGeometry(const TeTextSet& result);
00134            void setGeometry(const TeMultiGeometry& result);
00135                                  
00137            bool addGeometry(const TePolygon& poly);  
00139            bool addGeometry(const TeLine2D& line);
00141            bool addGeometry(const TePoint& point);     
00143            bool addGeometry(const TeCell& cell);                  
00145            bool addGeometry(const TeText& cell);                  
00146 
00148            virtual void centroid(TeCoord2D& centroid, TeGeomRep geomRep=TeGEOMETRYNONE); 
00149            
00151            virtual void area(double& a, TeGeomRep geomRep=TeGEOMETRYNONE);
00152 
00154            virtual TeTimeInterval timeInterval () 
00155            {          return getTime();     }
00156            
00158            virtual void timeInterval (const TeTimeInterval& t) 
00159            {          setTime(t);           }
00160 
00162            virtual string getInitialDateTime(const string& mask="YYYYsMMsDDsHHsmmsSS") 
00163            {          return time_.getInitialDateTime(mask);      }
00164            
00166            virtual string getFinalDateTime(const string& mask="YYYYsMMsDDsHHsmmsSS") 
00167            {          return time_.getFinalDateTime(mask);        }
00168            
00169 };
00170 
00172 typedef vector<TeSTInstance>  TeSTElement;
00173 
00174 #endif 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines