GEOS 3.6.2
SegmentString.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
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>
25#include <geos/noding/SegmentNodeList.h>
26
27#include <vector>
28
29// Forward declarations
30namespace geos {
31 namespace algorithm {
32 class LineIntersector;
33 }
34}
35
36namespace geos {
37namespace noding { // geos.noding
38
46class GEOS_DLL SegmentString {
47public:
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
55 //
58 SegmentString(const void* newContext)
59 :
60 context(newContext)
61 {}
62
63 virtual ~SegmentString() {}
64
70 const void* getData() const { return context; }
71
77 void setData(const void* data) { context=data; }
78
79
80 virtual unsigned int size() const=0;
81
82 virtual const geom::Coordinate& getCoordinate(unsigned int i) const=0;
83
87 //
91
92 virtual bool isClosed() const=0;
93
94 virtual std::ostream& print(std::ostream& os) const;
95
96private:
97
98 const void* context;
99
100 // Declare type as noncopyable
101 SegmentString(const SegmentString& other);
102 SegmentString& operator=(const SegmentString& rhs);
103};
104
105std::ostream& operator<< (std::ostream& os, const SegmentString& ss);
106
107} // namespace geos.noding
108} // namespace geos
109
110#endif
111
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition LineIntersector.h:49
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:59
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:46
const void * getData() const
Definition SegmentString.h:70
SegmentString(const void *newContext)
Construct a SegmentString.
Definition SegmentString.h:58
void setData(const void *data)
Definition SegmentString.h:77
virtual geom::CoordinateSequence * getCoordinates() const =0
Return a pointer to the CoordinateSequence associated with this SegmentString.
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:33
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition PreparedLineString.h:27
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25