GEOS  3.9.1dev
SegmentString.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
7  * Copyright (C) 2005-2006 Refractions Research Inc.
8  * Copyright (C) 2001-2002 Vivid Solutions Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************
16  *
17  * Last port: noding/SegmentString.java r430 (JTS-1.12+)
18  *
19  **********************************************************************/
20 
21 #ifndef GEOS_NODING_SEGMENTSTRING_H
22 #define GEOS_NODING_SEGMENTSTRING_H
23 
24 #include <geos/export.h>
26 
27 #include <vector>
28 
29 // Forward declarations
30 namespace geos {
31 namespace algorithm {
32 class LineIntersector;
33 }
34 }
35 
36 namespace geos {
37 namespace noding { // geos.noding
38 
47 public:
48  typedef std::vector<const SegmentString*> ConstVect;
49  typedef std::vector<SegmentString*> NonConstVect;
50 
51  friend std::ostream& operator<< (std::ostream& os,
52  const SegmentString& ss);
53 
58  SegmentString(const void* newContext)
59  :
60  context(newContext)
61  {}
62 
63  virtual
65 
71  const void*
72  getData() const
73  {
74  return context;
75  }
76 
82  void
83  setData(const void* data)
84  {
85  context = data;
86  }
87 
88 
89  virtual size_t size() const = 0;
90 
91  virtual const geom::Coordinate& getCoordinate(size_t i) const = 0;
92 
99  virtual geom::CoordinateSequence* getCoordinates() const = 0;
100 
101  virtual bool isClosed() const = 0;
102 
103  virtual std::ostream& print(std::ostream& os) const;
104 
105 private:
106 
107  const void* context;
108 
109  // Declare type as noncopyable
110  SegmentString(const SegmentString& other) = delete;
111  SegmentString& operator=(const SegmentString& rhs) = delete;
112 };
113 
114 std::ostream& operator<< (std::ostream& os, const SegmentString& ss);
115 
116 } // namespace geos.noding
117 } // namespace geos
118 
119 #endif
120 
#define GEOS_DLL
Definition: export.h:28
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
void setData(const void *data)
Sets the user-defined data for this segment string.
Definition: SegmentString.h:83
const void * getData() const
Gets the user-defined data for this segment string.
Definition: SegmentString.h:72
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
std::vector< const SegmentString * > ConstVect
Definition: SegmentString.h:48
Basic namespace for all GEOS functionalities.
std::vector< SegmentString * > NonConstVect
Definition: SegmentString.h:49
The internal representation of a list of coordinates inside a Geometry.
SegmentString(const void *newContext)
Construct a SegmentString.
Definition: SegmentString.h:58
std::ostream & operator<<(std::ostream &o, const HCoordinate &c)