geomgraph/DirectedEdge.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/DirectedEdge.java r428 (JTS-1.12)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <string>
#include <geos/geom/Location.h>
#include <geos/geomgraph/EdgeEnd.h> // for inheritance
// Forward declarations
namespace geos {
namespace geomgraph {
class Edge;
class EdgeRing;
}
}
namespace geos {
namespace geomgraph { // geos.geomgraph
class GEOS_DLL DirectedEdge final: public EdgeEnd {
public:
static int depthFactor(geom::Location currLocation, geom::Location nextLocation);
//DirectedEdge();
//virtual ~DirectedEdge();
DirectedEdge(Edge* newEdge, bool newIsForward);
// this is no different from Base class, no need to override
//Edge* getEdge();
void setInResult(bool v)
{
isInResultVar = v;
};
bool isInResult() const
{
return isInResultVar;
};
bool isVisited() const
{
return isVisitedVar;
};
void setVisited(bool v)
{
isVisitedVar = v;
};
void setEdgeRing(EdgeRing* er)
{
edgeRing = er;
};
EdgeRing* getEdgeRing() const
{
return edgeRing;
};
void setMinEdgeRing(EdgeRing* mer)
{
minEdgeRing = mer;
};
EdgeRing* getMinEdgeRing() const
{
return minEdgeRing;
};
int getDepth(int position) const
{
return depth[position];
};
void setDepth(int position, int newDepth);
int getDepthDelta() const;
void setVisitedEdge(bool newIsVisited);
DirectedEdge* getSym() const
{
return sym;
};
bool isForward() const
{
return isForwardVar;
};
void setSym(DirectedEdge* de)
{
sym = de;
};
DirectedEdge* getNext() const
{
return next;
};
void setNext(DirectedEdge* newNext)
{
next = newNext;
};
DirectedEdge* getNextMin() const
{
return nextMin;
};
void setNextMin(DirectedEdge* nm)
{
nextMin = nm;
};
bool isLineEdge();
bool isInteriorAreaEdge();
void setEdgeDepths(int position, int newDepth);
std::string print() const override;
std::string printEdge();
protected:
bool isForwardVar;
private:
bool isInResultVar;
bool isVisitedVar;
DirectedEdge* sym;
DirectedEdge* next;
DirectedEdge* nextMin;
EdgeRing* edgeRing;
EdgeRing* minEdgeRing;
int depth[3];
void computeDirectedLabel();
};
} // namespace geos.geomgraph
} // namespace geos
geos::geomgraph::DirectedEdge::setEdgeDepths
void setEdgeDepths(int position, int newDepth)
Set both edge depths.
geos::geomgraph::DirectedEdge::setVisitedEdge
void setVisitedEdge(bool newIsVisited)
geos::geomgraph::DirectedEdge::isLineEdge
bool isLineEdge()
Tells whether this edge is a Line.
geos::geomgraph::DirectedEdge::getSym
DirectedEdge * getSym() const
Each Edge gives rise to a pair of symmetric DirectedEdges, in opposite directions.
Definition geomgraph/DirectedEdge.h:126
geos::geomgraph::DirectedEdge::depthFactor
static int depthFactor(geom::Location currLocation, geom::Location nextLocation)
Computes the factor for the change in depth when moving from one location to another....
geos::geomgraph::DirectedEdge::isInteriorAreaEdge
bool isInteriorAreaEdge()
Tells whether this edge is an Area.
geos::geomgraph::EdgeRing
Definition geomgraph/EdgeRing.h:57
geos::geomgraph::Edge
Definition geomgraph/Edge.h:63
geos::geom::Location
Location
Constants representing the location of a point relative to a geometry.
Definition Location.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