45 GNEAdditional(id, viewNet,
GLO_TAZ,
SUMO_TAG_TAZ,
"", blockMovement, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
85 return Boundary(-0.1, -0.1, 0.1, 0.1);
176 if (shapeToCommit.size() > 1 && shapeToCommit.front().distanceTo2D(shapeToCommit.back()) < (2 *
myHintSize)) {
177 shapeToCommit.pop_back();
178 shapeToCommit.push_back(shapeToCommit.front());
201 if (createIfNoExist) {
216 if ((index == 0 || index == (
int)modifiedShape.size() - 1)) {
217 modifiedShape.erase(modifiedShape.begin());
218 modifiedShape.erase(modifiedShape.end() - 1);
219 modifiedShape.push_back(modifiedShape.front());
221 modifiedShape.erase(modifiedShape.begin() + index);
270 glTranslated(0, 0, 128);
285 bool mouseOverVertex =
false;
290 RGBColor invertedColor, darkerColor;
313 if (modeMove && (i.distanceTo(mousePosition) <
myHintSize)) {
314 mouseOverVertex =
true;
355 std::vector<std::string> edgeIDs;
415 return canParse<PositionVector>(value);
417 return canParse<RGBColor>(value);
425 return canParse<bool>(value);
427 return canParse<bool>(value);
429 return canParse<bool>(value);
460 int numberOfSources = 0;
461 int numberOfSinks = 0;
515 myColor = parse<RGBColor>(value);
526 if (parse<bool>(value)) {
Position getPositionInView() const
Returns position of additional in view.
GNETAZFrame * getTAZFrame() const
get frame for GNE_NMODE_TAZ
average sink (used only by TAZs)
~GNETAZ()
GNETAZ Destructor.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
GNETAZ * getTAZ() const
get current TAZ
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
double scale
information about a lane's width (temporary, used for a single view)
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
a source within a district (connection road)
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
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) ...
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
double distance2D(const Position &p, bool perpendicular=false) const
closest 2D-distance to point p (or -1 if perpendicular is true and the point is beyond this vector) ...
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
const std::string & getAdditionalID() const
block shape of a graphic element (Used mainly in GNEShapes)
int indexOfClosest(const Position &p) const
index of the closest position to p
double myMaxWeightSource
Max source weight.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
a traffic assignment zone
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
Stores the information about how to visualize structures.
void commitShapeChange(const PositionVector &oldShape, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of changeShapeGeometry(...)
GNEViewParent * getViewParent() const
get the net object
double y() const
Returns the y-position.
PositionVector getShape() const
Returns additional element's shape.
double x() const
Returns the x-position.
void updateGeometry()
update pre-computed geometry information
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
double myMinWeightSource
Min source weight.
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
double getWidth() const
Returns the width of the boudary (x-axis)
TAZCurrent * getTAZCurrentModul() const
get Current TAZ modul
Position originalViewPosition
value for saving first original position over lane before moving
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...
bool myBlockShape
flag for block shape
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
max source (used only by TAZs)
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
min sink (used only by TAZs)
RGBColor invertedColor() const
obtain inverted of current RGBColor
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
void changeAdditionalID(const std::string &newID)
change ID of additional
A class that stores a 2D geometrical boundary.
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
#define WRITE_WARNING(msg)
mode for moving network elements
static const double myHintSizeSquared
squaredhint size of vertex
GUIVisualizationSizeSettings polySize
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
static const double myHintSize
hint size of vertex
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
AdditionalMove myMove
variable AdditionalMove
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions ...
std::string getParentName() const
Returns the name of the parent object (if any)
double myMaxWeightSink
Max Sink weight.
GNEUndoList * getUndoList() const
get the undoList object
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void removeDoublePoints(double minDist=POSITION_EPS, bool assertLength=false)
Removes positions if too near.
min source (used only by TAZs)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
max sink (used only by TAZs)
double minSize
The minimum size to draw this object.
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.
PositionVector shape
The shape of the additional element.
RGBColor selectionColor
basic selection color
Supermode currentSupermode
the current supermode
double myMinWeightSink
Min Sink weight.
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
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
friend class GNEChange_Attribute
declare friend class
void selectAttributeCarrier(bool changeFlag=true)
std::string getAttribute(SumoXMLAttr key) const
block movement of a graphic element
static void drawShapeDottedContourAroundClosedShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape)
draw a dotted contour around the given closed shape with certain width
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
int myCurrentMovingVertexIndex
index of vertex that is been moved (-1 means that none vertex is been moved)
edge: the shape in xml-definition
Boundary & grow(double by)
extends the boundary by the given amount
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
int insertAtClosest(const Position &p)
inserts p between the two closest positions and returns the insertion index
double angle
The current view rotation angle.
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
void updateAdditionalParent()
update TAZ after add or remove a Source/sink, or change their weight
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
a sink within a district (connection road)
double getHeight() const
Returns the height of the boundary (y-axis)
An Element which don't belongs to GNENet but has influency in the simulation.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
AdditionalGeometry myGeometry
geometry to be precomputed in updateGeometry(...)
RGBColor myColor
TAZ Color.
const std::string & getTagStr() const
get tag assigned to this object in string format
Demanding mode (Routes, Vehicles etc..)
Boundary movingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE
bool isInitialised() const
check if Boundary is Initialised
std::string getGenericParametersStr() const
return generic parameters in string format
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions) ...
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
average source (used only by TAZs)
NetworkEditMode networkEditMode
the current Network edit mode
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
GUIVisualizationColorSettings colorSettings
color settings
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
GNETAZ(const std::string &id, GNEViewNet *viewNet, PositionVector shape, RGBColor color, bool blockMovement)
GNETAZ Constructor.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
double myAverageWeightSource
Average source weight.
bool isShapeBlocked() const
return true if Shape TAZ is blocked
void add(double xoff, double yoff, double zoff)
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
double myAverageWeightSink
Average Sink weight.
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool drawBoundaries
enable or disable draw boundaries
static RGBColor getColor()
gets the gl-color
GUIVisualizationTextSettings polyName