00001 /********************************************************************** 00002 * $Id: TaggedLineSegment.h 2785 2009-12-03 19:55:11Z 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/export.h> 00034 #include <geos/geom/LineSegment.h> // for inheritance 00035 00036 00037 // Forward declarations 00038 namespace geos { 00039 namespace geom { 00040 class Coordinate; 00041 class Geometry; 00042 } 00043 } 00044 00045 namespace geos { 00046 namespace simplify { // geos::simplify 00047 00048 00055 class GEOS_DLL TaggedLineSegment: public geom::LineSegment 00056 { 00057 00058 public: 00059 00060 TaggedLineSegment(const geom::Coordinate& p0, 00061 const geom::Coordinate& p1, 00062 const geom::Geometry* parent, 00063 unsigned int index); 00064 00065 TaggedLineSegment(const geom::Coordinate& p0, 00066 const geom::Coordinate& p1); 00067 00068 TaggedLineSegment(const TaggedLineSegment& ls); 00069 00070 const geom::Geometry* getParent() const; 00071 00072 unsigned int getIndex() const; 00073 00074 private: 00075 00076 const geom::Geometry* parent; 00077 00078 unsigned int index; 00079 00080 }; 00081 00082 00083 00084 } // namespace geos::simplify 00085 } // namespace geos 00086 00087 #endif // GEOS_SIMPLIFY_TAGGEDLINESEGMENT_H 00088 00089 /********************************************************************** 00090 * $Log$ 00091 * Revision 1.2 2006/04/12 17:19:57 strk 00092 * Ported TaggedLineStringSimplifier class, made LineSegment class 00093 * polymorphic to fix derivation of TaggedLineSegment 00094 * 00095 * Revision 1.1 2006/04/12 14:22:12 strk 00096 * Initial implementation of TaggedLineSegment and TaggedLineString classes 00097 * 00098 **********************************************************************/