SUMO - Simulation of Urban MObility

Polygon Class Reference

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

#include <Polygon.h>

Inheritance diagram for Polygon:
GUIPolygon

Public Member Functions

 Polygon (const std::string &name, const std::string &type, const RGBColor &color, const PositionVector &shape, bool fill) throw ()
 Constructor.
virtual ~Polygon () throw ()
 Destructor.
Getter
const std::string & getID () const throw ()
 Returns the name of the polygon.
const std::string & getType () const throw ()
 Returns the (abstract) type of the polygon.
const RGBColor & getColor () const throw ()
 Returns the color of the polygon.
const PositionVector & getShape () const throw ()
 Returns the shape of the polygon.
bool fill () const throw ()
 Returns whether the polygon is filled.
Setter
void setType (const std::string &type) throw ()
 Sets a new type.
void setColor (const RGBColor &col) throw ()
 Sets a new color.
void setShape (const PositionVector &shape) throw ()
 Sets a new shape.
void setFill (bool fill) throw ()
 Sets whether the polygon shall be filled.

Protected Attributes

RGBColor myColor
 The color of the polygon.
bool myFill
 Information whether the polygon has to be filled.
std::string myName
 The name of the polygon.
PositionVector myShape
 The positions of the polygon.
std::string myType
 The type of the polygon.

Detailed Description

A 2D- or 3D-polygon.

Definition at line 47 of file Polygon.h.


Constructor & Destructor Documentation

Polygon::Polygon ( const std::string &  name,
const std::string &  type,
const RGBColor &  color,
const PositionVector &  shape,
bool  fill 
) throw ()

Constructor.

Parameters:
[in]nameThe name of the polygon
[in]typeThe (abstract) type of the polygon
[in]colorThe color of the polygon
[in]shapeThe shape of the poslygon
[in]fillWhether the polygon shall be filled

Definition at line 41 of file Polygon.cpp.

Polygon::~Polygon ( ) throw () [virtual]

Destructor.

Definition at line 47 of file Polygon.cpp.


Member Function Documentation

bool Polygon::fill ( ) const throw () [inline]

Returns whether the polygon is filled.

Returns:
Whether the polygon is filled

Definition at line 103 of file Polygon.h.

References myFill.

Referenced by TraCIServerAPI_Polygon::processGet(), and setFill().

const RGBColor& Polygon::getColor ( ) const throw () [inline]

Returns the color of the polygon.

Returns:
The polygon's color

Definition at line 87 of file Polygon.h.

References myColor.

Referenced by TraCIServerAPI_Polygon::processGet().

const std::string& Polygon::getID ( ) const throw () [inline]

Returns the name of the polygon.

Returns:
The polygon's id

Definition at line 71 of file Polygon.h.

References myName.

const PositionVector& Polygon::getShape ( ) const throw () [inline]

Returns the shape of the polygon.

Returns:
The polygon's shape

Definition at line 95 of file Polygon.h.

References myShape.

Referenced by TraCIServerAPI_Polygon::processGet().

const std::string& Polygon::getType ( ) const throw () [inline]

Returns the (abstract) type of the polygon.

Returns:
The polygon's (abstract) type

Definition at line 79 of file Polygon.h.

References myType.

Referenced by TraCIServerAPI_Polygon::processGet().

void Polygon::setColor ( const RGBColor &  col) throw () [inline]

Sets a new color.

Parameters:
[in]colThe new color to use

Definition at line 124 of file Polygon.h.

References myColor.

Referenced by TraCIServerAPI_Polygon::processSet().

void Polygon::setFill ( bool  fill) throw () [inline]

Sets whether the polygon shall be filled.

Parameters:
[in]fillWhether the polygon shall be filled

Definition at line 140 of file Polygon.h.

References fill(), and myFill.

Referenced by TraCIServerAPI_Polygon::processSet().

void Polygon::setShape ( const PositionVector &  shape) throw () [inline]

Sets a new shape.

Parameters:
[in]shapeThe new shape to use

Definition at line 132 of file Polygon.h.

References myShape.

Referenced by ShapeContainer::reshapePolygon(), and GUIShapeContainer::reshapePolygon().

void Polygon::setType ( const std::string &  type) throw () [inline]

Sets a new type.

Parameters:
[in]typeThe new type to use

Definition at line 116 of file Polygon.h.

References myType.

Referenced by TraCIServerAPI_Polygon::processSet().


Field Documentation

The color of the polygon.

Definition at line 154 of file Polygon.h.

Referenced by getColor(), and setColor().

bool Polygon::myFill [protected]

Information whether the polygon has to be filled.

Definition at line 160 of file Polygon.h.

Referenced by fill(), and setFill().

std::string Polygon::myName [protected]

The name of the polygon.

Definition at line 148 of file Polygon.h.

Referenced by getID().

The positions of the polygon.

Definition at line 157 of file Polygon.h.

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

std::string Polygon::myType [protected]

The type of the polygon.

Definition at line 151 of file Polygon.h.

Referenced by getType(), and setType().


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines