60 #ifdef CHECK_MEMORY_LEAKS 72 myFrequency(frequency),
75 myFlowValues(flowValues) {
117 Position s =
myShape[i] + Position(1, 0);
196 std::map<std::string, GNECalibrator::CalibratorFlow>
213 throw InvalidArgument(
"Calibrators don't allow Flows with duplicate Id's (" +
id +
")");
244 for (
int i = 0; i < (int)
myShape.size(); ++i) {
248 glTranslated(pos.
x(), pos.
y(),
getType());
249 glRotated(rot, 0, 0, 1);
251 glScaled(exaggeration, exaggeration, 1);
252 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
254 glBegin(GL_TRIANGLES);
255 glColor3d(1, .8f, 0);
257 glVertex2d(0 - 1.4, 0);
258 glVertex2d(0 - 1.4, 6);
259 glVertex2d(0 + 1.4, 6);
260 glVertex2d(0 + 1.4, 0);
261 glVertex2d(0 - 1.4, 0);
262 glVertex2d(0 + 1.4, 6);
266 if (s.
scale * exaggeration >= 1.) {
267 glTranslated(0, 0, .1);
272 glRotated(180, 0, 1, 0);
273 glTranslated(-w / 2., 2, 0);
275 glTranslated(w / 2., -2, 0);
348 return (canParse<SUMOReal>(value) && parse<SUMOReal>(value) >= 0);
SUMOReal getExaggeration(const GUIVisualizationSettings &s, SUMOReal factor=20) const
return the drawing size including exaggeration and constantSize values
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
int pfDrawString(const char *c)
void writeAdditional(OutputDevice &device, const std::string &)
writte additional element into a xml file
GUIVisualizationTextSettings addName
virtual void centerTo(GUIGlID id, bool applyZoom, SUMOReal zoomDist=20)
centers to the chosen artifact
Stores the information about how to visualize structures.
void insertFlow(const std::string &id, const CalibratorFlow &flow)
insert a new flow
~GNECalibrator()
Destructor.
std::string time2string(SUMOTime t)
SUMOTime myFrequency
Frequency of calibrator.
void pfSetPosition(SUMOReal x, SUMOReal y)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNERouteProbe * myRouteProbe
pointer to RouteProbe
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
bool addAdditional(GNEAdditional *additional)
add additional to this edge
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
void removeFlow(const std::string &id)
remove a existent flow
SUMOReal x() const
Returns the x-position.
GUIGlID getGlID() const
Returns the numerical id of the object.
void openAdditionalDialog()
open Calibrator Dialog
SUMOReal scale
information about a lane's width (temporary, used for a single view)
bool removeAdditional(GNEAdditional *additional)
remove additional from this edge
void setFlowValues(std::map< std::string, CalibratorFlow > calibratorFlowValues)
set Calbratorflow values
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
RGBColor myBaseColorSelected
base color selected (Default blue)
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GUIVisualizationSizeSettings addSize
std::map< std::string, CalibratorFlow > getFlowValues() const
get Calbratorflow values
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static bool isValidFileValue(const std::string &value)
true if value is a valid file value
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::string myOutput
output of calibrator
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
bool myMovable
boolean to check if additional element is movable (with the mouse). By default true ...
GNEEdge & getParentEdge()
Returns underlying parent edge.
const std::string & getAdditionalID() const
returns the ID of additional
bool isValid(SumoXMLAttr key, const std::string &value)
std::string getAttribute(SumoXMLAttr key) const
PositionVector myShape
The shape of the additional element.
A point in 2D or 3D with translation and scaling methods.
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
friend class GNEChange_Attribute
declare friend class
void moveAdditional(SUMOReal, SUMOReal, GNEUndoList *)
change the position of the calibrator geometry
SUMOTime string2time(const std::string &r)
void setAdditionalID(const std::string &id)
set the ID of additional
const std::string getID() const
function to support debugging
void drawName(const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
draw name of item
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
A road/street connecting two junctions (netedit-version)
Dialog for edit calibrators.
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
void pfSetScale(SUMOReal s)
An Element which don't belongs to GNENet but has influency in the simulation.
SUMOReal y() const
Returns the y-position.
RGBColor myBaseColor
base color (Default green)
std::vector< SUMOReal > myShapeRotations
GNEEdge * myEdge
edge in which this calibrator is placed
GNENet * getNet() const
get the net object
SUMOReal pfdkGetStringWidth(const char *c)
SumoXMLTag getTag() const
get Tag assigned to this object
Static storage of an output device and its base (abstract) implementation.
Position myPosition
The position in which this additional element is located.
bool closeTag()
Closes the most recently opened tag.
void updateGeometry()
update pre-computed geometry information
const std::string & getParentName() const
Returns the name of the parent object (if any)
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Position getPositionInView() const
Returns position of Calibrator in view.
std::map< std::string, CalibratorFlow > myFlowValues
Calbratorflow values.
GNECalibrator(const std::string &id, GNEEdge *edge, GNEViewNet *viewNet, SUMOReal pos, SUMOTime frequency, const std::string &output, const std::map< std::string, CalibratorFlow > &flowValues, bool blocked)
Constructor.