70 myTimeThreshold(timeThreshold),
71 mySpeedThreshold(speedThreshold) {
111 (*i)->updateGeometryByParent();
116 (*i)->updateGeometryByParent();
167 device.
openTag((*i)->getTag());
175 device.
openTag((*i)->getTag());
288 glRotated(180, 0, 0, 1);
371 return canParse<double>(value);
373 return canParse<double>(value);
375 return (canParse<double>(value) && parse<double>(value) >= 0);
379 return (canParse<double>(value) && parse<double>(value) >= 0);
381 return (canParse<double>(value) && parse<double>(value) >= 0);
383 return canParse<bool>(value);
414 myFreq = parse<double>(value);
440 std::vector<Position> posConnection;
444 posConnection.push_back((*i)->getPositionInView());
447 posConnection.push_back(
Position((*i)->getPositionInView().x() + A, (*i)->getPositionInView().y()));
449 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() - B));
453 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() + B));
455 posConnection.push_back(
Position((*i)->getPositionInView().x() - A, (*i)->getPositionInView().y()));
463 std::vector<Position> posConnection;
467 posConnection.push_back((*i)->getPositionInView());
470 posConnection.push_back(
Position((*i)->getPositionInView().x() + A, (*i)->getPositionInView().y()));
472 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() - B));
476 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() + B));
478 posConnection.push_back(
Position((*i)->getPositionInView().x() - A, (*i)->getPositionInView().y()));
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
double mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting...
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
const std::string & getParentName() const
Returns the name of the parent object (if any)
void moveAdditionalGeometry(double offsetx, double offsety)
change the position of the E3 geometry
double scale
information about a lane's width (temporary, used for a single view)
void commmitAdditionalGeometryMoved(double oldPosx, double oldPosy, GNEUndoList *undoList)
updated geometry changes in the attributes of additional
GNEDetectorE3(const std::string &id, GNEViewNet *viewNet, Position pos, double freq, const std::string &filename, const double timeThreshold, double speedThreshold)
GNEDetectorE3 Constructor.
GUIVisualizationTextSettings addName
std::string getAttribute(SumoXMLAttr key) const
const std::string & getAdditionalID() const
returns the ID of additional
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
Position getPositionInView() const
Returns position of detector E3 in view.
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
void addExitChild(GNEDetectorExit *exit)
add an Exit child
double myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
double x() const
Returns the x-position.
std::vector< GNEDetectorEntry * > myGNEDetectorEntrys
vector with the GNEDetectorE3EntryExits of the detector
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void set(double x, double y)
set positions x and y
static bool isValidFilename(const std::string &value)
true if value is a valid file value
std::vector< double > myShapeRotations
#define WRITE_WARNING(msg)
int getNumberOfEntryChilds() const
get number of entry childs
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
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)
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void drawParentAndChildrenConnections() const
draw connections between Parent and childrens
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)
void updateGeometry()
update pre-computed geometry information
void refreshAdditional(GNEAdditional *additional)
refreshes boundary information of an additional after a geometry update
PositionVector myShape
The shape of the additional element.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
A point in 2D or 3D with translation and scaling methods.
void setx(double x)
set position x
void setBlockIconRotation(GNELane *lane=NULL)
set Rotation of block Icon
friend class GNEChange_Attribute
declare friend class
std::vector< std::vector< Position > > myConnectionPositions
Matrix with the Vertex's positions of connections between Additional Parent an their childs...
std::vector< GNEDetectorExit * > myGNEDetectorExits
vector with the GNEDetectorE3EntryExits of the detector
void updateGeometryConnections()
update Connection's geometry
block movement of a graphic element
std::string generateEntryID()
gererate a new ID for an Entry detector child
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
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
const std::string getID() const
function to support debugging
void writeAdditional(OutputDevice &device) const
writte additionals element into a xml file
Position myBlockIconOffset
The offSet of the block icon.
double myFreq
frequency of E3 detector
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
An Element which don't belongs to GNENet but has influency in the simulation.
void sety(double y)
set position y
RGBColor myBaseColor
base color (Default green)
~GNEDetectorE3()
GNEDetectorE3 6Destructor.
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
int getNumberOfExitChilds() const
get number of exit childs
void addEntryChild(GNEDetectorEntry *entry)
add an Entry child
void removeEntryChild(GNEDetectorEntry *entry)
delete an Entry child
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.
bool isAdditionalSelected() const
std::string generateExitID()
gererate a new ID for an Exit detector child
void removeExitChild(GNEDetectorExit *exit)
delete an Exit child
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string myFilename
fielname of E3 detector
Position myBlockIconPosition
position of the block icon
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
SumoXMLTag getTag() const
get XML Tag assigned to this object