GEOS
3.9.1dev
|
A Label
indicates the topological relationship of a component of a topology graph to a given Geometry
.
More...
#include <Label.h>
Public Member Functions | |
Label (geom::Location onLoc) | |
Construct a Label with a single location for both Geometries. More... | |
Label (uint32_t geomIndex, geom::Location onLoc) | |
Construct a Label with the location specified for the given Geometry. More... | |
Label (geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc) | |
Construct a Label with On, Left and Right locations for both Geometries. More... | |
Label (const Label &l) | |
Copy ctor. More... | |
Label & | operator= (const Label &l) |
Label () | |
Initialize both locations to Location::NONE. More... | |
Label (uint32_t geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc) | |
Construct a Label with On, Left and Right locations for the given Geometries. Initialize the locations for the other Geometry to Location::NONE. More... | |
void | flip () |
geom::Location | getLocation (uint32_t geomIndex, uint32_t posIndex) const |
geom::Location | getLocation (uint32_t geomIndex) const |
void | setLocation (uint32_t geomIndex, uint32_t posIndex, geom::Location location) |
void | setLocation (uint32_t geomIndex, geom::Location location) |
void | setAllLocations (uint32_t geomIndex, geom::Location location) |
void | setAllLocationsIfNull (uint32_t geomIndex, geom::Location location) |
void | setAllLocationsIfNull (geom::Location location) |
void | merge (const Label &lbl) |
Merge this label with another one. More... | |
int | getGeometryCount () const |
bool | isNull () const |
bool | isNull (uint32_t geomIndex) const |
bool | isAnyNull (uint32_t geomIndex) const |
bool | isArea () const |
bool | isArea (uint32_t geomIndex) const |
bool | isLine (uint32_t geomIndex) const |
bool | isEqualOnSide (const Label &lbl, uint32_t side) const |
bool | allPositionsEqual (uint32_t geomIndex, geom::Location loc) const |
void | toLine (uint32_t geomIndex) |
Converts one GeometryLocation to a Line location. More... | |
std::string | toString () const |
Static Public Member Functions | |
static Label | toLineLabel (const Label &label) |
Converts a Label to a Line label (that is, one with no side Locations) More... | |
Private Attributes | |
TopologyLocation | elt [2] |
Friends | |
std::ostream & | operator<< (std::ostream &, const Label &) |
A Label
indicates the topological relationship of a component of a topology graph to a given Geometry
.
This class supports labels for relationships to two Geometry
s, which is sufficient for algorithms for binary operations.
Topology graphs support the concept of labeling nodes and edges in the graph. The label of a node or edge specifies its topological relationship to one or more geometries. (In fact, since JTS operations have only two arguments labels are required for only two geometries). A label for a node or edge has one or two elements, depending on whether the node or edge occurs in one or both of the input Geometry
s. Elements contain attributes which categorize the topological location of the node or edge relative to the parent Geometry
; that is, whether the node or edge is in the interior, boundary or exterior of the Geometry
. Attributes have a value from the set {Interior, Boundary, Exterior}
. In a node each element has a single attribute <On>
. For an edge each element has a triplet of attributes <Left, On, Right>
.
It is up to the client code to associate the 0 and 1 TopologyLocation
s with specific geometries.
geos::geomgraph::Label::Label | ( | geom::Location | onLoc | ) |
Construct a Label with a single location for both Geometries.
geos::geomgraph::Label::Label | ( | uint32_t | geomIndex, |
geom::Location | onLoc | ||
) |
Construct a Label with the location specified for the given Geometry.
Other geometry location will be set to Location::NONE.
geos::geomgraph::Label::Label | ( | geom::Location | onLoc, |
geom::Location | leftLoc, | ||
geom::Location | rightLoc | ||
) |
Construct a Label with On, Left and Right locations for both Geometries.
Initialize the locations for both Geometries to the given values.
geos::geomgraph::Label::Label | ( | const Label & | l | ) |
Copy ctor.
geos::geomgraph::Label::Label | ( | ) |
Initialize both locations to Location::NONE.
isNull() should return true after this kind of construction
geos::geomgraph::Label::Label | ( | uint32_t | geomIndex, |
geom::Location | onLoc, | ||
geom::Location | leftLoc, | ||
geom::Location | rightLoc | ||
) |
Construct a Label with On, Left and Right locations for the given Geometries. Initialize the locations for the other Geometry to Location::NONE.
bool geos::geomgraph::Label::allPositionsEqual | ( | uint32_t | geomIndex, |
geom::Location | loc | ||
) | const |
void geos::geomgraph::Label::flip | ( | ) |
int geos::geomgraph::Label::getGeometryCount | ( | ) | const |
geom::Location geos::geomgraph::Label::getLocation | ( | uint32_t | geomIndex, |
uint32_t | posIndex | ||
) | const |
geom::Location geos::geomgraph::Label::getLocation | ( | uint32_t | geomIndex | ) | const |
bool geos::geomgraph::Label::isAnyNull | ( | uint32_t | geomIndex | ) | const |
bool geos::geomgraph::Label::isArea | ( | ) | const |
bool geos::geomgraph::Label::isArea | ( | uint32_t | geomIndex | ) | const |
bool geos::geomgraph::Label::isEqualOnSide | ( | const Label & | lbl, |
uint32_t | side | ||
) | const |
bool geos::geomgraph::Label::isLine | ( | uint32_t | geomIndex | ) | const |
bool geos::geomgraph::Label::isNull | ( | ) | const |
bool geos::geomgraph::Label::isNull | ( | uint32_t | geomIndex | ) | const |
void geos::geomgraph::Label::merge | ( | const Label & | lbl | ) |
Merge this label with another one.
Merging updates any null attributes of this label with the attributes from lbl
void geos::geomgraph::Label::setAllLocations | ( | uint32_t | geomIndex, |
geom::Location | location | ||
) |
void geos::geomgraph::Label::setAllLocationsIfNull | ( | uint32_t | geomIndex, |
geom::Location | location | ||
) |
void geos::geomgraph::Label::setAllLocationsIfNull | ( | geom::Location | location | ) |
void geos::geomgraph::Label::setLocation | ( | uint32_t | geomIndex, |
uint32_t | posIndex, | ||
geom::Location | location | ||
) |
void geos::geomgraph::Label::setLocation | ( | uint32_t | geomIndex, |
geom::Location | location | ||
) |
void geos::geomgraph::Label::toLine | ( | uint32_t | geomIndex | ) |
Converts one GeometryLocation to a Line location.
Converts a Label to a Line label (that is, one with no side Locations)
std::string geos::geomgraph::Label::toString | ( | ) | const |
|
friend |
|
private |