| 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/TeIntersector.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 *************************************************************************************/
    00030 #ifndef  __TERRALIB_INTERNAL_INTERSECTOR2_H
    00031 #define  __TERRALIB_INTERNAL_INTERSECTOR2_H
    00032
    00033 //TerraLib's include
    00034 #include "TeCoord2D.h"
    00035 #include "TeRTree.h"
    00036
    00037 //STL's include
    00038 #include <vector>
    00039
    00040 using namespace std;
    00041
    00042 /*
    00043  *  WARNING: These data structures and algorithms MUST BE USED ONLY BY TerraLib kernel and should NOT be used by anyone because
    00044  *           the support and interfaces can be changed in future. THIS IS FOR INTERNAL USE ONLY.
    00045  */
    00046
    00049 namespace TeINTERSECTOR2
    00050 {
    00052 #define EPSILON_COMPARE 1.0e-15
    00053
    00059
    00060 struct TL_DLL TeBoundaryIP
    00061 {
    00062            vector<TeCoord2D> coords_;
    00063
    00064            unsigned int redSegNum_;
    00065            unsigned int redPartNum_;
    00066            unsigned int redPolNum_;
    00067
    00068            unsigned int blueSegNum_;
    00069            unsigned int bluePartNum_;
    00070            unsigned int bluePolNum_;
    00071 };
    00072
    00074 typedef vector<TeBoundaryIP> TeVectorBoundaryIP;
    00075
    00077 struct TL_DLL TeSegIdInPolygonSet
    00078 {
    00079            unsigned int polId_;
    00080            unsigned int lineId_;
    00081            unsigned int segId_;
    00082 };
    00083
    00085 typedef pair<TeSegIdInPolygonSet, TeSegIdInPolygonSet> TePairSegIdInPolygonSet;
    00086
    00088 typedef TeSAM::TeRTree<TeSegIdInPolygonSet, 8> TeSegmentRTree;
    00089
    00097 TL_DLL short TeCCW(const TeCoord2D& c1, const TeCoord2D& c2, const TeCoord2D& c3, bool& between);
    00098
    00108 TL_DLL bool TeIntersection(const TeCoord2D& a, const TeCoord2D& b, const TeCoord2D& c, const TeCoord2D& d, TeBoundaryIP& ips, TeSegmentIntersectionType& intersectionType);
    00109
    00110
    00119 TL_DLL bool TeIntersects(const TeCoord2D& a, const TeCoord2D& b, const TeCoord2D& c, const TeCoord2D& d, TeSegmentIntersectionType& intersectionType);
    00120
    00121
    00133 TL_DLL bool TeSafeIntersections(const TePolygonSet& redPols, const TePolygonSet& bluePols, TeVectorBoundaryIP& report);
    00134
    00148 TL_DLL bool TeSafeIntersections(const TeLine2D& redLine, const TeLine2D& blueLine, TeVectorBoundaryIP& report, const unsigned int& redObjId = 0, const unsigned int& blueObjId = 0);
    00149
    00157 TL_DLL bool TeIntersects(const TeLine2D& redLine, const TeLine2D& blueLine);
    00158
    00170 TL_DLL bool TeIntersection(const TePolygonSet& polygons, TeSegmentRTree& tree, TeVectorBoundaryIP& report);
    00171
    00183 TL_DLL bool TeIntersection(const TePolygonSet& redPolygons, TeSegmentRTree& redTree, const TePolygonSet& bluePolygons, TeINTERSECTOR2::TeVectorBoundaryIP& report);
    00184
    00195 TL_DLL bool TeIntersection(const TeLineSet& redLines, const TePolygonSet& bluePolygons, TeSegmentRTree& blueTree, TeINTERSECTOR2::TeVectorBoundaryIP& report);
    00196
    00202 TL_DLL bool TeIsSimple(const TePolygonSet& polygons, vector<TePairSegIdInPolygonSet>& selfIntersectionList);
    00203
    00208 TL_DLL void TeIndexPolygonSet(const TePolygonSet& polygons, TeSegmentRTree& tree);
    00209
    00212 }          // end namespace TeINTERSECTOR2
    00213 #endif //__TERRALIB_INTERNAL_INTERSECTOR2_H
    00214

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines