63 bool cont,
const double timeThreshold,
double speedThreshold,
double jamThreshold) :
67 myTimeThreshold(timeThreshold),
68 mySpeedThreshold(speedThreshold),
69 myJamThreshold(jamThreshold) {
95 int numberOfSegments = (int)
myShape.size() - 1;
98 if (numberOfSegments >= 0) {
105 for (
int i = 0; i < numberOfSegments; ++i) {
117 myShapeRotations.push_back((
double) atan2((s.
x() - f.
x()), (f.
y() - s.
y())) * (double) 180.0 / (
double)
PI);
196 if (s.
scale * exaggeration >= 10) {
287 return (canParse<double>(value) && parse<double>(value) >= 0);
289 return (canParse<double>(value) && parse<double>(value) >= 0);
293 return canParse<bool>(value);
295 return (canParse<double>(value) && parse<double>(value) >= 0);
297 return (canParse<double>(value) && parse<double>(value) >= 0);
299 return (canParse<double>(value) && parse<double>(value) >= 0);
301 return canParse<bool>(value);
326 myFreq = parse<double>(value);
337 myCont = parse<bool>(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
const std::string & getAdditionalID() const
returns the ID of additional
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
GNELane * myLane
The lane this additional belongs.
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
double getPositionRelativeToParametricLength(double position) const
double x() const
Returns the x-position.
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 bool isValidFilename(const std::string &value)
true if value is a valid file value
std::vector< double > myShapeRotations
Position getLineCenter() const
get line center
~GNEDetectorE2()
Destructor.
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.
RGBColor myBaseColorSelected
base color selected (Default blue)
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
GUIVisualizationSizeSettings addSize
Position getPositionInView() const
Returns position of detector E2 in view.
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.
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.
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
void setBlockIconRotation(GNELane *lane=NULL)
set Rotation of block Icon
Position myDetectorLogoOffset
The position of detector.
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
void setAdditionalID(const std::string &id)
set the ID of additional
const std::string getID() const
function to support debugging
double myLength
attribute length
PositionVector getSubpart(double beginOffset, double endOffset) const
get subpart of a position vector
void changeLane(const std::string &laneID)
change lane of additional
Position myBlockIconOffset
The offSet of the block icon.
std::string myFilename
The path to the output file.
std::string getAttribute(SumoXMLAttr key) const
std::string getAttribute(SumoXMLAttr key) const
void drawDetectorIcon(const int GNELogoID, double sizex=0.5, double sizey=0.5) const
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
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) ...
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
RGBColor myBaseColor
base color (Default green)
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
double myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
Static storage of an output device and its base (abstract) implementation.
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Position myPosition
The position in which this additional element is located.
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)
Constructor.
double myJamThreshold
The minimum distance to the next standing vehicle in order to make this vehicle count as a participan...
bool isAdditionalSelected() const
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Position myBlockIconPosition
position of the block icon
SumoXMLTag getTag() const
get XML Tag assigned to this object