35 const PositionVector& shape,
bool geo,
bool fill,
double lineWidth,
36 double layer,
double angle,
const std::string& imgFile,
const std::string& name,
38 Shape(id, type, color, layer, angle, imgFile, name),
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 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.
std::map< std::string, std::string > Map
parameters map
Parameterised()
Default constructor.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
const PositionVector & getShape() const
Returns the shape of the polygon.
virtual void setHoles(const std::vector< PositionVector > &holes)
Sets the holes of the polygon.
PositionVector myShape
The positions 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, const std::string &name=DEFAULT_NAME, const Parameterised::Map ¶meters=DEFAULT_PARAMETERS)
Constructor.
double myLineWidth
The line width for drawing an unfilled polygon.
~SUMOPolygon()
Destructor.
void setFill(bool fill)
Sets whether the polygon shall be filled.
bool myGEO
specify if shape is handled as GEO coordinate (Main used in netedit)
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.
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.
Shape(const std::string &id)
default consructor
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.