72 myTimeThreshold(timeThreshold),
73 mySpeedThreshold(speedThreshold) {
109 (*i)->updateGeometryByParent();
114 (*i)->updateGeometryByParent();
165 device.
openTag((*i)->getTag());
184 device.
openTag((*i)->getTag());
308 glRotated(180, 0, 0, 1);
391 return canParse<double>(value);
393 return canParse<double>(value);
395 return canParse<double>(value) && (parse<double>(value) >= 0);
399 return canParse<double>(value) && (parse<double>(value) >= 0);
401 return canParse<double>(value) && (parse<double>(value) >= 0);
403 return canParse<bool>(value);
434 myFreq = parse<double>(value);
460 std::vector<Position> posConnection;
464 posConnection.push_back((*i)->getPositionInView());
467 posConnection.push_back(
Position((*i)->getPositionInView().x() + A, (*i)->getPositionInView().y()));
469 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() - B));
473 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() + B));
475 posConnection.push_back(
Position((*i)->getPositionInView().x() - A, (*i)->getPositionInView().y()));
483 std::vector<Position> posConnection;
487 posConnection.push_back((*i)->getPositionInView());
490 posConnection.push_back(
Position((*i)->getPositionInView().x() + A, (*i)->getPositionInView().y()));
492 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() - B));
496 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() + B));
498 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...
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)
GNEDetectorE3(const std::string &id, GNEViewNet *viewNet, Position pos, double freq, const std::string &filename, const double timeThreshold, double speedThreshold)
GNEDetectorE3 Constructor.
GUIVisualizationTextSettings addName
Position myPosition
position of E3 in view
const std::string & getParentName() const
Returns the name of the parent object (if any)
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
double x() const
Returns the x-position.
Stores the information about how to visualize structures.
void addExitChild(GNEDetectorExit *exit)
add an Exit child
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
bool isAdditionalSelected() const
double myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
Position getPositionInView() const
Returns position of additional in view.
void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const
writte additional element into a xml file
std::vector< GNEDetectorEntry * > myGNEDetectorEntrys
vector with the GNEDetectorE3EntryExits of the detector
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.
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.
#define WRITE_WARNING(msg)
void undo()
undo the last command group
static OptionsCont & getOptions()
Retrieves the options.
GNEUndoList * getUndoList() const
get the undoList object
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
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
void moveGeometry(const Position &newPosition)
change the position of the element geometry without saving in undoList
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const std::string & getAdditionalID() const
returns the ID of additional
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
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
double y() const
Returns the y-position.
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 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
Position myBlockIconOffset
The offSet of the block icon.
void drawParentAndChildrenConnections() const
draw connections between Parent and childrens
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
double myFreq
frequency of E3 detector
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
An Element which don't belongs to GNENet but has influency in the simulation.
void sety(double y)
set position y
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
GNENet * getNet() const
get the net object
~GNEDetectorE3()
GNEDetectorE3 6Destructor.
SumoXMLTag getTag() const
get XML Tag assigned to this object
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.
bool closeTag()
Closes the most recently opened tag.
std::string generateExitID()
gererate a new ID for an Exit detector child
int getNumberOfEntryChilds() const
get number of entry childs
int getNumberOfExitChilds() const
get number of exit childs
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
void duplicateLane(GNELane *lane, GNEUndoList *undoList)
duplicates lane
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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 ...