TaggedLineSegment.h

00001 /**********************************************************************
00002  * $Id: TaggedLineSegment.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/TaggedLineSegment.java rev. 1.1 (JTS-1.7)
00017  *
00018  **********************************************************************
00019  *
00020  * NOTES: Use of this class by DP simplification algorithms
00021  * makes it useless for a TaggedLineSegment to store copies
00022  * of coordinates. Using pointers would be good enough here.
00023  * We don't do it to avoid having to break inheritance from 
00024  * LineSegment, which has copies intead. Wheter LineSegment
00025  * itself should be refactored can be discussed. 
00026  *  --strk 2006-04-12
00027  *
00028  **********************************************************************/
00029 
00030 #ifndef _GEOS_SIMPLIFY_TAGGEDLINESEGMENT_H_
00031 #define _GEOS_SIMPLIFY_TAGGEDLINESEGMENT_H_ 
00032 
00033 #include <geos/geom/LineSegment.h> // for inheritance
00034 
00035 
00036 // Forward declarations
00037 namespace geos {
00038         namespace geom {
00039                 class Coordinate;
00040                 class Geometry;
00041         }
00042 }
00043 
00044 namespace geos {
00045 namespace simplify { // geos::simplify
00046 
00047 
00054 class TaggedLineSegment: public geom::LineSegment
00055 {
00056 
00057 public:
00058 
00059         TaggedLineSegment(const geom::Coordinate& p0,
00060                         const geom::Coordinate& p1,
00061                         const geom::Geometry* parent,
00062                         unsigned int index);
00063 
00064         TaggedLineSegment(const geom::Coordinate& p0,
00065                         const geom::Coordinate& p1);
00066 
00067         TaggedLineSegment(const TaggedLineSegment& ls);
00068 
00069         const geom::Geometry* getParent() const;
00070 
00071         unsigned int getIndex() const;
00072 
00073 private:
00074 
00075         const geom::Geometry* parent;
00076 
00077         unsigned int index;
00078 
00079 };
00080 
00081 
00082 
00083 } // namespace geos::simplify
00084 } // namespace geos
00085 
00086 #endif // _GEOS_SIMPLIFY_TAGGEDLINESEGMENT_H_ 
00087 
00088 /**********************************************************************
00089  * $Log$
00090  * Revision 1.2  2006/04/12 17:19:57  strk
00091  * Ported TaggedLineStringSimplifier class, made LineSegment class
00092  * polymorphic to fix derivation of TaggedLineSegment
00093  *
00094  * Revision 1.1  2006/04/12 14:22:12  strk
00095  * Initial implementation of TaggedLineSegment and TaggedLineString classes
00096  *
00097  **********************************************************************/

Generated on Fri Mar 27 04:53:03 2009 for GEOS by  doxygen 1.5.4