Polygon2D Class Reference

#include <Polygon2D.h>

Inheritance diagram for Polygon2D:

GUIPolygon2D

Detailed Description

A 2D-polygon.

Definition at line 47 of file Polygon2D.h.


Public Member Functions

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

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.
Position2DVector myShape
 The positions of the polygon.
std::string myType
 The type of the polygon.

Constructor & Destructor Documentation

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

Constructor.

Parameters:
[in] name The name of the polygon
[in] type The (abstract) type of the polygon
[in] color The color of the polygon
[in] shape The shape of the poslygon
[in] fill Whether the polygon shall be filled

Definition at line 41 of file Polygon2D.cpp.

00044         : myName(name),  myType(type), myColor(color), myShape(shape), myFill(fill) {}

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

Destructor.

Definition at line 47 of file Polygon2D.cpp.

00047 {}


Member Function Documentation

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

Returns whether the polygon is filled.

Returns:
Whether the polygon is filled

Definition at line 103 of file Polygon2D.h.

References myFill.

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

00103                               {
00104         return myFill;
00105     }

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

Returns the color of the polygon.

Returns:
The polygon's color

Definition at line 87 of file Polygon2D.h.

References myColor.

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

00087                                              {
00088         return myColor;
00089     }

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

Returns the name of the polygon.

Returns:
The polygon's id

Definition at line 71 of file Polygon2D.h.

References myName.

Referenced by traci::TraCIServer::handlePolygonDomain().

00071                                            {
00072         return myName;
00073     }

const Position2DVector& Polygon2D::getShape (  )  const throw () [inline]

Returns the shape of the polygon.

Returns:
The polygon's shape

Definition at line 95 of file Polygon2D.h.

References myShape.

Referenced by traci::TraCIServer::handlePolygonDomain(), and TraCIServerAPI_Polygon::processGet().

00095                                                      {
00096         return myShape;
00097     }

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

Returns the (abstract) type of the polygon.

Returns:
The polygon's (abstract) type

Definition at line 79 of file Polygon2D.h.

References myType.

Referenced by traci::TraCIServer::handlePolygonDomain(), and TraCIServerAPI_Polygon::processGet().

00079                                              {
00080         return myType;
00081     }

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

Sets a new color.

Parameters:
[in] col The new color to use

Definition at line 124 of file Polygon2D.h.

References myColor.

Referenced by TraCIServerAPI_Polygon::processSet().

00124                                                {
00125         myColor = col;
00126     }

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

Sets whether the polygon shall be filled.

Parameters:
[in] fill Whether the polygon shall be filled

Definition at line 140 of file Polygon2D.h.

References myFill.

Referenced by TraCIServerAPI_Polygon::processSet().

00140                                     {
00141         myFill = fill;
00142     }

void Polygon2D::setShape ( const Position2DVector shape  )  throw () [inline]

Sets a new shape.

Parameters:
[in] shape The new shape to use

Definition at line 132 of file Polygon2D.h.

References myShape.

Referenced by TraCIServerAPI_Polygon::processSet().

00132                                                          {
00133         myShape = shape;
00134     }

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

Sets a new type.

Parameters:
[in] type The new type to use

Definition at line 116 of file Polygon2D.h.

References myType.

Referenced by TraCIServerAPI_Polygon::processSet().

00116                                                 {
00117         myType = type;
00118     }


Field Documentation

The color of the polygon.

Definition at line 154 of file Polygon2D.h.

Referenced by getColor(), and setColor().

bool Polygon2D::myFill [protected]

Information whether the polygon has to be filled.

Definition at line 160 of file Polygon2D.h.

Referenced by fill(), and setFill().

std::string Polygon2D::myName [protected]

The name of the polygon.

Definition at line 148 of file Polygon2D.h.

Referenced by getID(), and GUIPolygon2D::getMicrosimID().

The positions of the polygon.

Definition at line 157 of file Polygon2D.h.

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

std::string Polygon2D::myType [protected]

The type of the polygon.

Definition at line 151 of file Polygon2D.h.

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


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

Generated on Wed May 5 00:06:58 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6