37 GNEAdditional(
"", net,
GLO_CALIBRATOR, tag,
GUIIconSubSys::getIcon(
GUIIcon::
CALIBRATOR),
"", {}, {}, {}, {}, {}, {}),
38 myPositionOverLane(0),
47 const std::string& output,
const double jamThreshold,
const std::vector<std::string>& vTypes,
const Parameterised::Map& parameters) :
48 GNEAdditional(id, net,
GLO_CALIBRATOR,
SUMO_TAG_CALIBRATOR,
GUIIconSubSys::getIcon(
GUIIcon::
CALIBRATOR), name, {}, {edge}, {}, {}, {}, {}),
50 myPositionOverLane(pos),
51 myFrequency(frequency),
53 myJamThreshold(jamThreshold),
56 updateCenteringBoundary(
false);
61 const std::string& output,
GNEAdditional* routeProbe,
const double jamThreshold,
const std::vector<std::string>& vTypes,
63 GNEAdditional(id, net,
GLO_CALIBRATOR,
SUMO_TAG_CALIBRATOR,
GUIIconSubSys::getIcon(
GUIIcon::
CALIBRATOR), name, {}, {edge}, {}, {routeProbe}, {}, {}),
65 myPositionOverLane(pos),
66 myFrequency(frequency),
68 myJamThreshold(jamThreshold),
71 updateCenteringBoundary(
false);
76 const std::string& output,
const double jamThreshold,
const std::vector<std::string>& vTypes,
const Parameterised::Map& parameters) :
77 GNEAdditional(id, net,
GLO_CALIBRATOR,
GNE_TAG_CALIBRATOR_LANE,
GUIIconSubSys::getIcon(
GUIIcon::
CALIBRATOR), name, {}, {}, {lane}, {}, {}, {}),
79 myPositionOverLane(pos),
80 myFrequency(frequency),
82 myJamThreshold(jamThreshold),
85 updateCenteringBoundary(
false);
90 const std::string& output,
GNEAdditional* routeProbe,
const double jamThreshold,
const std::vector<std::string>& vTypes,
92 GNEAdditional(id, net,
GLO_CALIBRATOR,
GNE_TAG_CALIBRATOR_LANE,
GUIIconSubSys::getIcon(
GUIIcon::
CALIBRATOR), name, {}, {}, {lane}, {routeProbe}, {}, {}),
94 myPositionOverLane(pos),
95 myFrequency(frequency),
97 myJamThreshold(jamThreshold),
100 updateCenteringBoundary(
false);
141 calibratorFlow->writeAdditional(device);
169 for (
int i = 1; i < (int)
getParentEdges().front()->getLanes().size(); i++) {
176 throw ProcessError(
"Both edges and lanes aren't defined");
220 throw ProcessError(
"Both myEdge and myLane aren't defined");
236 drawCalibratorSymbol(s, exaggeration, edgeCalibratorGeometry.getShape().front(), edgeCalibratorGeometry.getShapeRotations().front() + 90);
247 calibratorFlow->drawGL(s);
358 if (canParse<double>(value)) {
360 const double newPosition = parse<double>(value);
362 return (newPosition >= 0);
366 if ((newPosition < 0) || (newPosition > shape.
length())) {
376 return canParse<SUMOTime>(value);
388 return canParse<double>(value) ? (parse<double>(value) >= 0) :
false;
396 return canParse<bool>(value);
429 glTranslated(pos.
x(), pos.
y(), 0);
433 glScaled(exaggeration, exaggeration, 1);
435 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
443 glBegin(GL_TRIANGLES);
463 throw ProcessError(
"Both myEdge and myLane aren't defined");
532 myVTypes = parse<std::vector<std::string> >(value);
535 if (parse<bool>(value)) {
@ GLO_CALIBRATOR
a Calibrator
GUIIcon
An enumeration of icons used by the gui applications.
std::string time2string(SUMOTime t)
convert SUMOTime to string
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_ROUTEPROBE
a routeprobe detector
@ GNE_TAG_CALIBRATOR_LANE
A calibrator placed over lane.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ GNE_TAG_CALIBRATOR_FLOW
a flow definition within in Calibrator
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_JAM_DIST_THRESHOLD
@ GNE_ATTR_SELECTED
element is selected
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ GNE_ATTR_SHIFTLANEINDEX
shift lane index (only used by elements over lanes)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void reset()
Resets the boundary.
Boundary & grow(double by)
extends the boundary by the given amount
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void pushName(unsigned int name)
push Name
static void popMatrix()
pop matrix
static void popName()
pop Name
static void pushMatrix()
push matrix
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, const int align=0, double width=-1)
An Element which don't belong to GNENet but has influence in the simulation.
void replaceAdditionalParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace additional parent
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
void replaceAdditionalParentEdges(const std::string &value)
replace additional parent edges
void drawAdditionalID(const GUIVisualizationSettings &s) const
draw additional ID
void replaceAdditionalParentLanes(const std::string &value)
replace additional parent lanes
void shiftLaneIndex()
shift lane index
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
std::string myAdditionalName
name of additional
Boundary myAdditionalBoundary
Additional Boundary.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
bool isTemplate() const
check if this AC is template
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
Dialog for edit calibrators.
std::string getAttribute(SumoXMLAttr key) const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void drawCalibratorSymbol(const GUIVisualizationSettings &s, const double exaggeration, const Position &pos, const double rot) const
draw calibrator symbol
void updateGeometry()
update pre-computed geometry information
Position getPositionInView() const
Returns position of additional in view.
const Parameterised::Map & getACParametersMap() const
get parameters map
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
double myJamThreshold
jamThreshold
std::string myOutput
output of calibrator
std::string getParentName() const
Returns the name of the parent object.
~GNECalibrator()
Destructor.
SUMOTime myFrequency
Frequency of calibrator.
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
double myPositionOverLane
position over Lane
std::vector< std::string > myVTypes
vTypes
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
double getAttributeDouble(SumoXMLAttr key) const
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
GNECalibrator(SumoXMLTag tag, GNENet *net)
Default constructor.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
GNEMoveOperation * getMoveOperation()
get move operation
void openAdditionalDialog()
open Calibrator Dialog
std::vector< GUIGeometry > myEdgeCalibratorGeometries
extra calibrator geometries
A road/street connecting two junctions (netedit-version)
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
A NBNetBuilder extended by visualisation and editing capabilities.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEViewNet * getViewNet() const
get view net
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
bool drawSelectContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw select contour
bool drawDeleteContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw delete contour
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
static void drawDottedSquaredShape(const GUIVisualizationSettings &s, const DottedContourType type, const Position &pos, const double width, const double height, const double offsetX, const double offsetY, const double rot, const double exaggeration)
draw dotted squared contour (used by additionals and demand elements)
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
void mouseWithinGeometry(const Position center, const double radius) const
check if mouse is within elements geometry (for circles)
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlID getGlID() const
Returns the numerical id of the object.
Stores the information about how to visualize structures.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GUIVisualizationDetailSettings detailSettings
detail settings
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
GUIVisualizationColorSettings colorSettings
color settings
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
An upper class for objects with additional parameters.
static bool areParametersValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
std::map< std::string, std::string > Map
parameters map
void setParametersStr(const std::string ¶msString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
double y() const
Returns the y-position.
double length() const
Returns the length.
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
static const RGBColor BLACK
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
static bool isValidListOfTypeID(const std::string &value)
whether the given string is a valid list of ids for an edge or vehicle type (empty aren't allowed)
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
bool showAdditionals() const
check if additionals has to be drawn
bool showSubAdditionals() const
check if show sub-additionals
static const RGBColor calibratorColor
color for Calibrators
static const double calibratorWidth
Calibrator width.
static const double calibratorHeight
Calibrator height.
RGBColor selectionColor
basic selection color
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
static const double calibratorText
details for calibrator text