42 const std::string& output,
const double jamThreshold,
const std::vector<std::string>& vTypes,
const Parameterised::Map& parameters) :
59 const std::string& output,
GNEAdditional* routeProbe,
const double jamThreshold,
const std::vector<std::string>& vTypes,
78 const std::string& output,
const double jamThreshold,
const std::vector<std::string>& vTypes,
const Parameterised::Map& parameters) :
95 const std::string& output,
GNEAdditional* routeProbe,
const double jamThreshold,
const std::vector<std::string>& vTypes,
171 calibratorFlow->writeAdditional(device);
228 rerouterElement->updateGeometry();
275 const auto& inspectedElements =
myNet->getViewNet()->getInspectedElements();
277 if (
myNet->getViewNet()->getDataViewOptions().showAdditionals()) {
298 if (
myNet->getViewNet()->getNetworkViewOptions().showSubAdditionals() ||
300 calibratorFlow->isAttributeCarrierSelected() || inspectedElements.isACInspected(calibratorFlow) ||
301 calibratorFlow->isMarkedForDrawingFront()) {
302 calibratorFlow->drawGL(s);
312 const auto& editModes =
myNet->getViewNet()->getEditModes();
314 if (!
myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
315 !
myNet->getViewNet()->getEditNetworkElementShapes().getEditedNetworkElement() &&
318 return myNet->getViewNet()->getViewObjectsSelector().getGUIGlObjectFront() ==
this;
417 if (
myNet->getAttributeCarriers()->retrieveEdge(
value,
false) !=
nullptr) {
423 if (
myNet->getAttributeCarriers()->retrieveLane(
value,
false) !=
nullptr) {
433 return (newPosition >= 0);
437 if ((newPosition < 0) || (newPosition > shape.
length())) {
489 const Position& pos,
const double rot,
const int symbolIndex)
const {
497 glTranslated(pos.
x(), pos.
y(), 0);
501 glScaled(exaggeration, exaggeration, 1);
503 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
507 glBegin(GL_TRIANGLES);
533 if (symbolIndex == -1) {
546 if (symbolIndex == -1) {
549 exaggeration, parentBoundary);
551 if (symbolIndex == 0) {
554 exaggeration, parentBoundary);
558 exaggeration, parentBoundary);
@ NETWORK_MOVE
mode for moving network elements
@ GLO_CALIBRATOR
a calibrator
const std::string invalid_return< std::string >::value
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
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_SHIFTLANEINDEX
shift lane index (only used by elements over lanes)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void popMatrix()
pop matrix
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)
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
bool isValidAdditionalID(const std::string &value) const
check if a new additional ID is valid
void replaceAdditionalParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace additional parent
void setAdditionalID(const std::string &newID)
set additional ID
GNEContour myAdditionalContour
variable used for draw additional contours
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
std::string myAdditionalName
name of additional
void writeAdditionalAttributes(OutputDevice &device) const
write common additional attributes
GNEAdditional(const std::string &id, GNENet *net, const std::string &filename, SumoXMLTag tag, const std::string &additionalName)
Constructor.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
double getCommonAttributeDouble(SumoXMLAttr key) const
bool mySelected
boolean to check if this AC is selected (more quickly as checking GUIGlObjectStorage)
const std::string getID() const override
get ID (all Attribute Carriers have one)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
PositionVector getCommonAttributePositionVector(SumoXMLAttr key) const
void setCommonAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
const std::string & getTagStr() const
get tag assigned to this object in string format
bool isTemplate() const
check if this AC is template
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void drawInLayer(const double typeOrLayer, const double extraOffset=0) const
draw element in the given layer, or in front if corresponding flag is enabled
Position getCommonAttributePosition(SumoXMLAttr key) const
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * myNet
pointer to net
bool isCommonAttributeValid(SumoXMLAttr key, const std::string &value) const
std::string getCommonAttribute(SumoXMLAttr key) const
void drawCalibratorSymbol(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double exaggeration, const Position &pos, const double rot, const int symbolIndex) const
draw calibrator symbol
bool isAdditionalValid() const override
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
std::string getParentName() const override
Returns the name of the parent object.
double myJamThreshold
jamThreshold
std::string myOutput
output of calibrator
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
std::vector< GNEContour * > * myEdgeCalibratorContours
edge calibrator contours
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this calibrator
double getAttributeDouble(SumoXMLAttr key) const override
~GNECalibrator()
Destructor.
SUMOTime myFrequency
Frequency of calibrator.
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
bool isValid(SumoXMLAttr key, const std::string &value) override
std::string getAttribute(SumoXMLAttr key) const override
double myPositionOverLane
position over Lane
std::vector< std::string > myVTypes
vTypes
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
bool checkDrawMoveContour() const override
check if draw move contour (red)
Position getPositionInView() const override
Returns position of additional in view.
void openAdditionalDialog() override
open Calibrator Dialog
GNECalibrator(SumoXMLTag tag, GNENet *net)
Default constructor.
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
Position getAttributePosition(SumoXMLAttr key) const override
void updateGeometry() override
update pre-computed geometry information
Parameterised * getParameters() override
get parameters associated with this calibrator
std::vector< GUIGeometry > myEdgeCalibratorGeometries
edge calibrator geometries
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
const GNEHierarchicalContainerParents< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const GNEHierarchicalContainerParents< GNEEdge * > & getParentEdges() const
get parent edges
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
const GNEHierarchicalContainerChildren< GNEAdditional * > & getChildAdditionals() const
return child additionals
void setParent(ParentType parent)
edit parent and childrens without maintain integrity (use carefully)
const GNEHierarchicalContainerParents< GNELane * > & getParentLanes() const
get parent lanes
A NBNetBuilder extended by visualisation and editing capabilities.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)
void updateGeometry(const PositionVector &shape)
update entire geometry
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GUIGlObject(GUIGlObjectType type, const std::string µsimID, FXIcon *icon)
Constructor.
Stores the information about how to visualize structures.
bool checkDrawAdditional(Detail d, const bool selected) const
check if draw additionals
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
static const std::vector< SumoXMLTag > calibrators
calibrators namespace
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
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.
std::map< std::string, std::string > Map
parameters map
Parameterised()
Default constructor.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
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.
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)
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 segmentWidth
width of dotted contour segments