SUMO - Simulation of Urban MObility
Boundary Class Reference

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

#include <Boundary.h>

Inheritance diagram for Boundary:
AbstractPoly SUMORTree LayeredRTree

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

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 53 of file Boundary.cpp.

References add().

Boundary::~Boundary ( )

Destructor.

Definition at line 62 of file Boundary.cpp.

Member Function Documentation

void Boundary::add ( SUMOReal  x,
SUMOReal  y 
)

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(), Boundary(), GUIDanielPerspectiveChanger::centerTo(), NBNetBuilder::compute(), NIVissimDisturbance::computeBounding(), NIVissimConnection::computeBounding(), GUIEdge::getBoundary(), PositionVector::getBoxBoundary(), MSDevice_BTsender::VehicleInformation::getBoxBoundary(), GUITrafficLightLogicWrapper::getCenteringBoundary(), GUIContainer::getCenteringBoundary(), GUIPerson::getCenteringBoundary(), GUIPolygon::getCenteringBoundary(), GUIPointOfInterest::getCenteringBoundary(), GUIVehicle::getCenteringBoundary(), GUILane::getCenteringBoundary(), GUISUMOAbstractView::getObjectAtPosition(), GUISUMOAbstractView::getObjectsAtPosition(), GUICalibrator::GUICalibrator(), GUILaneSpeedTrigger::GUILaneSpeedTrigger(), GUITriggeredRerouter::GUITriggeredRerouter(), GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(), GUINet::initGUIStructures(), NBHeightMapper::loadShapeFile(), NBHeightMapper::loadTiff(), GUITriggeredRerouter::myEndElement(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUI_E2_ZS_CollectorOverLanes::MyWrapper::MyWrapper(), GUIE3Collector::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), NIVissimConnectionCluster::recomputeBoundary(), 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)

Makes the boundary include the given boundary.

Definition at line 99 of file Boundary.cpp.

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

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

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(), NBHeightMapper::getZ(), PCPolyContainer::insert(), 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 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.

References myYmax, myYmin, and SUMOReal.

void Boundary::growHeight ( SUMOReal  by)
void Boundary::growWidth ( SUMOReal  by)
void Boundary::moveby ( SUMOReal  x,
SUMOReal  y 
)

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

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

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 240 of file Boundary.cpp.

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

Referenced by TraCIServer::readTypeCheckingBoundary().

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(), NBHeightMapper::addTriangle(), GUISUMOAbstractView::applyGLTransform(), NIVissimConnectionCluster::around(), NIVissimConnection::buildNodeClusters(), GUIDanielPerspectiveChanger::changeCanvassLeft(), TraCIServer::collectObjectsInRange(), NBNetBuilder::compute(), NIVissimDisturbance::computeBounding(), NIVissimBoundedClusterObject::crosses(), GeomHelper::crossPoint(), GUIViewTraffic::doPaintGL(), MSDevice_BTreceiver::BTreceiverUpdate::execute(), MSLane::fill(), NIVissimConnection::getBoundingBox(), NIVissimConnectionCluster::getPositionForEdge(), GUISUMOAbstractView::getPositionInformation(), 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_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), NIVissimConnectionCluster::recheckEdges(), NIVissimConnectionCluster::recomputeBoundary(), SUMORTree::removeAdditionalGLObject(), set(), GUIVehicle::setFunctionalColor(), BinaryFormatter::writeAttr(), NWWriter_OpenDrive::writeNetwork(), and GUIDanielPerspectiveChanger::zoom().

Friends And Related Function Documentation

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

Output operator.

Definition at line 233 of file Boundary.cpp.

Field Documentation

bool Boundary::myWasInitialised
private

Information whether the boundary was initialised.

Definition at line 132 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

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