GEOS
3.3.6
|
00001 /********************************************************************** 00002 * $Id: EdgeNodingValidator.h 3255 2011-03-01 17:56:10Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2005-2006 Refractions Research Inc. 00008 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00009 * 00010 * This is free software; you can redistribute and/or modify it under 00011 * the terms of the GNU Lesser General Public Licence as published 00012 * by the Free Software Foundation. 00013 * See the COPYING file for more information. 00014 * 00015 ********************************************************************** 00016 * 00017 * Last port: geomgraph/EdgeNodingValidator.java rev. 1.6 (JTS-1.10) 00018 * 00019 **********************************************************************/ 00020 00021 00022 #ifndef GEOS_GEOMGRAPH_EDGENODINGVALIDATOR_H 00023 #define GEOS_GEOMGRAPH_EDGENODINGVALIDATOR_H 00024 00025 #include <geos/export.h> 00026 #include <vector> 00027 00028 #include <geos/noding/FastNodingValidator.h> // for composition 00029 00030 #include <geos/inline.h> 00031 00032 #ifdef _MSC_VER 00033 #pragma warning(push) 00034 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00035 #endif 00036 00037 // Forward declarations 00038 namespace geos { 00039 namespace geom { 00040 class CoordinateSequence; 00041 } 00042 namespace noding { 00043 class SegmentString; 00044 } 00045 namespace geomgraph { 00046 class Edge; 00047 } 00048 } 00049 00050 namespace geos { 00051 namespace geomgraph { // geos.geomgraph 00052 00058 class GEOS_DLL EdgeNodingValidator { 00059 00060 private: 00061 std::vector<noding::SegmentString*>& toSegmentStrings(std::vector<Edge*>& edges); 00062 00063 // Make sure this member is initialized *before* 00064 // the NodingValidator, as initialization of 00065 // NodingValidator will use toSegmentString(), that 00066 // in turn expects this member to be initialized 00067 std::vector<noding::SegmentString*> segStr; 00068 00069 // Make sure this member is initialized *before* 00070 // the NodingValidator, as initialization of 00071 // NodingValidator will use toSegmentString(), that 00072 // in turn expects this member to be initialized 00073 std::vector<geom::CoordinateSequence*> newCoordSeq; 00074 00075 noding::FastNodingValidator nv; 00076 00077 public: 00078 00090 static void checkValid(std::vector<Edge*>& edges) 00091 { 00092 EdgeNodingValidator validator(edges); 00093 validator.checkValid(); 00094 } 00095 00096 EdgeNodingValidator(std::vector<Edge*>& edges) 00097 : 00098 segStr(), 00099 newCoordSeq(), 00100 nv(toSegmentStrings(edges)) 00101 {} 00102 00103 ~EdgeNodingValidator(); 00104 00105 void checkValid() { nv.checkValid(); } 00106 }; 00107 00108 00109 } // namespace geos.geomgraph 00110 } // namespace geos 00111 00112 #ifdef _MSC_VER 00113 #pragma warning(pop) 00114 #endif 00115 00116 //#ifdef GEOS_INLINE 00117 //# include "geos/geomgraph/EdgeNodingValidator.inl" 00118 //#endif 00119 00120 #endif // ifndef GEOS_GEOMGRAPH_EDGENODINGVALIDATOR_H 00121 00122 /********************************************************************** 00123 * $Log$ 00124 * Revision 1.2 2006/03/24 09:52:41 strk 00125 * USE_INLINE => GEOS_INLINE 00126 * 00127 * Revision 1.1 2006/03/09 16:46:49 strk 00128 * geos::geom namespace definition, first pass at headers split 00129 * 00130 **********************************************************************/ 00131