62 GNEBusStop::GNEBusStop(
const std::string&
id,
GNELane* lane,
GNEViewNet* viewNet,
double startPos,
double endPos,
const std::string& name,
const std::vector<std::string>& lines,
bool friendlyPosition) :
107 if (
myName.empty() ==
false) {
119 const std::vector<std::string>&
150 if (s.
scale * exaggeration >= 10) {
156 for (
int i = 0; i < (int)
myLines.size(); ++i) {
182 if (s.
scale * exaggeration > 25) {
183 noPoints =
MIN2((
int)(9.0 + (s.
scale * exaggeration) / 10.0), 36);
187 glScaled(exaggeration, exaggeration, 1);
200 glTranslated(0, 0, .1);
213 if (s.
scale * exaggeration >= 4.5) {
301 if (canParse<double>(value)) {
308 if (canParse<double>(value)) {
317 return canParse<bool>(value);
319 return canParse<std::vector<std::string> >(value);
321 return canParse<bool>(value);
353 myLines = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
double scale
information about a lane's width (temporary, used for a single view)
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.
GUIVisualizationTextSettings addName
void refreshElement(GUIGlObject *o)
refreshes boundary information for o and update
const std::string & getAdditionalID() const
returns Additional ID
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
double getAbsoluteEndPosition() const
get absolute end Position
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)
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
bool myFriendlyPosition
Flag for friendly position.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
std::vector< double > myShapeRotations
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
void changeAdditionalID(const std::string &newID)
change ID of additional
Position getLineCenter() const
get line center
static OptionsCont & getOptions()
Retrieves the options.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
GUIVisualizationSizeSettings addSize
static const RGBColor selectedAdditionalColor
color of selected additionals
double getLaneParametricLength() const
returns the parameteric length of the lane
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void drawLockIcon(double size=0.5) const
draw lock icon
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
PositionVector myShape
The shape of the additional element.
A point in 2D or 3D with translation and scaling methods.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
GNELane * myLane
The lane in which this lane is placed.
friend class GNEChange_Attribute
declare friend class
block movement of a graphic element
std::vector< double > myShapeLengths
The lengths of the shape parts.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
const std::string getID() const
function to support debugging
void move2side(double amount)
move position vector to side using certain ammount
std::string myName
name of stoppingPlace
std::vector< std::string > myLines
The list of lines that are assigned to this stop.
const std::vector< std::string > & getLines() const
get string vector with the lines of the busStop
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
GUIVisualizationTextSettings addFullName
double myEndPosRelative
The relative [0,1] end position this stopping place is located at.
void updateGeometry()
update pre-computed geometry information
double myStartPosRelative
The relative [0,1] start position this stopping place is located at.
void setBlockIconRotation(GNELane *additionalLane=NULL)
GNEBusStop(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double startPos, double endPos, const std::string &name, const std::vector< std::string > &lines, bool friendlyPosition)
Constructor.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
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.
void setStoppingPlaceGeometry()
set geometry common to all stopping places
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
bool isAdditionalSelected() const
static const RGBColor selectionColor
Position mySignPos
The position of the sign.
double getAbsoluteStartPosition() const
get absolute start Position
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
double myBlockIconRotation
The rotation of the block icon.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
GNELane * changeLane(GNELane *oldLane, const std::string &newLaneID)
change lane of additional
Position myBlockIconPosition
position of the block icon
SumoXMLTag getTag() const
get XML Tag assigned to this object