GEOS: SegmentString.h Source File

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

- File List

# SegmentString.h

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