SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Boundary Class Reference

A class that stores a 2D geometrical boundary. More...

#include <Boundary.h>

Inheritance diagram for Boundary:
Inheritance graph
Collaboration diagram for Boundary:
Collaboration graph

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...
 
Boundarygrow (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...
 

Detailed Description

A class that stores a 2D geometrical boundary.

Definition at line 48 of file Boundary.h.

Constructor & Destructor Documentation

Boundary::Boundary ( )

Constructor - the boundary is unset.

Definition at line 47 of file Boundary.cpp.

Boundary::Boundary ( SUMOReal  x1,
SUMOReal  y1,
SUMOReal  x2,
SUMOReal  y2 
)

Constructor - the boundary will be build using the given values.

Definition at line 54 of file Boundary.cpp.

References add().

Boundary::Boundary ( SUMOReal  x1,
SUMOReal  y1,
SUMOReal  z1,
SUMOReal  x2,
SUMOReal  y2,
SUMOReal  z2 
)

Definition at line 64 of file Boundary.cpp.

References add().

Boundary::~Boundary ( )

Destructor.

Definition at line 74 of file Boundary.cpp.

Member Function Documentation

void Boundary::add ( SUMOReal  x,
SUMOReal  y,
SUMOReal  z = 0 
)

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)

Makes the boundary include the given boundary.

Definition at line 117 of file Boundary.cpp.

References add(), xmax(), xmin(), ymax(), ymin(), zmax(), and zmin().

bool Boundary::around ( const Position p,
SUMOReal  offset = 0 
) const
virtual

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().

bool Boundary::crosses ( const Position p1,
const Position p2 
) const
virtual

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().

Boundary & Boundary::grow ( SUMOReal  by)

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().

void Boundary::moveby ( SUMOReal  x,
SUMOReal  y,
SUMOReal  z = 0 
)
bool Boundary::overlapsWith ( const AbstractPoly poly,
SUMOReal  offset = 0 
) const
virtual
bool Boundary::partialWithin ( const AbstractPoly poly,
SUMOReal  offset = 0 
) const
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().

void Boundary::set ( SUMOReal  xmin,
SUMOReal  ymin,
SUMOReal  xmax,
SUMOReal  ymax 
)

Sets the boundary to the given values.

Definition at line 272 of file Boundary.cpp.

References myXmax, myXmin, myYmax, myYmin, xmax(), xmin(), ymax(), and ymin().

Referenced by TraCIServer::readTypeCheckingBoundary().

SUMOReal Boundary::xmax ( ) const
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::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().

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Boundary b 
)
friend

Output operator.

Definition at line 265 of file Boundary.cpp.

Field Documentation

bool Boundary::myWasInitialised
private

Information whether the boundary was initialised.

Definition at line 142 of file Boundary.h.

Referenced by add(), and reset().

SUMOReal Boundary::myXmax
private
SUMOReal Boundary::myXmin
private
SUMOReal Boundary::myYmax
private
SUMOReal Boundary::myYmin
private
SUMOReal Boundary::myZmax
private

Definition at line 139 of file Boundary.h.

Referenced by add(), around(), getCenter(), moveby(), reset(), and zmax().

SUMOReal Boundary::myZmin
private

Definition at line 139 of file Boundary.h.

Referenced by add(), around(), getCenter(), moveby(), reset(), and zmin().


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