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

A 2D- or 3D-polygon. More...

#include <Polygon.h>

Inheritance diagram for SUMO::Polygon:
Shape Named GUIPolygon

Public Member Functions

void addTo (const StoringVisitor &cont) const
 Adds this object to the given container. More...
 
const std::string & getID () const
 Returns the id. More...
 
 Polygon (const std::string &id, const std::string &type, const RGBColor &color, const PositionVector &shape, bool fill, SUMOReal layer=DEFAULT_LAYER, SUMOReal angle=DEFAULT_ANGLE, const std::string &imgFile=DEFAULT_IMG_FILE)
 Constructor. More...
 
void setID (const std::string &newID)
 resets the id More...
 
virtual ~Polygon ()
 Destructor. More...
 
Getter
const PositionVectorgetShape () const
 Returns whether the shape of the polygon. More...
 
bool getFill () const
 Returns whether the polygon is filled. More...
 
Setter
void setFill (bool fill)
 Sets whether the polygon shall be filled. More...
 
virtual void setShape (const PositionVector &shape)
 Sets the shape of the polygon. More...
 
Getter
const std::string & getType () const
 Returns the (abstract) type of the Shape. More...
 
const RGBColorgetColor () const
 Returns the color of the Shape. More...
 
SUMOReal getLayer () const
 Returns the layer of the Shape. More...
 
SUMOReal getAngle () const
 Returns the angle of the Shape. More...
 
const std::string & getImgFile () const
 Returns the imgFile of the Shape. More...
 
Setter
void setType (const std::string &type)
 Sets a new type. More...
 
void setColor (const RGBColor &col)
 Sets a new color. More...
 
void setLayer (const SUMOReal layer)
 Sets a new layer. More...
 
void setAngle (const SUMOReal angle)
 Sets a new angle. More...
 
void setImgFile (const std::string &imgFile)
 Sets a new imgFile. More...
 

Static Public Attributes

static const SUMOReal DEFAULT_ANGLE = 0
 
static const std::string DEFAULT_IMG_FILE = ""
 
static const SUMOReal DEFAULT_IMG_HEIGHT = 1
 
static const SUMOReal DEFAULT_IMG_WIDTH = 1
 
static const SUMOReal DEFAULT_LAYER = 128
 

Protected Attributes

SUMOReal myAngle
 The angle of the Shape. More...
 
RGBColor myColor
 The color of the Shape. More...
 
bool myFill
 Information whether the polygon has to be filled. More...
 
std::string myID
 The name of the object. More...
 
std::string myImgFile
 The angle of the Shape. More...
 
SUMOReal myLayer
 The layer of the Shape. More...
 
PositionVector myShape
 The positions of the polygon. More...
 
std::string myType
 The type of the Shape. More...
 

Detailed Description

A 2D- or 3D-polygon.

Definition at line 47 of file Polygon.h.

Constructor & Destructor Documentation

Polygon::Polygon ( const std::string &  id,
const std::string &  type,
const RGBColor color,
const PositionVector shape,
bool  fill,
SUMOReal  layer = DEFAULT_LAYER,
SUMOReal  angle = DEFAULT_ANGLE,
const std::string &  imgFile = DEFAULT_IMG_FILE 
)

Constructor.

Parameters
[in]idThe name of the polygon
[in]typeThe (abstract) type of the polygon
[in]colorThe color of the polygon
[in]layerThe layer of the polygon
[in]angleThe rotation of the polygon
[in]imgFileThe raster image of the polygon
[in]shapeThe shape of the polygon
[in]fillWhether the polygon shall be filled

Definition at line 43 of file Polygon.cpp.

Polygon::~Polygon ( )
virtual

Destructor.

Definition at line 52 of file Polygon.cpp.

Member Function Documentation

void Named::addTo ( const StoringVisitor cont) const
inlineinherited

Adds this object to the given container.

Parameters
in,filled]cont The container to add this item to

Definition at line 114 of file Named.h.

References Named::StoringVisitor::add().

