22 #ifndef GEOS_GEOMGRAPH_NODE_H
23 #define GEOS_GEOMGRAPH_NODE_H
25 #include <geos/export.h>
26 #include <geos/geomgraph/GraphComponent.h>
27 #include <geos/geom/Coordinate.h>
30 #include <geos/geomgraph/EdgeEndStar.h>
31 #include <geos/geomgraph/EdgeEnd.h>
34 #include <geos/inline.h>
41 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
47 class IntersectionMatrix;
61 class GEOS_DLL Node:
public GraphComponent {
62 using GraphComponent::setLabel;
66 friend std::ostream& operator<< (std::ostream& os,
const Node& node);
68 Node(
const geom::Coordinate& newCoord, EdgeEndStar* newEdges);
72 virtual const geom::Coordinate& getCoordinate()
const;
74 virtual EdgeEndStar* getEdges();
76 virtual bool isIsolated()
const;
81 virtual void add(EdgeEnd *e);
83 virtual void mergeLabel(
const Node& n);
92 virtual void mergeLabel(
const Label& label2);
94 virtual void setLabel(
int argIndex,
int onLocation);
100 virtual void setLabelBoundary(
int argIndex);
110 virtual int computeMergedLocation(
const Label* label2,
int eltIndex);
112 virtual std::string print();
114 virtual const std::vector<double> &getZ()
const;
116 virtual void addZ(
double);
129 virtual bool isIncidentEdgeInResult()
const;
133 void testInvariant()
const;
135 geom::Coordinate coord;
142 virtual void computeIM(geom::IntersectionMatrix* ) {};
146 std::vector<double> zvals;
152 std::ostream& operator<< (std::ostream& os,
const Node& node);
155 Node::testInvariant()
const
162 for (EdgeEndStar::iterator
163 it=edges->begin(), itEnd=edges->end();
168 assert(e->getCoordinate().equals2D(coord));
172 #if 0 // We can't rely on numerical stability with FP computations
174 double ztot_check=0.0;
175 for (std::vector<double>::const_iterator
176 i = zvals.begin(), e = zvals.end();
182 assert(ztot_check == ztot);
200 #endif // ifndef GEOS_GEOMGRAPH_NODE_H