41 const std::vector<GNELane*>& parentLanes,
const std::string& filename,
const std::vector<std::string>& vehicleTypes,
const std::string& name,
42 const bool friendlyPos,
const std::map<std::string, std::string>& parameters) :
43 GNEAdditional(id, net, type, tag, name, {}, {}, parentLanes, {}, {}, {}, {}, {}, parameters),
44 myPositionOverLane(pos),
47 myVehicleTypes(vehicleTypes),
48 myFriendlyPosition(friendlyPos) {
53 const std::vector<GNELane*>& parentLanes,
const std::string& filename,
const std::string& name,
const bool friendlyPos,
54 const std::map<std::string, std::string>& parameters) :
55 GNEAdditional(net, type, tag, name, {}, {}, parentLanes, {additionalParent}, {}, {}, {}, {}, parameters),
56 myPositionOverLane(pos),
59 myFriendlyPosition(friendlyPos) {
116 if (newE2Lanes.size() > 0) {
168 glScaled(exaggeration, exaggeration, 1);
175 glVertex2d(-1.0, -2);
181 glTranslated(0, 0, .01);
185 glVertex2d(0, 2 - .1);
186 glVertex2d(0, -2 + .1);
194 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
199 glVertex2f(-1.0, -2);
205 glRotated(90, 0, 0, -1);
207 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
223 const std::string& logo,
const RGBColor& textColor)
const {
239 glTranslated(pos.
x(), pos.
y(), 0.1);
243 glTranslated(-1, 0, 0);
245 glScaled(exaggeration, exaggeration, 1);
301 if (fromGeometry.
getShape().front().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
306 }
else if (toGeometry.
getShape().back().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
@ NETWORK_MOVE
mode for moving network elements
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_E2DETECTOR
an e2 detector
@ GNE_TAG_E2DETECTOR_MULTILANE
an e2 detector over multiple lanes (placed here due create Additional Frame)
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 fixSinglePositionOverLane(double &pos, const double laneLength)
fix given position over lane
An Element which don't belongs to GNENet but has influency in the simulation.
const std::string & getID() const
get ID
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
Boundary myAdditionalBoundary
Additional Boundary.
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
GNEDetector(const std::string &id, GNENet *net, GUIGlObjectType type, SumoXMLTag tag, const double pos, const SUMOTime freq, const std::vector< GNELane * > &parentLanes, const std::string &filename, const std::vector< std::string > &vehicleTypes, const std::string &name, const bool friendlyPos, const std::map< std::string, std::string > ¶meters)
Constructor.
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 * getMoveOperationE2MultiLane()
get moveOperation for E2 multi lane
GNEMoveOperation * getMoveOperation()
get move operation
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)
GNEMoveOperation * getMoveOperationE2SingleLane()
get moveOperation for E2 single lane
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.
double getLengthGeometryFactor() const
get length geometry factor
GNEEdge * getParentEdge() const
get arent 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
const std::string & getID() const
get ID
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed modul
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.
void updateGeometry(const PositionVector &shape)
update entire geometry
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
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
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
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.
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
static const double additionalGeometryPointRadius
moving additional geometry point radius