SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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)
 Constructor.
virtual ~Polygon ()
 Destructor.
Getter
const std::string & getID () const
 Returns the name of the polygon.
const std::string & getType () const
 Returns the (abstract) type of the polygon.
const RGBColorgetColor () const
 Returns the color of the polygon.
const PositionVectorgetShape () const
 Returns the shape of the polygon.
bool fill () const
 Returns whether the polygon is filled.
Setter
void setType (const std::string &type)
 Sets a new type.
void setColor (const RGBColor &col)
 Sets a new color.
void setShape (const PositionVector &shape)
 Sets a new shape.
void setFill (bool fill)
 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 49 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 
)

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 43 of file Polygon.cpp.

Polygon::~Polygon ( )
virtual

Destructor.

Definition at line 49 of file Polygon.cpp.

Member Function Documentation

bool Polygon::fill ( ) const
inline

Returns whether the polygon is filled.

Returns
Whether the polygon is filled

Definition at line 105 of file Polygon.h.

References myFill.

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

const RGBColor& Polygon::getColor ( ) const
inline

Returns the color of the polygon.

Returns
The polygon's color

Definition at line 89 of file Polygon.h.

References myColor.

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

const std::string& Polygon::getID ( ) const
inline

Returns the name of the polygon.

Returns
The polygon's id

Definition at line 73 of file Polygon.h.

References myName.

Referenced by ShapeContainer::add().

const PositionVector& Polygon::getShape ( ) const
inline

Returns the shape of the polygon.

Returns
The polygon's shape

Definition at line 97 of file Polygon.h.

References myShape.

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

const std::string& Polygon::getType ( ) const
inline

Returns the (abstract) type of the polygon.

Returns
The polygon's (abstract) type

Definition at line 81 of file Polygon.h.

References myType.

Referenced by TraCIServerAPI_Polygon::processGet().

void Polygon::setColor ( const RGBColor col)
inline

Sets a new color.

Parameters
[in]colThe new color to use

Definition at line 126 of file Polygon.h.

References myColor.

Referenced by GUIPolygon::drawGL(), and TraCIServerAPI_Polygon::processSet().

void Polygon::setFill ( bool  fill)
inline

Sets whether the polygon shall be filled.

Parameters
[in]fillWhether the polygon shall be filled

Definition at line 142 of file Polygon.h.

References fill(), and myFill.

Referenced by TraCIServerAPI_Polygon::processSet().

void Polygon::setShape ( const PositionVector shape)
inline

Sets a new shape.

Parameters
[in]shapeThe new shape to use

Definition at line 134 of file Polygon.h.

References myShape.

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

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

Sets a new type.

Parameters
[in]typeThe new type to use

Definition at line 118 of file Polygon.h.

References myType.

Referenced by TraCIServerAPI_Polygon::processSet().

Field Documentation

RGBColor Polygon::myColor
protected

The color of the polygon.

Definition at line 156 of file Polygon.h.

Referenced by getColor(), and setColor().

bool Polygon::myFill
protected

Information whether the polygon has to be filled.

Definition at line 162 of file Polygon.h.

Referenced by fill(), and setFill().

std::string Polygon::myName
protected

The name of the polygon.

Definition at line 150 of file Polygon.h.

Referenced by getID().

PositionVector Polygon::myShape
protected

The positions of the polygon.

Definition at line 159 of file Polygon.h.

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

std::string Polygon::myType
protected

The type of the polygon.

Definition at line 153 of file Polygon.h.

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


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