 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
35 GNEDetector(
"", net,
GLO_E1DETECTOR_INSTANT,
SUMO_TAG_INSTANT_INDUCTION_LOOP, 0, 0, {},
"", {},
"",
false,
Parameterised::Map()) {
42 const std::string& name,
const bool friendlyPos,
const Parameterised::Map& parameters) :
45 }, filename, vehicleTypes, name, friendlyPos, parameters) {
47 updateCenteringBoundary(
false);
93 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
99 std::string errorPosition;
107 return errorPosition;
144 RGBColor mainColor, secondColor, textColor;
164 drawE1Shape(s, E1InstantExaggeration, scaledWidth, mainColor, secondColor);
266 return canParse<double>(value) && fabs(parse<double>(value)) <
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
278 return canParse<bool>(value);
280 return canParse<bool>(value);
318 if (parse<bool>(value)) {
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
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".
void fixAdditionalProblem()
fix additional problem
double getAttributeDouble(SumoXMLAttr key) const
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
const std::string getID() const
get ID (all Attribute Carriers have one)
@ GNE_ATTR_SHIFTLANEINDEX
shift lane index (only used by elements over lanes)
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
bool showAdditionals() const
check if additionals has to be drawn
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
Static storage of an output device and its base (abstract) implementation.
double myMoveElementLateralOffset
move element lateral offset (used by elements placed over lanes
static const RGBColor BLACK
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
const GNETagProperties & myTagProperty
reference to tagProperty associated with this attribute carrier
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
A NBNetBuilder extended by visualisation and editing capabilities.
void shiftLaneIndex()
shift lane index
const PositionVector & getShape() const
The shape of the additional element.
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
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|....
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
std::map< std::string, std::string > Map
parameters map
std::string getAttribute(SumoXMLAttr key) const
static const RGBColor connectionColor
connection color
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
double myPositionOverLane
position of detector over Lane
static void pushName(unsigned int name)
push Name
bool myFriendlyPosition
Flag for friendly position.
static const double detectorDetails
details for detectors
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
std::vector< std::string > myVehicleTypes
attribute vehicle types
~GNEDetectorE1Instant()
Destructor.
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
double getGeometryPositionOverLane() const
get position over lane that is applicable to the shape
static void pushMatrix()
push matrix
GNENet * myNet
pointer to net
friend class GNEChange_Attribute
declare friend class
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
void updateGeometry(const PositionVector &shape)
update entire geometry
bool isValidDetectorID(const std::string &newID) const
check if a new detector ID is valid
GUIVisualizationDetailSettings detailSettings
detail settings
GUIVisualizationDetectorSettings detectorSettings
Detector settings.
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
bool isAdditionalValid() const
check if current additional is valid to be writed into XML
double newFirstPos
new first position
@ GLO_E1DETECTOR_INSTANT
a E1 detector
void drawDetectorLogo(const GUIVisualizationSettings &s, const double exaggeration, const std::string &logo, const RGBColor &textColor) const
draw detector Logo
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawAdditionalName(const GUIVisualizationSettings &s) const
draw additional name
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
double scale
information about a lane's width (temporary, used for a single view)
void updateGeometry()
update pre-computed geometry information
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"
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
static void fixLanePosition(double &pos, double &length, const double laneLength)
fix given position over lane
GNEUndoList * getUndoList() const
get the undoList object
void drawParentChildLines(const GUIVisualizationSettings &s, const RGBColor &color, const bool onlySymbols=false) const
draw parent and child lines
static void drawLockIcon(const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position viewPosition, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
std::string myAdditionalName
name of additional
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
void replaceAdditionalParentLanes(const std::string &value)
replace additional parent lanes
static bool checkLanePosition(double pos, const double length, const double laneLength, const bool friendlyPos)
check if the given position over a lane is valid
static const double E1InstantWidth
E1 Instant detector widths.
GNEViewNet * getViewNet() const
get view net
GUIVisualizationColorSettings colorSettings
color settings
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void drawAdditionalID(const GUIVisualizationSettings &s) const
draw additional ID
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
std::string getAdditionalProblem() const
return a string with the current additional problem
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)
std::string myFilename
The path to the output file.
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
GNEDetectorE1Instant(GNENet *net)
default Constructor
static void popMatrix()
pop matrix
const GNELane * newFirstLane
new first Lane
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
double firstLaneOffset
lane offset
@ GNE_ATTR_SELECTED
element is selected
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
const std::string & getTagStr() const
get tag assigned to this object in string format
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)
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
Stores the information about how to visualize structures.
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
static void popName()
pop Name
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
static const RGBColor E1InstantColor
color for E1 Instant detectors
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void drawE1Shape(const GUIVisualizationSettings &s, const double exaggeration, const double scaledWidth, const RGBColor &mainColor, const RGBColor &secondColor) const
draw E1 shape
@ SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
static const RGBColor WHITE