 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
44 GNEAdditional(id, viewNet,
GLO_TAZ,
SUMO_TAG_TAZ,
"", blockMovement, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
48 myCurrentMovingVertexIndex(-1),
51 myAverageWeightSource(0),
54 myAverageWeightSink(0) {
89 return Boundary(-0.1, -0.1, 0.1, 0.1);
128 if ((index == 0 || index == (
int)
myTAZShape.size() - 1)) {
179 if (shapeToCommit.size() !=
myTAZShape.size()) {
183 if (shapeToCommit.size() > 1 && shapeToCommit.front().distanceTo2D(shapeToCommit.back()) < (2 *
myHintSize)) {
184 shapeToCommit.pop_back();
185 shapeToCommit.push_back(shapeToCommit.front());
208 if (createIfNoExist) {
223 if ((index == 0 || index == (
int)modifiedShape.size() - 1)) {
224 modifiedShape.erase(modifiedShape.begin());
225 modifiedShape.erase(modifiedShape.end() - 1);
226 modifiedShape.push_back(modifiedShape.front());
228 modifiedShape.erase(modifiedShape.begin() + index);
277 glTranslated(0, 0, 128);
292 bool mouseOverVertex =
false;
297 RGBColor invertedColor, darkerColor;
320 if (modeMove && (i.distanceTo2D(mousePosition) <
myHintSize)) {
321 mouseOverVertex =
true;
362 std::vector<std::string> edgeIDs;
443 return canParse<PositionVector>(value);
445 return canParse<RGBColor>(value);
453 return canParse<bool>(value);
455 return canParse<bool>(value);
457 return canParse<bool>(value);
494 int numberOfSources = 0;
495 int numberOfSinks = 0;
549 myColor = parse<RGBColor>(value);
560 if (parse<bool>(value)) {
int myCurrentMovingVertexIndex
index of vertex that is been moved (-1 means that none vertex is been moved)
GUIVisualizationSizeSettings polySize
void updateGeometry()
update pre-computed geometry information
TAZCurrent * getTAZCurrentModul() const
get Current TAZ modul
static RGBColor getColor()
gets the gl-color
std::string getAttribute(SumoXMLAttr key) const
An Element which don't belongs to GNENet but has influency in the simulation.
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
const std::string & getAdditionalID() const
const std::string getID() const
function to support debugging
#define WRITE_WARNING(msg)
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
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
average sink (used only by TAZs)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Boundary movingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
double angle
The current view rotation angle.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
double myAverageWeightSink
Average Sink weight.
bool drawBoundaries
enable or disable draw boundaries
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.
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
min sink (used only by TAZs)
PositionVector myTAZShape
TAZ shape.
a source within a district (connection road)
void updateParentAdditional()
update TAZ after add or remove a Source/sink, or change their weight
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
double getAttributeDouble(SumoXMLAttr key) const
GNETAZFrame * getTAZFrame() const
get frame for GNE_NMODE_TAZ
double getHeight() const
Returns the height of the boundary (y-axis)
GNETAZ * getTAZ() const
get current TAZ
RGBColor myColor
TAZ Color.
void changeAdditionalID(const std::string &newID)
change ID of additional
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
GUIVisualizationTextSettings polyName
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
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.
double myMaxWeightSource
Max source weight.
AdditionalMove myMove
variable AdditionalMove
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
max source (used only by TAZs)
friend class GNEChange_Attribute
declare friend class
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void add(double xoff, double yoff, double zoff)
GNENet * getNet() const
get the net object
min source (used only by TAZs)
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
GNETAZ(const std::string &id, GNEViewNet *viewNet, PositionVector shape, RGBColor color, bool blockMovement)
GNETAZ Constructor.
void commitShapeChange(const PositionVector &oldShape, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of changeShapeGeometry(....
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
~GNETAZ()
GNETAZ Destructor.
void selectAttributeCarrier(bool changeFlag=true)
GUIGlID getGlID() const
Returns the numerical id of the object.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
A class that stores a 2D geometrical boundary.
average source (used only by TAZs)
static void drawShapeDottedContourAroundClosedShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape)
draw a dotted contour around the given closed shape with certain width
double getWidth() const
Returns the width of the boudary (x-axis)
parameters "key1=value1|key2=value2|...|keyN=valueN"
static const double myHintSizeSquared
squaredhint size of vertex
double scale
information about a lane's width (temporary, used for a single view)
Supermode currentSupermode
the current supermode
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
block shape of a graphic element (Used mainly in GNEShapes)
GNEUndoList * getUndoList() const
get the undoList object
static const double myHintSize
hint size of vertex
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
max sink (used only by TAZs)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
int indexOfClosest(const Position &p) const
index of the closest position to p
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
int insertAtClosest(const Position &p, bool interpolateZ)
inserts p between the two closest positions
double minSize
The minimum size to draw this object.
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
GUIVisualizationColorSettings colorSettings
color settings
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)
RGBColor selectionColor
basic selection color
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
a traffic assignment zone
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
double myAverageWeightSource
Average source weight.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
a sink within a district (connection road)
double y() const
Returns the y-position.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
Demanding mode (Routes, Vehicles etc..)
bool isShapeBlocked() const
return true if Shape TAZ is blocked
block movement of a graphic element
bool myBlockShape
flag for block shape
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
Position getPositionInView() const
Returns position of additional in view.
double myMinWeightSource
Min source weight.
RGBColor invertedColor() const
obtain inverted of current RGBColor
bool isInitialised() const
check if Boundary is Initialised
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Boundary & grow(double by)
extends the boundary by the given amount
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
const std::string & getTagStr() const
get tag assigned to this object in string format
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)
Stores the information about how to visualize structures.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
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.
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
edge: the shape in xml-definition
Position originalViewPosition
value for saving first original position over lane before moving
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
NetworkEditMode networkEditMode
the current Network edit mode
mode for moving network elements
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
const PositionVector & getTAZShape() const
get TAZ shape
bool isAttributeEnabled(SumoXMLAttr key) const
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
GNEViewParent * getViewParent() const
get the net object
std::string getParentName() const
Returns the name of the parent object (if any)
double myMaxWeightSink
Max Sink weight.
void removeDoublePoints(double minDist=POSITION_EPS, bool assertLength=false)
Removes positions if too near.
double myMinWeightSink
Min Sink weight.