SUMO - Simulation of Urban MObility
GNETAZ.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 //
16 /****************************************************************************/
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
23 #include <utils/gui/div/GLHelper.h>
26 #include <netedit/GNEUndoList.h>
27 #include <netedit/GNENet.h>
29 #include <netedit/GNEViewParent.h>
31 #include "GNETAZ.h"
32 
33 
34 // ===========================================================================
35 // static members
36 // ===========================================================================
37 const double GNETAZ::myHintSize = 0.8;
38 const double GNETAZ::myHintSizeSquared = 0.64;
39 
40 
41 // ===========================================================================
42 // member method definitions
43 // ===========================================================================
44 GNETAZ::GNETAZ(const std::string& id, GNEViewNet* viewNet, PositionVector shape, RGBColor color, bool blockMovement) :
45  GNEAdditional(id, viewNet, GLO_TAZ, SUMO_TAG_TAZ, "", blockMovement),
46  myColor(color),
47  myBlockShape(false),
48  myCurrentMovingVertexIndex(-1),
49  myMaxWeightSource(0),
50  myMinWeightSource(0),
51  myAverageWeightSource(0),
52  myMaxWeightSink(0),
53  myMinWeightSink(0),
54  myAverageWeightSink(0) {
55  // set TAZ shape
56  myGeometry.shape = shape;
57 }
58 
59 
61 
62 
63 void
64 GNETAZ::updateGeometry(bool /*updateGrid*/) {
65  // Nothing to do
66 }
67 
68 
71  return myGeometry.shape.getCentroid();
72 }
73 
74 
75 void
77  // restore old position, apply offset and update Geometry
79  myGeometry.shape[0].add(offset);
80  // filtern position using snap to active grid
82  updateGeometry(false);
83 }
84 
85 
86 void
88  // commit new position allowing undo/redo
89  undoList->p_begin("position of " + getTagStr());
91  undoList->p_end();
92 }
93 
94 
95 int
96 GNETAZ::moveVertexShape(const int index, const Position& oldPos, const Position& offset) {
97  // only move shape if block movement block shape are disabled
98  if (!myBlockMovement && !myBlockShape && (index != -1)) {
99  // check that index is correct before change position
100  if (index < (int)myGeometry.shape.size()) {
101  // save current moving Geometry Point
103  // if closed shape and cliked is first or last, move both giving more priority to first always
104  if ((index == 0 || index == (int)myGeometry.shape.size() - 1)) {
105  // Change position of first shape Geometry Point and filtern position using snap to active grid
106  myGeometry.shape.front() = oldPos;
107  myGeometry.shape.front().add(offset);
109  // Change position of last shape Geometry Point and filtern position using snap to active grid
110  myGeometry.shape.back() = oldPos;
111  myGeometry.shape.back().add(offset);
113  } else {
114  // change position of Geometry Point and filtern position using snap to active grid
115  myGeometry.shape[index] = oldPos;
116  myGeometry.shape[index].add(offset);
118  }
119  // return index of moved Geometry Point
120  return index;
121  } else {
122  throw InvalidArgument("Index greater than shape size");
123  }
124  } else {
125  return index;
126  }
127 }
128 
129 
130 void
131 GNETAZ::moveEntireShape(const PositionVector& oldShape, const Position& offset) {
132  // only move shape if block movement is disabled and block shape is enabled
133  if (!myBlockMovement && myBlockShape) {
134  // restore original shape
135  myGeometry.shape = oldShape;
136  // change all points of the shape shape using offset
137  for (auto& i : myGeometry.shape) {
138  i.add(offset);
139  }
140  // update Geometry after moving
141  updateGeometry(true);
142  }
143 }
144 
145 
146 void
148  if (!myBlockMovement) {
149  // disable current moving vertex
151  // restore original shape into shapeToCommit
152  PositionVector shapeToCommit = myGeometry.shape;
153  // restore old shape in polygon (to avoid problems with RTree)
154  myGeometry.shape = oldShape;
155  // first check if double points has to be removed
156  shapeToCommit.removeDoublePoints(myHintSize);
157  if (shapeToCommit.size() != myGeometry.shape.size()) {
158  WRITE_WARNING("Merged shape's point")
159  }
160  // check if polygon has to be closed
161  if (shapeToCommit.size() > 1 && shapeToCommit.front().distanceTo2D(shapeToCommit.back()) < (2 * myHintSize)) {
162  shapeToCommit.pop_back();
163  shapeToCommit.push_back(shapeToCommit.front());
164  }
165  // commit new shape
166  undoList->p_begin("moving " + toString(SUMO_ATTR_SHAPE) + " of " + getTagStr());
167  undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_SHAPE, toString(shapeToCommit)));
168  undoList->p_end();
169  }
170 }
171 
172 
173 int
174 GNETAZ::getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid) {
175  // check if position has to be snapped to grid
176  if (snapToGrid) {
177  pos = myViewNet->snapToActiveGrid(pos);
178  }
179  // first check if vertex already exists
180  for (auto i : myGeometry.shape) {
181  if (i.distanceTo2D(pos) < myHintSize) {
182  return myGeometry.shape.indexOfClosest(i);
183  }
184  }
185  // if vertex doesn't exist, insert it
186  if (createIfNoExist) {
187  return myGeometry.shape.insertAtClosest(pos);
188  } else {
189  return -1;
190  }
191 }
192 
193 
194 void
195 GNETAZ::deleteGeometryPoint(const Position& pos, bool allowUndo) {
196  if (myGeometry.shape.size() > 2) {
197  // obtain index
198  PositionVector modifiedShape = myGeometry.shape;
199  int index = modifiedShape.indexOfClosest(pos);
200  // remove point dependending of
201  if ((index == 0 || index == (int)modifiedShape.size() - 1)) {
202  modifiedShape.erase(modifiedShape.begin());
203  modifiedShape.erase(modifiedShape.end() - 1);
204  modifiedShape.push_back(modifiedShape.front());
205  } else {
206  modifiedShape.erase(modifiedShape.begin() + index);
207  }
208  // set new shape depending of allowUndo
209  if (allowUndo) {
210  myViewNet->getUndoList()->p_begin("delete geometry point");
213  } else {
214  // first remove object from grid due shape is used for boundary
216  // set new shape
217  myGeometry.shape = modifiedShape;
218  // add object into grid again
220  }
221  } else {
222  WRITE_WARNING("Number of remaining points insufficient")
223  }
224 }
225 
226 
227 bool
229  return myBlockShape;
230 }
231 
232 
233 std::string
235  return myViewNet->getNet()->getMicrosimID();
236 }
237 
238 
239 void
241  if (s.polySize.getExaggeration(s, this) == 0) {
242  return;
243  }
245  int circleResolution = GNEAttributeCarrier::getCircleResolution(s);
246  if (s.scale * MAX2(boundary.getWidth(), boundary.getHeight()) < s.polySize.minSize) {
247  return;
248  }
249  glPushName(getGlID());
250  if (myGeometry.shape.size() > 1) {
251  glPushMatrix();
252  glTranslated(0, 0, 128);
255  } else {
257  }
260  glPopMatrix();
261  const Position namePos = myGeometry.shape.getPolygonCenter();
262  drawName(namePos, s.scale, s.polyName, s.angle);
263  }
264  // draw geometry details hints if is not too small and isn't in selecting mode
265  if (s.scale * myHintSize > 1.) {
266  // set values relative to mouse position regarding to shape
267  bool mouseOverVertex = false;
268  bool modeMove = myViewNet->getCurrentEditMode() == GNE_MODE_MOVE;
269  Position mousePosition = myViewNet->getPositionInformation();
270  double distanceToShape = myGeometry.shape.distance2D(mousePosition);
271  // set colors
272  RGBColor invertedColor, darkerColor;
274  invertedColor = s.selectionColor.invertedColor();
275  darkerColor = s.selectionColor.changedBrightness(-32);
276  } else {
277  invertedColor = GLHelper::getColor().invertedColor();
278  darkerColor = GLHelper::getColor().changedBrightness(-32);
279  }
280  // Draw geometry hints if polygon's shape isn't blocked
281  if (myBlockShape == false) {
282  // draw a boundary for moving using darkerColor
283  glPushMatrix();
284  glTranslated(0, 0, GLO_POLYGON + 0.01);
285  GLHelper::setColor(darkerColor);
287  glPopMatrix();
288  // draw points of shape
289  for (auto i : myGeometry.shape) {
291  glPushMatrix();
292  glTranslated(i.x(), i.y(), GLO_POLYGON + 0.02);
293  // Change color of vertex and flag mouseOverVertex if mouse is over vertex
294  if (modeMove && (i.distanceTo(mousePosition) < myHintSize)) {
295  mouseOverVertex = true;
296  GLHelper::setColor(invertedColor);
297  } else {
298  GLHelper::setColor(darkerColor);
299  }
300  GLHelper::drawFilledCircle(myHintSize, circleResolution);
301  glPopMatrix();
302  }
303  }
304  // check if draw moving hint has to be drawed
305  if (modeMove && (mouseOverVertex == false) && (myBlockMovement == false) && (distanceToShape < myHintSize)) {
306  // push matrix
307  glPushMatrix();
309  glTranslated(hintPos.x(), hintPos.y(), GLO_POLYGON + 0.04);
310  GLHelper::setColor(invertedColor);
311  GLHelper:: drawFilledCircle(myHintSize, circleResolution);
312  glPopMatrix();
313  }
314  }
315  }
316  // check if dotted contour has to be drawn
317  if ((myViewNet->getDottedAC() == this) || (myViewNet->getViewParent()->getTAZFrame()->getTAZCurrentModul()->getTAZ() == this)) {
319  }
320  // pop name
321  glPopName();
322 }
323 
324 
325 std::string
327  switch (key) {
328  case SUMO_ATTR_ID:
329  return getAdditionalID();
330  case SUMO_ATTR_SHAPE:
331  return toString(myGeometry.shape);
332  case SUMO_ATTR_COLOR:
333  return toString(myColor);
334  case SUMO_ATTR_EDGES: {
335  std::vector<std::string> edgeIDs;
336  for (auto i : myAdditionalChilds) {
337  edgeIDs.push_back(i->getAttribute(SUMO_ATTR_EDGE));
338  }
339  return toString(edgeIDs);
340  }
342  return toString(myBlockMovement);
344  return toString(myBlockShape);
345  case GNE_ATTR_SELECTED:
347  case GNE_ATTR_GENERIC:
348  return getGenericParametersStr();
349  case GNE_ATTR_MIN_SOURCE:
350  return toString(myMinWeightSource);
351  case GNE_ATTR_MIN_SINK:
352  return toString(myMinWeightSink);
353  case GNE_ATTR_MAX_SOURCE:
354  return toString(myMaxWeightSource);
355  case GNE_ATTR_MAX_SINK:
356  return toString(myMaxWeightSink);
361  default:
362  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
363  }
364 }
365 
366 
367 void
368 GNETAZ::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
369  if (value == getAttribute(key)) {
370  return; //avoid needless changes, later logic relies on the fact that attributes have changed
371  }
372  switch (key) {
373  case SUMO_ATTR_ID:
374  case SUMO_ATTR_SHAPE:
375  case SUMO_ATTR_COLOR:
376  case SUMO_ATTR_EDGES:
379  case GNE_ATTR_SELECTED:
380  case GNE_ATTR_GENERIC:
381  undoList->p_add(new GNEChange_Attribute(this, key, value));
382  break;
383  default:
384  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
385  }
386 }
387 
388 
389 bool
390 GNETAZ::isValid(SumoXMLAttr key, const std::string& value) {
391  switch (key) {
392  case SUMO_ATTR_ID:
393  return isValidAdditionalID(value);
394  case SUMO_ATTR_SHAPE:
395  return canParse<PositionVector>(value);
396  case SUMO_ATTR_COLOR:
397  return canParse<RGBColor>(value);
398  case SUMO_ATTR_EDGES:
399  if (value.empty()) {
400  return true;
401  } else {
403  }
405  return canParse<bool>(value);
407  return canParse<bool>(value);
408  case GNE_ATTR_SELECTED:
409  return canParse<bool>(value);
410  case GNE_ATTR_GENERIC:
411  return isGenericParametersValid(value);
412  default:
413  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
414  }
415 }
416 
417 
418 std::string
420  return getTagStr() + ":" + getID();
421 }
422 
423 
424 std::string
426  return getTagStr();
427 }
428 
429 
430 void
432  // reset all stadistic variables
433  myMaxWeightSource = 0;
434  myMinWeightSource = -1;
436  myMaxWeightSink = 0;
437  myMinWeightSink = -1;
439  // declare an extra variables for saving number of childs
440  int numberOfSources = 0;
441  int numberOfSinks = 0;
442  // iterate over additional childs
443  for (auto i : myAdditionalChilds) {
444  if (i->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) {
445  double weight = parse<double>(i->getAttribute(SUMO_ATTR_WEIGHT));
446  // check max Weight
447  if (myMaxWeightSource < weight) {
448  myMaxWeightSource = weight;
449  }
450  // check min Weight
451  if ((myMinWeightSource == -1) || (weight < myMinWeightSource)) {
452  myMinWeightSource = weight;
453  }
454  // update Average
455  myAverageWeightSource += weight;
456  // update number of sources
457  numberOfSources++;
458  } else if (i->getTagProperty().getTag() == SUMO_TAG_TAZSINK) {
459  double weight = parse<double>(i->getAttribute(SUMO_ATTR_WEIGHT));
460  // check max Weight
461  if (myMaxWeightSink < weight) {
462  myMaxWeightSink = weight;
463  }
464  // check min Weight
465  if ((myMinWeightSink == -1) || (weight < myMinWeightSink)) {
466  myMinWeightSink = weight;
467  }
468  // update Average
469  myAverageWeightSink += weight;
470  // update number of sinks
471  numberOfSinks++;
472  }
473  }
474  // calculate average
475  myAverageWeightSource /= numberOfSources;
476  myAverageWeightSink /= numberOfSinks;
477 }
478 
479 // ===========================================================================
480 // private
481 // ===========================================================================
482 
483 void
484 GNETAZ::setAttribute(SumoXMLAttr key, const std::string& value) {
485  switch (key) {
486  case SUMO_ATTR_ID:
487  changeAdditionalID(value);
488  break;
489  case SUMO_ATTR_SHAPE:
491  myGeometry.shape = parse<PositionVector>(value);
493  break;
494  case SUMO_ATTR_COLOR:
495  myColor = parse<RGBColor>(value);
496  break;
497  case SUMO_ATTR_EDGES:
498  break;
500  myBlockMovement = parse<bool>(value);
501  break;
503  myBlockShape = parse<bool>(value);
504  break;
505  case GNE_ATTR_SELECTED:
506  if (parse<bool>(value)) {
508  } else {
510  }
511  break;
512  case GNE_ATTR_GENERIC:
514  break;
515  default:
516  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
517  }
518 }
519 
520 
521 /****************************************************************************/
Position getPositionInView() const
Returns position of additional in view.
Definition: GNETAZ.cpp:70
GNETAZFrame * getTAZFrame() const
get frame for GNE_MODE_TAZ
average sink (used only by TAZs)
~GNETAZ()
GNETAZ Destructor.
Definition: GNETAZ.cpp:60
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 ...
Definition: GNETAZ.cpp:368
double scale
information about a lane&#39;s width (temporary, used for a single view)
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:154
a source within a district (connection road)
a polygon
mode for moving things
Definition: GNEViewNet.h:48
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNETAZ.cpp:76
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.
Definition: GLHelper.cpp:178
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&#39;t allowed) ...
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
Definition: GNETAZ.cpp:87
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
returns Additional ID
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.
Definition: GNETAZ.h:166
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(...)
Definition: GNETAZ.cpp:147
GNEViewParent * getViewParent() const
get the net object
double y() const
Returns the y-position.
Definition: Position.h:62
Position snapToActiveGrid(const Position &pos) const
Returns a position that is mapped to the closest grid point if the grid is active.
PositionVector getShape() const
Returns additional element&#39;s shape.
double x() const
Returns the x-position.
Definition: Position.h:57
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
double myMinWeightSource
Min source weight.
Definition: GNETAZ.h:169
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
T MAX2(T a, T b)
Definition: StdDefs.h:76
double getWidth() const
Returns the width of the boudary (x-axis)
Definition: Boundary.cpp:155
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...
Definition: GNEUndoList.cpp:73
bool myBlockShape
flag for block shape
Definition: GNETAZ.h:153
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNETAZ.cpp:425
max source (used only by TAZs)
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNETAZ.cpp:195
min sink (used only by TAZs)
RGBColor invertedColor() const
obtain inverted of current RGBColor
Definition: RGBColor.cpp:143
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:344
void updateGeometry(bool updateGrid)
update pre-computed geometry information
Definition: GNETAZ.cpp:64
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void changeAdditionalID(const std::string &newID)
change ID of additional
generic attribute
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
Definition: GNETAZ.cpp:96
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:241
static const double myHintSizeSquared
squaredhint size of vertex
Definition: GNETAZ.h:163
GUIVisualizationSizeSettings polySize
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
static const double myHintSize
hint size of vertex
Definition: GNETAZ.h:160
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
Definition: GNETAZ.cpp:131
AdditionalMove myMove
variable AdditionalMove
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
std::string getParentName() const
Returns the name of the parent object (if any)
Definition: GNETAZ.cpp:234
double myMaxWeightSink
Max Sink weight.
Definition: GNETAZ.h:175
GNEUndoList * getUndoList() const
get the undoList object
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNETAZ.cpp:419
void removeDoublePoints(double minDist=POSITION_EPS, bool assertLength=false)
Removes positions if too near.
min source (used only by TAZs)
the edges of a route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:573
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.
Definition: GNEUndoList.cpp:80
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
PositionVector shape
The shape of the additional element.
A list of positions.
double myMinWeightSink
Min Sink weight.
Definition: GNETAZ.h:178
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
Definition: GNENet.cpp:1160
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&#39;s edge ...
Definition: GNETAZ.cpp:174
friend class GNEChange_Attribute
declare friend class
void selectAttributeCarrier(bool changeFlag=true)
std::string getAttribute(SumoXMLAttr key) const
Definition: GNETAZ.cpp:326
block movement of a graphic element
RGBColor selectionColor
NETEDIT special colors.
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)
Definition: GNETAZ.h:156
edge: the shape in xml-definition
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.
Definition: GLHelper.cpp:270
void updateAdditionalParent()
update TAZ after add or remove a Source/sink, or change their weight
Definition: GNETAZ.cpp:431
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
EditMode getCurrentEditMode() const
get the current edit mode
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNETAZ.cpp:390
a sink within a district (connection road)
double getHeight() const
Returns the height of the boundary (y-axis)
Definition: Boundary.cpp:161
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
Definition: GLHelper.cpp:471
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
AdditionalGeometry myGeometry
geometry to be precomputed in updateGeometry(...)
RGBColor myColor
TAZ Color.
Definition: GNETAZ.h:150
const std::string & getTagStr() const
get tag assigned to this object in string format
element is selected
static int getCircleResolution(const GUIVisualizationSettings &settings)
function to calculate circle resolution for all circles drawn in drawGL(...) functions ...
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) ...
Definition: Position.h:249
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
average source (used only by TAZs)
Position getPositionInformation() const
Returns the cursor&#39;s x/y position within the network.
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.
Definition: GNETAZ.cpp:44
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
double myAverageWeightSource
Average source weight.
Definition: GNETAZ.h:172
bool isShapeBlocked() const
return true if Shape TAZ is blocked
Definition: GNETAZ.cpp:228
void add(double xoff, double yoff, double zoff)
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
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.
Definition: GNETAZ.h:181
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1153
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNETAZ.cpp:240
A color information.
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:579
GUIVisualizationTextSettings polyName