GEOS: LineSegmentIndex.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

# LineSegmentIndex.h

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