GEOS: OffsetPointGenerator.h Source File

GEOS 3.3.8

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

- File List

OffsetPointGenerator.h
1 /**********************************************************************
2 * $Id: OffsetPointGenerator.h 3255 2011-03-01 17:56:10Z mloskot $
3 *
4 * GEOS - Geometry Engine Open Source
5 * http://geos.refractions.net
6 *
7 * Copyright (C) 2006 Refractions Research Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 ***********************************************************************
15 *
16 * Last port: operation/overlay/validate/OffsetPointGenerator.java rev. 1.1 (JTS-1.10)
17 *
18 **********************************************************************/
19
20 #ifndef GEOS_OP_OVERLAY_OFFSETPOINTGENERATOR_H
21 #define GEOS_OP_OVERLAY_OFFSETPOINTGENERATOR_H
22
23 #include <geos/export.h>
24 #include <geos/algorithm/PointLocator.h> // for composition
25 #include <geos/geom/Geometry.h> // for auto_ptr visibility of dtor
26 #include <geos/geom/MultiPoint.h> // for auto_ptr visibility of dtor
27 #include <geos/geom/Coordinate.h> // for use in vector
28
29 #include <vector>
30 #include <memory> // for auto_ptr
31
32 #ifdef _MSC_VER
33 #pragma warning(push)
34 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
35 #endif
36
37 // Forward declarations
38 namespace geos {
39 namespace geom {
40 //class Geometry;
41 //class MultiPoint;
42 class LineString;
43 //class Coordinate;
44 }
45 }
46
47 namespace geos {
48 namespace operation { // geos::operation
49 namespace overlay { // geos::operation::overlay
50 namespace validate { // geos::operation::overlay::validate
51
53 //
54 class GEOS_DLL OffsetPointGenerator {
55
56 public:
57
58 OffsetPointGenerator(const geom::Geometry& geom, double offset);
59
61 std::auto_ptr< std::vector<geom::Coordinate> > getPoints();
62
63 private:
64
65 const geom::Geometry& g;
66
67 double offsetDistance;
68
69 std::auto_ptr< std::vector<geom::Coordinate> > offsetPts;
70
71 void extractPoints(const geom::LineString* line);
72
73 void computeOffsets(const geom::Coordinate& p0,
74 const geom::Coordinate& p1);
75
76 // Declare type as noncopyable
77 OffsetPointGenerator(const OffsetPointGenerator& other);
78 OffsetPointGenerator& operator=(const OffsetPointGenerator& rhs);
79 };
80
81 } // namespace geos::operation::overlay::validate
82 } // namespace geos::operation::overlay
83 } // namespace geos::operation
84 } // namespace geos
85
86 #ifdef _MSC_VER
87 #pragma warning(pop)
88 #endif
89
90 #endif // ndef GEOS_OP_OVERLAY_OFFSETPOINTGENERATOR_H
91
92 /**********************************************************************
93 * $Log$
94 **********************************************************************/
95