Complete Note#1 in the http://wiki.osgeo.org/wiki/GEOS_Provenance_Review to get out...
[geos.git] / include / geos / operation / buffer / SubgraphDepthLocater.h
blobaaeef1874d15ab5f5cfdf263abe93f783421fd37
1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2006 Refractions Research Inc.
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
13 **********************************************************************
15 * Last port: operation/buffer/SubgraphDepthLocater.java r320 (JTS-1.12)
17 **********************************************************************/
19 #ifndef GEOS_OP_BUFFER_SUBGRAPHDEPTHLOCATER_H
20 #define GEOS_OP_BUFFER_SUBGRAPHDEPTHLOCATER_H
22 #include <geos/export.h>
24 #include <vector>
26 #include <geos/geom/LineSegment.h> // for composition
28 // Forward declarations
29 namespace geos {
30 namespace geom {
31 class Coordinate;
33 namespace geomgraph {
34 class DirectedEdge;
36 namespace operation {
37 namespace buffer {
38 class BufferSubgraph;
39 class DepthSegment;
44 namespace geos {
45 namespace operation { // geos.operation
46 namespace buffer { // geos.operation.buffer
48 /**
49 * \class SubgraphDepthLocater opBuffer.h geos/opBuffer.h
51 * \brief
52 * Locates a subgraph inside a set of subgraphs,
53 * in order to determine the outside depth of the subgraph.
55 * The input subgraphs are assumed to have had depths
56 * already calculated for their edges.
59 class GEOS_DLL SubgraphDepthLocater {
61 public:
63 SubgraphDepthLocater(std::vector<BufferSubgraph*> *newSubgraphs)
65 subgraphs(newSubgraphs)
68 ~SubgraphDepthLocater() {}
70 int getDepth(const geom::Coordinate &p);
72 private:
74 std::vector<BufferSubgraph*> *subgraphs;
76 geom::LineSegment seg;
78 /**
79 * Finds all non-horizontal segments intersecting the stabbing line.
80 * The stabbing line is the ray to the right of stabbingRayLeftPt.
82 * @param stabbingRayLeftPt the left-hand origin of the stabbing line
83 * @param stabbedSegments a vector to which DepthSegments intersecting
84 * the stabbing line will be added.
86 void findStabbedSegments(const geom::Coordinate &stabbingRayLeftPt,
87 std::vector<DepthSegment*>& stabbedSegments);
89 /**
90 * Finds all non-horizontal segments intersecting the stabbing line
91 * in the list of dirEdges.
92 * The stabbing line is the ray to the right of stabbingRayLeftPt.
94 * @param stabbingRayLeftPt the left-hand origin of the stabbing line
95 * @param stabbedSegments the current vector of DepthSegments
96 * intersecting the stabbing line will be added.
98 void findStabbedSegments(const geom::Coordinate &stabbingRayLeftPt,
99 std::vector<geomgraph::DirectedEdge*> *dirEdges,
100 std::vector<DepthSegment*>& stabbedSegments);
103 * Finds all non-horizontal segments intersecting the stabbing line
104 * in the input dirEdge.
105 * The stabbing line is the ray to the right of stabbingRayLeftPt.
107 * @param stabbingRayLeftPt the left-hand origin of the stabbing line
108 * @param stabbedSegments the current list of DepthSegments intersecting
109 * the stabbing line
111 void findStabbedSegments(const geom::Coordinate &stabbingRayLeftPt,
112 geomgraph::DirectedEdge *dirEdge,
113 std::vector<DepthSegment*>& stabbedSegments);
118 } // namespace geos::operation::buffer
119 } // namespace geos::operation
120 } // namespace geos
122 #endif // ndef GEOS_OP_BUFFER_SUBGRAPHDEPTHLOCATER_H
124 /**********************************************************************
125 * $Log$
126 * Revision 1.2 2006/03/15 15:50:11 strk
127 * const correctness, cleanups
129 * Revision 1.1 2006/03/14 00:19:40 strk
130 * opBuffer.h split, streamlined headers in some (not all) files in operation/buffer/
132 **********************************************************************/