EdgeEndStar.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/EdgeEndStar.java r428 (JTS-1.12+)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geomgraph/EdgeEnd.h> // for EdgeEndLT
#include <geos/geom/Location.h>
#include <geos/geom/Coordinate.h> // for p0,p1
#include <array>
#include <memory>
#include <set>
#include <string>
#include <vector>
#include <algorithm> // for inlines (find)
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
#endif
// Forward declarations
namespace geos {
namespace algorithm {
class BoundaryNodeRule;
}
namespace geomgraph {
class GeometryGraph;
}
}
namespace geos {
namespace geomgraph { // geos.geomgraph
class GEOS_DLL EdgeEndStar /* non-final */ {
public:
typedef std::set<EdgeEnd*, EdgeEndLT> container;
typedef container::iterator iterator;
typedef container::const_iterator const_iterator;
typedef container::reverse_iterator reverse_iterator;
EdgeEndStar();
virtual
~EdgeEndStar() {}
virtual void insert(EdgeEnd* e) = 0;
geom::Coordinate& getCoordinate();
const geom::Coordinate& getCoordinate() const;
std::size_t getDegree();
iterator begin();
iterator end();
reverse_iterator rbegin();
reverse_iterator rend();
const_iterator
begin() const
{
return edgeMap.begin();
}
const_iterator
end() const
{
return edgeMap.end();
}
container& getEdges();
EdgeEnd* getNextCW(EdgeEnd* ee);
virtual void computeLabelling(const std::vector<std::unique_ptr<GeometryGraph>>&geomGraph);
// throw(TopologyException *);
bool isAreaLabelsConsistent(const GeometryGraph& geomGraph);
void propagateSideLabels(uint32_t geomIndex);
// throw(TopologyException *);
//virtual int findIndex(EdgeEnd *eSearch);
iterator find(EdgeEnd* eSearch);
virtual std::string print() const;
protected:
EdgeEndStar::container edgeMap;
void
insertEdgeEnd(EdgeEnd* e)
{
edgeMap.insert(e);
}
private:
geom::Location getLocation(uint32_t geomIndex,
const geom::Coordinate&p,
const std::vector<std::unique_ptr<GeometryGraph>>&geom);
std::array<geom::Location, 2> ptInAreaLocation;
void computeEdgeEndLabels(const algorithm::BoundaryNodeRule&);
bool checkAreaLabelsConsistent(uint32_t geomIndex);
};
inline std::size_t
EdgeEndStar::getDegree()
{
return edgeMap.size();
}
inline EdgeEndStar::iterator
EdgeEndStar::begin()
{
return edgeMap.begin();
}
inline EdgeEndStar::container&
EdgeEndStar::getEdges()
{
return edgeMap;
}
inline EdgeEndStar::reverse_iterator
EdgeEndStar::rend()
{
return edgeMap.rend();
}
inline EdgeEndStar::iterator
EdgeEndStar::end()
{
return edgeMap.end();
}
inline EdgeEndStar::reverse_iterator
EdgeEndStar::rbegin()
{
return edgeMap.rbegin();
}
inline EdgeEndStar::iterator
EdgeEndStar::find(EdgeEnd* eSearch)
{
return edgeMap.find(eSearch);
}
std::ostream& operator<< (std::ostream&, const EdgeEndStar&);
} // namespace geos.geomgraph
} // namespace geos
#ifdef _MSC_VER
#pragma warning(pop)
#endif
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::EdgeEndStar
A EdgeEndStar is an ordered list of EdgeEnds around a node.
Definition EdgeEndStar.h:63
geos::geomgraph::EdgeEndStar::edgeMap
EdgeEndStar::container edgeMap
A map which maintains the edges in sorted order around the node.
Definition EdgeEndStar.h:138
geos::geomgraph::EdgeEndStar::getCoordinate
geom::Coordinate & getCoordinate()
geos::geomgraph::EdgeEndStar::insertEdgeEnd
void insertEdgeEnd(EdgeEnd *e)
Insert an EdgeEnd into the map.
Definition EdgeEndStar.h:144
geos::geomgraph::EdgeEndStar::insert
virtual void insert(EdgeEnd *e)=0
Insert a EdgeEnd into this EdgeEndStar.
geos::geomgraph::EdgeEnd
Models the end of an edge incident on a node.
Definition EdgeEnd.h:54
geos::geomgraph::GeometryGraph
A GeometryGraph is a graph that models a given Geometry.
Definition GeometryGraph.h:71
geos::algorithm
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
geos::geom
Definition Angle.h:26
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