/usr/include/geos/geomgraph/GeometryGraph.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 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | /**********************************************************************
* $Id: GeometryGraph.h 2773 2009-12-03 19:36:17Z mloskot $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2005-2006 Refractions Research Inc.
* Copyright (C) 2001-2002 Vivid Solutions 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: geomgraph/GeometryGraph.java rev. 1.9 (JTS-1.10)
*
**********************************************************************/
#ifndef GEOS_GEOMGRAPH_GEOMETRYGRAPH_H
#define GEOS_GEOMGRAPH_GEOMETRYGRAPH_H
#include <geos/export.h>
#include <map>
#include <vector>
#include <memory>
#include <geos/geom/Coordinate.h>
#include <geos/geom/CoordinateSequence.h> // for auto_ptr<CoordinateSequence>
#include <geos/geomgraph/PlanarGraph.h>
#include <geos/geom/LineString.h> // for LineStringLT
#include <geos/inline.h>
// Forward declarations
namespace geos {
namespace geom {
class LineString;
class LinearRing;
class Polygon;
class Geometry;
class GeometryCollection;
class Point;
}
namespace algorithm {
class LineIntersector;
class BoundaryNodeRule;
}
namespace geomgraph {
class Edge;
class Node;
namespace index {
class SegmentIntersector;
class EdgeSetIntersector;
}
}
}
namespace geos {
namespace geomgraph { // geos.geomgraph
class GEOS_DLL GeometryGraph: public PlanarGraph
{
using PlanarGraph::add;
using PlanarGraph::findEdge;
private:
const geom::Geometry* parentGeom;
/**
* The lineEdgeMap is a map of the linestring components of the
* parentGeometry to the edges which are derived from them.
* This is used to efficiently perform findEdge queries
*
* Following the above description there's no need to
* compare LineStrings other then by pointer value.
*/
//std::map<const geom::LineString*,Edge*,geom::LineStringLT> lineEdgeMap;
std::map<const geom::LineString*, Edge*> lineEdgeMap;
/**
* If this flag is true, the Boundary Determination Rule will
* used when deciding whether nodes are in the boundary or not
*/
bool useBoundaryDeterminationRule;
const algorithm::BoundaryNodeRule& boundaryNodeRule;
/**
* the index of this geometry as an argument to a spatial function
* (used for labelling)
*/
int argIndex;
/// Cache for fast responses to getBoundaryPoints
std::auto_ptr< geom::CoordinateSequence > boundaryPoints;
std::auto_ptr< std::vector<Node*> > boundaryNodes;
bool hasTooFewPointsVar;
geom::Coordinate invalidPoint;
std::vector<index::SegmentIntersector*> newSegmentIntersectors;
/// Allocates a new EdgeSetIntersector. Remember to delete it!
index::EdgeSetIntersector* createEdgeSetIntersector();
void add(const geom::Geometry *g);
// throw(UnsupportedOperationException);
void addCollection(const geom::GeometryCollection *gc);
void addPoint(const geom::Point *p);
void addPolygonRing(const geom::LinearRing *lr,
int cwLeft, int cwRight);
void addPolygon(const geom::Polygon *p);
void addLineString(const geom::LineString *line);
void insertPoint(int argIndex, const geom::Coordinate& coord,
int onLocation);
/** \brief
* Adds candidate boundary points using the current
* algorithm::BoundaryNodeRule.
*
* This is used to add the boundary
* points of dim-1 geometries (Curves/MultiCurves).
*/
void insertBoundaryPoint(int argIndex, const geom::Coordinate& coord);
void addSelfIntersectionNodes(int argIndex);
/** \brief
* Add a node for a self-intersection.
*
* If the node is a potential boundary node (e.g. came from an edge
* which is a boundary) then insert it as a potential boundary node.
* Otherwise, just add it as a regular node.
*/
void addSelfIntersectionNode(int argIndex,
const geom::Coordinate& coord, int loc);
// Declare type as noncopyable
GeometryGraph(const GeometryGraph& other);
GeometryGraph& operator=(const GeometryGraph& rhs);
public:
static bool isInBoundary(int boundaryCount);
static int determineBoundary(int boundaryCount);
static int determineBoundary(
const algorithm::BoundaryNodeRule& boundaryNodeRule,
int boundaryCount);
GeometryGraph();
GeometryGraph(int newArgIndex, const geom::Geometry *newParentGeom);
GeometryGraph(int newArgIndex, const geom::Geometry *newParentGeom,
const algorithm::BoundaryNodeRule& boundaryNodeRule);
virtual ~GeometryGraph();
const geom::Geometry* getGeometry();
/// Returned object is owned by this GeometryGraph
std::vector<Node*>* getBoundaryNodes();
void getBoundaryNodes(std::vector<Node*>&bdyNodes);
/// Returned object is owned by this GeometryGraph
geom::CoordinateSequence* getBoundaryPoints();
Edge* findEdge(const geom::LineString *line);
void computeSplitEdges(std::vector<Edge*> *edgelist);
void addEdge(Edge *e);
void addPoint(geom::Coordinate& pt);
/**
* \brief
* Compute self-nodes, taking advantage of the Geometry type to
* minimize the number of intersection tests. (E.g. rings are
* not tested for self-intersection, since
* they are assumed to be valid).
*
* @param li the LineIntersector to use
*
* @param computeRingSelfNodes if <false>, intersection checks are
* optimized to not test rings for self-intersection
*
* @return the SegmentIntersector used, containing information about
* the intersections found
*/
index::SegmentIntersector* computeSelfNodes(
algorithm::LineIntersector *li,
bool computeRingSelfNodes);
// Quick inline calling the function above, the above should probably
// be deprecated.
index::SegmentIntersector* computeSelfNodes(
algorithm::LineIntersector& li,
bool computeRingSelfNodes);
index::SegmentIntersector* computeEdgeIntersections(GeometryGraph *g,
algorithm::LineIntersector *li, bool includeProper);
std::vector<Edge*> *getEdges();
bool hasTooFewPoints();
const geom::Coordinate& getInvalidPoint();
const algorithm::BoundaryNodeRule& getBoundaryNodeRule() const
{ return boundaryNodeRule; }
};
} // namespace geos.geomgraph
} // namespace geos
#ifdef GEOS_INLINE
# include "geos/geomgraph/GeometryGraph.inl"
#endif
#endif // ifndef GEOS_GEOMGRAPH_GEOMETRYGRAPH_H
/**********************************************************************
* $Log$
* Revision 1.4 2006/06/13 22:00:26 strk
* Changed GeometryGraph::lineEdgeMap set comparison function to be pointer-based. Should be safe and much faster. Available tests all succeed.
*
* Revision 1.3 2006/03/29 15:23:49 strk
* Moved GeometryGraph inlines from .h to .inl file
*
* Revision 1.2 2006/03/24 09:52:41 strk
* USE_INLINE => GEOS_INLINE
*
* Revision 1.1 2006/03/09 16:46:49 strk
* geos::geom namespace definition, first pass at headers split
*
**********************************************************************/
|