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) |
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... | |
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. More... | |
SUMOReal | getWidth () const |
Returns the width of the boudary. More... | |
Boundary & | grow (SUMOReal by) |
extends the boundary by the given amount More... | |
void | growHeight (SUMOReal by) |
void | growWidth (SUMOReal by) |
void | moveby (SUMOReal x, SUMOReal y) |
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... | |
~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 |
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 53 of file Boundary.cpp.
References add().
Boundary::~Boundary | ( | ) |
Destructor.
Definition at line 62 of file Boundary.cpp.
Makes the boundary include the given coordinate.
Definition at line 76 of file Boundary.cpp.
References myWasInitialised, myXmax, myXmin, myYmax, and myYmin.
Referenced by add(), NIVissimConnectionCluster::NodeSubCluster::add(), NIVissimConnectionCluster::add(), TraCIRTree::addObject(), Boundary(), GUIDanielPerspectiveChanger::centerTo(), NIVissimDisturbance::computeBounding(), NIVissimConnection::computeBounding(), GUIEdge::getBoundary(), PositionVector::getBoxBoundary(), GUITrafficLightLogicWrapper::getCenteringBoundary(), GUIPolygon::getCenteringBoundary(), GUIPerson::getCenteringBoundary(), GUIPointOfInterest::getCenteringBoundary(), GUILaneWrapper::getCenteringBoundary(), GUIVehicle::getCenteringBoundary(), GUISUMOAbstractView::getObjectAtPosition(), TraCIServerAPI_Edge::getTree(), GUILaneSpeedTrigger::GUILaneSpeedTrigger(), GUITriggeredRerouter::GUITriggeredRerouter(), GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(), GUINet::initGUIStructures(), NBNetBuilder::moveToOrigin(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUIE3Collector::MyWrapper::MyWrapper(), GUI_E2_ZS_CollectorOverLanes::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), NIVissimConnectionCluster::recomputeBoundary(), NIVissimNodeDef_Edges::searchAndSetConnections(), GUIDanielPerspectiveChanger::setViewport(), and GeoConvHelper::x2cartesian().
void Boundary::add | ( | const Position & | p | ) |
Makes the boundary include the given coordinate.
Definition at line 93 of file Boundary.cpp.
References add(), Position::x(), and Position::y().
void Boundary::add | ( | const Boundary & | p | ) |
Returns whether the boundary contains the given coordinate.
Implements AbstractPoly.
Definition at line 148 of file Boundary.cpp.
References myXmax, myXmin, myYmax, myYmin, Position::x(), and Position::y().
Referenced by NIVissimConnectionCluster::around(), PCPolyContainer::insert(), and NIVissimConnectionCluster::recheckEdges().
Returns whether the boundary crosses the given line.
Implements AbstractPoly.
Definition at line 177 of file Boundary.cpp.
References GeomHelper::intersects(), myXmax, myXmin, myYmax, and myYmin.
void Boundary::flipY | ( | ) |
flips ymin and ymax
Definition at line 222 of file Boundary.cpp.
Position Boundary::getCenter | ( | ) | const |
Returns the center of the boundary.
Definition at line 106 of file Boundary.cpp.
References myXmax, myXmin, myYmax, myYmin, and SUMOReal.
Referenced by GUISUMOAbstractView::centerTo(), GUIDanielPerspectiveChanger::getXPos(), GUIDanielPerspectiveChanger::getYPos(), NIVissimConnectionCluster::liesOnSameEdgesEnd(), GUIVehicle::setFunctionalColor(), and GUIDanielPerspectiveChanger::zoom().
SUMOReal Boundary::getHeight | ( | ) | const |
Returns the height of the boundary.
Definition at line 142 of file Boundary.cpp.
References myYmax, and myYmin.
Referenced by GUISUMOAbstractView::applyGLTransform(), GUIPolygon::drawGL(), GUISUMOAbstractView::getGridHeight(), GUISUMOAbstractView::getPositionInformation(), GUIJunctionWrapper::GUIJunctionWrapper(), GUINet::initGUIStructures(), and GUIPerspectiveChanger::patchedViewPort().
SUMOReal Boundary::getWidth | ( | ) | const |
Returns the width of the boudary.
Definition at line 136 of file Boundary.cpp.
References myXmax, and myXmin.
Referenced by GUISUMOAbstractView::applyGLTransform(), GUIPolygon::drawGL(), GUISUMOAbstractView::getGridWidth(), GUISUMOAbstractView::getPositionInformation(), GUIDanielPerspectiveChanger::getZoom(), GUIJunctionWrapper::GUIJunctionWrapper(), GUINet::initGUIStructures(), GUISUMOAbstractView::m2p(), GUISUMOAbstractView::p2m(), and GUIPerspectiveChanger::patchedViewPort().
extends the boundary by the given amount
The method returns a reference to the instance for further use
Definition at line 200 of file Boundary.cpp.
References myXmax, myXmin, myYmax, and myYmin.
Referenced by GUIDanielPerspectiveChanger::centerTo(), traci::TraCIServer::collectObjectsInRange(), GUIEdge::getBoundary(), GUITrafficLightLogicWrapper::getCenteringBoundary(), GUIPerson::getCenteringBoundary(), GUIPolygon::getCenteringBoundary(), GUILaneSpeedTrigger::getCenteringBoundary(), GUITriggeredRerouter::getCenteringBoundary(), GUIInstantInductLoop::MyWrapper::getCenteringBoundary(), GUIJunctionWrapper::getCenteringBoundary(), GUILaneWrapper::getCenteringBoundary(), GUIE3Collector::MyWrapper::getCenteringBoundary(), GUIVehicle::getCenteringBoundary(), GUIBusStop::getCenteringBoundary(), GUI_E2_ZS_Collector::MyWrapper::getCenteringBoundary(), GUIEdge::getCenteringBoundary(), GUITriggeredRerouter::GUITriggeredRerouterEdge::getCenteringBoundary(), GUIInductLoop::MyWrapper::getCenteringBoundary(), GUISUMOAbstractView::getObjectAtPosition(), TraCIServerAPI_Lane::getTree(), NBEdgeCont::ignoreFilterMatch(), and GUINet::initGUIStructures().
void Boundary::growHeight | ( | SUMOReal | by | ) |
Definition at line 216 of file Boundary.cpp.
References myYmax, and myYmin.
Referenced by GUIPointOfInterest::getCenteringBoundary(), GUIPerspectiveChanger::patchedViewPort(), and GUIDanielPerspectiveChanger::setViewport().
void Boundary::growWidth | ( | SUMOReal | by | ) |
Definition at line 209 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 249 of file Boundary.cpp.
References myXmax, myXmin, myYmax, and myYmin.
Referenced by GUIDanielPerspectiveChanger::centerTo(), GUIDanielPerspectiveChanger::move(), and GeoConvHelper::moveConvertedBy().
|
virtual |
Returns whether the boundary overlaps with the given polygon.
Implements AbstractPoly.
Definition at line 156 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 190 of file Boundary.cpp.
References AbstractPoly::around(), myXmax, myXmin, myYmax, and myYmin.
Referenced by PCPolyContainer::insert(), and overlapsWith().
void Boundary::reset | ( | ) |
Resets the boundary.
Definition at line 66 of file Boundary.cpp.
References myWasInitialised, myXmax, myXmin, myYmax, and myYmin.
SUMOReal Boundary::xmax | ( | ) | const |
Returns maximum x-coordinate.
Definition at line 118 of file Boundary.cpp.
References myXmax.
Referenced by add(), NIVissimConnectionCluster::add(), SUMORTree::addAdditionalGLObject(), TraCIRTree::addObject(), NIVissimConnectionCluster::around(), NIVissimConnection::buildNodeClusters(), GUIDanielPerspectiveChanger::changeCanvassLeft(), traci::TraCIServer::collectObjectsInRange(), NBNetBuilder::compute(), NIVissimDisturbance::computeBounding(), NIVissimBoundedClusterObject::crosses(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), NIVissimConnection::getBoundingBox(), NIVissimConnectionCluster::getPositionForEdge(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), NIVissimConnectionCluster::NIVissimConnectionCluster(), NIVissimConnectionCluster::overlapsWith(), NIVissimConnectionCluster::NodeSubCluster::overlapsWith(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), NIVissimConnectionCluster::recheckEdges(), NIVissimConnectionCluster::recomputeBoundary(), SUMORTree::removeAdditionalGLObject(), TraCIRTree::removeAdditionalGLObject(), set(), GUIVehicle::setFunctionalColor(), BinaryFormatter::writeAttr(), NWWriter_OpenDrive::writeNetwork(), and GUIDanielPerspectiveChanger::zoom().
SUMOReal Boundary::xmin | ( | ) | const |
Returns minimum x-coordinate.
Definition at line 112 of file Boundary.cpp.
References myXmin.
Referenced by add(), NIVissimConnectionCluster::add(), SUMORTree::addAdditionalGLObject(), TraCIRTree::addObject(), GUISUMOAbstractView::applyGLTransform(), NIVissimConnectionCluster::around(), NIVissimConnection::buildNodeClusters(), GUIDanielPerspectiveChanger::changeCanvassLeft(), traci::TraCIServer::collectObjectsInRange(), NBNetBuilder::compute(), NIVissimDisturbance::computeBounding(), NIVissimBoundedClusterObject::crosses(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), NIVissimConnection::getBoundingBox(), NIVissimConnectionCluster::getPositionForEdge(), GUISUMOAbstractView::getPositionInformation(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), NBNetBuilder::moveToOrigin(), NIVissimConnectionCluster::NIVissimConnectionCluster(), NIVissimConnectionCluster::overlapsWith(), NIVissimConnectionCluster::NodeSubCluster::overlapsWith(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), NIVissimConnectionCluster::recheckEdges(), NIVissimConnectionCluster::recomputeBoundary(), SUMORTree::removeAdditionalGLObject(), TraCIRTree::removeAdditionalGLObject(), set(), GUIVehicle::setFunctionalColor(), BinaryFormatter::writeAttr(), NWWriter_OpenDrive::writeNetwork(), and GUIDanielPerspectiveChanger::zoom().
SUMOReal Boundary::ymax | ( | ) | const |
Returns maximum y-coordinate.
Definition at line 130 of file Boundary.cpp.
References myYmax.
Referenced by add(), SUMORTree::addAdditionalGLObject(), TraCIRTree::addObject(), GUIDanielPerspectiveChanger::changeCanvassLeft(), traci::TraCIServer::collectObjectsInRange(), NBNetBuilder::compute(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), SUMORTree::removeAdditionalGLObject(), TraCIRTree::removeAdditionalGLObject(), set(), GUIVehicle::setFunctionalColor(), BinaryFormatter::writeAttr(), NWWriter_OpenDrive::writeNetwork(), and GUIDanielPerspectiveChanger::zoom().
SUMOReal Boundary::ymin | ( | ) | const |
Returns minimum y-coordinate.
Definition at line 124 of file Boundary.cpp.
References myYmin.
Referenced by add(), SUMORTree::addAdditionalGLObject(), TraCIRTree::addObject(), GUISUMOAbstractView::applyGLTransform(), GUIDanielPerspectiveChanger::changeCanvassLeft(), traci::TraCIServer::collectObjectsInRange(), NBNetBuilder::compute(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), GUISUMOAbstractView::getPositionInformation(), GUINet::initGUIStructures(), main(), GUISUMOAbstractView::makeSnapshot(), NBNetBuilder::moveToOrigin(), GUISUMOAbstractView::paintGLGrid(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), SUMORTree::removeAdditionalGLObject(), TraCIRTree::removeAdditionalGLObject(), set(), GUIVehicle::setFunctionalColor(), BinaryFormatter::writeAttr(), NWWriter_OpenDrive::writeNetwork(), and GUIDanielPerspectiveChanger::zoom().
|
friend |
Output operator.
Definition at line 233 of file Boundary.cpp.
|
private |
Information whether the boundary was initialised.
Definition at line 132 of file Boundary.h.
|
private |
Definition at line 129 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 129 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 129 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 129 of file Boundary.h.
Referenced by add(), around(), crosses(), flipY(), getCenter(), getHeight(), grow(), growHeight(), moveby(), operator<<(), overlapsWith(), partialWithin(), reset(), set(), and ymin().