58 GNEDetectorE3::GNEDetectorE3(
const std::string&
id,
GNEViewNet* viewNet,
Position pos,
double freq,
const std::string& filename,
const std::string& vehicleTypes,
const std::string& name,
const double timeThreshold,
double speedThreshold,
bool blockMovement) :
63 myVehicleTypes(vehicleTypes),
64 myTimeThreshold(timeThreshold),
65 mySpeedThreshold(speedThreshold) {
149 glRotated(180, 0, 0, 1);
252 return canParse<Position>(value);
254 return canParse<double>(value) && (parse<double>(value) >= 0);
266 return canParse<double>(value) && (parse<double>(value) >= 0);
268 return canParse<double>(value) && (parse<double>(value) >= 0);
270 return canParse<bool>(value);
272 return canParse<bool>(value);
294 if (numEntrys == 0) {
301 return ((numEntrys != 0) && (numExits != 0));
330 myFreq = parse<double>(value);
351 if (parse<bool>(value)) {
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...
const GNEAttributeCarrier * getACUnderCursor() const
get AttributeCarrier under cursor
double scale
information about a lane's width (temporary, used for a single view)
void setBlockIconRotation(GNELane *additionalLane=nullptr)
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name) ...
static bool isValidListOfTypeID(const std::string &value)
whether the given string is a valid list of ids for an edge or vehicle type (empty aren't allowed) ...
GUIVisualizationTextSettings addName
std::string getAttribute(SumoXMLAttr key) const
Position myPosition
position of E3 in view
void add(const Position &pos)
Adds the given position to this one.
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
const std::string & getAdditionalID() const
returns Additional ID
std::string myVehicleTypes
attribute vehicle types
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
Position getPositionInView() const
Returns position of additional in view.
Stores the information about how to visualize structures.
double myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
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.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
bool checkAdditionalChildRestriction() const
check restriction with the number of childs
void changeAdditionalID(const std::string &newID)
change ID of additional
std::vector< PositionVector > myChildConnectionPositions
Matrix with the Vertex's positions of connections between parents an their childs.
#define WRITE_WARNING(msg)
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.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
static const RGBColor GREY
void drawChildConnections() 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)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
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.
GNEDetectorE3(const std::string &id, GNEViewNet *viewNet, Position pos, double freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, const double timeThreshold, double speedThreshold, bool blockMovement)
GNEDetectorE3 Constructor.
std::string myAdditionalName
name of additional
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
friend class GNEChange_Attribute
declare friend class
void selectAttributeCarrier(bool changeFlag=true)
block movement of a graphic element
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
void updateChildConnections()
update Connection's geometry
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
Position myBlockIconOffset
The offSet of the block icon.
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
std::vector< GNEAdditional * > myAdditionalChilds
vector with the Additional childs
std::string getParentName() const
Returns the name of the parent object (if any)
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void updateGeometry(bool updateGrid)
update pre-computed geometry information
double myFreq
frequency of E3 detector
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
static void drawShapeDottedContour(const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
An Element which don't belongs to GNENet but has influency in the simulation.
std::string getGenericParametersStr() const
return generic parameters in string format
~GNEDetectorE3()
GNEDetectorE3 Destructor.
GNENet * getNet() const
get the net object
std::string generateAdditionalChildID(SumoXMLTag childTag)
gererate a new ID for an additional child
GUIGlID getGlID() const
Returns the numerical id of the object.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name) ...
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