39 const SUMOTime period,
const std::string& outputFilename,
const std::vector<std::string>& vehicleTypes,
40 const std::vector<std::string>& nextEdges,
const std::string& detectPersons,
const std::string& name,
45 myOutputFilename(outputFilename),
46 myVehicleTypes(vehicleTypes),
47 myNextEdges(nextEdges),
48 myDetectPersons(detectPersons) {
50 if (outputFilename.empty()) {
57 const std::string& outputFilename,
const std::string& name,
62 myOutputFilename(outputFilename) {
64 setParent<GNEAdditional*>(additionalParent);
96 if (segment && segment->getJunction()) {
98 }
else if (segment && segment->getLane()) {
100 if (segment->getLaneIndex() == 0) {
102 }
else if (segment->getLaneIndex() == ((
int)
getParentLanes().size() - 1)) {
138 if (newE2Lanes.size() > 0) {
244 return (canParse<double>(value) && (parse<double>(value) >= 0));
318 myNextEdges = parse<std::vector<std::string> >(value);
345 glScaled(exaggeration, exaggeration, 1);
352 glVertex2d(-1.0, -2);
358 glTranslated(0, 0, .01);
362 glVertex2d(0, 2 - .1);
363 glVertex2d(0, -2 + .1);
371 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
376 glVertex2f(-1.0, -2);
382 glRotated(90, 0, 0, -1);
384 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
393 glTranslated(2, 0, 0);
404 const double exaggeration,
const std::string& logo,
const RGBColor& textColor)
const {
414 glTranslated(pos.
x(), pos.
y(), 0.1);
416 glScaled(exaggeration, exaggeration, 1);
427 const double exaggeration,
const std::string& logo,
const RGBColor& textColor)
const {
439 glTranslated(pos.
x(), pos.
y(), 0.1);
441 glScaled(exaggeration, exaggeration, 1);
@ NETWORK_MOVE
mode for moving network elements
GUIViewObjectsHandler gViewObjectsHandler
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
#define SUMOTime_MAX_PERIOD
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_MULTI_LANE_AREA_DETECTOR
an e2 detector over multiple lanes (placed here due create Additional Frame)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_SHIFTLANEINDEX
shift lane index (only used by elements over lanes)
@ SUMO_ATTR_DETECT_PERSONS
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth, const double extraOffset=0)
Draws a triangle at the end of the given line.
static void popMatrix()
pop matrix
static void pushMatrix()
push matrix
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
void setAdditionalID(const std::string &newID)
set additional ID
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
bool isValidDetectorID(const std::string &value) const
check if a new detector ID is valid
void shiftLaneIndex()
shift lane index
std::string myAdditionalName
name of additional
virtual double getAttributeDouble(SumoXMLAttr key) const =0
const std::string getID() const
get ID (all Attribute Carriers have one)
bool mySelected
boolean to check if this AC is selected (more quickly as checking GUIGlObjectStorage)
virtual GNEMoveElement * getMoveElement() const =0
get GNEMoveElement associated with this AttributeCarrier
PositionVector getCommonAttributePositionVector(SumoXMLAttr key) const
const std::string & getTagStr() const
get tag assigned to this object in string format
GNENet * myNet
pointer to net
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
const GNETagProperties * myTagProperty
reference to tagProperty associated with this attribute carrier
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
SUMOTime myPeriod
The aggregation period the values the detector collects shall be summed up.
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
void drawE2DetectorLogo(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double exaggeration, const std::string &logo, const RGBColor &textColor) const
draw E2 detector Logo
Position getPositionInView() const
Returns position of additional in view.
Position getDetectorAttributePosition(SumoXMLAttr key) const
std::string myOutputFilename
The path to the output file.
bool checkDrawMoveContour() const override
check if draw move contour (red)
~GNEDetector()
Destructor.
bool isDetectorValid(SumoXMLAttr key, const std::string &value)
Parameterised * getParameters() override
methods to retrieve the elements linked to this detector
void setDetectorAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
std::vector< std::string > myNextEdges
next edges
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
void drawE1Shape(const GUIVisualizationSettings::Detail d, const double exaggeration, const RGBColor &mainColor, const RGBColor &secondColor) const
draw E1 shape
double getDetectorAttributeDouble(SumoXMLAttr key) const
GNEDetector(GNENet *net, SumoXMLTag tag)
Default constructor.
void writeDetectorValues(OutputDevice &device) const
write additional element into a xml file
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
std::string getDetectorAttribute(SumoXMLAttr key) const
std::vector< std::string > myVehicleTypes
attribute vehicle types
void drawE1DetectorLogo(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double exaggeration, const std::string &logo, const RGBColor &textColor) const
draw E1 detector Logo
std::string myDetectPersons
detect persons
std::string getParentName() const
Returns the name of the parent object.
const GNEHierarchicalContainerParents< GNELane * > & getParentLanes() const
get parent lanes
std::string getNewListOfParents(const GNENetworkElement *currentElement, const GNENetworkElement *newNextElement) const
if use edge/parent lanes as a list of consecutive elements, obtain a list of IDs of elements after in...
virtual double getMovingAttributeDouble(SumoXMLAttr key) const =0
get moving attribute double
virtual std::string getMovingAttribute(SumoXMLAttr key) const =0
get moving attribute
virtual void setMovingAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
set moving attribute (using undo-list)
virtual bool isMovingAttributeValid(SumoXMLAttr key, const std::string &value) const =0
check if the given moving attribute is valid
virtual Position getMovingAttributePosition(SumoXMLAttr key) const =0
get moving attribute position
A NBNetBuilder extended by visualisation and editing capabilities.
GNEViewNet * getViewNet() const
get view net
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
const GUIGlObject * getGUIGlObjectFront() const
get front GUIGLObject or a pointer to nullptr
bool isCurrentlyMovingElements() const
check if an element is being moved
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
const PositionVector & getShape() const
The shape of the additional element.
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
const GNESegment * getSelectedSegment(const GUIGlObject *GLObject) const
get segment associated with the given GLObject (if exist)
Stores the information about how to visualize structures.
double getTextAngle(double objectAngle) const
return an angle that is suitable for reading text aligned with the given angle (degrees)
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
double y() const
Returns the y-position.
double length2D() const
Returns the length.
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
Position positionAtOffset2D(double pos, double lateralOffset=0, bool extrapolateBeyond=false) const
Returns the position at the given length.
static StringBijection< PersonMode > PersonModeValues
person modes
static bool isValidListOfNetIDs(const std::string &value)
whether the given string is a valid list of id for a network (empty aren't allowed)
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (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)
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
const std::string & getString(const T key) const
get string
bool hasString(const std::string &str) const
check if the given string exist
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element