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);
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
int pfDrawString(const char *c)
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
double scale
information about a lane's width (temporary, used for a single view)
const std::vector< GNECalibratorFlow > & getCalibratorFlows() const
get calibrator flows
description of a vehicle type
void addCalibratorRoute(const GNECalibratorRoute &route)
add calibrator route
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.
bool routeExists(const std::string &routeID) const
Check if exist a route with these ID.
void pfSetScale(double s)
a flow definition (used by router)
const std::string & getAdditionalID() const
returns the ID of additional
void addCalibratorFlow(const GNECalibratorFlow &flow)
add calibrator flow
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
GNELane * myLane
The lane this additional belongs.
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
std::string getAttribute(SumoXMLAttr key) const
bool vehicleTypeExists(const std::string &vehicleTypeID) const
Check if exist a vehicle type with these ID.
double getPositionRelativeToParametricLength(double position) const
~GNECalibrator()
Destructor.
std::vector< GNECalibratorFlow > myCalibratorFlows
calibrator flow values
double x() const
Returns the x-position.
Position getPositionInView() const
Returns position of Calibrator in view.
weights: time range begin
GNERouteProbe * myRouteProbe
pointer to current RouteProbe
std::string generateVehicleTypeID() const
generate a vehicleType ID
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
bool vehicleTypeExists(std::string vehicleTypeID) const
check if a vehicelType with ID = vehicleTypeID exists
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void pfSetPosition(double x, double y)
const std::vector< GNECalibratorRoute > & getCalibratorRoutes() const
get calibrator routes
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
static bool isValidFilename(const std::string &value)
true if value is a valid file value
std::vector< double > myShapeRotations
bool routeExists(std::string routeID) const
check if a route with ID = routeID exists
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
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
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
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 ...
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
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
std::vector< double > myShapeLengths
The lengths of the shape parts.
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 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
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
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
std::string generateFlowID() const
generate a flow ID
const std::string & getParentName() const
Returns the name of the parent object (if any)
Dialog for edit calibrators.
double pfdkGetStringWidth(const char *c)
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
const PositionVector & getShape() const
returns the shape of the lane
An Element which don't belongs to GNENet but has influency in the simulation.
RGBColor myBaseColor
base color (Default green)
bool flowExists(std::string flowID) const
check if a flow with ID = flowID exists
const std::vector< GNECalibratorVehicleType > & getCalibratorVehicleTypes() const
get calibrator vehicleTypes
void setCalibratorFlows(const std::vector< GNECalibratorFlow > &calibratorFlows)
set calibrator flow values
std::vector< GNECalibratorVehicleType > myCalibratorVehicleTypes
calibrator vehicleType values
GNENet * getNet() const
get the net object
bool flowExists(const std::string &flowID) const
Check if exist a flow with these ID.
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
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
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
std::string generateRouteID() const
generate a route ID
const GNECalibratorFlow & getCalibratorFlow(const std::string &flowID)
get reference to calibrator flow
std::vector< GNECalibratorRoute > myCalibratorRoutes
calibrator route values
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
void moveAdditionalGeometry(double, double)
change the position of the calibrator geometry
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
SumoXMLTag getTag() const
get XML Tag assigned to this object