36 const PositionVector& shape,
const bool geo,
const bool fill,
const double lineWidth,
37 const double layer,
const double angle,
const std::string& imgFile,
const std::string& name,
39 Shape(id, type, color, layer, angle, imgFile, name),
44 myLineWidth(lineWidth),
64const std::vector<PositionVector>&
139 for (
int i = 0; i < (int) shape.size(); i++) {
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_FILL
Fill the polygon.
@ SUMO_ATTR_LAYER
A layer number.
@ SUMO_ATTR_COLOR
A color information.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
const std::string & getID() const
Returns the id.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const ATTR_TYPE &attr, const T &val, const bool isNull=false, const bool escape=false)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
void setPrecision(int precision=gPrecision)
Sets the precision or resets it to default.
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
const PositionVector & getShape() const
Returns the shape of the polygon.
SUMOPolygon(const std::string &id, const std::string &type, const RGBColor &color, const PositionVector &shape, const bool geo, const bool fill, const double lineWidth, const double layer=DEFAULT_LAYER, const double angle=DEFAULT_ANGLE, const std::string &imgFile=DEFAULT_IMG_FILE, const std::string &name=DEFAULT_NAME, const double height=DEFAULT_HEIGHT, const Parameterised::Map ¶meters=DEFAULT_PARAMETERS)
Constructor.
virtual void setHoles(const std::vector< PositionVector > &holes)
Sets the holes of the polygon.
PositionVector myShape
The positions of the polygon.
double myLineWidth
The line width for drawing an unfilled polygon.
~SUMOPolygon()
Destructor.
void setFill(bool fill)
Sets whether the polygon shall be filled.
double myHeight
The line width for drawing an unfilled polygon.
void setLineWidth(double lineWidth)
set line width
double getLineWidth() const
Returns the line width.
double getHeight() const
Returns the polygon height.
virtual void setShape(const PositionVector &shape)
Sets the shape of the polygon.
void setHeight(double height)
set height
std::vector< PositionVector > myHoles
The collection of the holes of the polygon, each given by a sequence of coodinates.
PositionVector & getShapeRef()
Return the exterior shape of the polygon.
const std::vector< PositionVector > & getHoles() const
Returns the holers of the polygon.
void writeXML(OutputDevice &out, bool geo=false) const
bool myFill
Information whether the polygon has to be filled.
bool getFill() const
Returns whether the polygon is filled.
static const double DEFAULT_HEIGHT
static const std::string DEFAULT_IMG_FILE
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
static const double DEFAULT_LINEWIDTH
static const double DEFAULT_ANGLE
double getShapeLayer() const
Returns the layer of the Shape.
const std::string & getShapeImgFile() const
Returns the imgFile of the Shape.
const std::string & getShapeName() const
Returns the name of the Shape.
const RGBColor & getShapeColor() const
Returns the color of the Shape.
double getShapeNaviDegree() const
Returns the angle of the Shape in navigational degrees.
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.