SUMO - Simulation of Urban MObility
|
A class that stores a 2D geometrical boundary. More...
#include <Boundary.h>
Public Member Functions | |
void | add (SUMOReal x, SUMOReal y, SUMOReal z=0) |
Makes the boundary include the given coordinate. More... | |
void | add (const Position &p) |
Makes the boundary include the given coordinate. More... | |
void | add (const Boundary &p) |
Makes the boundary include the given boundary. More... | |
bool | around (const Position &p, SUMOReal offset=0) const |
Returns whether the boundary contains the given coordinate. More... | |
Boundary () | |
Constructor - the boundary is unset. More... | |
Boundary (SUMOReal x1, SUMOReal y1, SUMOReal x2, SUMOReal y2) | |
Constructor - the boundary will be build using the given values. More... | |
Boundary (SUMOReal x1, SUMOReal y1, SUMOReal z1, SUMOReal x2, SUMOReal y2, SUMOReal z2) | |
bool | crosses (const Position &p1, const Position &p2) const |
Returns whether the boundary crosses the given line. More... | |
void | flipY () |
flips ymin and ymax More... | |
Position | getCenter () const |
Returns the center of the boundary. More... | |
SUMOReal | getHeight () const |
Returns the height of the boundary (y-axis) More... | |
SUMOReal | getWidth () const |
Returns the width of the boudary (x-axis) More... | |
Boundary & | grow (SUMOReal by) |
extends the boundary by the given amount More... | |
void | growHeight (SUMOReal by) |
Increases the height of the boundary (y-axis) More... | |
void | growWidth (SUMOReal by) |
Increases the width of the boundary (x-axis) More... | |
void | moveby (SUMOReal x, SUMOReal y, SUMOReal z=0) |
Moves the boundary by the given amount. More... | |
bool | overlapsWith (const AbstractPoly &poly, SUMOReal offset=0) const |
Returns whether the boundary overlaps with the given polygon. More... | |
bool | partialWithin (const AbstractPoly &poly, SUMOReal offset=0) const |
Returns whether the boundary is partially within the given polygon. More... | |
void | reset () |
Resets the boundary. More... | |
void | set (SUMOReal xmin, SUMOReal ymin, SUMOReal xmax, SUMOReal ymax) |
Sets the boundary to the given values. More... | |
SUMOReal | xmax () const |
Returns maximum x-coordinate. More... | |
SUMOReal | xmin () const |
Returns minimum x-coordinate. More... | |
SUMOReal | ymax () const |
Returns maximum y-coordinate. More... | |
SUMOReal | ymin () const |
Returns minimum y-coordinate. More... | |
SUMOReal | zmax () const |
Returns maximum z-coordinate. More... | |
SUMOReal | zmin () const |
Returns minimum z-coordinate. More... | |
~Boundary () | |
Destructor. More... | |
Private Attributes | |
bool | myWasInitialised |
Information whether the boundary was initialised. More... | |
SUMOReal | myXmax |
SUMOReal | myXmin |
The boundaries. More... | |
SUMOReal | myYmax |
SUMOReal | myYmin |
SUMOReal | myZmax |
SUMOReal | myZmin |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Boundary &b) |
Output operator. More... | |
A class that stores a 2D geometrical boundary.
Definition at line 48 of file Boundary.h.
Boundary::Boundary | ( | ) |
Constructor - the boundary is unset.
Definition at line 47 of file Boundary.cpp.
Constructor - the boundary will be build using the given values.
Definition at line 54 of file Boundary.cpp.
References add().
Definition at line 64 of file Boundary.cpp.
References add().
Boundary::~Boundary | ( | ) |
Destructor.
Definition at line 74 of file Boundary.cpp.
Makes the boundary include the given coordinate.
Definition at line 90 of file Boundary.cpp.
References myWasInitialised, myXmax, myXmin, myYmax, myYmin, myZmax, and myZmin.
Referenced by add(), NIVissimConnectionCluster::NodeSubCluster::add(), NIVissimConnectionCluster::add(), Boundary(), GUIDanielPerspectiveChanger::centerTo(), NBNetBuilder::compute(), NIVissimDisturbance::computeBounding(), NIVissimConnection::computeBounding(), GUIEdge::getBoundary(), GNEEdge::getBoundary(), PositionVector::getBoxBoundary(), MSDevice_BTsender::VehicleInformation::getBoxBoundary(), GUITrafficLightLogicWrapper::getCenteringBoundary(), GUIContainer::getCenteringBoundary(), GUIPerson::getCenteringBoundary(), GUIPolygon::getCenteringBoundary(), GUIPointOfInterest::getCenteringBoundary(), GUIBaseVehicle::getCenteringBoundary(), GUILane::getCenteringBoundary(), GUISUMOAbstractView::getObjectAtPosition(), GUISUMOAbstractView::getObjectsAtPosition(), GNENet::GNENet(), GUICalibrator::GUICalibrator(), GUILaneSpeedTrigger::GUILaneSpeedTrigger(), GUITriggeredRerouter::GUITriggeredRerouter(), GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(), GUINet::initGUIStructures(), NBHeightMapper::loadShapeFile(), NBHeightMapper::loadTiff(), GNEViewNet::mergeJunctions(), GUITriggeredRerouter::myEndElement(), GUIMEInductLoop::MyWrapper::MyWrapper(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUI_E2_ZS_CollectorOverLanes::MyWrapper::MyWrapper(), GUIE3Collector::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), GNEViewNet::onLeftBtnRelease(), NIVissimConnectionCluster::recomputeBoundary(), GNENet::registerEdge(), GNENet::registerJunction(), GUIDanielPerspectiveChanger::setViewport(), GNEJunction::updateGeometry(), and GeoConvHelper::x2cartesian().
void Boundary::add | ( | const Position & | p | ) |
Makes the boundary include the given coordinate.
Definition at line 111 of file Boundary.cpp.
References add(), Position::x(), Position::y(), and Position::z().
void Boundary::add | ( | const Boundary & | p | ) |
Returns whether the boundary contains the given coordinate.
Implements AbstractPoly.
Definition at line 178 of file Boundary.cpp.
References myXmax, myXmin, myYmax, myYmin, myZmax, myZmin, Position::x(), Position::y(), and Position::z().
Referenced by PCPolyContainer::add(), NIVissimConnectionCluster::around(), NBHeightMapper::getZ(), and NIVissimConnectionCluster::recheckEdges().
Returns whether the boundary crosses the given line.
Implements AbstractPoly.
Definition at line 208 of file Boundary.cpp.
References PositionVector::intersects(), myXmax, myXmin, myYmax, and myYmin.
void Boundary::flipY | ( | ) |
flips ymin and ymax
Definition at line 254 of file Boundary.cpp.
References myYmax, myYmin, and SUMOReal.
Referenced by GeoConvHelper::computeFinal().
Position Boundary::getCenter | ( | ) | const |
Returns the center of the boundary.
Definition at line 124 of file Boundary.cpp.
References myXmax, myXmin, myYmax, myYmin, myZmax, myZmin, and SUMOReal.
Referenced by GUISUMOAbstractView::centerTo(), GUIDanielPerspectiveChanger::getXPos(), GUIDanielPerspectiveChanger::getYPos(), NIVissimConnectionCluster::liesOnSameEdgesEnd(), GUIBaseVehicle::setFunctionalColor(), and GUIDanielPerspectiveChanger::zoom().
SUMOReal Boundary::getHeight | ( | ) | const |
Returns the height of the boundary (y-axis)
Definition at line 172 of file Boundary.cpp.
References myYmax, and myYmin.
Referenced by GUISUMOAbstractView::applyGLTransform(), GUIPolygon::drawGL(), GUISUMOAbstractView::getGridHeight(), GNENet::GNENet(), GUIJunctionWrapper::GUIJunctionWrapper(), GUINet::initGUIStructures(), GUIDanielPerspectiveChanger::onKeyPress(), GUIPerspectiveChanger::patchedViewPort(), GUISUMOAbstractView::screenPos2NetPos(), and GNEJunction::updateGeometry().
SUMOReal Boundary::getWidth | ( | ) | const |
Returns the width of the boudary (x-axis)
Definition at line 166 of file Boundary.cpp.
References myXmax, and myXmin.
Referenced by GUISUMOAbstractView::applyGLTransform(), GUIPolygon::drawGL(), GUISUMOAbstractView::getGridWidth(), GUIDanielPerspectiveChanger::getZoom(), GUIDanielPerspectiveChanger::getZPos(), GNENet::GNENet(), GUIJunctionWrapper::GUIJunctionWrapper(), GUINet::initGUIStructures(), GUISUMOAbstractView::m2p(), GUIDanielPerspectiveChanger::onKeyPress(), GUISUMOAbstractView::p2m(), GUIPerspectiveChanger::patchedViewPort(), GUISUMOAbstractView::screenPos2NetPos(), and GNEJunction::updateGeometry().
extends the boundary by the given amount
The method returns a reference to the instance for further use
Definition at line 232 of file Boundary.cpp.
References myXmax, myXmin, myYmax, and myYmin.
Referenced by GUIDanielPerspectiveChanger::centerTo(), TraCIServer::collectObjectsInRange(), MSDevice_BTreceiver::BTreceiverUpdate::execute(), MSLane::fill(), GUIEdge::getBoundary(), GNEEdge::getBoundary(), GNEInternalLane::getCenteringBoundary(), GNECrossing::getCenteringBoundary(), GUITrafficLightLogicWrapper::getCenteringBoundary(), GNEJunction::getCenteringBoundary(), GUIContainer::getCenteringBoundary(), GUIPerson::getCenteringBoundary(), GUIPolygon::getCenteringBoundary(), GUIInstantInductLoop::MyWrapper::getCenteringBoundary(), GUILaneSpeedTrigger::getCenteringBoundary(), GUICalibrator::getCenteringBoundary(), GUIPointOfInterest::getCenteringBoundary(), GUIMEInductLoop::MyWrapper::getCenteringBoundary(), GUIJunctionWrapper::getCenteringBoundary(), GNEEdge::getCenteringBoundary(), GUIE3Collector::MyWrapper::getCenteringBoundary(), GNELane::getCenteringBoundary(), GUITriggeredRerouter::getCenteringBoundary(), GUIChargingStation::getCenteringBoundary(), GUIContainerStop::getCenteringBoundary(), GUIBusStop::getCenteringBoundary(), GUIEdge::getCenteringBoundary(), GUI_E2_ZS_Collector::MyWrapper::getCenteringBoundary(), GUIInductLoop::MyWrapper::getCenteringBoundary(), GUIBaseVehicle::getCenteringBoundary(), GUITriggeredRerouter::GUITriggeredRerouterEdge::getCenteringBoundary(), GNEAdditional::getCenteringBoundary(), GUILane::getCenteringBoundary(), GUISUMOAbstractView::getObjectAtPosition(), GUISUMOAbstractView::getObjectsAtPosition(), NBEdgeCont::ignoreFilterMatch(), GUINet::initGUIStructures(), and GNEViewNet::mergeJunctions().
void Boundary::growHeight | ( | SUMOReal | by | ) |
Increases the height of the boundary (y-axis)
Definition at line 248 of file Boundary.cpp.
References myYmax, and myYmin.
Referenced by GUIPointOfInterest::getCenteringBoundary(), GUIPerspectiveChanger::patchedViewPort(), and GUIDanielPerspectiveChanger::setViewport().
void Boundary::growWidth | ( | SUMOReal | by | ) |
Increases the width of the boundary (x-axis)
Definition at line 241 of file Boundary.cpp.
References myXmax, and myXmin.
Referenced by GUIPointOfInterest::getCenteringBoundary(), GUIPerspectiveChanger::patchedViewPort(), and GUIDanielPerspectiveChanger::setViewport().
Moves the boundary by the given amount.
Definition at line 281 of file Boundary.cpp.
References myXmax, myXmin, myYmax, myYmin, myZmax, and myZmin.
Referenced by GUIDanielPerspectiveChanger::centerTo(), GUIDanielPerspectiveChanger::move(), GeoConvHelper::moveConvertedBy(), GUIDanielPerspectiveChanger::onKeyPress(), and GNEJunction::setPosition().
|
virtual |
Returns whether the boundary overlaps with the given polygon.
Implements AbstractPoly.
Definition at line 187 of file Boundary.cpp.
References AbstractPoly::crosses(), myXmax, myXmin, myYmax, myYmin, AbstractPoly::partialWithin(), and partialWithin().
Referenced by NIVissimBoundedClusterObject::crosses(), NBEdgeCont::ignoreFilterMatch(), NIVissimConnectionCluster::overlapsWith(), and NIVissimConnectionCluster::NodeSubCluster::overlapsWith().
|
virtual |
Returns whether the boundary is partially within the given polygon.
Implements AbstractPoly.
Definition at line 222 of file Boundary.cpp.
References AbstractPoly::around(), myXmax, myXmin, myYmax, and myYmin.
Referenced by PCPolyContainer::add(), and overlapsWith().
void Boundary::reset | ( | ) |
Resets the boundary.
Definition at line 78 of file Boundary.cpp.
References myWasInitialised, myXmax, myXmin, myYmax, myYmin, myZmax, and myZmin.
Referenced by NBHeightMapper::clearData().
SUMOReal Boundary::xmax | ( | ) | const |
Returns maximum x-coordinate.
Definition at line 136 of file Boundary.cpp.
References myXmax.
Referenced by add(), NIVissimConnectionCluster::add(), SUMORTree::addAdditionalGLObject(), NBHeightMapper::addTriangle(), NIVissimConnectionCluster::around(), NIVissimConnection::buildNodeClusters(), GUIDanielPerspectiveChanger::changeCanvassLeft(), TraCIServer::collectObjectsInRange(), NBNetBuilder::compute(), NIVissimDisturbance::computeBounding(), NIVissimBoundedClusterObject::crosses(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), GNEViewNet::doPaintGL(), MSDevice_BTreceiver::BTreceiverUpdate::execute(), MSLane::fill(), NIVissimConnection::getBoundingBox(), NIVissimConnectionCluster::getPositionForEdge(), TraCIServerAPI_Junction::getTree(), TraCIServerAPI_Polygon::getTree(), NBHeightMapper::getZ(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), NIVissimConnectionCluster::NIVissimConnectionCluster(), NIVissimConnectionCluster::overlapsWith(), NIVissimConnectionCluster::NodeSubCluster::overlapsWith(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_Simulation::processGet(), NIVissimConnectionCluster::recheckEdges(), NIVissimConnectionCluster::recomputeBoundary(), SUMORTree::removeAdditionalGLObject(), set(), GUIBaseVehicle::setFunctionalColor(), GNEPoly::simplifyShape(), BinaryFormatter::writeAttr(), NWWriter_OpenDrive::writeNetwork(), and GUIDanielPerspectiveChanger::zoom().
SUMOReal Boundary::xmin | ( | ) | const |
Returns minimum x-coordinate.
Definition at line 130 of file Boundary.cpp.
References myXmin.
Referenced by add(), NIVissimConnectionCluster::add(), SUMORTree::addAdditionalGLObject(), NBHeightMapper::addTriangle(), GUISUMOAbstractView::applyGLTransform(), NIVissimConnectionCluster::around(), NIVissimConnection::buildNodeClusters(), GUIDanielPerspectiveChanger::changeCanvassLeft(), TraCIServer::collectObjectsInRange(), NBNetBuilder::compute(), NIVissimDisturbance::computeBounding(), NIVissimBoundedClusterObject::crosses(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), GNEViewNet::doPaintGL(), MSDevice_BTreceiver::BTreceiverUpdate::execute(), MSLane::fill(), NIVissimConnection::getBoundingBox(), NIVissimConnectionCluster::getPositionForEdge(), TraCIServerAPI_Junction::getTree(), TraCIServerAPI_Polygon::getTree(), NBHeightMapper::getZ(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), NBNetBuilder::moveToOrigin(), NIVissimConnectionCluster::NIVissimConnectionCluster(), NIVissimConnectionCluster::overlapsWith(), NIVissimConnectionCluster::NodeSubCluster::overlapsWith(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_Simulation::processGet(), NIVissimConnectionCluster::recheckEdges(), NIVissimConnectionCluster::recomputeBoundary(), SUMORTree::removeAdditionalGLObject(), GUISUMOAbstractView::screenPos2NetPos(), set(), GUIBaseVehicle::setFunctionalColor(), GNEPoly::simplifyShape(), BinaryFormatter::writeAttr(), NWWriter_OpenDrive::writeNetwork(), and GUIDanielPerspectiveChanger::zoom().
SUMOReal Boundary::ymax | ( | ) | const |
Returns maximum y-coordinate.
Definition at line 148 of file Boundary.cpp.
References myYmax.
Referenced by add(), SUMORTree::addAdditionalGLObject(), NBHeightMapper::addTriangle(), GUIDanielPerspectiveChanger::changeCanvassLeft(), TraCIServer::collectObjectsInRange(), NBNetBuilder::compute(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), GNEViewNet::doPaintGL(), MSDevice_BTreceiver::BTreceiverUpdate::execute(), MSLane::fill(), TraCIServerAPI_Junction::getTree(), TraCIServerAPI_Polygon::getTree(), NBHeightMapper::getZ(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), NBNetBuilder::moveToOrigin(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_Simulation::processGet(), SUMORTree::removeAdditionalGLObject(), set(), GUIBaseVehicle::setFunctionalColor(), GNEPoly::simplifyShape(), BinaryFormatter::writeAttr(), NWWriter_OpenDrive::writeNetwork(), and GUIDanielPerspectiveChanger::zoom().
SUMOReal Boundary::ymin | ( | ) | const |
Returns minimum y-coordinate.
Definition at line 142 of file Boundary.cpp.
References myYmin.
Referenced by add(), SUMORTree::addAdditionalGLObject(), NBHeightMapper::addTriangle(), GUISUMOAbstractView::applyGLTransform(), GUIDanielPerspectiveChanger::changeCanvassLeft(), TraCIServer::collectObjectsInRange(), NBNetBuilder::compute(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), GNEViewNet::doPaintGL(), MSDevice_BTreceiver::BTreceiverUpdate::execute(), MSLane::fill(), TraCIServerAPI_Junction::getTree(), TraCIServerAPI_Polygon::getTree(), GNENet::GNENet(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), NBNetBuilder::moveToOrigin(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_Simulation::processGet(), SUMORTree::removeAdditionalGLObject(), GUISUMOAbstractView::screenPos2NetPos(), set(), GUIBaseVehicle::setFunctionalColor(), GNEPoly::simplifyShape(), BinaryFormatter::writeAttr(), NWWriter_OpenDrive::writeNetwork(), and GUIDanielPerspectiveChanger::zoom().
SUMOReal Boundary::zmax | ( | ) | const |
Returns maximum z-coordinate.
Definition at line 160 of file Boundary.cpp.
References myZmax.
Referenced by add().
SUMOReal Boundary::zmin | ( | ) | const |
Returns minimum z-coordinate.
Definition at line 154 of file Boundary.cpp.
References myZmin.
Referenced by add().
|
friend |
Output operator.
Definition at line 265 of file Boundary.cpp.
|
private |
Information whether the boundary was initialised.
Definition at line 142 of file Boundary.h.
|
private |
Definition at line 139 of file Boundary.h.
Referenced by add(), around(), crosses(), getCenter(), getWidth(), grow(), growWidth(), moveby(), operator<<(), overlapsWith(), partialWithin(), reset(), set(), and xmax().
|
private |
The boundaries.
Definition at line 139 of file Boundary.h.
Referenced by add(), around(), crosses(), getCenter(), getWidth(), grow(), growWidth(), moveby(), operator<<(), overlapsWith(), partialWithin(), reset(), set(), and xmin().
|
private |
Definition at line 139 of file Boundary.h.
Referenced by add(), around(), crosses(), flipY(), getCenter(), getHeight(), grow(), growHeight(), moveby(), operator<<(), overlapsWith(), partialWithin(), reset(), set(), and ymax().
|
private |
Definition at line 139 of file Boundary.h.
Referenced by add(), around(), crosses(), flipY(), getCenter(), getHeight(), grow(), growHeight(), moveby(), operator<<(), overlapsWith(), partialWithin(), reset(), set(), and ymin().
|
private |
Definition at line 139 of file Boundary.h.
Referenced by add(), around(), getCenter(), moveby(), reset(), and zmax().
|
private |
Definition at line 139 of file Boundary.h.
Referenced by add(), around(), getCenter(), moveby(), reset(), and zmin().