GEOS  3.4.2
GeometryNoder.h
00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2012  Sandro Santilli <strk@keybit.net>
00007  *
00008  * This is free software; you can redistribute and/or modify it under
00009  * the terms of the GNU Lesser General Public Licence as published
00010  * by the Free Software Foundation. 
00011  * See the COPYING file for more information.
00012  *
00013  **********************************************************************
00014  *
00015  * NOTE: this is not in JTS. JTS has a snapround/GeometryNoder though
00016  *
00017  **********************************************************************/
00018 
00019 #ifndef GEOS_NODING_GEOMETRYNODER_H
00020 #define GEOS_NODING_GEOMETRYNODER_H
00021 
00022 #include <geos/export.h>
00023 #include <geos/noding/SegmentString.h> // for NonConstVect
00024 
00025 #include <memory> // for auto_ptr
00026 
00027 // Forward declarations
00028 namespace geos {
00029         namespace geom {
00030     class Geometry;
00031   }
00032         namespace noding {
00033                 class Noder;
00034         }
00035 }
00036 
00037 namespace geos {
00038 namespace noding { // geos.noding
00039 
00040 class GEOS_DLL GeometryNoder
00041 {
00042 public:
00043 
00044   static std::auto_ptr<geom::Geometry> node(const geom::Geometry& geom);
00045 
00046   GeometryNoder(const geom::Geometry& g);
00047 
00048   std::auto_ptr<geom::Geometry> getNoded();
00049 
00050 private:
00051 
00052   const geom::Geometry& argGeom;
00053 
00054   SegmentString::NonConstVect lineList;
00055 
00056   static void extractSegmentStrings(const geom::Geometry& g,
00057                                     SegmentString::NonConstVect& to);
00058 
00059   Noder& getNoder();
00060 
00061   std::auto_ptr<Noder> noder;
00062 
00063   std::auto_ptr<geom::Geometry> toGeometry(SegmentString::NonConstVect& noded);
00064 
00065   GeometryNoder(GeometryNoder const&); /*= delete*/
00066   GeometryNoder& operator=(GeometryNoder const&); /*= delete*/
00067 };
00068 
00069 } // namespace geos.noding
00070 } // namespace geos
00071 
00072 #endif // GEOS_NODING_NODER_H