/usr/include/geos/geomgraph/Node.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 | /**********************************************************************
* $Id: Node.h 2557 2009-06-08 09:30:55Z strk $
*
* 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/Node.java rev. 1.7 (JTS-1.10)
*
**********************************************************************/
#ifndef GEOS_GEOMGRAPH_NODE_H
#define GEOS_GEOMGRAPH_NODE_H
#include <geos/export.h>
#include <geos/geomgraph/GraphComponent.h> // for inheritance
#include <geos/geom/Coordinate.h> // for member
#ifndef NDEBUG
#include <geos/geomgraph/EdgeEndStar.h> // for testInvariant
#include <geos/geomgraph/EdgeEnd.h> // for testInvariant
#endif // ndef NDEBUG
#include <geos/inline.h>
#include <cassert>
#include <string>
// Forward declarations
namespace geos {
namespace geom {
class IntersectionMatrix;
}
namespace geomgraph {
class Node;
class EdgeEndStar;
class EdgeEnd;
class Label;
class NodeFactory;
}
}
namespace geos {
namespace geomgraph { // geos.geomgraph
class GEOS_DLL Node: public GraphComponent {
using GraphComponent::setLabel;
public:
friend std::ostream& operator<< (std::ostream& os, const Node& node);
Node(const geom::Coordinate& newCoord, EdgeEndStar* newEdges);
virtual ~Node();
virtual const geom::Coordinate& getCoordinate() const;
virtual EdgeEndStar* getEdges();
virtual bool isIsolated() const;
/** \brief
* Add the edge to the list of edges at this node
*/
virtual void add(EdgeEnd *e);
virtual void mergeLabel(const Node& n);
/** \brief
* To merge labels for two nodes,
* the merged location for each LabelElement is computed.
*
* The location for the corresponding node LabelElement is set
* to the result, as long as the location is non-null.
*/
virtual void mergeLabel(const Label& label2);
virtual void setLabel(int argIndex, int onLocation);
/** \brief
* Updates the label of a node to BOUNDARY,
* obeying the mod-2 boundaryDetermination rule.
*/
virtual void setLabelBoundary(int argIndex);
/**
* The location for a given eltIndex for a node will be one
* of { null, INTERIOR, BOUNDARY }.
* A node may be on both the boundary and the interior of a geometry;
* in this case, the rule is that the node is considered to be
* in the boundary.
* The merged location is the maximum of the two input values.
*/
virtual int computeMergedLocation(const Label* label2, int eltIndex);
virtual std::string print();
virtual const std::vector<double> &getZ() const;
virtual void addZ(double);
/** \brief
* Tests whether any incident edge is flagged as
* being in the result.
*
* This test can be used to determine if the node is in the result,
* since if any incident edge is in the result, the node must be in
* the result as well.
*
* @return <code>true</code> if any indicident edge in the in
* the result
*/
virtual bool isIncidentEdgeInResult() const;
protected:
void testInvariant() const;
geom::Coordinate coord;
EdgeEndStar* edges;
/** \brief
* Basic nodes do not compute IMs
*/
virtual void computeIM(geom::IntersectionMatrix* /*im*/) {};
private:
std::vector<double> zvals;
double ztot;
};
std::ostream& operator<< (std::ostream& os, const Node& node);
inline void
Node::testInvariant() const
{
#ifndef NDEBUG
if (edges)
{
// Each EdgeEnd in the star has this Node's
// coordinate as first coordinate
for (EdgeEndStar::iterator
it=edges->begin(), itEnd=edges->end();
it != itEnd; it++)
{
EdgeEnd* e=*it;
assert(e);
assert(e->getCoordinate().equals2D(coord));
}
}
#if 0 // We can't rely on numerical stability with FP computations
// ztot is the sum of doubnle sin zvals vector
double ztot_check=0.0;
for (std::vector<double>::const_iterator
i = zvals.begin(), e = zvals.end();
i != e;
i++)
{
ztot_check += *i;
}
assert(ztot_check == ztot);
#endif // 0
#endif
}
} // namespace geos.geomgraph
} // namespace geos
//#ifdef GEOS_INLINE
//# include "geos/geomgraph/Node.inl"
//#endif
#endif // ifndef GEOS_GEOMGRAPH_NODE_H
/**********************************************************************
* $Log$
* Revision 1.6 2006/06/01 11:49:36 strk
* Reduced installed headers form geomgraph namespace
*
* Revision 1.5 2006/04/27 15:15:06 strk
* Z check removed from invariant tester to avoid aborts due to differences in FP computations.
*
* Revision 1.4 2006/04/07 16:01:51 strk
* Port info, doxygen comments, testInvariant(), many assertionss, handling of
* the NULL EdgeEndStar member
*
* Revision 1.3 2006/03/24 09:52:41 strk
* USE_INLINE => GEOS_INLINE
*
* Revision 1.2 2006/03/15 16:27:54 strk
* operator<< for Node class
*
* Revision 1.1 2006/03/09 16:46:49 strk
* geos::geom namespace definition, first pass at headers split
*
**********************************************************************/
|