40 GNEDetector(parent, viewNet,
GLO_DET_ENTRY, entryExitTag, pos, 0,
"",
"", friendlyPos, blockMovement, {
67 std::string errorPosition;
68 const double len =
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
95 newPosition.
add(offset);
165 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
168 glScaled(exaggeration, exaggeration, 1);
179 glVertex2d(-1.7, .5);
180 glVertex2d(-1.7, -.5);
181 glVertex2d(1.7, -.5);
185 glTranslated(1.5, 0, 0);
189 glTranslated(-3, 0, 0);
195 glVertex2d(-1.7, 4.3);
196 glVertex2d(-1.7, -.5);
197 glVertex2d(1.7, -.5);
198 glVertex2d(1.7, 4.3);
214 glTranslated(1.9, 0, 0);
227 glTranslated(1.7, 0, 0);
229 glRotated(90, 0, 0, 1);
320 return canParse<double>(value) && fabs(parse<double>(value)) <
getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
322 return canParse<bool>(value);
324 return canParse<bool>(value);
328 return canParse<bool>(value);
358 if (parse<bool>(value)) {
GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNEViewNet *viewNet, GNEAdditional *parent, GNELane *lane, double pos, bool friendlyPos, bool blockMovement)
Constructor.
const TagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
SumoXMLTag
Numbers representing SUMO-XML - element names.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
double scale
information about a lane's width (temporary, used for a single view)
static bool checkAndFixDetectorPosition(double &pos, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
GUIVisualizationTextSettings addName
std::vector< double > shapeRotations
The rotations of the single shape parts.
void add(const Position &pos)
Adds the given position to this one.
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
std::string getAttribute(SumoXMLAttr key) const
const std::string & getAdditionalID() const
Stores the information about how to visualize structures.
void changeAdditionalParent(GNEShape *shapeTobeChanged, const std::string &newAdditionalParentID, int additionalParentIndex)
change additional parent of a shape
Position offset
The offSet of the block icon.
double y() const
Returns the y-position.
double x() const
Returns the x-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, int align=0, double width=-1)
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Position position
position of the block icon
BlockIcon myBlockIcon
variable BlockIcon
void clearGeometry()
reset geometry
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Position originalViewPosition
value for saving first original position over lane before moving
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void changeAdditionalID(const std::string &newID)
change ID of additional
Position getLineCenter() const
get line center
double rotation
The rotation of the block icon.
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
AdditionalMove myMove
variable AdditionalMove
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void fixAdditionalProblem()
fix additional problem
GUIVisualizationSizeSettings addSize
GNEUndoList * getUndoList() const
get the undoList object
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static const RGBColor E3Exit
color for Exits
double getGeometryPositionOverLane() const
get position over lane that is applicable to the shape
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
A point in 2D or 3D with translation and scaling methods.
PositionVector shape
The shape of the additional element.
Position getPositionInView() const
Returns position of additional in view.
bool isAdditionalValid() const
check if current additional is valid to be writed into XML (by default true, can be reimplemented in ...
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
friend class GNEChange_Attribute
declare friend class
void selectAttributeCarrier(bool changeFlag=true)
const std::vector< GNELane * > & getLaneParents() const
get lanes of VSS
block movement of a graphic element
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
static const double detectorDetails
details for detectors
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
std::string getAdditionalProblem() const
return a string with the current additional problem
bool myFriendlyPosition
Flag for friendly position.
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
static void drawShapeDottedContourRectangle(const GUIVisualizationSettings &s, const int type, const Position ¢er, const double width, const double height, const double rotation=0, const double offsetX=0, const double offsetY=0)
draw a dotted contour around the given Position with certain width and height
GUIVisualizationDetailSettings detailSettings
detail settings
static const RGBColor E3Entry
color for Entrys
void changeLaneParents(GNEShape *elementChild, const std::string &newLaneIDs)
change edge parents of a shape
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
An Element which don't belongs to GNENet but has influency in the simulation.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
AdditionalGeometry myGeometry
geometry to be precomputed in updateGeometry(...)
const std::string & getTagStr() const
get tag assigned to this object in string format
std::string getGenericParametersStr() const
return generic parameters in string format
void updateGeometry()
update pre-computed geometry information
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth)
Draws a triangle at the end of the given line.
GUIVisualizationColorSettings colorSettings
color settings
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
parent of an additional element
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
~GNEDetectorEntryExit()
destructor
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
void drawIcon(const GUIVisualizationSettings &s, const double exaggeration, const double size=0.5) const
draw lock icon
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void setRotation(GNELane *additionalLane=nullptr)
set Rotation of block Icon (must be called in updateGeometry() function)
double myPositionOverLane
position of detector over Lane