35 GNEDetector(id, net,
GLO_E1DETECTOR_INSTANT,
SUMO_TAG_INSTANT_INDUCTION_LOOP, pos,
"", filename, vehicleTypes, name, friendlyPos, blockMovement, {
39 updateCenteringBoundary(
false);
61 std::string errorPosition;
62 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
101 RGBColor mainColor, secondColor, textColor;
119 drawE1Shape(s, E1InstantExaggeration, scaledWidth, mainColor, secondColor);
212 return canParse<double>(value) && fabs(parse<double>(value)) <
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
224 return canParse<bool>(value);
226 return canParse<bool>(value);
228 return canParse<bool>(value);
274 if (parse<bool>(value)) {
@ GLO_E1DETECTOR_INSTANT
a E1 detector
@ SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
@ GNE_ATTR_SELECTED
element is selected
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static bool checkAndFixDetectorPosition(double &pos, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
const std::string & getID() const
get ID
GNEGeometry::Geometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
void drawAdditionalID(const GUIVisualizationSettings &s) const
draw additional ID
void replaceAdditionalParentLanes(const std::string &value)
replace additional parent lanes
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
std::string myAdditionalName
name of additional
void drawAdditionalName(const GUIVisualizationSettings &s) const
draw additional name
bool isValidDetectorID(const std::string &newID) const
check if a new detector ID is valid
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
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
std::string getAdditionalProblem() const
return a string with the current additional problem
std::string getAttribute(SumoXMLAttr key) const
~GNEDetectorE1Instant()
Destructor.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void updateGeometry()
update pre-computed geometry information
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
bool isAttributeEnabled(SumoXMLAttr key) const
bool isAdditionalValid() const
check if current additional is valid to be writed into XML (by default true, can be reimplemented in ...
GNEDetectorE1Instant(const std::string &id, GNELane *lane, GNENet *net, double pos, const std::string &filename, const std::string &vehicleTypes, const std::string &name, bool friendlyPos, bool blockMovement)
Constructor.
void fixAdditionalProblem()
fix additional problem
std::string myFilename
The path to the output file.
double myPositionOverLane
position of detector over Lane
void drawE1Shape(const GUIVisualizationSettings &s, const double exaggeration, const double scaledWidth, const RGBColor &mainColor, const RGBColor &secondColor) const
draw E1 shape
double getGeometryPositionOverLane() const
get position over lane that is applicable to the shape
std::string myVehicleTypes
attribute vehicle types
bool myFriendlyPosition
Flag for friendly position.
void drawDetectorLogo(const GUIVisualizationSettings &s, const double exaggeration, const std::string &logo, const RGBColor &textColor) const
draw detector Logo
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, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void updateID(GNEAttributeCarrier *AC, const std::string newID)
update ID
A NBNetBuilder extended by visualisation and editing capabilities.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
GNEViewNet * getViewNet() const
get view net
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
GNEUndoList * getUndoList() const
get the undoList object
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, GUIGlObjectType objectType, const double extraOffset=0)
draw front attributeCarrier
GUIGlID getGlID() const
Returns the numerical id of the object.
Stores the information about how to visualize structures.
GUIVisualizationDetailSettings detailSettings
detail settings
GUIVisualizationSizeSettings addSize
bool drawDottedContour() const
check if dotted contour can be drawn
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
GUIVisualizationColorSettings colorSettings
color settings
double scale
information about a lane's width (temporary, used for a single view)
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
GUIVisualizationDetectorSettings detectorSettings
Detector settings.
static bool areParametersValid(const std::string &value, bool report=false, ParameterisedAttrType attrType=ParameterisedAttrType::STRING, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
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"
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".
static const RGBColor WHITE
static const RGBColor BLACK
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
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 void drawDottedSquaredShape(const DottedContourType type, const GUIVisualizationSettings &s, 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)
bool showAdditionals() const
check if additionals has to be drawn
static void drawLockIcon(const GNEAttributeCarrier *AC, const GNEGeometry::Geometry &geometry, const double exaggeration, const double offsetx, const double offsety, const bool overlane, const double size=0.5)
draw lock icon
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
static const double detectorDetails
details for detectors
static const double E1InstantWidth
E1 Instant detector widths.
static const RGBColor E1InstantColor
color for E1 Instant detectors
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values