GEOS: LineSegmentIndex.h Source File

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

# LineSegmentIndex.h

    00001 /**********************************************************************
    00002  * $Id: LineSegmentIndex.h 1820 2006-09-06 16:54:23Z 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 <vector>
    00028 #include <memory> // for auto_ptr
    00029
    00030 // Forward declarations
    00031 namespace geos {
    00032         namespace geom {
    00033                 class Envelope;
    00034                 class LineSegment;
    00035         }
    00036         namespace simplify {
    00037                 class TaggedLineString;
    00038         }
    00039         namespace index {
    00040                 namespace quadtree {
    00041                         class Quadtree;
    00042                 }
    00043         }
    00044 }
    00045
    00046 namespace geos {
    00047 namespace simplify { // geos::simplify
    00048
    00049 class LineSegmentIndex {
    00050
    00051 public:
    00052
    00053         LineSegmentIndex();
    00054
    00055         ~LineSegmentIndex();
    00056
    00057         void add(const TaggedLineString& line);
    00058
    00059         void add(const geom::LineSegment* seg);
    00060
    00061         void remove(const geom::LineSegment* seg);
    00062
    00063         std::auto_ptr< std::vector<geom::LineSegment*> >
    00064                         query(const geom::LineSegment* seg) const;
    00065
    00066 private:
    00067
    00068         std::auto_ptr<index::quadtree::Quadtree> index;
    00069
    00070         std::vector<geom::Envelope*> newEnvelopes;
    00071
    00072         // Copying is turned off
    00073         LineSegmentIndex(const LineSegmentIndex&);
    00074         LineSegmentIndex& operator=(const LineSegmentIndex&);
    00075 };
    00076
    00077 } // namespace geos::simplify
    00078 } // namespace geos
    00079
    00080 #endif // _GEOS_SIMPLIFY_LINESEGMENTINDEX_H_
    00081
    00082 /**********************************************************************
    00083  * $Log$
    00084  * Revision 1.2  2006/04/13 09:28:09  mloskot
    00085  * Removed definition of copy ctor and assignment operator for LineSegmentString class.
    00086  *
    00087  * Revision 1.1  2006/04/12 15:20:37  strk
    00088  * LineSegmentIndex class
    00089  *
    00090  **********************************************************************/