/usr/include/geos/planargraph/Subgraph.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 | /**********************************************************************
* $Id: Subgraph.h 2784 2009-12-03 19:52:22Z mloskot $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2001-2002 Vivid Solutions Inc.
* Copyright (C) 2005-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.
*
**********************************************************************/
#ifndef GEOS_PLANARGRAPH_SUBGRAPH_H
#define GEOS_PLANARGRAPH_SUBGRAPH_H
#include <geos/export.h>
#include <geos/planargraph/NodeMap.h> // for composition
#include <vector>
// Forward declarations
namespace geos {
namespace planargraph {
class PlanarGraph;
class DirectedEdge;
class Edge;
}
}
namespace geos {
namespace planargraph { // geos.planargraph
/// A subgraph of a PlanarGraph.
//
/// A subgraph may contain any subset of geomgraph::Edges
/// from the parent graph.
/// It will also automatically contain all geomgraph::DirectedEdge
/// and geomgraph::Node associated with those edges.
/// No new objects are created when edges are added -
/// all associated components must already exist in the parent graph.
///
/// @@ Actually we'll be copying Coordinates in NodeMap.
/// I guess that'll need to be changed soon.
///
class GEOS_DLL Subgraph
{
public:
/**
* Creates a new subgraph of the given PlanarGraph
*
* @param parent the parent graph
*/
Subgraph(PlanarGraph &parent)
:
parentGraph(parent)
{}
/**
* Gets the {@link PlanarGraph} which this subgraph
* is part of.
*
* @return the parent PlanarGraph
*/
PlanarGraph& getParent() const { return parentGraph; }
/**
* Adds an {@link Edge} to the subgraph.
* The associated {@link DirectedEdge}s and {@link planarNode}s
* are also added.
*
* @param e the edge to add
*
* @return a pair with first element being an iterator
* to the Edge in set and second element
* being a boolean value indicating wheter
* the Edge has been inserted now or was
* already in the set.
*/
std::pair<std::set<Edge*>::iterator, bool> add(Edge *e);
/**
* Returns an iterator over the DirectedEdge in this graph,
* in the order in which they were added.
*
* @return an iterator over the directed edges
*
* @see add(Edge)
*/
std::vector<const DirectedEdge*>::iterator getDirEdgeBegin() {
return dirEdges.begin();
}
/**
* Returns an {@link Iterator} over the {@link Edge}s in this
* graph, in the order in which they were added.
*
* @return an iterator over the edges
*
* @see add(Edge)
*/
std::set<Edge*>::iterator edgeBegin() { return edges.begin(); }
std::set<Edge*>::iterator edgeEnd() { return edges.end(); }
/**
* Returns a iterators over the planarNodesMap::container
* in this graph.
*/
NodeMap::container::iterator nodeBegin() {
return nodeMap.begin();
}
NodeMap::container::const_iterator nodeEnd() const {
return nodeMap.end();
}
NodeMap::container::iterator nodeEnd() {
return nodeMap.end();
}
NodeMap::container::const_iterator nodeBegin() const {
return nodeMap.begin();
}
/**
* Tests whether an {@link Edge} is contained in this subgraph
* @param e the edge to test
* @return <code>true</code> if the edge is contained in this subgraph
*/
bool contains(Edge *e) { return (edges.find(e) != edges.end()); }
protected:
PlanarGraph &parentGraph;
std::set<Edge*> edges;
std::vector<const DirectedEdge*> dirEdges;
NodeMap nodeMap;
// Declare type as noncopyable
Subgraph(const Subgraph& other);
Subgraph& operator=(const Subgraph& rhs);
};
} // namespace geos::planargraph
} // namespace geos
#endif // GEOS_PLANARGRAPH_SUBGRAPH_H
/**********************************************************************
* $Log$
* Revision 1.1 2006/03/21 21:42:54 strk
* planargraph.h header split, planargraph:: classes renamed to match JTS symbols
*
**********************************************************************/
|