LineSegmentIndex.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2006 Refractions Research Inc.
00007  *
00008  * This is free software; you can redistribute and/or modify it under
00009  * the terms of the GNU Lesser General Licence as published
00010  * by the Free Software Foundation. 
00011  * See the COPYING file for more information.
00012  *
00013  **********************************************************************
00014  *
00015  * Last port: simplify/LineSegmentIndex.java rev. 1.1 (JTS-1.7.1)
00016  *
00017  **********************************************************************
00018  *
00019  * NOTES
00020  *
00021  **********************************************************************/
00022 
00023 #ifndef GEOS_SIMPLIFY_LINESEGMENTINDEX_H
00024 #define GEOS_SIMPLIFY_LINESEGMENTINDEX_H
00025 
00026 #include <geos/export.h>
00027 #include <vector>
00028 #include <memory> // for auto_ptr
00029 
00030 #ifdef _MSC_VER
00031 #pragma warning(push)
00032 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00033 #endif
00034 
00035 // Forward declarations
00036 namespace geos {
00037         namespace geom {
00038                 class Envelope;
00039                 class LineSegment;
00040         }
00041         namespace simplify {
00042                 class TaggedLineString;
00043         }
00044         namespace index {
00045                 namespace quadtree {
00046                         class Quadtree;
00047                 }
00048         }
00049 }
00050 
00051 namespace geos {
00052 namespace simplify { // geos::simplify
00053 
00054 class GEOS_DLL LineSegmentIndex {
00055 
00056 public:
00057 
00058         LineSegmentIndex();
00059 
00060         ~LineSegmentIndex();
00061 
00062         void add(const TaggedLineString& line);
00063 
00064         void add(const geom::LineSegment* seg);
00065 
00066         void remove(const geom::LineSegment* seg);
00067 
00068         std::auto_ptr< std::vector<geom::LineSegment*> >
00069                         query(const geom::LineSegment* seg) const;
00070 
00071 private:
00072 
00073         std::auto_ptr<index::quadtree::Quadtree> index;
00074 
00075         std::vector<geom::Envelope*> newEnvelopes;
00076         
00077         // Copying is turned off
00078         LineSegmentIndex(const LineSegmentIndex&);
00079         LineSegmentIndex& operator=(const LineSegmentIndex&);
00080 };
00081 
00082 } // namespace geos::simplify
00083 } // namespace geos
00084 
00085 #ifdef _MSC_VER
00086 #pragma warning(pop)
00087 #endif
00088 
00089 #endif // GEOS_SIMPLIFY_LINESEGMENTINDEX_H

Generated on 10 Sep 2013 for GEOS by  doxygen 1.4.7