37 double pos,
const std::string& freq,
const std::string& filename,
const std::string& vehicleTypes,
38 const std::string& name,
bool friendlyPos,
bool blockMovement,
const std::vector<GNELane*>& parentLanes) :
39 GNEAdditional(id, net, type, tag, name, blockMovement, {}, {}, parentLanes, {}, {}, {}, {}, {}),
40 myPositionOverLane(pos),
43 myVehicleTypes(vehicleTypes),
44 myFriendlyPosition(friendlyPos) {
49 double pos,
const std::string& freq,
const std::string& filename,
const std::string& name,
bool friendlyPos,
50 bool blockMovement,
const std::vector<GNELane*>& parentLanes) :
51 GNEAdditional(net, type, tag, name, blockMovement, {}, {}, parentLanes, {additionalParent}, {}, {}, {}, {}),
52 myPositionOverLane(pos),
55 myFriendlyPosition(friendlyPos) {
105 if (newE2Lanes.size() > 0) {
165 glScaled(exaggeration, exaggeration, 1);
172 glVertex2d(-1.0, -2);
178 glTranslated(0, 0, .01);
182 glVertex2d(0, 2 - .1);
183 glVertex2d(0, -2 + .1);
191 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
196 glVertex2f(-1.0, -2);
202 glRotated(90, 0, 0, -1);
204 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
220 const std::string& logo,
const RGBColor& textColor)
const {
236 glTranslated(pos.
x(), pos.
y(), 0.1);
240 glTranslated(-1, 0, 0);
242 glScaled(exaggeration, exaggeration, 1);
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_E2DETECTOR_MULTILANE
an e2 detector over multiple lanes (used by Netedit)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Boundary & grow(double by)
extends the boundary by the given amount
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
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)
static bool checkAndFixDetectorPosition(double &pos, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
An Element which don't belongs to GNENet but has influency in the simulation.
const std::string & getID() const
get ID
GNEGeometry::Geometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
Boundary myBoundary
Additional Boundary.
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
GNEMoveOperation * getMoveOperation(const double shapeOffset)
get move operation for the given shapeOffset
GNEDetector(const std::string &id, GNENet *net, GUIGlObjectType type, SumoXMLTag tag, double pos, const std::string &freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, bool friendlyPos, bool blockMovement, const std::vector< GNELane * > &parentLanes)
Constructor.
double myPositionOverLane
position of detector over Lane
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
double getAttributeDouble(SumoXMLAttr key) const
~GNEDetector()
Destructor.
double getPositionOverLane() const
get position over lane
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
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
GNELane * getLane() const
get lane
virtual void updateGeometry()=0
update pre-computed geometry information
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void drawDetectorLogo(const GUIVisualizationSettings &s, const double exaggeration, const std::string &logo, const RGBColor &textColor) const
draw detector Logo
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes
std::string getParentName() const
Returns the name of the parent object.
NBEdge * getNBEdge() const
returns the internal NBEdge
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
const PositionVector & getShape() const
The shape of the additional element.
std::string getNewListOfParents(const GNENetworkElement *currentElement, const GNENetworkElement *newNextElement) const
if use edge/parent lanes as a list of consecutive elements, obtain a list of IDs of elements after in...
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
double getLengthGeometryFactor() const
get length geometry factor
GNEEdge * getParentEdge() const
get arent edge
PositionVector shapeToUpdate
shape to update (edited in moveElement)
A NBNetBuilder extended by visualisation and editing capabilities.
const std::string & getID() const
get ID
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
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...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Stores the information about how to visualize structures.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
double getFinalLength() const
get length that will be assigned to the lanes in the final network
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 length2D() const
Returns the length.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)