41 GNEBusStop::GNEBusStop(
const std::string&
id,
GNELane* lane,
GNEViewNet* viewNet,
const std::string& startPos,
const std::string& endPos,
const std::string& name,
const std::vector<std::string>& lines,
int personCapacity,
bool friendlyPosition,
bool blockMovement) :
42 GNEStoppingPlace(id, viewNet,
GLO_BUS_STOP,
SUMO_TAG_BUS_STOP, lane, startPos, endPos, name, friendlyPosition, blockMovement),
44 myPersonCapacity(personCapacity) {
116 glScaled(exaggeration, exaggeration, 1);
134 for (
int i = 0; i < (int)
myLines.size(); ++i) {
153 glScaled(exaggeration, exaggeration, 1);
163 glTranslated(0, 0, .1);
200 if (!i->getTagProperty().isPlacedInRTree()) {
285 }
else if (canParse<double>(value)) {
293 }
else if (canParse<double>(value)) {
301 return canParse<bool>(value);
303 return canParse<std::vector<std::string> >(value);
305 return canParse<int>(value) && (parse<int>(value) > 0 || parse<int>(value) == -1);
307 return canParse<bool>(value);
309 return canParse<bool>(value);
343 myLines = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
352 if (parse<bool>(value)) {
double scale
information about a lane's width (temporary, used for a single view)
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name) ...
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
int myPersonCapacity
maximum number of persons that can wait at this stop
GUIVisualizationTextSettings addName
std::vector< double > shapeRotations
The rotations of the single shape parts.
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
const std::string & getAdditionalID() const
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Stores the information about how to visualize structures.
static const double myCircleWidthSquared
squared circle width resolution for all stopping places
double y() const
Returns the y-position.
static const double myCircleInWidth
inner circle width resolution for all stopping places
static const double stoppingPlaceText
details for stopping place texts
Position getPositionInView() const
Returns position of additional in view.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
static bool checkStoppinPlacePosition(const std::string &startPosStr, const std::string &endPosStr, const double laneLength, const bool friendlyPos)
check if the position of an stoppingPlace over a lane is valid (without modifications) ...
double x() const
Returns the x-position.
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, int align=0, double width=-1)
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position ...
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Position position
position of the block icon
BlockIcon myBlockIcon
variable BlockIcon
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
bool myFriendlyPosition
Flag for friendly position.
std::string myStartPosition
The relative start position this stopping place is located at (optional, if empty takes 0) ...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
static const double myCircleInText
text inner circle width resolution for all stopping places
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const RGBColor * mySpecialColor
pointer to special color (used for drawing Additional with a certain color, mainly used for selection...
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
void changeAdditionalID(const std::string &newID)
change ID of additional
A class that stores a 2D geometrical boundary.
GNEBusStop(const std::string &id, GNELane *lane, GNEViewNet *viewNet, const std::string &startPos, const std::string &endPos, const std::string &name, const std::vector< std::string > &lines, int personCapacity, bool friendlyPosition, bool blockMovement)
Constructor.
Position getLineCenter() const
get line center
static OptionsCont & getOptions()
Retrieves the options.
double rotation
The rotation of the block icon.
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions ...
GUIVisualizationSizeSettings addSize
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
A point in 2D or 3D with translation and scaling methods.
PositionVector shape
The shape of the additional element.
RGBColor selectionColor
basic selection color
double scaledSize(double scale, double constFactor=0.1) const
get scale size
std::string myAdditionalName
name of additional
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
friend class GNEChange_Attribute
declare friend class
void selectAttributeCarrier(bool changeFlag=true)
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
const std::vector< GNELane * > & getLaneParents() const
get lanes of VSS
block movement of a graphic element
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
Boundary & grow(double by)
extends the boundary by the given amount
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
static void drawShapeDottedContourAroundShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
static const double myCircleWidth
circle width resolution for all stopping places
std::vector< double > shapeLengths
The lengths of the single shape parts.
std::vector< std::string > myLines
The list of lines that are assigned to this stop.
GUIVisualizationDetailSettings detailSettings
detail settings
void changeLaneParents(GNEShape *elementChild, const std::string &newLaneIDs)
change edge parents of a shape
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
std::string getAttribute(SumoXMLAttr key) const
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
GUIVisualizationTextSettings addFullName
AdditionalGeometry myGeometry
geometry to be precomputed in updateGeometry(...)
const std::string & getTagStr() const
get tag assigned to this object in string format
void updateGeometry()
update pre-computed geometry information
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
std::string getGenericParametersStr() const
return generic parameters in string format
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions) ...
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
static const double stoppingPlaceDetails
details for stopping places
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
GUIVisualizationColorSettings colorSettings
color settings
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
std::string myEndPosition
The position this stopping place is located at (optional, if empty takes the lane lenght) ...
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
Position mySignPos
The position of the sign.
static const RGBColor busStop
color for busStops
void drawIcon(const GUIVisualizationSettings &s, const double exaggeration, const double size=0.5) const
draw lock icon
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
An access point for a train stop.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
static const RGBColor busStop_sign
color for busStops signs
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
void setRotation(GNELane *additionalLane=nullptr)
set Rotation of block Icon (must be called in updateGeometry() function)