63 myPositionOverLane(pos),
64 myFrequency(frequency),
66 myRouteProbe(nullptr) {
121 throw ProcessError(
"Both myEdge and myLane aren't defined");
134 return shape.front();
151 throw ProcessError(
"Both myEdge and myLane aren't defined");
164 for (
int i = 0; i < (int)
myShape.size(); ++i) {
168 glTranslated(pos.
x(), pos.
y(),
getType());
169 glRotated(rot, 0, 0, 1);
171 glScaled(exaggeration, exaggeration, 1);
172 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
180 glBegin(GL_TRIANGLES);
181 glVertex2d(0 - 1.4, 0);
182 glVertex2d(0 - 1.4, 6);
183 glVertex2d(0 + 1.4, 6);
184 glVertex2d(0 + 1.4, 0);
185 glVertex2d(0 - 1.4, 0);
186 glVertex2d(0 + 1.4, 6);
201 throw ProcessError(
"Both myEdge and myLane aren't defined");
301 if (canParse<double>(value)) {
303 double newPosition = parse<double>(value);
305 if ((newPosition < 0) || (newPosition > shape.length())) {
314 return (canParse<double>(value) && parse<double>(value) >= 0);
326 return canParse<bool>(value);
378 if (parse<bool>(value)) {
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
const GNEAttributeCarrier * getACUnderCursor() const
get AttributeCarrier under cursor
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
double scale
information about a lane's width (temporary, used for a single view)
void updateGeometry(bool updateGrid)
update pre-computed geometry information
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name) ...
GUIVisualizationTextSettings addName
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
const std::string & getAdditionalID() const
returns Additional ID
A calibrator placed over edge.
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
std::string getAttribute(SumoXMLAttr key) const
~GNECalibrator()
Destructor.
double x() const
Returns the x-position.
Position getPositionInView() const
Returns position of additional in view.
Representation of a RouteProbe in netedit.
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)
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
GNERouteProbe * myRouteProbe
pointer to current RouteProbe
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
static const RGBColor BLACK
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
std::vector< double > myShapeRotations
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void changeAdditionalID(const std::string &newID)
change ID of additional
void openAdditionalDialog()
open Calibrator Dialog
GNECalibrator(const std::string &id, GNEViewNet *viewNet, GNEEdge *edge, double pos, double frequency, const std::string &name, const std::string &output)
Constructor using edge.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GUIVisualizationSizeSettings addSize
static const RGBColor selectedAdditionalColor
color of selected additionals
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string myOutput
output of calibrator
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
PositionVector myShape
The shape of the additional element.
A point in 2D or 3D with translation and scaling methods.
std::string myAdditionalName
name of additional
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
friend class GNEChange_Attribute
declare friend class
void selectAttributeCarrier(bool changeFlag=true)
A calibrator placed over lane (used in netedit)
std::vector< double > myShapeLengths
The lengths of the shape parts.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
const std::string getID() const
function to support debugging
GNELane * myLane
The lane in which CalibratorLane are placed.
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
A road/street connecting two junctions (netedit-version)
Dialog for edit calibrators.
double myPositionOverLane
position over Lane
std::string getParentName() const
Returns the name of the parent object.
const PositionVector & getShape() const
returns the shape of the lane
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
double length() const
Returns the length.
GNEEdge * changeEdge(GNEEdge *oldEdge, const std::string &newEdgeID)
change edge of additional
static void drawShapeDottedContour(const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
An Element which don't belongs to GNENet but has influency in the simulation.
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
std::string getGenericParametersStr() const
return generic parameters in string format
GNEEdge * myEdge
The edge in which Calibrators are placed.
GNENet * getNet() const
get the net object
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
GUIGlID getGlID() const
Returns the numerical id of the object.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
double myFrequency
Frequency of calibrator.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
static const RGBColor selectionColor
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name) ...
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
GNELane * changeLane(GNELane *oldLane, const std::string &newLaneID)
change lane of additional
SumoXMLTag getTag() const
get XML Tag assigned to this object