61 #ifdef CHECK_MEMORY_LEAKS 73 myTimeThreshold(timeThreshold),
74 mySpeedThreshold(speedThreshold) {
114 (*i)->updateGeometryByParent();
119 (*i)->updateGeometryByParent();
170 device.
openTag((*i)->getTag());
178 device.
openTag((*i)->getTag());
291 glRotated(180, 0, 0, 1);
374 return canParse<SUMOReal>(value);
376 return canParse<SUMOReal>(value);
378 return (canParse<SUMOReal>(value) && parse<SUMOReal>(value) > 0);
382 return canParse<SUMOReal>(value);
384 return canParse<SUMOReal>(value);
386 return canParse<bool>(value);
417 myFreq = parse<SUMOReal>(value);
443 std::vector<Position> posConnection;
447 posConnection.push_back((*i)->getPositionInView());
450 posConnection.push_back(
Position((*i)->getPositionInView().x() + A, (*i)->getPositionInView().y()));
452 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() - B));
456 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() + B));
458 posConnection.push_back(
Position((*i)->getPositionInView().x() - A, (*i)->getPositionInView().y()));
466 std::vector<Position> posConnection;
470 posConnection.push_back((*i)->getPositionInView());
473 posConnection.push_back(
Position((*i)->getPositionInView().x() + A, (*i)->getPositionInView().y()));
475 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() - B));
479 posConnection.push_back(
Position((*i)->getPositionInView().x(), (*i)->getPositionInView().y() + B));
481 posConnection.push_back(
Position((*i)->getPositionInView().x() - A, (*i)->getPositionInView().y()));
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
GUIVisualizationTextSettings addName
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
Stores the information about how to visualize structures.
void addExitChild(GNEDetectorExit *exit)
add an Exit child
void sety(SUMOReal y)
set position y
bool isAdditionalSelected() const
Position getPositionInView() const
Returns position of detector E3 in view.
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.
void writeAdditional(OutputDevice &device) const
writte additionals element into a xml file
SUMOReal myFreq
frequency of E3 detector
SUMOReal x() const
Returns the x-position.
GUIGlID getGlID() const
Returns the numerical id of the object.
#define WRITE_WARNING(msg)
SUMOReal scale
information about a lane's width (temporary, used for a single view)
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.
RGBColor myBaseColorSelected
base color selected (Default blue)
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
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::string toString(const T &t, std::streamsize accuracy=gPrecision)
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
SUMOReal myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
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 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
void drawLockIcon(SUMOReal size=0.5) const
draw lock icon
std::string generateEntryID()
gererate a new ID for an Entry detector child
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
void commmitAdditionalGeometryMoved(SUMOReal oldPosx, SUMOReal oldPosy, GNEUndoList *undoList)
updated geometry changes in the attributes of additional
Position myBlockIconOffset
The offSet of the block icon.
void moveAdditionalGeometry(SUMOReal offsetx, SUMOReal offsety)
change the position of the E3 geometry
void drawParentAndChildrenConnections() const
draw connections between Parent and childrens
void setx(SUMOReal x)
set position x
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
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.
SUMOReal mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting...
SUMOReal y() const
Returns the y-position.
RGBColor myBaseColor
base color (Default green)
void set(SUMOReal x, SUMOReal y)
set positions x and y
std::vector< SUMOReal > myShapeRotations
std::string getAttribute(SumoXMLAttr key) const
GNENet * getNet() const
get the net object
~GNEDetectorE3()
GNEDetectorE3 6Destructor.
GNEDetectorE3(const std::string &id, GNEViewNet *viewNet, Position pos, SUMOReal freq, const std::string &filename, const SUMOReal timeThreshold, SUMOReal speedThreshold)
GNEDetectorE3 Constructor.
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.
Position myPosition
The position in which this additional element is located.
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
static void drawTexturedBox(int which, SUMOReal size)
Draws a named texture as a box with the given size.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string myFilename
fielname of E3 detector
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 ...