66 double frequency,
const std::string& output,
const std::vector<GNECalibratorRoute>& calibratorRoutes,
67 const std::vector<GNECalibratorFlow>& calibratorFlows,
const std::vector<GNECalibratorVehicleType>& calibratorVehicleTypes) :
69 myPositionOverLane(pos / lane->getLaneParametricLength()),
70 myFrequency(frequency),
73 myCalibratorRoutes(calibratorRoutes),
74 myCalibratorFlows(calibratorFlows),
75 myCalibratorVehicleTypes(calibratorVehicleTypes) {
117 Position s =
myShape[0] + Position(1, 0);
308 const std::vector<GNECalibratorVehicleType>&
314 const std::vector<GNECalibratorFlow>&
320 const std::vector<GNECalibratorRoute>&
377 if (i->getVehicleTypeID() == vehicleTypeID) {
388 if (i->getFlowID() == flowID) {
399 if (i->getRouteID() == routeID) {
410 if (i->getVehicleTypeID() == vehicleTypeID) {
421 if (i->getFlowID() == flowID) {
432 if (i->getRouteID() == routeID) {
452 for (
int i = 0; i < (int)
myShape.size(); ++i) {
456 glTranslated(pos.
x(), pos.
y(),
getType());
457 glRotated(rot, 0, 0, 1);
459 glScaled(exaggeration, exaggeration, 1);
460 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
468 glBegin(GL_TRIANGLES);
469 glVertex2d(0 - 1.4, 0);
470 glVertex2d(0 - 1.4, 6);
471 glVertex2d(0 + 1.4, 6);
472 glVertex2d(0 + 1.4, 0);
473 glVertex2d(0 - 1.4, 0);
474 glVertex2d(0 + 1.4, 6);
478 if (s.
scale * exaggeration >= 1.) {
480 glTranslated(0, 0, .1);
484 glRotated(180, 0, 1, 0);
485 glTranslated(-w / 2., 2, 0);
487 glTranslated(w / 2., -2, 0);
559 if (canParse<double>(value)) {
562 if ((newStartPos < 0) || (newStartPos > 1)) {
569 return (canParse<double>(value) && parse<double>(value) >= 0);
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 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.
bool isAdditionalSelected() const
~GNECalibrator()
Destructor.
std::vector< GNECalibratorFlow > myCalibratorFlows
calibrator flow values
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
weights: time range begin
void moveGeometry(const Position &newPosition)
change the position of the element geometry without saving in undoList
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.
begin/end of the description of a route
void undo()
undo the last command group
void openAdditionalDialog()
open Calibrator Dialog
static OptionsCont & getOptions()
Retrieves the options.
void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const
writte additional element into a xml file
GNEUndoList * getUndoList() const
get the undoList object
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.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
static bool isValidID(const std::string &value)
true if value is a valid sumo ID
GUIVisualizationSizeSettings addSize
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static const RGBColor selectedAdditionalColor
color of selected additionals
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)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
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)
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
This functions has to be implemented in allGNEAttributeCarrier.
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.
double length() const
Returns the length.
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.
double myPositionOverLane
position over Lane
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
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
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.
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
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
SumoXMLTag getTag() const
get XML Tag assigned to this object
Static storage of an output device and its base (abstract) implementation.
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
double getLaneParametricLength() const
returns the parameteric length of the lane
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void duplicateLane(GNELane *lane, GNEUndoList *undoList)
duplicates lane
Position getPositionInView() const
Returns position of additional in view.