66 double frequency,
const std::string& output,
const std::vector<GNECalibratorRoute>& calibratorRoutes,
67 const std::vector<GNECalibratorFlow>& calibratorFlows,
const std::vector<GNECalibratorVehicleType>& calibratorVehicleTypes) :
69 myFrequency(frequency),
72 myCalibratorRoutes(calibratorRoutes),
73 myCalibratorFlows(calibratorFlows),
74 myCalibratorVehicleTypes(calibratorVehicleTypes) {
119 Position s =
myShape[0] + Position(1, 0);
299 const std::vector<GNECalibratorVehicleType>&
305 const std::vector<GNECalibratorFlow>&
311 const std::vector<GNECalibratorRoute>&
368 if (i->getVehicleTypeID() == vehicleTypeID) {
379 if (i->getFlowID() == flowID) {
390 if (i->getRouteID() == routeID) {
401 if (i->getVehicleTypeID() == vehicleTypeID) {
412 if (i->getFlowID() == flowID) {
423 if (i->getRouteID() == routeID) {
443 for (
int i = 0; i < (int)
myShape.size(); ++i) {
447 glTranslated(pos.
x(), pos.
y(),
getType());
448 glRotated(rot, 0, 0, 1);
450 glScaled(exaggeration, exaggeration, 1);
451 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
453 glBegin(GL_TRIANGLES);
454 glColor3d(1, .8f, 0);
456 glVertex2d(0 - 1.4, 0);
457 glVertex2d(0 - 1.4, 6);
458 glVertex2d(0 + 1.4, 6);
459 glVertex2d(0 + 1.4, 0);
460 glVertex2d(0 - 1.4, 0);
461 glVertex2d(0 + 1.4, 6);
465 if (s.
scale * exaggeration >= 1.) {
466 glTranslated(0, 0, .1);
471 glRotated(180, 0, 1, 0);
472 glTranslated(-w / 2., 2, 0);
474 glTranslated(w / 2., -2, 0);
547 return (canParse<double>(value) && parse<double>(value) >= 0);
double getPositionRelativeToParametricLength(double position) const
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
writte additional element into a xml file
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
const std::vector< GNECalibratorRoute > & getCalibratorRoutes() const
get calibrator routes
double scale
information about a lane's width (temporary, used for a single view)
bool flowExists(std::string flowID) const
check if a flow with ID = flowID exists
description of a vehicle type
void addCalibratorRoute(const GNECalibratorRoute &route)
add calibrator route
bool flowExists(const std::string &flowID) const
Check if exist a flow with these ID.
GUIVisualizationTextSettings addName
GNECalibrator(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double pos, double frequency, const std::string &output, const std::vector< GNECalibratorRoute > &calibratorRoutes, const std::vector< GNECalibratorFlow > &calibratorFlows, const std::vector< GNECalibratorVehicleType > &calibratorVehicleTypes)
Constructor.
const std::vector< GNECalibratorVehicleType > & getCalibratorVehicleTypes() const
get calibrator vehicleTypes
void pfSetScale(double s)
a flow definition (used by router)
void addCalibratorFlow(const GNECalibratorFlow &flow)
add calibrator flow
double x() const
Returns the x-position.
GNELane * myLane
The lane this additional belongs.
Stores the information about how to visualize structures.
bool vehicleTypeExists(const std::string &vehicleTypeID) const
Check if exist a vehicle type with these ID.
~GNECalibrator()
Destructor.
std::vector< GNECalibratorFlow > myCalibratorFlows
calibrator flow values
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
weights: time range begin
bool routeExists(const std::string &routeID) const
Check if exist a route with these ID.
GNERouteProbe * myRouteProbe
pointer to current RouteProbe
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
bool routeExists(std::string routeID) const
check if a route with ID = routeID exists
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void pfSetPosition(double x, double y)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
bool vehicleTypeExists(std::string vehicleTypeID) const
check if a vehicelType with ID = vehicleTypeID exists
static bool isValidFilename(const std::string &value)
true if value is a valid file value
std::vector< double > myShapeRotations
GUIGlID getGlID() const
Returns the numerical id of the object.
void commmitAdditionalGeometryMoved(double, double, GNEUndoList *)
updated geometry changes in the attributes of additional
begin/end of the description of a route
void openAdditionalDialog()
open Calibrator Dialog
std::string generateRouteID() const
generate a route ID
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
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::string myOutput
output of calibrator
const GNECalibratorRoute & getCalibratorRoute(const std::string &routeID)
get reference calibrator route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
void setCalibratorVehicleTypes(const std::vector< GNECalibratorVehicleType > &calibratorVehicleType)
set calibrator vehicleTypes values
friend class GNEChange_Attribute
declare friend class
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
double y() const
Returns the y-position.
std::vector< double > myShapeLengths
The lengths of the shape parts.
const GNECalibratorVehicleType & getCalibratorVehicleType(const std::string &vehicleTypeID)
get reference to calibrator vehicle type
edge: the shape in xml-definition
void setAdditionalID(const std::string &id)
set the ID of additional
const std::string getID() const
function to support debugging
void changeLane(const std::string &laneID)
change lane of additional
void setCalibratorRoutes(const std::vector< GNECalibratorRoute > &calibratorRoutes)
set calibrator route values
void addCalibratorVehicleType(const GNECalibratorVehicleType &vehicleType)
add calibrator vehicleType
Dialog for edit calibrators.
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
const std::vector< GNECalibratorFlow > & getCalibratorFlows() const
get calibrator flows
std::string generateFlowID() const
generate a flow ID
double pfdkGetStringWidth(const char *c)
const PositionVector & getShape() const
returns the shape of the lane
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
An Element which don't belongs to GNENet but has influency in the simulation.
RGBColor myBaseColor
base color (Default green)
GNENet * getNet() const
get the net object
void setCalibratorFlows(const std::vector< GNECalibratorFlow > &calibratorFlows)
set calibrator flow values
std::vector< GNECalibratorVehicleType > myCalibratorVehicleTypes
calibrator vehicleType values
std::string generateVehicleTypeID() const
generate a vehicleType ID
SumoXMLTag getTag() const
get XML 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.
double myFrequency
Frequency of calibrator.
void updateGeometry()
update pre-computed geometry information
const GNECalibratorFlow & getCalibratorFlow(const std::string &flowID)
get reference to calibrator flow
const std::string & getParentName() const
Returns the name of the parent object (if any)
std::vector< GNECalibratorRoute > myCalibratorRoutes
calibrator route values
void moveAdditionalGeometry(double, double)
change the position of the calibrator geometry
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Position getPositionInView() const
Returns position of Calibrator in view.