49 GNELane* lane,
const double startPos,
const double endPos,
const std::string& name,
bool friendlyPosition,
51 GNEAdditional(id, net, type, tag, icon, name, {}, {}, {lane}, {}, {}, {}),
53 myStartPosition(startPos),
54 myEndPosition(endPos),
55 myFriendlyPosition(friendlyPosition) {
71 if (geometryPoints.empty()) {
73 }
else if (geometryPoints.front() == 0) {
111 double laneLength =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() *
getParentLanes().front()->getLengthGeometryFactor();
117 startPos += laneLength;
120 endPos += laneLength;
123 std::string errorStart, separator, errorEnd;
127 }
else if (startPos >
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
132 }
else if (endPos >
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
136 if ((errorStart.size() > 0) && (errorEnd.size() > 0)) {
137 separator =
TL(
" and ");
139 return errorStart + separator + errorEnd;
200 }
else if ((splitPosition >
myStartPosition) && (splitPosition < middlePosition)) {
206 }
else if ((splitPosition > middlePosition) && (splitPosition <
myEndPosition)) {
247 laneShape.
move2side(movingToSide * offsetSign);
267 return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
304 for (
int i = 0; i < (int)lines.size(); ++i) {
326 const RGBColor& signColor,
const std::string& word)
const {
340 glScaled(exaggeration, exaggeration, 1);
348 glTranslated(0, 0, .1);
364 const double width,
const bool movingGeometryPoints)
const {
366 if (movingGeometryPoints) {
386 const double laneLength =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
391 fixedPos += laneLength;
397 }
else if (fixedPos > (
getParentLanes().front()->getLaneShapeLength() - POSITION_EPS)) {
398 return (
getParentLanes().front()->getLaneShapeLength() - POSITION_EPS);
412 const double laneLength =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
417 fixedPos += laneLength;
421 if (fixedPos < POSITION_EPS) {
423 }
else if (fixedPos >
getParentLanes().front()->getLaneShapeLength()) {
@ NETWORK_MOVE
mode for moving network elements
GUIViewObjectsHandler gViewObjectsHandler
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const double INVALID_DOUBLE
invalid double
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void popMatrix()
pop matrix
static void drawFilledCircleDetailled(const GUIVisualizationSettings::Detail d, const double radius)
Draws a filled circle around (0,0) depending of level of detail.
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 fixLaneDoublePosition(double &from, double &to, const double laneLengt)
fix the given positions over lane
static bool checkLaneDoublePosition(double from, const double to, const double laneLength, const bool friendlyPos)
check if the given positions over a lane is valid
An Element which don't belong to GNENet but has influence in the simulation.
GNEContour myAdditionalContour
variable used for draw additional contours
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
bool drawMovingGeometryPoints(const bool ignoreShift) const
check if draw additional extrem geometry points
const std::string getID() const
get ID (all Attribute Carriers have one)
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
bool hasAttribute(SumoXMLAttr key) const
GNENet * myNet
pointer to net
void calculateContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset) const
calculate contour extruded (used in elements formed by a central shape)
void calculateContourLastGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double radius, const double scale) const
calculate contour for last geometry point
void calculateContourFirstGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double radius, const double scale) const
calculate contour for first geometry point
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 myMoveElementLateralOffset
move element lateral offset (used by elements placed over lanes
bool getAllowChangeLane() const
allow change lane
CommonModeOptions * getCommonModeOptions() const
get common mode options
const GNELane * newFirstLane
new first Lane
double newFirstPos
new first position
const GNEMoveOperation::OperationType operationType
move operation
double firstLaneOffset
lane offset
double newSecondPos
new second position
A NBNetBuilder extended by visualisation and editing capabilities.
GNEViewNet * getViewNet() const
get view net
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
double getStartGeometryPositionOverLane() const
get start position over lane that is applicable to the shape
virtual double getAttributeDouble(SumoXMLAttr key) const
GNEMoveOperation * getMoveOperation()
get move operation
Position getPositionInView() const
Returns position of additional in view.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool checkDrawMoveContour() const
check if draw move contour (red)
void drawSign(const GUIVisualizationSettings::Detail d, const double exaggeration, const RGBColor &baseColor, const RGBColor &signColor, const std::string &word) const
draw sign
static const double myCircleWidthSquared
squared circle width resolution for all stopping places
~GNEStoppingPlace()
Destructor.
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
const Parameterised::Map & getACParametersMap() const
get parameters map
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
static const double myCircleWidth
circle width resolution for all stopping places
virtual void updateGeometry()=0
update pre-computed geometry information
bool myFriendlyPosition
Flag for friendly position.
static const double myCircleInText
text inner circle width resolution for all stopping places
void drawLines(const GUIVisualizationSettings::Detail d, const std::vector< std::string > &lines, const RGBColor &color) const
draw lines
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
static const double myCircleInWidth
inner circle width resolution for all stopping places
GNEStoppingPlace(const std::string &id, GNENet *net, GUIGlObjectType type, SumoXMLTag tag, FXIcon *icon, GNELane *lane, const double startPos, const double endPos, const std::string &name, bool friendlyPosition, const Parameterised::Map ¶meters)
Constructor.
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
void calculateStoppingPlaceContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const bool movingGeometryPoints) const
check object in view
double myEndPosition
The position this stopping place is located at (-1 means empty)
Position mySignPos
The position of the sign.
std::string getParentName() const
Returns the name of the parent object (if any)
virtual std::string getAttribute(SumoXMLAttr key) const =0
double myStartPosition
The relative start position this stopping place is located at (-1 means empty)
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
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...
const GUIGlObject * getGUIGlObjectFront() const
get front attribute carrier or a pointer to nullptr
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
bool isMovingElement() const
check if an element is being moved
GNEViewParent * getViewParent() const
get the net object
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
GNEUndoList * getUndoList() const
get the undoList object
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
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 PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
const std::vector< int > & getGeometryPoints(const GUIGlObject *GLObject) const
get geometry points for the given glObject
Stores the information about how to visualize structures.
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
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.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
static const double additionalGeometryPointRadius
moving additional geometry point radius