64 mySplitByType(splitByType) {
93 Position s =
myShape[0] + Position(1, 0);
145 double width = (double) 2.0 * s.
scale;
155 glScaled(exaggeration, exaggeration, 1);
158 glVertex2d(-1.0, -2);
162 glTranslated(0, 0, .01);
164 glVertex2d(0, 2 - .1);
165 glVertex2d(0, -2 + .1);
169 if (width * exaggeration > 1) {
171 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
174 glVertex2f(-1.0, -2);
178 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
182 if (width * exaggeration > 1) {
183 glRotated(90, 0, 0, -1);
195 if (s.
scale * exaggeration >= 10) {
273 return (canParse<double>(value) && parse<double>(value) >= 0);
277 return canParse<bool>(value);
279 return canParse<bool>(value);
304 myFreq = parse<double>(value);
Position getPositionInView() const
Returns position of detector E1 in view.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
bool mySplitByType
attribute to enable or disable splitByType
double scale
information about a lane's width (temporary, used for a single view)
GUIVisualizationTextSettings addName
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.
GNELane * myLane
The lane this additional belongs.
Stores the information about how to visualize structures.
double getPositionRelativeToParametricLength(double position) const
double x() const
Returns the x-position.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
double myFreq
The aggregation period the values the detector collects shall be summed up.
~GNEDetectorE1()
Destructor.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
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
Position getLineCenter() const
get line center
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
GUIVisualizationSizeSettings addSize
double getLaneParametricLength() const
returns the parameteric length of the lane
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 refreshAdditional(GNEAdditional *additional)
refreshes boundary information of an additional after a geometry update
PositionVector myShape
The shape of the additional element.
A point in 2D or 3D with translation and scaling methods.
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
void setBlockIconRotation(GNELane *lane=NULL)
set Rotation of block Icon
Position myDetectorLogoOffset
The position of detector.
friend class GNEChange_Attribute
declare friend class
block movement of a graphic element
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
const std::string getID() const
function to support debugging
void changeLane(const std::string &laneID)
change lane of additional
Position myBlockIconOffset
The offSet of the block icon.
std::string myFilename
The path to the output file.
std::string getAttribute(SumoXMLAttr key) const
void drawDetectorIcon(const int GNELogoID, double sizex=0.5, double sizey=0.5) const
void updateGeometry()
update pre-computed geometry information
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::string getAttribute(SumoXMLAttr key) const
const PositionVector & getShape() const
returns the shape of the lane
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
RGBColor myBaseColor
base color (Default green)
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
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.
GNEDetectorE1(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double pos, double freq, const std::string &filename, bool splitByType)
Constructor.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Position myBlockIconPosition
position of the block icon
SumoXMLTag getTag() const
get XML Tag assigned to this object