60 #ifdef CHECK_MEMORY_LEAKS 71 myFrequency(frequency),
74 myFlowValues(flowValues) {
124 Position s =
myShape[i] + Position(1, 0);
206 std::map<std::string, GNECalibrator::CalibratorFlow>
223 throw InvalidArgument(
"Calibrators don't allow Flows with duplicate Id's (" +
id +
")");
254 for (
int i = 0; i < (int)
myShape.size(); ++i) {
258 glTranslated(pos.
x(), pos.
y(),
getType());
259 glRotated(rot, 0, 0, 1);
261 glScaled(exaggeration, exaggeration, 1);
262 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
264 glBegin(GL_TRIANGLES);
265 glColor3d(1, .8f, 0);
267 glVertex2d(0 - 1.4, 0);
268 glVertex2d(0 - 1.4, 6);
269 glVertex2d(0 + 1.4, 6);
270 glVertex2d(0 + 1.4, 0);
271 glVertex2d(0 - 1.4, 0);
272 glVertex2d(0 + 1.4, 6);
276 if (s.
scale * exaggeration >= 1.) {
277 glTranslated(0, 0, .1);
282 glRotated(180, 0, 1, 0);
283 glTranslated(-w / 2., 2, 0);
285 glTranslated(w / 2., -2, 0);
358 return (canParse<SUMOReal>(value) && parse<SUMOReal>(value) >= 0);
void drawName(const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
draw name of item
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
const std::string & getAdditionalID() const
returns the ID of additional
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
Stores the information about how to visualize structures.
void insertFlow(const std::string &id, const CalibratorFlow &flow)
insert a new flow
std::string getAttribute(SumoXMLAttr key) const
~GNECalibrator()
Destructor.
std::string time2string(SUMOTime t)
SUMOTime myFrequency
Frequency of calibrator.
Position getPositionInView() const
Returns position of Calibrator in view.
void pfSetPosition(SUMOReal x, SUMOReal y)
GNERouteProbe * myRouteProbe
pointer to RouteProbe
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
void removeFlow(const std::string &id)
remove a existent flow
void openAdditionalDialog()
open Calibrator Dialog
SUMOReal scale
information about a lane's width (temporary, used for a single view)
void setFlowValues(std::map< std::string, CalibratorFlow > calibratorFlowValues)
set Calbratorflow values
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.
RGBColor myBaseColorSelected
base color selected (Default blue)
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GUIVisualizationSizeSettings addSize
static bool isValidFileValue(const std::string &value)
true if value is a valid file value
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
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 ...
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void refreshAdditional(GNEAdditional *additional)
refreshes boundary information of an additional after a geometry update
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 commmitAdditionalGeometryMoved(SUMOReal, SUMOReal, GNEUndoList *)
updated geometry changes in the attributes of additional
SUMOTime string2time(const std::string &r)
SUMOReal x() const
Returns the x-position.
std::map< std::string, CalibratorFlow > getFlowValues() const
get Calbratorflow values
void setAdditionalID(const std::string &id)
set the ID of additional
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
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
void changeLane(const std::string &laneID)
change lane of additional
A road/street connecting two junctions (netedit-version)
const std::string & getParentName() const
Returns the name of the parent object (if any)
Dialog for edit calibrators.
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
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.
RGBColor myBaseColor
base color (Default green)
std::vector< SUMOReal > myShapeRotations
SUMOReal pfdkGetStringWidth(const char *c)
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the 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
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SUMOReal getExaggeration(const GUIVisualizationSettings &s, SUMOReal factor=20) const
return the drawing size including exaggeration and constantSize values
void moveAdditionalGeometry(SUMOReal, SUMOReal)
change the position of the calibrator geometry
GNEEdge * myEdge
The edge this additional belongs NULL if additional doesnt' belongs to a edge.
SUMOReal y() const
Returns the y-position.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
SumoXMLTag getTag() const
get Tag assigned to this object
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.