69 myPositionOverLane(pos / edge->getLanes().at(0)->getLaneParametricLength()),
70 myFrequency(frequency),
102 throw ProcessError(
"Both myEdge and myLane aren't defined");
108 i->writeRoute(device);
112 i->writeVehicleType(device);
116 i->writeFlow(device);
156 throw ProcessError(
"Both myEdge and myLane aren't defined");
171 throw ProcessError(
"Both myEdge and myLane aren't defined");
184 throw ProcessError(
"Both myEdge and myLane aren't defined");
197 for (
int i = 0; i < (int)
myShape.size(); ++i) {
201 glTranslated(pos.
x(), pos.
y(),
getType());
202 glRotated(rot, 0, 0, 1);
204 glScaled(exaggeration, exaggeration, 1);
205 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
213 glBegin(GL_TRIANGLES);
214 glVertex2d(0 - 1.4, 0);
215 glVertex2d(0 - 1.4, 6);
216 glVertex2d(0 + 1.4, 6);
217 glVertex2d(0 + 1.4, 0);
218 glVertex2d(0 - 1.4, 0);
219 glVertex2d(0 + 1.4, 6);
223 if (s.
scale * exaggeration >= 1.) {
234 throw ProcessError(
"Both myEdge and myLane aren't defined");
266 const std::vector<GNECalibratorRoute*>&
285 const std::vector<GNECalibratorFlow*>&
303 const std::vector<GNECalibratorVehicleType*>&
324 throw ProcessError(
"Both myEdge and myLane aren't defined");
382 if (canParse<double>(value)) {
386 newPosition = parse<double>(value) /
myEdge->
getLanes().at(0)->getLaneParametricLength();
390 throw ProcessError(
"Both myEdge and myLane aren't defined");
392 if ((newPosition < 0) || (newPosition > 1)) {
401 return (canParse<double>(value) && parse<double>(value) >= 0);
437 throw ProcessError(
"Both myEdge and myLane aren't defined");
void removeCalibratorFlow(GNECalibratorFlow *flow)
remove calibrator flow
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
double scale
information about a lane's width (temporary, used for a single view)
GUIVisualizationTextSettings addName
void refreshElement(GUIGlObject *o)
refreshes boundary information for o and update
const std::string & getAdditionalID() const
returns Additional ID
std::vector< GNECalibratorRoute * > myCalibratorRoutes
calibrator route values
A calibrator placed over edge.
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
const std::vector< GNECalibratorVehicleType * > & getCalibratorVehicleTypes() const
get calibrator vehicleTypes
std::vector< GNECalibratorVehicleType * > myCalibratorVehicleTypes
calibrator vehicleType values
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
~GNECalibrator()
Destructor.
double x() const
Returns the x-position.
Position getPositionInView() const
Returns position of additional in view.
Representation of a RouteProbe in netedit.
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
GNERouteProbe * myRouteProbe
pointer to current RouteProbe
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void removeCalibratorVehicleType(GNECalibratorVehicleType *vehicleType)
remove calibrator vehicleType
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::vector< GNECalibratorFlow * > myCalibratorFlows
calibrator flow values
static const RGBColor BLACK
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
void changeAdditionalID(const std::string &newID)
change ID of additional
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.
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
GNECalibrator(const std::string &id, GNEViewNet *viewNet, GNEEdge *edge, double pos, double frequency, const std::string &output)
Constructor using edge.
static const RGBColor selectedAdditionalColor
color of selected additionals
double getLaneParametricLength() const
returns the parameteric length of the lane
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string myOutput
output of calibrator
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
PositionVector myShape
The shape of the additional element.
A point in 2D or 3D with translation and scaling methods.
friend class GNEChange_Attribute
declare friend class
A calibrator placed over lane (used in netedit)
void addCalibratorRoute(GNECalibratorRoute *route)
add calibrator route
void removeCalibratorRoute(GNECalibratorRoute *route)
add calibrator route
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
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
const std::vector< GNECalibratorRoute * > & getCalibratorRoutes() const
get calibrator routes
GNELane * myLane
The lane in which CalibratorLane are placed.
A road/street connecting two junctions (netedit-version)
void addCalibratorVehicleType(GNECalibratorVehicleType *vehicleType)
add calibrator vehicleType
const std::string & getParentName() const
Returns the name of the parent object.
Dialog for edit calibrators.
double myPositionOverLane
position over Lane
void addCalibratorFlow(GNECalibratorFlow *flow)
add calibrator flow
const PositionVector & getShape() const
returns the shape of the lane
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
double length() const
Returns the length.
GNEEdge * changeEdge(GNEEdge *oldEdge, const std::string &newEdgeID)
change edge of additional
An Element which don't belongs to GNENet but has influency in the simulation.
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
GNEEdge * myEdge
The edge in which Calibrators are placed.
GNENet * getNet() const
get the net object
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
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
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
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
const std::vector< GNECalibratorFlow * > & getCalibratorFlows() const
get calibrator flows
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
bool isAdditionalSelected() const
static const RGBColor selectionColor
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
GNELane * changeLane(GNELane *oldLane, const std::string &newLaneID)
change lane of additional
SumoXMLTag getTag() const
get XML Tag assigned to this object