Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNETAZ.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18//
19/****************************************************************************/
20
22
26#include <netedit/GNENet.h>
34
35#include "GNETAZ.h"
36
37// ===========================================================================
38// static members
39// ===========================================================================
40
41const double GNETAZ::myHintSize = 0.8;
42const double GNETAZ::myHintSizeSquared = 0.64;
43
44// ===========================================================================
45// member method definitions
46// ===========================================================================
47
48#ifdef _MSC_VER
49#pragma warning(push)
50#pragma warning(disable: 4355) // mask warning about "this" in initializers
51#endif
54 TesselatedPolygon("", "", RGBColor::BLACK, {}, false, false, DEFAULT_LINEWIDTH, DEFAULT_LAYER,
55DEFAULT_ANGLE, DEFAULT_IMG_FILE, "", DEFAULT_HEIGHT, DEFAULT_PARAMETERS),
56myMoveElementShape(new GNEMoveElementShape(this)) {
57}
58
59
60GNETAZ::GNETAZ(const std::string& id, GNENet* net, FileBucket* fileBucket, const PositionVector& shape,
61 const Position& center, const bool fill, const RGBColor& color, const std::string& name,
62 const Parameterised::Map& parameters) :
63 GNEAdditional(id, net, SUMO_TAG_TAZ, fileBucket, name),
64 TesselatedPolygon(id, "", color, shape, false, fill, DEFAULT_LINEWIDTH, DEFAULT_LAYER,
65 DEFAULT_ANGLE, DEFAULT_IMG_FILE, "", DEFAULT_HEIGHT, parameters),
66 myMoveElementShape(new GNEMoveElementShape(this, myShape, center, true)) {
67 // update centering boundary without updating grid
69 // update geometry
71}
72#ifdef _MSC_VER
73#pragma warning(pop)
74#endif
75
76
80
81
86
87
90 return this;
91}
92
93
94const
96 return this;
97}
98
99
100int
101GNETAZ::getVertexIndex(Position pos, bool snapToGrid) {
102 // check if position has to be snapped to grid
103 if (snapToGrid) {
104 pos = myNet->getViewNet()->snapToActiveGrid(pos);
105 }
106 // first check if vertex already exists
107 for (const auto& shapePosition : myShape) {
108 if (shapePosition.distanceTo2D(pos) < myNet->getViewNet()->getVisualisationSettings().neteditSizeSettings.polygonGeometryPointRadius) {
109 return myShape.indexOfClosest(shapePosition);
110 }
111 }
112 return -1;
113}
114
115
116void
118 // first open TAZ tag
119 device.openTag(SUMO_TAG_TAZ);
120 // write common additional attributes
122 // write specific attributes
125 if ((center != myShape.getCentroid()) && (center != Position::INVALID)) {
126 device.writeAttr(SUMO_ATTR_CENTER, center);
127 }
128 if (myFill) {
129 device.writeAttr(SUMO_ATTR_FILL, true);
130 }
132 // sort all Source/Sinks by ID
133 std::map<std::pair<std::string, SumoXMLTag>, GNETAZSourceSink*> sortedSourceSinks;
134 for (const auto& sourceSink : getChildTAZSourceSinks()) {
135 sortedSourceSinks[std::make_pair(sourceSink->getAttribute(SUMO_ATTR_EDGE), sourceSink->getTagProperty()->getTag())] = sourceSink;
136 }
137 // write all TAZ Source/sinks
138 for (const auto& sortedSourceSink : sortedSourceSinks) {
139 sortedSourceSink.second->writeTAZSourceSink(device);
140 }
141 // write params
142 XMLHelpers::writeParams(device, *this);
143 // close TAZ tag
144 device.closeTag();
145}
146
147
148bool
150 return true;
151}
152
153
154std::string
156 return "";
157}
158
159
160void
162 // nothing to fix
163}
164
165
166bool
168 // get edit modes
169 const auto& editModes = myNet->getViewNet()->getEditModes();
170 // check if we're in move mode
171 if (!myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
173 (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && myNet->getViewNet()->checkOverLockedElement(this, mySelected)) {
174 // only move the first element
176 } else {
177 return false;
178 }
179}
180
181
182void
184 // just update geometry
186 // update geometry of child plan elements
187 for (const auto& demandElements : getChildDemandElements()) {
188 demandElements->updateGeometry();
189 }
190 // update geometry of childTAZRelDatas
191 for (const auto& TAZRelData : getChildGenericDatas()) {
192 TAZRelData->updateGeometry();
193 }
194 myTesselation.clear();
195}
196
197
200 return myShape.getCentroid();
201}
202
203
204double
206 return s.polySize.getExaggeration(s, this);
207}
208
209
210void
211GNETAZ::updateCenteringBoundary(const bool updateGrid) {
212 // Remove object from net
213 if (updateGrid) {
215 for (const auto& TAZRelData : getChildGenericDatas()) {
216 myNet->removeGLObjectFromGrid(TAZRelData);
217 }
218 }
219 // use shape as boundary
221 // add center
224 }
225 // grow boundary
227 // add object into net
228 if (updateGrid) {
230 for (const auto& TAZRelData : getChildGenericDatas()) {
231 TAZRelData->updateGeometry();
232 myNet->addGLObjectIntoGrid(TAZRelData);
233 }
234 }
235}
236
237
238void
239GNETAZ::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) {
240 // Nothing to split
241}
242
243
244std::string
246 return myNet->getMicrosimID();
247}
248
249
252 // create popup
253 GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, this);
254 // build common options
256 // create a extra FXMenuCommand if mouse is over a vertex
257 const int index = getVertexIndex(myNet->getViewNet()->getPositionInformation(), false);
258 if (index != -1) {
259 // add separator
260 new FXMenuSeparator(ret);
261 // check if we're in network mode
263 GUIDesigns::buildFXMenuCommand(ret, TL("Set custom Geometry Point"), nullptr, &parent, MID_GNE_CUSTOM_GEOMETRYPOINT);
264 }
265 }
266 return ret;
267}
268
269
270void
272 // get exaggeration
273 const double TAZExaggeration = getExaggeration(s);
274 // first check if poly can be drawn
275 if (myNet->getViewNet()->getDemandViewOptions().showShapes() && (TAZExaggeration > 0)) {
276 // draw boundary
277 const auto boundary = getCenteringBoundary();
278 GLHelper::drawBoundary(s, boundary);
279 // get detail level
280 const auto d = s.getDetailLevel(TAZExaggeration);
281 // draw geometry only if we'rent in drawForObjectUnderCursor mode
282 if (s.checkDrawPoly(boundary, isAttributeCarrierSelected())) {
283 // Obtain constants
284 const bool drawFill = (myNet->getViewNet()->getEditModes().isCurrentSupermodeData() && myNet->getViewNet()->getDataViewOptions().TAZDrawFill()) ? true : getFill();
285 // get colors
286 const RGBColor color = GUIPolygon::setColor(s, this, this, drawUsingSelectColor(), -1);
287 const RGBColor darkerColor = color.changedBrightness(-32);
288 // push layer matrix
290 // translate to front
292 // check if we're drawing a polygon or a polyline
294 // draw inner polygon
295 const int alphaOverride = myNet->getViewNet()->getDataViewOptions().TAZDrawFill() ? 128 : -1;
296 GUIPolygon::drawInnerPolygon(s, this, this, myAdditionalGeometry.getShape(), 0, drawFill, drawUsingSelectColor(), alphaOverride, true);
297 } else {
298 // push matrix
300 // set color
301 GLHelper::setColor(color);
302 // draw geometry (polyline)
304 // pop matrix
306 }
307 // draw contour if shape isn't blocked
309 // push contour matrix
311 // translate to front
312 glTranslated(0, 0, 0.1);
313 // set color
314 GLHelper::setColor(darkerColor);
315 // draw polygon contour
317 // pop contour matrix
319 // draw shape points only in Network supemode
321 // check if we're in move mode
323 // get geometry point sizes
324 const double geometryPointSize = s.neteditSizeSettings.polygonGeometryPointRadius * (moveMode ? 1 : 0.5);
325 // draw geometry points
326 GUIGeometry::drawGeometryPoints(d, myAdditionalGeometry.getShape(), darkerColor, geometryPointSize, TAZExaggeration,
329 // draw dotted contours for geometry points if we're in move mode
330 if (moveMode) {
332 TAZExaggeration, s.dottedContourSettings.segmentWidthSmall);
333 }
334 }
335 }
336 // declare center
338 // only draw if it's valid
339 if (center != Position::INVALID) {
340 // draw center
341 const double centerRadius = s.neteditSizeSettings.polygonGeometryPointRadius * TAZExaggeration;
342 // push center matrix
344 // move to vertex
345 glTranslated(center.x(), center.y(), GLO_JUNCTION + 0.3);
346 // set color
347 GLHelper::setColor(darkerColor);
348 // draw circle
349 GLHelper::drawFilledCircleDetailed(d, centerRadius);
350 // move to front
351 glTranslated(0, 0, 0.1);
352 // set color
353 GLHelper::setColor(color);
354 // draw circle
355 GLHelper::drawFilledCircleDetailed(d, centerRadius * 0.8);
356 // pop center matrix
358 }
359 // pop layer matrix
361 // draw lock icon
363 // draw name
365 // check if draw poly type
366 if (s.polyType.show(this)) {
369 }
370 // get contour width
372 // draw dotted contour
373 myAdditionalContour.drawDottedContours(s, d, this, contourWidth, true);
374 // draw TAZ Center dotted contour
375 myTAZCenterContour.drawDottedContours(s, d, this, contourWidth, true);
376 }
377 // draw demand element children
379 // calculate contour
381 calculateContourPolygons(s, d, getShapeLayer(), TAZExaggeration, true);
382 } else {
383 calculateContourPolygons(s, d, getShapeLayer(), TAZExaggeration, getFill());
384 }
385 // calculate contour for TAZ Center
387 }
388}
389
390
391std::string
393 switch (key) {
394 case SUMO_ATTR_ID:
395 return getMicrosimID();
396 case SUMO_ATTR_SHAPE:
397 return toString(myShape);
398 case SUMO_ATTR_CENTER:
400 return "";
401 } else {
403 }
404 case SUMO_ATTR_COLOR:
405 return toString(getShapeColor());
406 case SUMO_ATTR_NAME:
407 return myAdditionalName;
408 case SUMO_ATTR_FILL:
409 return toString(myFill);
410 case SUMO_ATTR_EDGES: {
411 std::vector<std::string> edgeIDs;
412 for (const auto& TAZSourceSink : getChildTAZSourceSinks()) {
413 edgeIDs.push_back(TAZSourceSink->getAttribute(SUMO_ATTR_EDGE));
414 }
415 return toString(edgeIDs);
416 }
418 return toString(myEdgesWithin);
421 return "undefined";
422 } else {
424 }
427 return "undefined";
428 } else {
430 }
433 return "undefined";
434 } else {
436 }
439 return "undefined";
440 } else {
442 }
445 return "undefined";
446 } else {
448 }
451 return "undefined";
452 } else {
454 }
455 default:
457 }
458}
459
460
461double
463 switch (key) {
465 return myMinWeightSource;
467 return myMinWeightSink;
469 return myMaxWeightSource;
471 return myMaxWeightSink;
475 return myAverageWeightSink;
476 default:
478 }
479}
480
481
493
494
497 switch (key) {
498 case SUMO_ATTR_SHAPE:
499 return myShape;
500 default:
502 }
503}
504
505
506void
507GNETAZ::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
508 if (value == getAttribute(key)) {
509 return; //avoid needless changes, later logic relies on the fact that attributes have changed
510 }
511 switch (key) {
512 case SUMO_ATTR_ID:
513 case SUMO_ATTR_SHAPE:
514 case SUMO_ATTR_CENTER:
515 case SUMO_ATTR_COLOR:
516 case SUMO_ATTR_NAME:
517 case SUMO_ATTR_FILL:
518 case SUMO_ATTR_EDGES:
520 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
521 break;
522 default:
523 myMoveElementShape->setMovingAttribute(key, value, undoList);
524 break;
525 }
526}
527
528
529bool
530GNETAZ::isValid(SumoXMLAttr key, const std::string& value) {
531 switch (key) {
532 case SUMO_ATTR_ID:
534 case SUMO_ATTR_SHAPE:
535 if (value.empty()) {
536 return false;
537 } else if (canParse<PositionVector>(value)) {
538 const auto shape = parse<PositionVector>(value);
539 if (shape.front() != shape.back()) {
540 return shape.size() >= 3;
541 } else {
542 return shape.size() >= 4;
543 }
544 } else {
545 return false;
546 }
547 case SUMO_ATTR_CENTER:
548 if (value.empty()) {
549 return true;
550 } else {
551 return canParse<Position>(value);
552 }
553 case SUMO_ATTR_COLOR:
554 return canParse<RGBColor>(value);
555 case SUMO_ATTR_NAME:
556 return StringUtils::isValidAttribute(value);
557 case SUMO_ATTR_FILL:
558 return canParse<bool>(value);
559 case SUMO_ATTR_EDGES:
560 if (value.empty()) {
561 return true;
562 } else {
564 }
566 return canParse<bool>(value);
567 default:
568 return myMoveElementShape->isMovingAttributeValid(key, value);
569 }
570}
571
572
573std::string
575 return getTagStr() + ":" + getID();
576}
577
578
579std::string
581 return getTagStr();
582}
583
584
585void
587 // reset all statistic variables
594 // declare an extra variables for saving number of children
595 int numberOfSources = 0;
596 int numberOfSinks = 0;
597 // iterate over child additional
598 for (const auto& TAZSourceSink : getChildTAZSourceSinks()) {
599 if (TAZSourceSink->getTagProperty()->getTag() == SUMO_TAG_TAZSOURCE) {
600 const double weight = TAZSourceSink->getAttributeDouble(SUMO_ATTR_WEIGHT);
601 // check max Weight
604 }
605 // check min Weight
608 }
609 // update Average
611 // update number of sources
612 numberOfSources++;
613 } else if (TAZSourceSink->getTagProperty()->getTag() == SUMO_TAG_TAZSINK) {
614 const double weight = TAZSourceSink->getAttributeDouble(SUMO_ATTR_WEIGHT);
615 // check max Weight
618 }
619 // check min Weight
622 }
623 // update Average
625 // update number of sinks
626 numberOfSinks++;
627 }
628 }
629 // calculate average
630 if (numberOfSources > 0) {
631 myAverageWeightSource /= numberOfSources;
632 }
633 if (numberOfSinks > 0) {
634 myAverageWeightSink /= numberOfSinks;
635 }
636}
637
638// ===========================================================================
639// private
640// ===========================================================================
641
642void
643GNETAZ::setAttribute(SumoXMLAttr key, const std::string& value) {
644 switch (key) {
645 case SUMO_ATTR_ID:
646 // update microsimID
647 setAdditionalID(value);
648 break;
649 case SUMO_ATTR_SHAPE: {
651 // set new shape
652 myShape = parse<PositionVector>(value);
653 // always close shape
654 if ((myShape.size() > 1) && (myShape.front() != myShape.back())) {
655 myShape.push_back(myShape.front());
656 }
657 // update center
658 if (myShape.size() == 0) {
660 } else if (updateCenter) {
662 }
663 // update geometry
665 // update centering boundary
666 if (!isTemplate()) {
668 }
669 break;
670 }
671 case SUMO_ATTR_CENTER:
672 if (value.empty()) {
674 } else {
676 }
677 // update geometry
679 // update centering boundary
680 if (!isTemplate()) {
682 }
683 break;
684 case SUMO_ATTR_COLOR:
685 setShapeColor(parse<RGBColor>(value));
686 break;
687 case SUMO_ATTR_NAME:
688 myAdditionalName = value;
689 break;
690 case SUMO_ATTR_FILL:
691 myFill = parse<bool>(value);
693 break;
694 case SUMO_ATTR_EDGES:
695 break;
697 myEdgesWithin = parse<bool>(value);
698 break;
699 default:
701 break;
702 }
703}
704
705/****************************************************************************/
@ NETWORK_MOVE
mode for moving network elements
@ MID_GNE_CUSTOM_GEOMETRYPOINT
set custom geometry point
@ GLO_JUNCTION
a junction
#define TL(string)
Definition MsgHandler.h:316
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_MAX_SOURCE
max source (used only by TAZs)
@ SUMO_ATTR_EDGE
@ GNE_ATTR_MAX_SINK
max sink (used only by TAZs)
@ GNE_ATTR_AVERAGE_SINK
average sink (used only by TAZs)
@ GNE_ATTR_TAZ_CENTROID
TAZ Center (uses to return the TAZ centroid if center is not defined)
@ GNE_ATTR_MIN_SINK
min sink (used only by TAZs)
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_WEIGHT
@ SUMO_ATTR_FILL
Fill the polygon.
@ SUMO_ATTR_NAME
@ SUMO_ATTR_CENTER
@ GNE_ATTR_AVERAGE_SOURCE
average source (used only by TAZs)
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_ID
@ GNE_ATTR_EDGES_WITHIN
virtual attribute used for use edges within during TAZ creation
@ GNE_ATTR_MIN_SOURCE
min source (used only by TAZs)
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:68
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:57
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:75
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:340
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void drawBoundary(const GUIVisualizationSettings &s, const Boundary &b)
Draw a boundary (used for debugging)
Definition GLHelper.cpp:952
static void drawFilledCircleDetailed(const GUIVisualizationSettings::Detail d, const double radius)
Draws a filled circle around (0,0) depending of level of detail.
Definition GLHelper.cpp:534
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
Definition GLHelper.cpp:773
bool isValidAdditionalID(const std::string &value) const
check if a new additional ID is valid
bool checkDrawFromContour() const override
check if draw from contour (green)
void setAdditionalID(const std::string &newID)
set additional ID
GNEContour myAdditionalContour
variable used for draw additional contours
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
std::string myAdditionalName
name of additional
void resetAdditionalContour()
reset additional contour
void drawDemandElementChildren(const GUIVisualizationSettings &s) const
draw demand element children
bool checkDrawToContour() const override
check if draw from contour (magenta)
void calculateContourPolygons(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double layer, const double exaggeration, const bool filledShape) const
calculate contour for polygons
void writeAdditionalAttributes(OutputDevice &device) const
write common additional attributes
Boundary myAdditionalBoundary
Additional Boundary (used only by additionals placed over grid)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
bool mySelected
boolean to check if this AC is selected (more quickly as checking GUIGlObjectStorage)
const std::string getID() const override
get ID (all Attribute Carriers have one)
const std::string & getTagStr() const
get tag assigned to this object in string format
bool isTemplate() const
check if this AC is template
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void drawInLayer(const double typeOrLayer, const double extraOffset=0) const
draw element in the given layer, or in front if corresponding flag is enabled
GNENet * myNet
pointer to net
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
void drawDottedContourGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const PositionVector &shape, const double radius, const double scale, const double lineWidth) const
draw dotted contour for geometry points
void calculateContourCircleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, double radius, const double layer, const double scale, const GUIGlObject *boundaryParent) const
calculate contour (circle elements)
bool drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
draw dotted contours (basics, select, delete, inspect...)
const GNEHierarchicalContainerChildren< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
const GNEHierarchicalContainerChildrenSet< GNETAZSourceSink * > & getChildTAZSourceSinks() const
return child TAZSourceSinks (Set)
const GNEHierarchicalContainerChildren< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
void setMovingAttributePosition(SumoXMLAttr key, const Position &value)
set moving attribute position (needed to avoid precision conversion problems)
void setMovingAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
set moving attribute (using undo-list)
double getMovingAttributeDouble(SumoXMLAttr key) const override
get moving attribute double
Position getMovingAttributePosition(SumoXMLAttr key) const override
get moving attribute position
std::string getMovingAttribute(SumoXMLAttr key) const override
get moving attribute
PositionVector getMovingAttributePositionVector(SumoXMLAttr key) const override
get moving attribute position vector
bool isMovingAttributeValid(SumoXMLAttr key, const std::string &value) const override
check if the given moving attribute is valid
bool getMoveWholePolygons() const
check if option "move whole polygons" is enabled
NetworkMoveOptions * getNetworkMoveOptions() const
get network mode options
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition GNENet.cpp:1476
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition GNENet.cpp:1486
GNEViewParent * getViewParent() const
get view parent (used for simplify code)
Definition GNENet.cpp:150
GNEViewNet * getViewNet() const
get view net (used for simplify code)
Definition GNENet.cpp:144
bool isAdditionalValid() const override
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
Definition GNETAZ.cpp:149
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
Definition GNETAZ.cpp:496
double myMaxWeightSink
Max Sink weight.
Definition GNETAZ.h:234
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this TAZ
Definition GNETAZ.cpp:83
bool checkDrawMoveContour() const override
check if draw move contour (red)
Definition GNETAZ.cpp:167
static const double myHintSize
hint size of vertex
Definition GNETAZ.h:219
Position getAttributePosition(SumoXMLAttr key) const override
Definition GNETAZ.cpp:483
GNEContour myTAZCenterContour
TAZ center contour.
Definition GNETAZ.h:212
bool myEdgesWithin
use edges whithin during creation (only in edit mode)
Definition GNETAZ.h:215
Parameterised * getParameters() override
get parameters associated with this TAZ
Definition GNETAZ.cpp:89
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
Definition GNETAZ.cpp:574
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
Definition GNETAZ.cpp:117
~GNETAZ()
GNETAZ Destructor.
Definition GNETAZ.cpp:77
double myAverageWeightSource
Average source weight.
Definition GNETAZ.h:231
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
Definition GNETAZ.cpp:161
double getAttributeDouble(SumoXMLAttr key) const override
Definition GNETAZ.cpp:462
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
Definition GNETAZ.cpp:580
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
Definition GNETAZ.cpp:205
double myMinWeightSink
Min Sink weight.
Definition GNETAZ.h:237
double myAverageWeightSink
Average Sink weight.
Definition GNETAZ.h:240
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
Definition GNETAZ.cpp:271
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNETAZ.cpp:507
GNEMoveElementShape * myMoveElementShape
move element shape
Definition GNETAZ.h:209
std::string getParentName() const override
Returns the name of the parent object.
Definition GNETAZ.cpp:245
bool isValid(SumoXMLAttr key, const std::string &value) override
Definition GNETAZ.cpp:530
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
Definition GNETAZ.cpp:251
static const double myHintSizeSquared
squaredhint size of vertex
Definition GNETAZ.h:222
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
Definition GNETAZ.cpp:155
Position getPositionInView() const override
Returns position of additional in view.
Definition GNETAZ.cpp:199
void updateTAZStatistic()
update TAZ Statistic
Definition GNETAZ.cpp:586
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
Definition GNETAZ.cpp:239
double myMinWeightSource
Min source weight.
Definition GNETAZ.h:228
int getVertexIndex(Position pos, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
Definition GNETAZ.cpp:101
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
Definition GNETAZ.cpp:211
void updateGeometry() override
update pre-computed geometry information
Definition GNETAZ.cpp:183
double myMaxWeightSource
Max source weight.
Definition GNETAZ.h:225
GNETAZ(GNENet *net)
@default GNETAZ Constructor
Definition GNETAZ.cpp:52
std::string getAttribute(SumoXMLAttr key) const override
Definition GNETAZ.cpp:392
void writeTAZSourceSink(OutputDevice &device) const
write TAZ sourceSink
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::DataViewOptions & getDataViewOptions() const
get data view options
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
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
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
GNEMoveFrame * getMoveFrame() const
get frame for move elements
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
The popup menu of a globject.
static void drawGeometryPoints(const GUIVisualizationSettings::Detail d, const PositionVector &shape, const RGBColor &color, const double radius, const double exaggeration, const bool drawSymbols, const bool editingElevation)
draw geometry points
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildPopUpMenuCommonOptions(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, GUISUMOAbstractView *parent, const SumoXMLTag tag, const bool selected, const bool allowDelete, const bool addSeparator)
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
static void drawInnerPolygon(const GUIVisualizationSettings &s, const TesselatedPolygon *polygon, const GUIGlObject *o, const PositionVector shape, const double layer, const bool fill, const bool disableSelectionColor=false, const int alphaOverride=-1, const bool disableText=false)
draw inner Polygon (before pushName() )
static RGBColor setColor(const GUIVisualizationSettings &s, const SUMOPolygon *polygon, const GUIGlObject *o, bool disableSelectionColor, int alphaOverride)
set color
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.
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Stores the information about how to visualize structures.
bool checkDrawPoly(const Boundary &b, const bool selected) const
check if draw polygon
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
double scale
information about a lane's width (temporary, used for a single view)
GUIVisualizationTextSettings polyName
GUIVisualizationSizeSettings polySize
GUIVisualizationTextSettings polyType
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
double angle
The current view rotation angle.
static const std::vector< SumoXMLTag > polygons
polygon namespace
Static storage of an output device and its base (abstract) implementation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const ATTR_TYPE &attr, const T &val, const bool isNull=false, const bool escape=false)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
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.
Definition Position.h:37
static const Position INVALID
used to indicate that a position is valid
Definition Position.h:323
double x() const
Returns the x-position.
Definition Position.h:52
double y() const
Returns the y-position.
Definition Position.h:57
A list of positions.
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
int indexOfClosest(const Position &p, bool twoD=false) const
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition RGBColor.cpp:228
PositionVector myShape
The positions of the polygon.
bool myFill
Information whether the polygon has to be filled.
bool getFill() const
Returns whether the polygon is filled.
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
Definition Shape.cpp:99
void setShapeColor(const RGBColor &col)
Sets a new color.
Definition Shape.cpp:141
double getShapeLayer() const
Returns the layer of the Shape.
Definition Shape.cpp:111
const RGBColor & getShapeColor() const
Returns the color of the Shape.
Definition Shape.cpp:105
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)
std::vector< GLPrimitive > myTesselation
id of the display list for the cached tesselation
Definition GUIPolygon.h:79
static OutputDevice & writeParams(OutputDevice &device, const Parameterised &params)
write the parameters of the given object as param tags
unsigned weight
bool TAZDrawFill() const
check if toggle TAZ draw fill checkbox is enabled
bool showShapes() const
check if shapes has to be drawn
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
static void drawLockIcon(const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position position, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
bool editingElevation() const
check if we're editing elevation
bool showPolygonSymbols() const
check if draw polygon symbols
static const double segmentWidthSmall
width of small dotted contour segments
static const double segmentWidth
width of dotted contour segments
static const double segmentWidthLarge
width of large dotted contour segments
static const double polygonGeometryPointRadius
moving geometry point radius
static const double polygonContourWidth
polygon contour width
static const double polylineWidth
poly line width
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
bool show(const GUIGlObject *o) const
whether to show the text