EdgeEnd.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
* 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/EdgeEnd.java r428 (JTS-1.12+)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/Coordinate.h> // for p0,p1
#include <geos/geomgraph/Label.h> // for composition
#include <string>
// Forward declarations
namespace geos {
namespace algorithm {
class BoundaryNodeRule;
}
namespace geomgraph {
class Edge;
class Node;
}
}
namespace geos {
namespace geomgraph { // geos.geomgraph
class GEOS_DLL EdgeEnd /* non-final */ {
public:
friend std::ostream& operator<< (std::ostream&, const EdgeEnd&);
EdgeEnd();
virtual
~EdgeEnd() {}
EdgeEnd(Edge* newEdge, const geom::Coordinate& newP0,
const geom::Coordinate& newP1,
const Label& newLabel);
EdgeEnd(Edge* newEdge, const geom::Coordinate& newP0,
const geom::Coordinate& newP1);
Edge*
getEdge()
{
return edge;
}
//virtual Edge* getEdge() { return edge; }
Label&
getLabel()
{
return label;
}
const Label&
getLabel() const
{
return label;
}
geom::Coordinate& getCoordinate() {
return p0;
}
const geom::Coordinate&
getCoordinate() const
{
return p0;
}
geom::Coordinate& getDirectedCoordinate();
int getQuadrant();
double getDx();
double getDy();
void setNode(Node* newNode);
Node* getNode();
int compareTo(const EdgeEnd* e) const;
int compareDirection(const EdgeEnd* e) const;
virtual void computeLabel(const algorithm::BoundaryNodeRule& bnr);
virtual std::string print() const;
protected:
Edge* edge;// the parent edge of this edge end
Label label;
EdgeEnd(Edge* newEdge);
void init(const geom::Coordinate& newP0,
const geom::Coordinate& newP1);
private:
Node* node;
geom::Coordinate p0, p1;
double dx, dy;
int quadrant;
};
std::ostream& operator<< (std::ostream&, const EdgeEnd&);
struct GEOS_DLL EdgeEndLT {
bool
operator()(const EdgeEnd* s1, const EdgeEnd* s2) const
{
return s1->compareTo(s2) < 0;
}
};
} // namespace geos.geomgraph
} // namespace geos
geos::algorithm::BoundaryNodeRule
An interface for rules which determine whether node points which are in boundaries of lineal geometry...
Definition BoundaryNodeRule.h:52
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geomgraph::EdgeEnd
Models the end of an edge incident on a node.
Definition EdgeEnd.h:54
geos::geomgraph::EdgeEnd::EdgeEnd
EdgeEnd(Edge *newEdge, const geom::Coordinate &newP0, const geom::Coordinate &newP1, const Label &newLabel)
geos::geomgraph::EdgeEnd::EdgeEnd
EdgeEnd(Edge *newEdge, const geom::Coordinate &newP0, const geom::Coordinate &newP1)
geos::geomgraph::EdgeEnd::compareDirection
int compareDirection(const EdgeEnd *e) const
geos::geomgraph::Edge
Definition geomgraph/Edge.h:63
geos::geomgraph::Label
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition Label.h:57
geos::geomgraph::Node
The node component of a geometry graph.
Definition geomgraph/Node.h:59
geos::algorithm
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
geos::geomgraph
Contains classes that implement topology graphs.
Definition Depth.h:31
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38