64 bool cont,
const double timeThreshold,
double speedThreshold,
double jamThreshold,
bool friendlyPos) :
66 myRelativeLength(length / lane->getLaneParametricLength()),
68 myTimeThreshold(timeThreshold),
69 mySpeedThreshold(speedThreshold),
70 myJamThreshold(jamThreshold) {
95 int numberOfSegments = (int)
myShape.size() - 1;
98 if (numberOfSegments >= 0) {
105 for (
int i = 0; i < numberOfSegments; ++i) {
214 if (s.
scale * exaggeration >= 10) {
222 glTranslated(-0.75, 0, 0);
320 return canParse<double>(value);
322 return (canParse<double>(value) && (parse<double>(value) >= 0));
324 if (canParse<double>(value)) {
326 double newLength = parse<double>(value);
328 if (newLength <= 0) {
342 return canParse<bool>(value);
344 return (canParse<double>(value) && (parse<double>(value) >= 0));
346 return (canParse<double>(value) && (parse<double>(value) >= 0));
348 return (canParse<double>(value) && (parse<double>(value) >= 0));
350 return canParse<bool>(value);
352 return canParse<bool>(value);
377 myFreq = parse<double>(value);
388 myCont = parse<bool>(value);
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 drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
void setBlockIconRotation()
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
double x() const
Returns the x-position.
GNELane * myLane
The lane this additional belongs.
Stores the information about how to visualize structures.
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
bool isAdditionalSelected() const
double myRelativeLength
relative length [0,1]
double myFreq
The aggregation period the values the detector collects shall be summed up.
bool myCont
attribute to enable or disable splitByType
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)
method for setting the attribute and letting the object perform additional changes ...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void updateGeometry()
update pre-computed geometry information
static const RGBColor BLACK
static bool isValidFilename(const std::string &value)
true if value is a valid file value
std::vector< double > myShapeRotations
GUIGlID getGlID() const
Returns the numerical id of the object.
void undo()
undo the last command group
static OptionsCont & getOptions()
Retrieves the options.
GNEUndoList * getUndoList() const
get the undoList object
~GNEDetectorE2()
Destructor.
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
double mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting...
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
static bool isValidID(const std::string &value)
true if value is a valid sumo ID
GUIVisualizationSizeSettings addSize
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static const RGBColor selectedAdditionalColor
color of selected additionals
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
GNEEdge & getParentEdge()
Returns underlying parent edge.
const std::string & getAdditionalID() const
returns the ID of additional
void refreshAdditional(GNEAdditional *additional)
refreshes boundary information of an additional after a geometry update
PositionVector myShape
The shape of the additional element.
A point in 2D or 3D with translation and scaling methods.
bool isDetectorPositionFixed() const
check if Position of detector is fixed
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
friend class GNEChange_Attribute
declare friend class
double y() const
Returns the y-position.
block movement of a graphic element
double length() const
Returns the length.
std::vector< double > myShapeLengths
The lengths of the shape parts.
double getAbsolutePositionOverLane() const
get absolute position over Lane
void setAdditionalID(const std::string &id)
set the ID of additional
const std::string getID() const
function to support debugging
void drawLockIcon(double size=0.5) const
draw lock icon
bool myFriendlyPosition
Flag for friendly position.
void changeLane(const std::string &laneID)
change lane of additional
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Position myBlockIconOffset
The offSet of the block icon.
std::string myFilename
The path to the output file.
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
const PositionVector & getShape() const
returns the shape of the lane
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
GNENet * getNet() const
get the net object
Position getLineCenter() const
get line center
double myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
SumoXMLTag getTag() const
get XML Tag assigned to this object
void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const
writte additional element into a xml file
PositionVector getSubpart(double beginOffset, double endOffset) const
get subpart of a position vector
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
GNEDetectorE2(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double pos, double length, double freq, const std::string &filename, bool cont, const double timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos)
Constructor.
double myJamThreshold
The minimum distance to the next standing vehicle in order to make this vehicle count as a participan...
static const RGBColor selectionColor
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)
draw Text with given parameters
double getLaneParametricLength() const
returns the parameteric length of the lane
double getAbsoluteLenght() const
get absolute lenght
double myBlockIconRotation
The rotation of the block icon.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void duplicateLane(GNELane *lane, GNEUndoList *undoList)
duplicates lane
double myPositionOverLane
position of detector over Lane
Position myBlockIconPosition
position of the block icon