GEOS 3.3.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
geos::geomgraph::Label Class Reference

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. More...

`#include <Label.h>`

## Public Member Functions
| Label (int onLoc)
| Construct a Label with a single location for both Geometries.
| Label (int geomIndex, int onLoc)
| Construct a Label with the location specified for the given Geometry.
| Label (int onLoc, int leftLoc, int rightLoc)
| Construct a Label with On, Left and Right locations for both Geometries.
| Label (const Label &l)
| Copy ctor.
| Label ()
| Initialize the locations to Location::UNDEF.
virtual | ~Label ()
| I'd drop the 'virtual' modifier here –strk 2006-04-06.
| Label (int geomIndex, int onLoc, int leftLoc, int rightLoc)
| Construct a Label with On, Left and Right locations for the given Geometries. Initialize the locations for the other Geometry to Location::UNDEF.
void | flip ()
int | getLocation (int geomIndex, int posIndex) const
int | getLocation (int geomIndex) const
void | setLocation (int geomIndex, int posIndex, int location)
void | setLocation (int geomIndex, int location)
void | setAllLocations (int geomIndex, int location)
void | setAllLocationsIfNull (int geomIndex, int location)
void | setAllLocationsIfNull (int location)
void | merge (const Label &lbl)
| Merge this label with another one.
int | getGeometryCount () const
bool | isNull (int geomIndex) const
bool | isAnyNull (int geomIndex) const
bool | isArea () const
bool | isArea (int geomIndex) const
bool | isLine (int geomIndex) const
bool | isEqualOnSide (const Label &lbl, int side) const
bool | allPositionsEqual (int geomIndex, int loc) const
void | toLine (int geomIndex)
| Converts one GeometryLocation to a Line location.
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)

## Protected Attributes
TopologyLocation | elt [2]

## Friends
std::ostream & | operator<< (std::ostream &, const Label &)

## Detailed Description

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.

## Constructor & Destructor Documentation

geos::geomgraph::Label::Label | ( | int | geomIndex,
|  | int | onLoc
| ) |  |

Construct a Label with the location specified for the given Geometry.

Other geometry location will be set to Location::UNDEF.

geos::geomgraph::Label::Label | ( | int | onLoc,
|  | int | leftLoc,
|  | int | rightLoc
| ) |  |

Construct a Label with On, Left and Right locations for both Geometries.

Initialize the locations for both Geometries to the given values.

## Member Function Documentation

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

static Label* geos::geomgraph::Label::toLineLabel | ( | const Label & | label | ) |
| static

Converts a Label to a Line label (that is, one with no side Locations)

Returns a newly allocated object, responsibility of it to the caller.

The documentation for this class was generated from the following file:

- Label.h