 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
36 GNEDetector(
"", net,
GLO_DET_ENTRY, entryExitTag, 0, 0, {},
"", {},
"",
false,
Parameterised::Map()) {
46 },
"",
"", friendlyPos, parameters) {
48 updateCenteringBoundary(
false);
81 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
87 std::string errorPosition;
143 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
150 glScaled(entryExitExaggeration, entryExitExaggeration, 1);
159 glVertex2d(-1.7, .5);
160 glVertex2d(-1.7, -.5);
161 glVertex2d(1.7, -.5);
165 glTranslated(1.5, 0, 0);
169 glTranslated(-3, 0, 0);
175 glVertex2d(-1.7, 4.3);
176 glVertex2d(-1.7, -.5);
177 glVertex2d(1.7, -.5);
178 glVertex2d(1.7, 4.3);
192 glTranslated(1.9, 0, 0);
194 glScaled(entryExitExaggeration, entryExitExaggeration, 1);
207 glTranslated(1.7, 0, 0);
209 glRotated(90, 0, 0, 1);
313 return canParse<double>(value) && fabs(parse<double>(value)) <
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
315 return canParse<bool>(value);
319 return canParse<bool>(value);
344 if (parse<bool>(value)) {
@ GLO_DET_ENTRY
a DetEntry detector
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
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".
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
An Element which don't belong to GNENet but has influence in the simulation.
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 storage of an output device and its base (abstract) implementation.
double myMoveElementLateralOffset
move element lateral offset (used by elements placed over lanes
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
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.
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
static const RGBColor connectionColor
connection color
@ SUMO_TAG_DET_ENTRY
an e3 entry point
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
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
bool myFriendlyPosition
Flag for friendly position.
SumoXMLTag
Numbers representing SUMO-XML - element names.
static const double detectorDetails
details for detectors
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.
void replaceAdditionalParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace additional parent
GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNENet *net)
default Constructor
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
void updateGeometry(const PositionVector &shape)
update entire geometry
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
void fixAdditionalProblem()
fix additional problem
double newFirstPos
new first position
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)
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawAdditionalName(const GUIVisualizationSettings &s) const
draw additional name
std::string getAdditionalProblem() const
return a string with the current additional problem
static const RGBColor E3EntryColor
color for Entrys
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
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"
A point in 2D or 3D with translation and scaling methods.
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 getAttribute(SumoXMLAttr key) const
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
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
GNEViewNet * getViewNet() const
get view net
GUIVisualizationColorSettings colorSettings
color settings
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)
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 updateGeometry()
update pre-computed geometry information
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
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 isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
static const RGBColor E3ExitColor
color for Exits
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
static void popMatrix()
pop matrix
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
@ SUMO_TAG_E3DETECTOR
an e3 detector
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
~GNEDetectorEntryExit()
destructor
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
Stores the information about how to visualize structures.
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
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
@ SUMO_TAG_DET_EXIT
an e3 exit point
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth, const double extraOffset=0)
Draws a triangle at the end of the given line.
@ GNE_ATTR_PARENT
parent of an additional element
double getAttributeDouble(SumoXMLAttr key) const