/usr/include/geos/operation/buffer/BufferSubgraph.h is in libgeos-dev 3.2.2-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | /**********************************************************************
* $Id: BufferSubgraph.h 2559 2009-06-08 10:07:05Z strk $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: operation/buffer/BufferSubgraph.java rev. 1.21 (JTS-1.10)
*
**********************************************************************/
#ifndef GEOS_OP_BUFFER_BUFFERSUBGRAPH_H
#define GEOS_OP_BUFFER_BUFFERSUBGRAPH_H
#include <geos/export.h>
#include <vector>
#include <set>
#include <geos/operation/buffer/RightmostEdgeFinder.h> // for composition
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
class Envelope;
}
namespace algorithm {
class CGAlgorithms;
}
namespace geomgraph {
class DirectedEdge;
class Node;
}
}
namespace geos {
namespace operation { // geos.operation
namespace buffer { // geos.operation.buffer
/**
* \brief
* A connected subset of the graph of DirectedEdge and geomgraph::Node.
*
* Its edges will generate either
* - a single polygon in the complete buffer, with zero or more holes, or
* - ne or more connected holes
*/
class GEOS_DLL BufferSubgraph {
private:
RightmostEdgeFinder finder;
std::vector<geomgraph::DirectedEdge*> dirEdgeList;
std::vector<geomgraph::Node*> nodes;
geom::Coordinate *rightMostCoord;
geom::Envelope *env;
/** \brief
* Adds all nodes and edges reachable from this node to the subgraph.
*
* Uses an explicit stack to avoid a large depth of recursion.
*
* @param node a node known to be in the subgraph
*/
void addReachable(geomgraph::Node *startNode);
/// Adds the argument node and all its out edges to the subgraph
//
/// @param node the node to add
/// @param nodeStack the current set of nodes being traversed
///
void add(geomgraph::Node* node, std::vector<geomgraph::Node*>* nodeStack);
void clearVisitedEdges();
/** \brief
* Compute depths for all dirEdges via breadth-first traversal
* of nodes in graph
*
* @param startEdge edge to start processing with
*/
// <FIX> MD - use iteration & queue rather than recursion, for speed and robustness
void computeDepths(geomgraph::DirectedEdge *startEdge);
void computeNodeDepth(geomgraph::Node *n);
void copySymDepths(geomgraph::DirectedEdge *de);
bool contains(std::set<geomgraph::Node*>& nodes, geomgraph::Node *node);
public:
friend std::ostream& operator<< (std::ostream& os, const BufferSubgraph& bs);
BufferSubgraph();
~BufferSubgraph();
std::vector<geomgraph::DirectedEdge*>* getDirectedEdges();
std::vector<geomgraph::Node*>* getNodes();
/** \brief
* Gets the rightmost coordinate in the edges of the subgraph
*/
geom::Coordinate* getRightmostCoordinate();
/** \brief
* Creates the subgraph consisting of all edges reachable from
* this node.
*
* Finds the edges in the graph and the rightmost coordinate.
*
* @param node a node to start the graph traversal from
*/
void create(geomgraph::Node *node);
void computeDepth(int outsideDepth);
/** \brief
* Find all edges whose depths indicates that they are in the
* result area(s).
*
* Since we want polygon shells to be
* oriented CW, choose dirEdges with the interior of the result
* on the RHS.
* Mark them as being in the result.
* Interior Area edges are the result of dimensional collapses.
* They do not form part of the result area boundary.
*/
void findResultEdges();
/** \brief
* BufferSubgraphs are compared on the x-value of their rightmost
* Coordinate.
*
* This defines a partial ordering on the graphs such that:
*
* g1 >= g2 <==> Ring(g2) does not contain Ring(g1)
*
* where Polygon(g) is the buffer polygon that is built from g.
*
* This relationship is used to sort the BufferSubgraphs so
* that shells are guaranteed to
* be built before holes.
*/
int compareTo(BufferSubgraph *);
/** \brief
* Computes the envelope of the edges in the subgraph.
* The envelope is cached after being computed.
*
* @return the envelope of the graph.
*/
geom::Envelope *getEnvelope();
};
std::ostream& operator<< (std::ostream& os, const BufferSubgraph& bs);
// INLINES
inline geom::Coordinate*
BufferSubgraph::getRightmostCoordinate() {return rightMostCoord;}
inline std::vector<geomgraph::Node*>*
BufferSubgraph::getNodes() { return &nodes; }
inline std::vector<geomgraph::DirectedEdge*>*
BufferSubgraph::getDirectedEdges() {
return &dirEdgeList;
}
bool BufferSubgraphGT(BufferSubgraph *first, BufferSubgraph *second);
} // namespace geos::operation::buffer
} // namespace geos::operation
} // namespace geos
#endif // ndef GEOS_OP_BUFFER_BUFFERSUBGRAPH_H
/**********************************************************************
* $Log$
* Revision 1.3 2006/03/15 11:45:06 strk
* doxygen comments
*
* Revision 1.2 2006/03/14 14:16:52 strk
* operator<< for BufferSubgraph, more debugging calls
*
* Revision 1.1 2006/03/14 00:19:40 strk
* opBuffer.h split, streamlined headers in some (not all) files in operation/buffer/
*
**********************************************************************/
|