GEOS: SegmentString.h Source File

GEOS 3.5.0

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

- File List

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
30 namespace geos {
31 namespace algorithm {
32 class LineIntersector;
33 }
34 }
35
36 namespace geos {
37 namespace noding { // geos.noding
38
46 class GEOS_DLL SegmentString {
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
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 //
90 virtual geom::CoordinateSequence* getCoordinates() const=0;
91
92 virtual bool isClosed() const=0;
93
94 virtual std::ostream& print(std::ostream& os) const;
95
96 private:
97
98 const void* context;
99
100 // Declare type as noncopyable
101 SegmentString(const SegmentString& other);
102 SegmentString& operator=(const SegmentString& rhs);
103 };
104
105 std::ostream& operator<< (std::ostream& os, const SegmentString& ss);
106
107 } // namespace geos.noding
108 } // namespace geos
109
110 #endif
111
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
geos::noding::SegmentString::setData
void setData(const void *data)
Definition: SegmentString.h:77
geos::noding::SegmentString::getData
const void * getData() const
Definition: SegmentString.h:70
geos::noding::SegmentString
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
geos
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:59
geos::noding::SegmentString::SegmentString
SegmentString(const void *newContext)
Construct a SegmentString.
Definition: SegmentString.h:58