SUMOReal Shape::getAngle ( ) const
inlineinherited

Returns the angle of the Shape.

Returns
The Shape's rotation angle

Definition at line 93 of file Shape.h.

References Shape::myAngle.

Referenced by GUIPointOfInterest::drawGL(), and PCPolyContainer::save().

const RGBColor& Shape::getColor ( ) const
inlineinherited

Returns the color of the Shape.

Returns
The Shape's color

Definition at line 78 of file Shape.h.

References Shape::myColor.

Referenced by GUIPolygon::drawGL(), GUIPointOfInterest::drawGL(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), and PCPolyContainer::save().

bool SUMO::Polygon::getFill ( ) const
inline

Returns whether the polygon is filled.

Returns
Whether the polygon is filled

Definition at line 81 of file Polygon.h.

References myFill.

Referenced by GUIPolygon::drawGL(), TraCIServerAPI_Polygon::processGet(), PCPolyContainer::save(), and GUIPolygon::storeTesselation().

const std::string& Named::getID ( ) const
inlineinherited

Returns the id.

Returns
The stored id

Definition at line 60 of file Named.h.

References Named::myID.

Referenced by Named::StoringVisitor::add(), MSDetectorControl::add(), RORouteDef::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), NBTrafficLightLogic::addStep(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), MSPerson::MSPersonStage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Waiting::beginEventOutput(), NIVisumTL::build(), MS_E2_ZS_CollectorOverLanes::buildCollector(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), MSVehicleTransfer::checkInsertions(), ODDistrictHandler::closeDistrict(), NLHandler::closeEdge(), RORouteHandler::closeRouteDistribution(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSE3Collector::enter(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), NIImporter_OpenDrive::loadNetwork(), MSVehicle::moveChecked(), NBRampsComputer::moveRampRight(), MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(), MSVehicle::MSVehicle(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Person::notifyLeave(), RORouteHandler::openRoute(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), NBNode::nodes_by_id_sorter::operator()(), MSEdge::by_id_sorter::operator()(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Turns(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), NIXMLConnectionsHandler::parseLaneBound(), RORDLoader_SUMOBase::parseRoute(), NBLoadedTLDef::SignalGroup::patchTYellow(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), NWWriter_SUMO::prohibitionConnection(), NBEdgeCont::recheckPostProcessConnections(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), PCPolyContainer::save(), RONet::saveAndRemoveRoutesUntil(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), NBEdge::startShapeAt(), NIXMLConnectionsHandler::validateLaneInfo(), MSEmissionExport::write(), MSInstantInductLoop::write(), NBSign::writeAsPOI(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), MSFullExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), MSInductLoop::writeTypedXMLOutput(), MSFullExport::writeVehicles(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().

const std::string& Shape::getImgFile ( ) const
inlineinherited

Returns the imgFile of the Shape.

Returns
The Shape's rotation imgFile

Definition at line 100 of file Shape.h.

References Shape::myImgFile.

Referenced by GUIPolygon::drawGL(), and PCPolyContainer::save().

SUMOReal Shape::getLayer ( ) const
inlineinherited

Returns the layer of the Shape.

Returns
The Shape's layer

Definition at line 86 of file Shape.h.

References Shape::myLayer.

Referenced by GUIPolygon::drawGL(), GUIPointOfInterest::drawGL(), and PCPolyContainer::save().

const PositionVector& SUMO::Polygon::getShape ( ) const
inline

Returns whether the shape of the polygon.

Returns
The shape of the polygon

Definition at line 74 of file Polygon.h.

References myShape.

Referenced by TraCIServerAPI_Polygon::getShape(), PCPolyContainer::insert(), TraCIServerAPI_Polygon::processGet(), and PCPolyContainer::save().

const std::string& Shape::getType ( ) const
inlineinherited

Returns the (abstract) type of the Shape.

Returns
The Shape's (abstract) type

Definition at line 70 of file Shape.h.

References Shape::myType.

Referenced by TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), and PCPolyContainer::save().

void Shape::setAngle ( const SUMOReal  angle)
inlineinherited

Sets a new angle.

Parameters
[in]layerThe new angle to use

Definition at line 136 of file Shape.h.

References Shape::myAngle.

void Shape::setColor ( const RGBColor col)
inlineinherited

Sets a new color.

Parameters
[in]colThe new color to use

Definition at line 120 of file Shape.h.

References Shape::myColor.

Referenced by TraCIServerAPI_POI::processSet(), and TraCIServerAPI_Polygon::processSet().

void SUMO::Polygon::setFill ( bool  fill)
inline

Sets whether the polygon shall be filled.

Parameters
[in]fillWhether the polygon shall be filled

Definition at line 93 of file Polygon.h.

References myFill.

Referenced by TraCIServerAPI_Polygon::processSet().

void Named::setID ( const std::string &  newID)
inlineinherited

resets the id

Parameters
[in]newIDThe new id of this object

Definition at line 68 of file Named.h.

References Named::myID.

Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().

void Shape::setImgFile ( const std::string &  imgFile)
inlineinherited

Sets a new imgFile.

Parameters
[in]imgFileThe new imgFile to use

Definition at line 143 of file Shape.h.

References Shape::myImgFile.

void Shape::setLayer ( const SUMOReal  layer)
inlineinherited

Sets a new layer.

Parameters
[in]layerThe new layer to use

Definition at line 128 of file Shape.h.

References Shape::myLayer.

virtual void SUMO::Polygon::setShape ( const PositionVector shape)
inlinevirtual

Sets the shape of the polygon.

Parameters
[in]shapeThe new shape of the polygon

Reimplemented in GUIPolygon.

Definition at line 101 of file Polygon.h.

References myShape.

Referenced by ShapeContainer::reshapePolygon().

void Shape::setType ( const std::string &  type)
inlineinherited

Sets a new type.

Parameters
[in]typeThe new type to use

Definition at line 112 of file Shape.h.

References Shape::myType.

Referenced by TraCIServerAPI_POI::processSet(), and TraCIServerAPI_Polygon::processSet().

Field Documentation

const std::string Shape::DEFAULT_IMG_FILE = ""
staticinherited
const SUMOReal Shape::DEFAULT_IMG_HEIGHT = 1
staticinherited
const SUMOReal Shape::DEFAULT_IMG_WIDTH = 1
staticinherited
const SUMOReal Shape::DEFAULT_LAYER = 128
staticinherited

Definition at line 148 of file Shape.h.

SUMOReal Shape::myAngle
protectedinherited

The angle of the Shape.

Definition at line 165 of file Shape.h.

Referenced by Shape::getAngle(), and Shape::setAngle().

RGBColor Shape::myColor
protectedinherited

The color of the Shape.

Definition at line 159 of file Shape.h.

Referenced by Shape::getColor(), and Shape::setColor().

bool SUMO::Polygon::myFill
protected

Information whether the polygon has to be filled.

Definition at line 112 of file Polygon.h.

Referenced by getFill(), and setFill().

std::string Shape::myImgFile
protectedinherited

The angle of the Shape.

Definition at line 168 of file Shape.h.

Referenced by GUIPointOfInterest::drawGL(), Shape::getImgFile(), and Shape::setImgFile().

SUMOReal Shape::myLayer
protectedinherited

The layer of the Shape.

Definition at line 162 of file Shape.h.

Referenced by Shape::getLayer(), and Shape::setLayer().

PositionVector SUMO::Polygon::myShape
protected

The positions of the polygon.

Definition at line 109 of file Polygon.h.

Referenced by GUIPolygon::drawGL(), GUIPolygon::getCenteringBoundary(), getShape(), setShape(), and GUIPolygon::storeTesselation().

std::string Shape::myType
protectedinherited

The type of the Shape.

Definition at line 156 of file Shape.h.

Referenced by GUIPolygon::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), Shape::getType(), and Shape::setType().


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