36 double lineWidth,
double layer,
double angle,
const std::string& imgFile,
bool relativePath,
38 Shape(id, type, color, layer, angle, imgFile, name, relativePath),
43 myLineWidth(lineWidth) {
56const std::vector<PositionVector>&
116 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 std::string getFilePath(const std::string &path)
Removes the file information from the given path.
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 & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
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, bool geo, bool fill, double lineWidth, double layer=DEFAULT_LAYER, double angle=DEFAULT_ANGLE, const std::string &imgFile=DEFAULT_IMG_FILE, bool relativePath=DEFAULT_RELATIVEPATH, const std::string &name=DEFAULT_NAME, 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.
void setLineWidth(double lineWidth)
set line width
double getLineWidth() const
Returns whether the polygon is filled.
virtual void setShape(const PositionVector &shape)
Sets the shape of the polygon.
std::vector< PositionVector > myHoles
The collection of the holes of the polygon, each given by a sequence of coodinates.
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.
const std::string getShapeName() const
Returns the name of the Shape.
bool getShapeRelativePath() const
Returns the relativePath of the Shape.
static const std::string DEFAULT_IMG_FILE
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
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 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.