• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

EdgeNodingValidator.h

00001 /**********************************************************************
00002  * $Id: EdgeNodingValidator.h 2557 2009-06-08 09:30:55Z strk $
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 // Forward declarations
00033 namespace geos {
00034         namespace geom {
00035                 class CoordinateSequence;
00036         }
00037         namespace noding {
00038                 class SegmentString;
00039         }
00040         namespace geomgraph {
00041                 class Edge;
00042         }
00043 }
00044 
00045 namespace geos {
00046 namespace geomgraph { // geos.geomgraph
00047 
00053 class GEOS_DLL EdgeNodingValidator {
00054 
00055 private:
00056         std::vector<noding::SegmentString*>& toSegmentStrings(std::vector<Edge*>& edges);
00057 
00058         // Make sure this member is initialized *before*
00059         // the NodingValidator, as initialization of
00060         // NodingValidator will use toSegmentString(), that
00061         // in turn expects this member to be initialized
00062         std::vector<noding::SegmentString*> segStr;
00063 
00064         // Make sure this member is initialized *before*
00065         // the NodingValidator, as initialization of
00066         // NodingValidator will use toSegmentString(), that
00067         // in turn expects this member to be initialized
00068         std::vector<geom::CoordinateSequence*> newCoordSeq;
00069 
00070         noding::FastNodingValidator nv;
00071 
00072 public:
00073 
00085         static void checkValid(std::vector<Edge*>& edges)
00086         {
00087                 EdgeNodingValidator validator(edges);
00088                 validator.checkValid();
00089         }
00090 
00091         EdgeNodingValidator(std::vector<Edge*>& edges)
00092                 :
00093                 segStr(), 
00094                 newCoordSeq(),
00095                 nv(toSegmentStrings(edges))
00096         {}
00097 
00098         ~EdgeNodingValidator();
00099 
00100         void checkValid() { nv.checkValid(); }
00101 };
00102 
00103 
00104 } // namespace geos.geomgraph
00105 } // namespace geos
00106 
00107 //#ifdef GEOS_INLINE
00108 //# include "geos/geomgraph/EdgeNodingValidator.inl"
00109 //#endif
00110 
00111 #endif // ifndef GEOS_GEOMGRAPH_EDGENODINGVALIDATOR_H
00112 
00113 /**********************************************************************
00114  * $Log$
00115  * Revision 1.2  2006/03/24 09:52:41  strk
00116  * USE_INLINE => GEOS_INLINE
00117  *
00118  * Revision 1.1  2006/03/09 16:46:49  strk
00119  * geos::geom namespace definition, first pass at headers split
00120  *
00121  **********************************************************************/
00122 

Generated on Thu Jul 22 2010 for GEOS by  doxygen 1.7.1