![]() |
Eclipse SUMO - Simulation of Urban MObility
|
A class that stores a 2D geometrical boundary. More...
#include <Boundary.h>
Public Member Functions | |
| void | add (const Boundary &p) |
| Makes the boundary include the given boundary. | |
| void | add (const Position &p) |
| Makes the boundary include the given coordinate. | |
| void | add (double x, double y, double z=0) |
| Makes the boundary include the given coordinate. | |
| Boundary () | |
| Constructor - the boundary is unset. | |
| Boundary (double x1, double y1, double x2, double y2) | |
| Constructor - the boundary will be build using the given values. | |
| Boundary (double x1, double y1, double z1, double x2, double y2, double z2) | |
| Constructor - the boundary will be build using the given values including Z. | |
| bool | contains2D (const Boundary &b) const |
| return true if this boundary contains the given boundary (only X-Y) | |
| double | distanceTo2D (const Boundary &b) const |
| returns the euclidean distance in the x-y-plane | |
| double | distanceTo2D (const Position &p) const |
| returns the euclidean distance in the x-y-plane | |
| void | flipY () |
| flips ymin and ymax | |
| Position | getCenter () const |
| Returns the center of the boundary. | |
| double | getHeight () const |
| Returns the height of the boundary (y-axis). | |
| PositionVector | getShape (const bool closeShape) const |
| get position vector (shape) based on this boundary | |
| double | getWidth () const |
| Returns the width of the boudary (x-axis). | |
| double | getZRange () const |
| Returns the elevation range of the boundary (z-axis). | |
| Boundary & | grow (double by) |
| extends the boundary by the given amount | |
| void | growHeight (double by) |
| Increases the height of the boundary (y-axis). | |
| void | growWidth (double by) |
| Increases the width of the boundary (x-axis). | |
| bool | isInitialised () const |
| check if Boundary is Initialised | |
| void | moveby (double x, double y, double z=0) |
| Moves the boundary by the given amount. | |
| bool | operator!= (const Boundary &b) const |
| Comparison operator not equal. | |
| bool | operator== (const Boundary &b) const |
| Comparison operator equal. | |
| bool | overlaps2D (const Boundary &b) const |
| return true if at least one point of the given boundary is in boundary(only X-Y) | |
| void | reset () |
| Resets the boundary. | |
| Boundary & | scale (double by) |
| scale the boundary by the given amount | |
| void | set (double xmin, double ymin, double xmax, double ymax) |
| Sets the boundary to the given values. | |
| void | setOffsets (double xmin, double ymin, double xmax, double ymax) |
| Sets the boundary to the given values, ignoring min < max constraints. | |
| double | xmax () const |
| Returns maximum x-coordinate. | |
| double | xmin () const |
| Returns minimum x-coordinate. | |
| double | ymax () const |
| Returns maximum y-coordinate. | |
| double | ymin () const |
| Returns minimum y-coordinate. | |
| double | zmax () const |
| Returns maximum z-coordinate. | |
| double | zmin () const |
| Returns minimum z-coordinate. | |
inherited from AbstractPoly | |
| bool | around (const Position &p, double offset=0) const |
| Returns whether the boundary contains the given coordinate. | |
| bool | around2D (const Position &p, double offset=0) const |
| Returns whether the boundary contains the given 2D coordinate (position). | |
| bool | around2D (const double x, const double y) const |
| Returns whether the boundary contains the given 2D coordinate (x-y version). | |
| bool | overlapsWith (const AbstractPoly &poly, double offset=0) const |
| Returns whether the boundary overlaps with the given polygon. | |
| bool | partialWithin (const AbstractPoly &poly, double offset=0) const |
| Returns whether the boundary is partially within the given polygon. | |
| bool | crosses (const Position &p1, const Position &p2) const |
| Returns whether the boundary crosses the given line. | |
Private Attributes | |
| bool | myWasInitialised |
| Information whether the boundary was initialised. | |
| double | myXmax |
| double | myXmin |
| The boundaries. | |
| double | myYmax |
| double | myYmin |
| double | myZmax |
| double | myZmin |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Boundary &b) |
| Output operator. | |
A class that stores a 2D geometrical boundary.
Definition at line 39 of file Boundary.h.
| Boundary::Boundary | ( | ) |
Constructor - the boundary is unset.
Definition at line 35 of file Boundary.cpp.
References myWasInitialised, myXmax, myXmin, myYmax, myYmin, myZmax, and myZmin.
Referenced by add(), SUMORTree::addAdditionalGLObject(), contains2D(), distanceTo2D(), operator!=(), operator<<, operator==(), overlaps2D(), and SUMORTree::removeAdditionalGLObject().
| Boundary::Boundary | ( | double | x1, |
| double | y1, | ||
| double | x2, | ||
| double | y2 ) |
Constructor - the boundary will be build using the given values.
Definition at line 42 of file Boundary.cpp.
References add(), myWasInitialised, myXmax, myXmin, myYmax, myYmin, myZmax, and myZmin.
| Boundary::Boundary | ( | double | x1, |
| double | y1, | ||
| double | z1, | ||
| double | x2, | ||
| double | y2, | ||
| double | z2 ) |
Constructor - the boundary will be build using the given values including Z.
Definition at line 52 of file Boundary.cpp.
References add(), myWasInitialised, myXmax, myXmin, myYmax, myYmin, myZmax, and myZmin.
| void Boundary::add | ( | const Boundary & | p | ) |
Makes the boundary include the given boundary.
Definition at line 102 of file Boundary.cpp.
References add(), Boundary(), xmax(), xmin(), ymax(), ymin(), zmax(), and zmin().
| void Boundary::add | ( | const Position & | p | ) |
Makes the boundary include the given coordinate.
Definition at line 96 of file Boundary.cpp.
References add(), Position::x(), Position::y(), and Position::z().
| void Boundary::add | ( | double | x, |
| double | y, | ||
| double | z = 0 ) |
Makes the boundary include the given coordinate.
Definition at line 75 of file Boundary.cpp.
References myWasInitialised, myXmax, myXmin, myYmax, myYmin, myZmax, and myZmin.
Referenced by add(), add(), MSEdge::addSuccessor(), ROEdge::addSuccessor(), GUISUMOAbstractView::applyGLTransform(), Boundary(), Boundary(), GNEAdditionalHandler::buildTAZ(), GUIViewObjectsHandler::checkGeometryPoint(), NBNetBuilder::compute(), NIVissimConnection::computeBounding(), NIVissimDisturbance::computeBounding(), GUIEdge::getBoundary(), MSDevice_BTsender::VehicleInformation::getBoxBoundary(), PositionVector::getBoxBoundary(), GNEContainer::getCenteringBoundary(), GNEPerson::getCenteringBoundary(), GNERoute::getCenteringBoundary(), GNEVehicle::getCenteringBoundary(), GUITrafficLightLogicWrapper::getCenteringBoundary(), GUISUMOAbstractView::getGUIGlObjectsAtPosition(), GUISUMOAbstractView::getObjectAtPosition(), GUISUMOAbstractView::getObjectsAtPosition(), NBHeightMapper::loadTiff(), MSPModel_Striping::moveInDirection(), NIImporter_OpenDrive::myCharacters(), GNEShapeFrame::GEOPOICreator::onCmdCreateGEOPOI(), GNEViewNetHelper::SelectingArea::processEdgeRectangleSelection(), GNEViewNetHelper::SelectingArea::processRectangleSelection(), NBRailwayGeometryHelper::straigthenCorrdidor(), and GNEViewNet::updateObjectsInPosition().
|
virtual |
Returns whether the boundary contains the given coordinate.
Implements AbstractPoly.
Definition at line 169 of file Boundary.cpp.
References myXmax, myXmin, myYmax, myYmin, myZmax, myZmin, Position::x(), Position::y(), and Position::z().
| bool Boundary::around2D | ( | const double | x, |
| const double | y ) const |
| bool Boundary::around2D | ( | const Position & | p, |
| double | offset = 0 ) const |
Returns whether the boundary contains the given 2D coordinate (position).
Definition at line 178 of file Boundary.cpp.
References myXmax, myXmin, myYmax, myYmin, Position::x(), and Position::y().
Referenced by NBHeightMapper::getZ(), and overlaps2D().
| bool Boundary::contains2D | ( | const Boundary & | b | ) | const |
return true if this boundary contains the given boundary (only X-Y)
Definition at line 229 of file Boundary.cpp.
References Boundary(), myXmax, myXmin, myYmax, and myYmin.
Returns whether the boundary crosses the given line.
Implements AbstractPoly.
Definition at line 215 of file Boundary.cpp.
References PositionVector::intersects(), myXmax, myXmin, myYmax, and myYmin.
| double Boundary::distanceTo2D | ( | const Boundary & | b | ) | const |
returns the euclidean distance in the x-y-plane
Definition at line 296 of file Boundary.cpp.
References Boundary(), myXmax, myXmin, myYmax, and myYmin.
| double Boundary::distanceTo2D | ( | const Position & | p | ) | const |
returns the euclidean distance in the x-y-plane
Definition at line 262 of file Boundary.cpp.
References myXmax, myXmin, myYmax, myYmin, Position::x(), and Position::y().
Referenced by libsumo::Helper::convertCartesianToRoadMap(), MSEdge::getDistanceTo(), and ROEdge::getDistanceTo().
| void Boundary::flipY | ( | ) |
| Position Boundary::getCenter | ( | ) | const |
Returns the center of the boundary.
Definition at line 109 of file Boundary.cpp.
References myXmax, myXmin, myYmax, myYmin, myZmax, and myZmin.
Referenced by GUISUMOAbstractView::applyGLTransform(), GUIGlObject::getCenter(), NIVissimConnectionCluster::liesOnSameEdgesEnd(), MSPModel_Striping::moveInDirection(), GUISUMOAbstractView::screenPos2NetPos(), and GUIOSGPerspectiveChanger::setViewport().
| double Boundary::getHeight | ( | ) | const |
Returns the height of the boundary (y-axis).
Definition at line 157 of file Boundary.cpp.
References myYmax, and myYmin.
Referenced by GUISUMOAbstractView::applyGLTransform(), GUIPolygon::checkDraw(), libsumo::Helper::convertCartesianToRoadMap(), and GUISUMOAbstractView::screenPos2NetPos().
| PositionVector Boundary::getShape | ( | const bool | closeShape | ) | const |
get position vector (shape) based on this boundary
Definition at line 444 of file Boundary.cpp.
References myXmax, myXmin, myYmax, and myYmin.
Referenced by GNEAdditionalHandler::buildTAZ(), GNEViewNetHelper::SelectingArea::processBoundarySelection(), GNEViewNetHelper::SelectingArea::processEdgeRectangleSelection(), and LIBSUMO_NAMESPACE::Simulation::storeShape().
| double Boundary::getWidth | ( | ) | const |
Returns the width of the boudary (x-axis).
Definition at line 151 of file Boundary.cpp.
References myXmax, and myXmin.
Referenced by GUISUMOAbstractView::applyGLTransform(), GUIPolygon::checkDraw(), libsumo::Helper::convertCartesianToRoadMap(), MSPModel_Striping::moveInDirection(), and GUISUMOAbstractView::screenPos2NetPos().
| double Boundary::getZRange | ( | ) | const |
Returns the elevation range of the boundary (z-axis).
Definition at line 163 of file Boundary.cpp.
References myZmax, and myZmin.
Referenced by NBNetBuilder::compute().
| Boundary & Boundary::grow | ( | double | by | ) |
extends the boundary by the given amount
Definition at line 340 of file Boundary.cpp.
References myXmax, myXmin, myYmax, and myYmin.
Referenced by NBEdgeCont::checkOverlap(), libsumo::Helper::collectObjectsInRange(), GUIEdge::getBoundary(), GNEAdditional::getCenteringBoundary(), GNEContainer::getCenteringBoundary(), GNEPerson::getCenteringBoundary(), GNEVehicle::getCenteringBoundary(), GUITrafficLightLogicWrapper::getCenteringBoundary(), GUISUMOAbstractView::getGUIGlObjectsAtPosition(), GUISUMOAbstractView::getObjectAtPosition(), GUISUMOAbstractView::getObjectsAtPosition(), NBEdgeCont::ignoreFilterMatch(), NBEdgeCont::joinTramEdges(), NWWriter_OpenDrive::mapmatchRoadObjects(), GNEShapeFrame::GEOPOICreator::onCmdCreateGEOPOI(), and GNEViewNet::updateObjectsInPosition().
| void Boundary::growHeight | ( | double | by | ) |
Increases the height of the boundary (y-axis).
Definition at line 366 of file Boundary.cpp.
References myYmax, and myYmin.
Referenced by scale().
| void Boundary::growWidth | ( | double | by | ) |
Increases the width of the boundary (x-axis).
Definition at line 359 of file Boundary.cpp.
References myXmax, and myXmin.
Referenced by MSPModel_Striping::moveInDirection(), and scale().
| bool Boundary::isInitialised | ( | ) | const |
check if Boundary is Initialised
Definition at line 256 of file Boundary.cpp.
References myWasInitialised.
Referenced by GUIViewObjectsHandler::checkShapeObject(), GNEAdditional::getCenteringBoundary(), GNERoute::getCenteringBoundary(), and NIImporter_OpenDrive::loadNetwork().
| void Boundary::moveby | ( | double | x, |
| double | y, | ||
| double | z = 0 ) |
| bool Boundary::operator!= | ( | const Boundary & | b | ) | const |
| bool Boundary::operator== | ( | const Boundary & | b | ) | const |
Comparison operator equal.
Definition at line 390 of file Boundary.cpp.
References Boundary(), myWasInitialised, myXmax, myXmin, myYmax, myYmin, myZmax, and myZmin.
| bool Boundary::overlaps2D | ( | const Boundary & | b | ) | const |
return true if at least one point of the given boundary is in boundary(only X-Y)
Definition at line 240 of file Boundary.cpp.
References around2D(), and Boundary().
|
virtual |
Returns whether the boundary overlaps with the given polygon.
Implements AbstractPoly.
Definition at line 194 of file Boundary.cpp.
References AbstractPoly::crosses(), myXmax, myXmin, myYmax, myYmin, AbstractPoly::partialWithin(), and partialWithin().
Referenced by NBEdgeCont::checkOverlap(), NBEdgeCont::ignoreFilterMatch(), and NIVissimConnectionCluster::overlapsWith().
|
virtual |
Returns whether the boundary is partially within the given polygon.
Implements AbstractPoly.
Definition at line 330 of file Boundary.cpp.
References AbstractPoly::around(), myXmax, myXmin, myYmax, and myYmin.
Referenced by overlapsWith().
| void Boundary::reset | ( | ) |
Resets the boundary.
Definition at line 63 of file Boundary.cpp.
References myWasInitialised, myXmax, myXmin, myYmax, myYmin, myZmax, and myZmin.
| Boundary & Boundary::scale | ( | double | by | ) |
scale the boundary by the given amount
Definition at line 351 of file Boundary.cpp.
References growHeight(), growWidth(), myXmax, myXmin, myYmax, and myYmin.
| void Boundary::set | ( | double | xmin, |
| double | ymin, | ||
| double | xmax, | ||
| double | ymax ) |
| void Boundary::setOffsets | ( | double | xmin, |
| double | ymin, | ||
| double | xmax, | ||
| double | ymax ) |
| double Boundary::xmax | ( | ) | const |
Returns maximum x-coordinate.
Definition at line 121 of file Boundary.cpp.
References myXmax.
Referenced by add(), MSPModel_JuPedSim::add(), NIVissimConnectionCluster::add(), GUISUMOAbstractView::applyGLTransform(), NBPTStopCont::assignEdgeForFloatingStops(), NIVissimConnection::buildNodeClusters(), NBNetBuilder::compute(), GUIViewTraffic::doPaintGL(), GNEViewNet::drawGLElements(), NBPTStopCont::findAccessEdgesForRailStops(), Triangle::intersectWithShape(), Triangle::isBoundaryFullWithin(), NBEdgeCont::joinTramEdges(), NIImporter_OpenDrive::loadNetwork(), main(), GUISUMOAbstractView::makeSnapshot(), NWWriter_OpenDrive::mapmatchRoadObjects(), NIVissimConnectionCluster::NodeSubCluster::overlapsWith(), NIVissimConnectionCluster::overlapsWith(), set(), setOffsets(), and NWWriter_DlrNavteq::writeNodesUnsplitted().
| double Boundary::xmin | ( | ) | const |
Returns minimum x-coordinate.
Definition at line 115 of file Boundary.cpp.
References myXmin.
Referenced by add(), MSPModel_JuPedSim::add(), NIVissimConnectionCluster::add(), GUISUMOAbstractView::applyGLTransform(), NBPTStopCont::assignEdgeForFloatingStops(), NIVissimConnection::buildNodeClusters(), NBNetBuilder::compute(), GUIViewTraffic::doPaintGL(), GNEViewNet::drawGLElements(), NBPTStopCont::findAccessEdgesForRailStops(), NBHeightMapper::getZ(), Triangle::intersectWithShape(), Triangle::isBoundaryFullWithin(), NBEdgeCont::joinTramEdges(), NIImporter_OpenDrive::loadNetwork(), main(), GUISUMOAbstractView::makeSnapshot(), NWWriter_OpenDrive::mapmatchRoadObjects(), NBNetBuilder::moveToOrigin(), NIVissimConnectionCluster::NodeSubCluster::overlapsWith(), NIVissimConnectionCluster::overlapsWith(), GUISUMOAbstractView::screenPos2NetPos(), set(), setOffsets(), and NWWriter_DlrNavteq::writeNodesUnsplitted().
| double Boundary::ymax | ( | ) | const |
Returns maximum y-coordinate.
Definition at line 133 of file Boundary.cpp.
References myYmax.
Referenced by add(), MSPModel_JuPedSim::add(), GUISUMOAbstractView::applyGLTransform(), NBPTStopCont::assignEdgeForFloatingStops(), NBNetBuilder::compute(), GUIViewTraffic::doPaintGL(), GNEViewNet::drawGLElements(), NBPTStopCont::findAccessEdgesForRailStops(), NBHeightMapper::getZ(), Triangle::intersectWithShape(), Triangle::isBoundaryFullWithin(), NBEdgeCont::joinTramEdges(), NIImporter_OpenDrive::loadNetwork(), main(), GUISUMOAbstractView::makeSnapshot(), NWWriter_OpenDrive::mapmatchRoadObjects(), MSPModel_Striping::moveInDirection(), NBNetBuilder::moveToOrigin(), set(), setOffsets(), and NWWriter_DlrNavteq::writeNodesUnsplitted().
| double Boundary::ymin | ( | ) | const |
Returns minimum y-coordinate.
Definition at line 127 of file Boundary.cpp.
References myYmin.
Referenced by add(), MSPModel_JuPedSim::add(), GUISUMOAbstractView::applyGLTransform(), NBPTStopCont::assignEdgeForFloatingStops(), NBNetBuilder::compute(), GUIViewTraffic::doPaintGL(), GNEViewNet::drawGLElements(), NBPTStopCont::findAccessEdgesForRailStops(), Triangle::intersectWithShape(), Triangle::isBoundaryFullWithin(), NBEdgeCont::joinTramEdges(), NIImporter_OpenDrive::loadNetwork(), main(), GUISUMOAbstractView::makeSnapshot(), NWWriter_OpenDrive::mapmatchRoadObjects(), MSPModel_Striping::moveInDirection(), NBNetBuilder::moveToOrigin(), GUISUMOAbstractView::screenPos2NetPos(), set(), setOffsets(), and NWWriter_DlrNavteq::writeNodesUnsplitted().
| double Boundary::zmax | ( | ) | const |
Returns maximum z-coordinate.
Definition at line 145 of file Boundary.cpp.
References myZmax.
Referenced by add().
| double Boundary::zmin | ( | ) | const |
Returns minimum z-coordinate.
Definition at line 139 of file Boundary.cpp.
References myZmin.
Referenced by add().
|
friend |
|
private |
Information whether the boundary was initialised.
Definition at line 175 of file Boundary.h.
Referenced by add(), Boundary(), Boundary(), Boundary(), isInitialised(), operator==(), and reset().
|
private |
Definition at line 172 of file Boundary.h.
Referenced by add(), around(), around2D(), around2D(), Boundary(), Boundary(), Boundary(), contains2D(), crosses(), distanceTo2D(), distanceTo2D(), getCenter(), getShape(), getWidth(), grow(), growWidth(), moveby(), operator==(), overlapsWith(), partialWithin(), reset(), scale(), set(), setOffsets(), and xmax().
|
private |
The boundaries.
Definition at line 172 of file Boundary.h.
Referenced by add(), around(), around2D(), around2D(), Boundary(), Boundary(), Boundary(), contains2D(), crosses(), distanceTo2D(), distanceTo2D(), getCenter(), getShape(), getWidth(), grow(), growWidth(), moveby(), operator==(), overlapsWith(), partialWithin(), reset(), scale(), set(), setOffsets(), and xmin().
|
private |
Definition at line 172 of file Boundary.h.
Referenced by add(), around(), around2D(), around2D(), Boundary(), Boundary(), Boundary(), contains2D(), crosses(), distanceTo2D(), distanceTo2D(), flipY(), getCenter(), getHeight(), getShape(), grow(), growHeight(), moveby(), operator==(), overlapsWith(), partialWithin(), reset(), scale(), set(), setOffsets(), and ymax().
|
private |
Definition at line 172 of file Boundary.h.
Referenced by add(), around(), around2D(), around2D(), Boundary(), Boundary(), Boundary(), contains2D(), crosses(), distanceTo2D(), distanceTo2D(), flipY(), getCenter(), getHeight(), getShape(), grow(), growHeight(), moveby(), operator==(), overlapsWith(), partialWithin(), reset(), scale(), set(), setOffsets(), and ymin().
|
private |
Definition at line 172 of file Boundary.h.
Referenced by add(), around(), Boundary(), Boundary(), Boundary(), getCenter(), getZRange(), moveby(), operator==(), reset(), and zmax().
|
private |
Definition at line 172 of file Boundary.h.
Referenced by add(), around(), Boundary(), Boundary(), Boundary(), getCenter(), getZRange(), moveby(), operator==(), reset(), and zmin().