57 #ifdef CHECK_MEMORY_LEAKS 70 myTimeThreshold(timeThreshold),
71 mySpeedThreshold(speedThreshold),
72 myJamThreshold(jamThreshold) {
98 int numberOfSegments = (int)
myShape.size() - 1;
101 if (numberOfSegments >= 0) {
108 for (
int i = 0; i < numberOfSegments; ++i) {
193 if (s.
scale * exaggeration >= 10) {
281 return (canParse<SUMOReal>(value) && parse<SUMOReal>(value) >= 0);
283 return (canParse<SUMOReal>(value) && parse<SUMOReal>(value) >= 0);
287 return canParse<bool>(value);
289 return canParse<int>(value);
291 return canParse<SUMOReal>(value);
293 return canParse<SUMOReal>(value);
318 myFreq = parse<SUMOReal>(value);
329 myCont = parse<bool>(value);
SUMOReal getExaggeration(const GUIVisualizationSettings &s, SUMOReal factor=20) const
return the drawing size including exaggeration and constantSize values
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void changeLane(GNELane *newLane)
change lane of detector
GUIVisualizationTextSettings addName
Stores the information about how to visualize structures.
std::string getAttribute(SumoXMLAttr key) const
GNEDetectorE2(const std::string &id, GNELane *lane, GNEViewNet *viewNet, SUMOReal pos, SUMOReal length, SUMOReal freq, const std::string &filename, bool cont, SUMOTime timeThreshold, SUMOReal speedThreshold, SUMOReal jamThreshold, bool blocked)
Constructor.
bool isAdditionalSelected() const
std::string time2string(SUMOTime t)
static void drawBoxLines(const PositionVector &geom, const std::vector< SUMOReal > &rots, const std::vector< SUMOReal > &lengths, SUMOReal width, int cornerDetail=0, SUMOReal offset=0)
Draws thick lines.
bool myCont
attribute to enable or disable splitByType
SUMOReal myLength
attribute lenght
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
SUMOReal distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
void updateGeometry()
update pre-computed geometry information
SUMOReal x() const
Returns the x-position.
GUIGlID getGlID() const
Returns the numerical id of the object.
SUMOReal scale
information about a lane's width (temporary, used for a single view)
~GNEDetectorE2()
Destructor.
SUMOTime myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
RGBColor myBaseColorSelected
base color selected (Default blue)
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
SUMOReal mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting...
GUIVisualizationSizeSettings addSize
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static bool isValidFileValue(const std::string &value)
true if value is a valid file value
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
const std::string & getAdditionalID() const
returns the ID of additional
void drawDetectorIcon(const int GNELogoID, SUMOReal sizex=0.5, SUMOReal sizey=0.5) const
SUMOReal getLaneParametricLenght() const
returns the parameteric length of the lane
SUMOReal getPositionRelativeToParametricLenght(SUMOReal position) const
PositionVector myShape
The shape of the additional element.
A point in 2D or 3D with translation and scaling methods.
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
void setBlockIconRotation(GNELane *lane=NULL)
Position myDetectorLogoOffset
The position of detector.
Position getPositionInView() const
Returns position of detector E2 in view.
friend class GNEChange_Attribute
declare friend class
Position positionAtOffset(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
void drawLockIcon(SUMOReal size=0.5) const
draw lock icon
SUMOReal myJamThreshold
The minimum distance to the next standing vehicle in order to make this vehicle count as a participan...
SUMOTime string2time(const std::string &r)
void setAdditionalID(const std::string &id)
set the ID of additional
const std::string getID() const
function to support debugging
void drawName(const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
draw name of item
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Position myBlockIconOffset
The offSet of the block icon.
std::string myFilename
The path to the output file.
std::string getAttribute(SumoXMLAttr key) const
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
const PositionVector & getShape() const
returns the shape of the lane
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool isValid(SumoXMLAttr key, const std::string &value)
SUMOReal y() const
Returns the y-position.
RGBColor myBaseColor
base color (Default green)
GNELane * myLane
The lane this detector belongs.
std::vector< SUMOReal > myShapeRotations
GNENet * getNet() const
get the net object
Position getLineCenter() const
get line center
SumoXMLTag getTag() const
get Tag assigned to this object
Static storage of an output device and its base (abstract) implementation.
Position myPosition
The position in which this additional element is located.
bool closeTag()
Closes the most recently opened tag.
static GUIGlID getGif(GUITexture which)
returns a texture Gif previously defined in the enum GUITexture
Information whether the detector shall be continued on the folowing lanes.
PositionVector getSubpart(SUMOReal beginOffset, SUMOReal endOffset) const
get subpart of a position vector
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
int myFreq
The aggregation period the values the detector collects shall be summed up.
Position myBlockIconPosition
position of the block icon
void writeAdditional(OutputDevice &device, const std::string &)
writte additional element into a xml file