| 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/TeSTEvent.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_STEVENT_H
    00029 #define  __TERRALIB_INTERNAL_STEVENT_H
    00030
    00031 #include "TeBaseSTInstance.h"
    00032 #include "TeBaseSTInstanceSet.h"
    00033 #include "TeGeometry.h"
    00034 #include "TeKdTree.h"
    00035
    00036
    00047 class TL_DLL TeSTEvent : public TeBaseSTInstance<TePoint, long>
    00048 {
    00049 public:
    00050
    00052            TeSTEvent() : TeBaseSTInstance<TePoint, long>()
    00053            { }
    00054
    00056            TeSTEvent(const string& objId, const TePoint& point, const long& time) :
    00057                       TeBaseSTInstance<TePoint, long>(objId, point, time)
    00058            { }
    00059
    00061            TeSTEvent(const string& objId, const TePoint& point, const vector<string>& attrValues,
    00062                       TeAttributeList* attList, const long& time) :
    00063                       TeBaseSTInstance<TePoint, long>(objId, attrValues, attList, point, -1, time)
    00064            { }
    00065
    00067            virtual void clear();
    00068
    00070            virtual bool isTimeValid();
    00071
    00073            void getGeometry(TePoint& result)
    00074            {          result = this->geometries(); }
    00075
    00077            virtual TeTimeInterval timeInterval ()
    00078            {          TeTimeInterval t; return t;      }
    00079 };
    00080
    00081
    00092 class TL_DLL TeSTEventSet : public TeBaseSTInstanceSet<TePoint, long, TeSTEvent>
    00093 {
    00094 protected:
    00095
    00096            typedef TeSAM::TeAdaptativeKdTreeNode<TeCoord2D, vector<TePoint>, TePoint> kdNode;
    00097            typedef TeSAM::TeAdaptativeKdTree<kdNode> kdTree;
    00098
    00100            kdTree*               kdTree_;
    00101
    00103            bool buildImpl(TeQuerier* querier, const int& slide = -1);
    00104
    00105 public:
    00107            TeSTEventSet(TeTheme* theme=0, const TeAttributeList& attrList = TeAttributeList());
    00108
    00110            ~TeSTEventSet();
    00111
    00113            virtual bool buildKdTree(const int& n);
    00114
    00116            virtual bool search(const TeBox& b, vector<TeSTEvent* >& result);
    00117
    00119            virtual bool nearestNeighbourSearch(const TeCoord2D& coord, vector<TeSTEvent* >& result, vector<double>& distances, const unsigned int& k);
    00120
    00122            virtual void clear();
    00123 };
    00124
    00125 #endif
    00126
    00127
    00128
    00129
    00130
    00131
    00132

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines