GEOS  3.3.6
SegmentString.h
00001 /**********************************************************************
00002  * $Id: SegmentString.h 3255 2011-03-01 17:56:10Z 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 Public Licence as published
00011  * by the Free Software Foundation. 
00012  * See the COPYING file for more information.
00013  *
00014  **********************************************************************
00015  *
00016  * Last port: noding/SegmentString.java rev. 1.6 (JTS-1.9)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_NODING_SEGMENTSTRING_H
00021 #define GEOS_NODING_SEGMENTSTRING_H
00022 
00023 #include <geos/export.h>
00024 #include <geos/noding/SegmentNodeList.h>
00025 #include <geos/inline.h>
00026 
00027 #include <vector>
00028 
00029 // Forward declarations
00030 namespace geos {
00031         namespace algorithm {
00032                 class LineIntersector;
00033         }
00034 }
00035 
00036 namespace geos {
00037 namespace noding { // geos.noding
00038 
00046 class GEOS_DLL SegmentString {
00047 public:
00048         typedef std::vector<const SegmentString*> ConstVect;
00049         typedef std::vector<SegmentString *> NonConstVect;
00050 
00051         friend std::ostream& operator<< (std::ostream& os,
00052                         const SegmentString& ss);
00053 
00055         //
00058         SegmentString(const void* newContext)
00059                 :
00060                 context(newContext)
00061         {}
00062 
00063         virtual ~SegmentString() {}
00064 
00070         const void* getData() const { return context; }
00071 
00077         void setData(const void* data) { context=data; }
00078 
00079 
00080         virtual unsigned int size() const=0;
00081 
00082         virtual const geom::Coordinate& getCoordinate(unsigned int i) const=0;
00083 
00087         //
00091         virtual geom::CoordinateSequence* getCoordinates() const=0;
00092 
00093         // Return a read-only pointer to this SegmentString CoordinateSequence
00094         //const CoordinateSequence* getCoordinatesRO() const { return pts; }
00095 
00096         virtual bool isClosed() const=0;
00097 
00098         virtual std::ostream& print(std::ostream& os) const;
00099 
00100 private:
00101 
00102         const void* context;
00103 
00104     // Declare type as noncopyable
00105     SegmentString(const SegmentString& other);
00106     SegmentString& operator=(const SegmentString& rhs);
00107 };
00108 
00109 std::ostream& operator<< (std::ostream& os, const SegmentString& ss);
00110 
00111 } // namespace geos.noding
00112 } // namespace geos
00113 
00114 #ifdef GEOS_INLINE
00115 # include "geos/noding/SegmentString.inl"
00116 #endif
00117 
00118 #endif
00119 
00120 /**********************************************************************
00121  * $Log$
00122  * Revision 1.10  2006/05/05 14:25:05  strk
00123  * moved getSegmentOctant out of .inl into .cpp, renamed private eiList to nodeList as in JTS, added more assertion checking and fixed doxygen comments
00124  *
00125  * Revision 1.9  2006/05/05 10:19:06  strk
00126  * droppped SegmentString::getContext(), new name is getData() to reflect change in JTS
00127  *
00128  * Revision 1.8  2006/05/04 08:29:07  strk
00129  * * source/noding/ScaledNoder.cpp: removed use of SegmentString::setCoordinates().
00130  * * source/headers/geos/noding/SegmentStrign.{h,inl}: removed new setCoordinates() interface.
00131  *
00132  * Revision 1.7  2006/05/04 07:43:44  strk
00133  * output operator for SegmentString class
00134  *
00135  * Revision 1.6  2006/05/03 18:04:49  strk
00136  * added SegmentString::setCoordinates() interface
00137  *
00138  * Revision 1.5  2006/05/03 16:19:39  strk
00139  * fit in 80 columns
00140  *
00141  * Revision 1.4  2006/05/03 15:26:02  strk
00142  * testInvariant made public and always inlined
00143  *
00144  * Revision 1.3  2006/03/24 09:52:41  strk
00145  * USE_INLINE => GEOS_INLINE
00146  *
00147  * Revision 1.2  2006/03/13 21:14:24  strk
00148  * Added missing forward declarations
00149  *
00150  * Revision 1.1  2006/03/09 16:46:49  strk
00151  * geos::geom namespace definition, first pass at headers split
00152  *
00153  **********************************************************************/
00154