GEOS  3.3.2
BasicSegmentString.h
00001 /**********************************************************************
00002  * $Id: BasicSegmentString.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) 2009 Sandro Santilli <strk@keybit.net>
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/BasicSegmentString.java rev. 1.1 (JTS-1.9)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_NODING_BASICSEGMENTSTRING_H
00021 #define GEOS_NODING_BASICSEGMENTSTRING_H
00022 
00023 #include <geos/export.h>
00024 #include <geos/noding/SegmentString.h> // for inheritance
00025 #include <geos/geom/CoordinateSequence.h> // for inlines (size())
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 
00051 class GEOS_DLL BasicSegmentString : public SegmentString {
00052 
00053 public:
00054 
00056         //
00061         BasicSegmentString(geom::CoordinateSequence *newPts,
00062                         const void* newContext)
00063                 :
00064                 SegmentString(newContext),
00065                 pts(newPts)
00066         {}
00067 
00068         virtual ~BasicSegmentString()
00069         {}
00070 
00072         virtual unsigned int size() const
00073         {
00074                 return pts->size();
00075         }
00076 
00078         virtual const geom::Coordinate& getCoordinate(unsigned int i) const;
00079 
00081         virtual geom::CoordinateSequence* getCoordinates() const;
00082 
00084         virtual bool isClosed() const;
00085 
00087         virtual std::ostream& print(std::ostream& os) const;
00088 
00096         int getSegmentOctant(unsigned int index) const;
00097 
00098 private:
00099 
00100         geom::CoordinateSequence *pts;
00101 
00102 };
00103 
00104 } // namespace geos.noding
00105 } // namespace geos
00106 
00107 #ifdef GEOS_INLINE
00108 # include "geos/noding/SegmentString.inl"
00109 #endif
00110 
00111 #endif // ndef GEOS_NODING_BASICSEGMENTSTRING_H
00112