 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
41 }, {}, {}, {}, {}, {}, {}, {}, {}, {}),
42 myPositionOverLane(pos),
43 myFrequency(frequency),
45 myRouteProbe(routeprobe) {
50 GNEAdditional(id, viewNet,
GLO_CALIBRATOR,
SUMO_TAG_LANECALIBRATOR, name, false, {}, {lane}, {}, {}, {}, {}, {}, {}, {}, {}),
51 myPositionOverLane(pos),
52 myFrequency(frequency),
54 myRouteProbe(routeprobe) {
85 for (
int i = 1; i < (int)
getParentEdges().front()->getLanes().size(); i++) {
92 throw ProcessError(
"Both edges and lanes aren't defined");
101 return shape.front();
137 return getParentEdges().front()->getLanes().at(0)->getMicrosimID();
139 throw ProcessError(
"Both myEdge and myLane aren't defined");
157 drawCalibratorSymbol(s, exaggeration, edgeCalibratorGeometry.getPosition(), edgeCalibratorGeometry.getRotation());
252 if (canParse<double>(value)) {
254 double newPosition = parse<double>(value);
256 if ((newPosition < 0) || (newPosition > shape.
length())) {
265 return canParse<SUMOTime>(value);
273 return canParse<bool>(value);
305 glTranslated(pos.
x(), pos.
y(),
getType());
306 glRotated(rot, 0, 0, 1);
308 glScaled(exaggeration, exaggeration, 1);
309 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
317 glBegin(GL_TRIANGLES);
318 glVertex2d(0 - 1.4, 0);
319 glVertex2d(0 - 1.4, 6);
320 glVertex2d(0 + 1.4, 6);
321 glVertex2d(0 + 1.4, 0);
322 glVertex2d(0 - 1.4, 0);
323 glVertex2d(0 + 1.4, 6);
337 throw ProcessError(
"Both myEdge and myLane aren't defined");
375 if (parse<bool>(value)) {
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
@ SUMO_TAG_LANECALIBRATOR
A calibrator placed over lane (used in netedit)
An Element which don't belongs to GNENet but has influency in the simulation.
static bool isValidAdditionalID(const std::string &value)
whether the given string is a valid id for an additional object
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
void replaceParentEdges(GNEShape *elementChild, const std::string &newEdgeIDs)
replace the parent edges of a shape
const std::string & getAdditionalID() const
const std::string getID() const
function to support debugging
std::string myRouteProbe
ID to current RouteProbe.
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
bool isAttributeEnabled(SumoXMLAttr key) const
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
static const RGBColor BLACK
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
std::string getAttribute(SumoXMLAttr key) const
double getAttributeDouble(SumoXMLAttr key) const
SUMOTime myFrequency
Frequency of calibrator.
void updateGeometryPosition(const GNELane *lane, const double posOverLane)
update position and rotation
@ SUMO_TAG_LANE
begin/end of the description of a single lane
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
double length() const
Returns the length.
~GNECalibrator()
Destructor.
Position getPositionInView() const
Returns position of additional in view.
void changeAdditionalID(const std::string &newID)
change ID of additional
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
void openAdditionalDialog()
open Calibrator Dialog
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
std::vector< GNEGeometry::Geometry > myEdgeCalibratorGeometries
extra calibrator geometries
A road/street connecting two junctions (netedit-version)
friend class GNEChange_Attribute
declare friend class
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GNECalibrator(const std::string &id, GNEViewNet *viewNet, GNEEdge *edge, double pos, SUMOTime frequency, const std::string &name, const std::string &output, const std::string &routeprobe)
Constructor using edge.
GNENet * getNet() const
get the net object
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
GUIVisualizationTextSettings addName
std::string myOutput
output of calibrator
GUIVisualizationDetailSettings detailSettings
detail settings
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
const PositionVector & getShape() const
The shape of the additional element.
static const double calibratorText
details for calibrator text
void selectAttributeCarrier(bool changeFlag=true)
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
GUIGlID getGlID() const
Returns the numerical id of the object.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
A class that stores a 2D geometrical boundary.
void replaceParentLanes(GNEShape *elementChild, const std::string &newLaneIDs)
replace the parent edges of a shape
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
double getRotation() const
get rotation
static void drawShapeDottedContourRectangle(const GUIVisualizationSettings &s, const int type, const Position ¢er, const double width, const double height, const double rotation=0, const double offsetX=0, const double offsetY=0)
draw a dotted contour around the given Position with certain width and height
double scale
information about a lane's width (temporary, used for a single view)
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
std::string time2string(SUMOTime t)
GNEGeometry::Geometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
std::string myAdditionalName
name of additional
struct for pack all variables related with geometry of stop
const Position & getPosition() const
get Position
double myPositionOverLane
position over Lane
static const RGBColor calibrator
color for Calibrators
GUIVisualizationColorSettings colorSettings
color settings
RGBColor selectionColor
basic selection color
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void drawCalibratorSymbol(const GUIVisualizationSettings &s, const double exaggeration, const Position &pos, const double rot) const
draw calibrator symbol
double y() const
Returns the y-position.
Dialog for edit calibrators.
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
std::string getParentName() const
Returns the name of the parent object.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
@ GLO_CALIBRATOR
a Calibrator
void updateGeometry()
update pre-computed geometry information
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
GUIVisualizationSizeSettings addSize
@ GNE_ATTR_SELECTED
element is selected
Boundary & grow(double by)
extends the boundary by the given amount
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
const std::string & getTagStr() const
get tag assigned to this object in string format
Stores the information about how to visualize structures.
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)