38 const std::vector<GNELane*>& parentLanes,
const std::string& filename,
const std::vector<std::string>& vehicleTypes,
const std::string& name,
40 GNEAdditional(id, net, type, tag, icon, name, {}, {}, parentLanes, {}, {}, {}),
42 myPositionOverLane(pos),
45 myVehicleTypes(vehicleTypes),
46 myFriendlyPosition(friendlyPos) {
51 const double pos,
const SUMOTime period,
const std::vector<GNELane*>& parentLanes,
const std::string& filename,
52 const std::string& name,
const bool friendlyPos,
const Parameterised::Map& parameters) :
53 GNEAdditional(net, type, tag, icon, name, {}, {}, parentLanes, {additionalParent}, {}, {}),
55 myPositionOverLane(pos),
58 myFriendlyPosition(friendlyPos) {
117 if (newE2Lanes.size() > 0) {
135 return (fixedPos *
getLane()->getLengthGeometryFactor());
176 glScaled(exaggeration, exaggeration, 1);
183 glVertex2d(-1.0, -2);
189 glTranslated(0, 0, .01);
193 glVertex2d(0, 2 - .1);
194 glVertex2d(0, -2 + .1);
202 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
207 glVertex2f(-1.0, -2);
213 glRotated(90, 0, 0, -1);
215 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
231 const std::string& logo,
const RGBColor& textColor)
const {
247 glTranslated(pos.
x(), pos.
y(), 0.1);
251 glTranslated(-1, 0, 0);
253 glScaled(exaggeration, exaggeration, 1);
@ NETWORK_MOVE
mode for moving network elements
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_MULTI_LANE_AREA_DETECTOR
an e2 detector over multiple lanes (placed here due create Additional Frame)
@ SUMO_TAG_LANE_AREA_DETECTOR
alternative tag for e2 detector
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void reset()
Resets the boundary.
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 popMatrix()
pop matrix
static void pushMatrix()
push matrix
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 void fixLanePosition(double &pos, double &length, const double laneLength)
fix given position over lane
An Element which don't belong to GNENet but has influence in the simulation.
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
GNEMoveOperation * getMoveOperationMultiLane(const double startPos, const double endPos)
get moveOperation for an element over multi lane
Boundary myAdditionalBoundary
Additional Boundary.
GNEMoveOperation * getMoveOperationSingleLane(const double startPos, const double endPos)
get moveOperation for an element over single lane
const std::string getID() const
get ID (all Attribute Carriers have one)
const std::string & getTagStr() const
get tag assigned to this object in string format
GNENet * myNet
pointer to net
const GNETagProperties & myTagProperty
reference to tagProperty associated with this attribute carrier
double myPositionOverLane
position of detector over Lane
Position getPositionInView() const
Returns position of additional in view.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
~GNEDetector()
Destructor.
double getPositionOverLane() const
get position 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
GNELane * getLane() const
get lane
virtual double getAttributeDouble(SumoXMLAttr key) const =0
GNEMoveOperation * getMoveOperation()
get move operation
const Parameterised::Map & getACParametersMap() const
get parameters map
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)
GNEDetector(const std::string &id, GNENet *net, GUIGlObjectType type, SumoXMLTag tag, FXIcon *icon, const double pos, const SUMOTime period, const std::vector< GNELane * > &parentLanes, const std::string &filename, const std::vector< std::string > &vehicleTypes, const std::string &name, const bool friendlyPos, const Parameterised::Map ¶meters)
Constructor.
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
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.
GNEEdge * getParentEdge() const
get parent edge
bool getAllowChangeLane() const
allow change lane
CommonModeOptions * getCommonModeOptions() const
get common mode options
A NBNetBuilder extended by visualisation and editing capabilities.
GNEViewNet * getViewNet() const
get view net
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
GNEViewParent * getViewParent() const
get the net object
GNEMoveFrame * getMoveFrame() const
get frame for move elements
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
const PositionVector & getShape() const
The shape of the additional element.
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
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
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.
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network