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);
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.
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
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)
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 ...
const std::string & getAdditionalID() const
returns the ID of additional
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
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 commmitAdditionalGeometryMoved(SUMOReal, SUMOReal, GNEUndoList *)
updated geometry changes in the attributes of additional
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)
void changeLane(const std::string &laneID)
change lane of additional
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
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
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.
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.