46 GNELane* lane,
double startPos,
double endPos,
int parametersSet,
const std::string& name,
47 bool friendlyPosition,
bool blockMovement) :
49 {}, {}, {lane}, {}, {}, {}, {}, {}),
50 myStartPosition(startPos),
51 myEndPosition(endPos),
52 myParametersSet(parametersSet),
53 myFriendlyPosition(friendlyPosition) {
83 double laneLength =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() *
getParentLanes().front()->getLengthGeometryFactor();
89 startPos += laneLength;
98 return (endPos <=
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
100 return (startPos >= 0);
102 return ((startPos >= 0) && (endPos <=
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) && ((endPos - startPos) >= POSITION_EPS));
114 double laneLength =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
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)) {
139 return errorStart + separator + errorEnd;
204 }
else if ((splitPosition >
myStartPosition) && (splitPosition < middlePosition)) {
210 }
else if ((splitPosition > middlePosition) && (splitPosition <
myEndPosition)) {
325 laneShape.
move2side(movingToSide * offsetSign);
336 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
340 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
351 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
355 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
357 return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
410 for (
int i = 0; i < (int)lines.size(); ++i) {
432 const RGBColor& baseColor,
const RGBColor& signColor,
const std::string& word)
const {
447 glScaled(exaggeration, exaggeration, 1);
463 glScaled(exaggeration, exaggeration, 1);
471 glTranslated(0, 0, .1);
const int STOPPINGPLACE_STARTPOS_SET
const int STOPPINGPLACE_ENDPOS_SET
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_PARKING_SPACE
A parking space for a single vehicle within a parking area.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
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.
Boundary & grow(double by)
extends the boundary by the given amount
void growWidth(double by)
Increases the width of the boundary (x-axis)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
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)
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.
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
const GNETagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
PositionVector shapeToUpdate
shape to update (edited in moveElement)
A NBNetBuilder extended by visualisation and editing capabilities.
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
GNEViewNet * getViewNet() const
get view net
const std::string & getID() const
get ID
void fixAdditionalProblem()
fix additional problem
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
GNEStoppingPlace(const std::string &id, GNENet *net, GUIGlObjectType type, SumoXMLTag tag, GNELane *lane, double startPos, double endPos, int parametersSet, const std::string &name, bool friendlyPosition, bool blockMovement)
Constructor.
double getAttributeDouble(SumoXMLAttr key) const
double getEndPosition() const
get end Position
GNEMoveOperation * getMoveOperation(const double shapeOffset)
get move operation for the given shapeOffset
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
static const double myCircleWidthSquared
squared circle width resolution for all stopping places
~GNEStoppingPlace()
Destructor.
double getStartPosition() const
get start Position
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
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
std::string getAdditionalProblem() const
return a string with the current additional problem
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
bool isAdditionalValid() const
check if current additional is valid to be writed into XML (by default true, can be reimplemented in ...
void drawLines(const GUIVisualizationSettings &s, const std::vector< std::string > &lines, const RGBColor &color) const
draw lines
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
bool isAttributeEnabled(SumoXMLAttr key) const
double myEndPosition
The position this stopping place is located at (optional, if empty takes the lane length)
void drawSign(const GUIVisualizationSettings &s, const double exaggeration, const RGBColor &baseColor, const RGBColor &signColor, const std::string &word) const
draw sign
int myParametersSet
Variable used for set/unset start/endPositions.
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 (optional, if empty takes 0)
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
bool isPlacedInRTree() const
return true if Tag correspond to an element that has has to be placed in RTREE
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
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,...
GNEUndoList * getUndoList() const
get the undoList object
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
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
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.
A point in 2D or 3D with translation and scaling methods.
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
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.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
static StopPos checkStopPos(double &startPos, double &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check start and end position of a stop
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)