Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GNECalibrator.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-2025 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// Calibrator over edge or lane
19/****************************************************************************/
20#include <config.h>
21
22#include <netedit/GNENet.h>
24#include <netedit/GNEUndoList.h>
25#include <netedit/GNEViewNet.h>
32
33#include "GNECalibrator.h"
34
35// ===========================================================================
36// member method definitions
37// ===========================================================================
38
40 GNEAdditional("", net, "", tag, ""),
41 myCalibratorContours(new std::vector<GNEContour*>()) {
42}
43
44
45GNECalibrator::GNECalibrator(const std::string& id, GNENet* net, const std::string& filename, GNEEdge* edge, double pos, SUMOTime frequency, const std::string& name,
46 const std::string& output, const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters) :
47 GNEAdditional(id, net, filename, SUMO_TAG_CALIBRATOR, name),
48 Parameterised(parameters),
49 myPositionOverLane(pos),
50 myFrequency(frequency),
51 myOutput(output),
52 myJamThreshold(jamThreshold),
53 myVTypes(vTypes),
54 myCalibratorContours(new std::vector<GNEContour*>()) {
55 // set parents
56 setParent<GNEEdge*>(edge);
57 // update centering boundary without updating grid
59}
60
61
62GNECalibrator::GNECalibrator(const std::string& id, GNENet* net, const std::string& filename, GNEEdge* edge, double pos, SUMOTime frequency, const std::string& name,
63 const std::string& output, GNEAdditional* routeProbe, const double jamThreshold, const std::vector<std::string>& vTypes,
64 const Parameterised::Map& parameters) :
65 GNEAdditional(id, net, filename, SUMO_TAG_CALIBRATOR, name),
66 Parameterised(parameters),
67 myPositionOverLane(pos),
68 myFrequency(frequency),
69 myOutput(output),
70 myJamThreshold(jamThreshold),
71 myVTypes(vTypes),
72 myCalibratorContours(new std::vector<GNEContour*>()) {
73 // set parents
74 setParent<GNEEdge*>(edge);
75 setParent<GNEAdditional*>(routeProbe);
76 // update centering boundary without updating grid
78}
79
80
81GNECalibrator::GNECalibrator(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane, double pos, SUMOTime frequency, const std::string& name,
82 const std::string& output, const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters) :
83 GNEAdditional(id, net, filename, GNE_TAG_CALIBRATOR_LANE, name),
84 Parameterised(parameters),
85 myPositionOverLane(pos),
86 myFrequency(frequency),
87 myOutput(output),
88 myJamThreshold(jamThreshold),
89 myVTypes(vTypes),
90 myCalibratorContours(new std::vector<GNEContour*>()) {
91 // set parents
92 setParent<GNELane*>(lane);
93 // update centering boundary without updating grid
95}
96
97
98GNECalibrator::GNECalibrator(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane, double pos, SUMOTime frequency, const std::string& name,
99 const std::string& output, GNEAdditional* routeProbe, const double jamThreshold, const std::vector<std::string>& vTypes,
100 const Parameterised::Map& parameters) :
101 GNEAdditional(id, net, filename, GNE_TAG_CALIBRATOR_LANE, name),
102 Parameterised(parameters),
103 myPositionOverLane(pos),
104 myFrequency(frequency),
105 myOutput(output),
106 myJamThreshold(jamThreshold),
107 myVTypes(vTypes),
108 myCalibratorContours(new std::vector<GNEContour*>()) {
109 // set parents
110 setParent<GNELane*>(lane);
111 setParent<GNEAdditional*>(routeProbe);
112 // update centering boundary without updating grid
114}
115
116
118 for (auto it = myCalibratorContours->begin(); it != myCalibratorContours->end(); it++) {
119 delete *it;
120 }
122}
123
124
125void
127 // open tag
129 // write parameters
130 device.writeAttr(SUMO_ATTR_ID, getID());
131 if (getParentEdges().size() > 0) {
132 device.writeAttr(SUMO_ATTR_EDGE, getParentEdges().front()->getID());
133 }
134 if (getParentLanes().size() > 0) {
135 device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID());
136 }
138 if (time2string(myFrequency) != "1.00") {
140 }
141 if (!myAdditionalName.empty()) {
143 }
144 if (!myOutput.empty()) {
146 }
147 if (getParentAdditionals().size() > 0) {
149 }
150 if (myJamThreshold != 0.5) {
152 }
153 if (myVTypes.size() > 0) {
155 }
156 // write calibrator flows
157 for (const auto& calibratorFlow : getChildAdditionals()) {
158 if (calibratorFlow->getTagProperty()->getTag() == GNE_TAG_CALIBRATOR_FLOW) {
159 calibratorFlow->writeAdditional(device);
160 }
161 }
162 // write parameters (Always after children to avoid problems with additionals.xsd)
163 writeParams(device);
164 device.closeTag();
165}
166
167
168bool
170 return true;
171}
172
173
174std::string
176 return "";
177}
178
179
180void
182 // nothing to fix
183}
184
185
188 // calibrators cannot be moved
189 return nullptr;
190}
191
192
193void
195 // get shape depending of we have a edge or a lane
196 if (getParentLanes().size() > 0) {
197 // update geometry
199 } else if (getParentEdges().size() > 0) {
200 // clear extra geometries and contours
201 if (getParentEdges().size() != myCalibratorContours->size()) {
202 for (auto it = myCalibratorContours->begin(); it != myCalibratorContours->end(); it++) {
203 delete *it;
204 }
205 myCalibratorContours->clear();
206 for (int i = 1; i < (int)getParentEdges().front()->getChildLanes().size(); i++) {
207 myCalibratorContours->push_back(new GNEContour());
208 }
209 }
211 // iterate over every lane and upadte geometries
212 for (const auto& lane : getParentEdges().front()->getChildLanes()) {
213 if (lane == getParentEdges().front()->getChildLanes().front()) {
215 } else {
216 // add new calibrator geometry
217 GUIGeometry calibratorGeometry;
218 calibratorGeometry.updateGeometry(lane->getLaneShape(), myPositionOverLane, 0);
219 myEdgeCalibratorGeometries.push_back(calibratorGeometry);
220 }
221 }
222 } else {
223 throw ProcessError(TL("Both edges and lanes aren't defined"));
224 }
225}
226
227
232
233
234void
235GNECalibrator::updateCenteringBoundary(const bool /*updateGrid*/) {
236 // nothing to update
237}
238
239
240void
241GNECalibrator::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* newElement, GNEUndoList* undoList) {
242 if (splitPosition < myPositionOverLane) {
243 // change lane or edge
244 if (newElement->getTagProperty()->getTag() == SUMO_TAG_LANE) {
245 setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
246 } else {
247 setAttribute(SUMO_ATTR_EDGE, newElement->getID(), undoList);
248 }
249 // now adjust start position
250 setAttribute(SUMO_ATTR_POSITION, toString(myPositionOverLane - splitPosition), undoList);
251 }
252}
253
254
255std::string
257 // get parent name depending of we have a edge or a lane
258 if (getParentLanes().size() > 0) {
259 return getParentLanes().front()->getID();
260 } else if (getParentEdges().size() > 0) {
261 return getParentEdges().front()->getChildLanes().at(0)->getID();
262 } else {
263 throw ProcessError(TL("Both myEdge and myLane aren't defined"));
264 }
265}
266
267
268void
270 const auto& inspectedElements = myNet->getViewNet()->getInspectedElements();
271 // first check if additional has to be drawn
273 // get values
274 const double exaggeration = getExaggeration(s);
275 // get detail level
276 const auto d = s.getDetailLevel(exaggeration);
277 // draw first calibrator symbols
278 drawCalibratorSymbol(s, d, exaggeration, myAdditionalGeometry.getShape().front(),
279 myAdditionalGeometry.getShapeRotations().front() + 90, -1);
280 // draw rest of calibrator symbols
281 for (int i = 0; i < (int)myEdgeCalibratorGeometries.size(); i++) {
282 drawCalibratorSymbol(s, d, exaggeration, myEdgeCalibratorGeometries.at(i).getShape().front(),
283 myEdgeCalibratorGeometries.at(i).getShapeRotations().front() + 90, i);
284 }
285 // draw additional ID
287 // iterate over additionals and check if drawn
288 for (const auto& calibratorFlow : getChildAdditionals()) {
289 // if calibrator is being inspected or selected, then draw
291 isAttributeCarrierSelected() || inspectedElements.isACInspected(this) ||
292 calibratorFlow->isAttributeCarrierSelected() || inspectedElements.isACInspected(calibratorFlow) ||
293 calibratorFlow->isMarkedForDrawingFront()) {
294 calibratorFlow->drawGL(s);
295 }
296 }
297 }
298}
299
300
301bool
303 // get edit modes
304 const auto& editModes = myNet->getViewNet()->getEditModes();
305 // check if we're in move mode
306 if (!myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
308 (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && myNet->getViewNet()->checkOverLockedElement(this, mySelected)) {
309 // only move the first element
311 } else {
312 return false;
313 }
314}
315
316
317void
319 // Open calibrator dialog
320 GNECalibratorDialog calibratorDialog(this);
321}
322
323
324std::string
326 switch (key) {
327 case SUMO_ATTR_ID:
328 return getMicrosimID();
329 case SUMO_ATTR_EDGE:
330 return getParentEdges().front()->getID();
331 case SUMO_ATTR_LANE:
332 return getParentLanes().front()->getID();
335 case SUMO_ATTR_PERIOD:
337 return time2string(myFrequency);
338 case SUMO_ATTR_NAME:
339 return myAdditionalName;
340 case SUMO_ATTR_OUTPUT:
341 return myOutput;
343 if (getParentAdditionals().size() > 0) {
344 return getParentAdditionals().front()->getID();
345 } else {
346 return "";
347 }
349 return toString(myJamThreshold);
350 case SUMO_ATTR_VTYPES:
351 return toString(myVTypes);
353 return "";
354 default:
355 return getCommonAttribute(this, key);
356 }
357}
358
359
360double
362 throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
363}
364
365
370
371
372void
373GNECalibrator::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
374 switch (key) {
375 case SUMO_ATTR_ID:
376 case SUMO_ATTR_EDGE:
377 case SUMO_ATTR_LANE:
379 case SUMO_ATTR_PERIOD:
381 case SUMO_ATTR_NAME:
382 case SUMO_ATTR_OUTPUT:
385 case SUMO_ATTR_VTYPES:
387 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
388 break;
389 default:
390 setCommonAttribute(key, value, undoList);
391 break;
392 }
393
394}
395
396
397bool
398GNECalibrator::isValid(SumoXMLAttr key, const std::string& value) {
399 switch (key) {
400 case SUMO_ATTR_ID:
402 case SUMO_ATTR_EDGE:
403 if (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr) {
404 return true;
405 } else {
406 return false;
407 }
408 case SUMO_ATTR_LANE:
409 if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) {
410 return true;
411 } else {
412 return false;
413 }
415 if (canParse<double>(value)) {
416 // obtain position and check if is valid
417 const double newPosition = parse<double>(value);
418 if (isTemplate()) {
419 return (newPosition >= 0);
420 }
421 // get shape
422 PositionVector shape = (getParentLanes().size() > 0) ? getParentLanes().front()->getLaneShape() : getParentEdges().front()->getChildLanes().at(0)->getLaneShape();
423 if ((newPosition < 0) || (newPosition > shape.length())) {
424 return false;
425 } else {
426 return true;
427 }
428 } else {
429 return false;
430 }
431 case SUMO_ATTR_PERIOD:
433 return canParse<SUMOTime>(value);
434 case SUMO_ATTR_NAME:
436 case SUMO_ATTR_OUTPUT:
439 if (value.empty()) {
440 return true;
441 } else {
442 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_ROUTEPROBE, value, false) != nullptr);
443 }
445 return canParse<double>(value) ? (parse<double>(value) >= 0) : false;
446 case SUMO_ATTR_VTYPES:
447 if (value.empty()) {
448 return true;
449 } else {
451 }
452 default:
453 return isCommonValid(key, value);
454 }
455}
456
457
458std::string
460 return getTagStr() + ": " + getID();
461}
462
463
464std::string
466 return getTagStr();
467}
468
469// ===========================================================================
470// private
471// ===========================================================================
472
473void
475 const Position& pos, const double rot, const int symbolIndex) const {
476 // draw geometry only if we'rent in drawForObjectUnderCursor mode
478 // push layer matrix
480 // translate to front
482 // translate to position
483 glTranslated(pos.x(), pos.y(), 0);
484 // rotate over lane
486 // scale
487 glScaled(exaggeration, exaggeration, 1);
488 // set drawing mode
489 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
490 // set color
492 // base
493 glBegin(GL_TRIANGLES);
494 glVertex2d(0 - s.additionalSettings.calibratorWidth, 0);
497 glVertex2d(0 + s.additionalSettings.calibratorWidth, 0);
498 glVertex2d(0 - s.additionalSettings.calibratorWidth, 0);
500 glEnd();
501 // draw text if isn't being drawn for selecting
503 // set color depending of selection status
505 // draw "C"
506 GLHelper::drawText("C", Position(0, 1.5), 0.1, 3, textColor, 180);
507 // draw "edge" or "lane "
508 if (getParentLanes().size() > 0) {
509 GLHelper::drawText("lane", Position(0, 3), .1, 1, textColor, 180);
510 } else if (getParentEdges().size() > 0) {
511 GLHelper::drawText("edge", Position(0, 3), .1, 1, textColor, 180);
512 } else {
513 throw ProcessError(TL("Both myEdge and myLane aren't defined"));
514 }
515 }
516 // pop layer matrix
518 // draw dotted contours
519 if (symbolIndex == -1) {
521 } else if (symbolIndex < (int)myCalibratorContours->size()) {
522 myCalibratorContours->at(symbolIndex)->drawDottedContours(s, d, this, s.dottedContourSettings.segmentWidth, true);
523 }
524 }
525 GUIGlObject* parentBoundary = nullptr;
526 if (getParentEdges().size() > 0) {
527 parentBoundary = getParentEdges().front();
528 } else if (getParentLanes().size() > 0) {
529 parentBoundary = getParentLanes().front();
530 }
531 // calculate dotted contour
532 if (symbolIndex == -1) {
535 exaggeration, parentBoundary);
536 } else if (symbolIndex < (int)myCalibratorContours->size()) {
537 myCalibratorContours->at(symbolIndex)->calculateContourRectangleShape(s, d, this, pos, s.additionalSettings.calibratorWidth,
539 exaggeration, parentBoundary);
540 }
541}
542
543void
544GNECalibrator::setAttribute(SumoXMLAttr key, const std::string& value) {
545 switch (key) {
546 case SUMO_ATTR_ID:
547 // update microsimID
548 setAdditionalID(value);
549 break;
550 case SUMO_ATTR_EDGE:
552 break;
553 case SUMO_ATTR_LANE:
555 break;
557 myPositionOverLane = parse<double>(value);
558 break;
559 case SUMO_ATTR_PERIOD:
561 myFrequency = parse<SUMOTime>(value);
562 break;
563 case SUMO_ATTR_NAME:
564 myAdditionalName = value;
565 break;
566 case SUMO_ATTR_OUTPUT:
567 myOutput = value;
568 break;
571 break;
573 myJamThreshold = parse<double>(value);
574 break;
575 case SUMO_ATTR_VTYPES:
576 myVTypes = parse<std::vector<std::string> >(value);
577 break;
580 break;
581 default:
582 setCommonAttribute(this, key, value);
583 break;
584 }
585}
586
587
588void
590 // nothing to do
591}
592
593
594void
595GNECalibrator::commitMoveShape(const GNEMoveResult& /*moveResult*/, GNEUndoList* /*undoList*/) {
596 // nothing to do
597}
598
599
600/****************************************************************************/
@ NETWORK_MOVE
mode for moving network elements
long long int SUMOTime
Definition GUI.h:36
@ GLO_CALIBRATOR
a calibrator
#define TL(string)
Definition MsgHandler.h:301
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:91
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_ROUTEPROBE
a routeprobe detector
@ GNE_TAG_CALIBRATOR_LANE
A calibrator placed over lane.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ GNE_TAG_CALIBRATOR_FLOW
a flow definition within in Calibrator
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_LANE
@ SUMO_ATTR_EDGE
@ SUMO_ATTR_JAM_DIST_THRESHOLD
@ SUMO_ATTR_ROUTEPROBE
@ SUMO_ATTR_VTYPES
@ SUMO_ATTR_NAME
@ SUMO_ATTR_PERIOD
@ SUMO_ATTR_FREQUENCY
@ SUMO_ATTR_OUTPUT
@ SUMO_ATTR_ID
@ SUMO_ATTR_POSITION
@ GNE_ATTR_SHIFTLANEINDEX
shift lane index (only used by elements over lanes)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
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 pushMatrix()
push matrix
Definition GLHelper.cpp:118
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
Definition GLHelper.cpp:748
bool isValidAdditionalID(const std::string &value) const
check if a new additional ID is valid
void replaceAdditionalParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace additional parent
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(...)
void replaceAdditionalParentEdges(const std::string &value)
replace additional parent edges
void drawAdditionalID(const GUIVisualizationSettings &s) const
draw additional ID
void replaceAdditionalParentLanes(const std::string &value)
replace additional parent lanes
void shiftLaneIndex()
shift lane index
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
std::string myAdditionalName
name of additional
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
bool mySelected
boolean to check if this AC is selected (more quickly as checking GUIGlObjectStorage)
std::string getCommonAttribute(const Parameterised *parameterised, SumoXMLAttr key) const
void setCommonAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
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
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * myNet
pointer to net
bool isCommonValid(SumoXMLAttr key, const std::string &value) const
Dialog for edit calibrators.
std::string getAttribute(SumoXMLAttr key) const
void drawCalibratorSymbol(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double exaggeration, const Position &pos, const double rot, const int symbolIndex) const
draw calibrator symbol
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void updateGeometry()
update pre-computed geometry information
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
Position getPositionInView() const
Returns position of additional in view.
const Parameterised::Map & getACParametersMap() const
get parameters map
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
double myJamThreshold
jamThreshold
std::string myOutput
output of calibrator
std::string getParentName() const
Returns the name of the parent object.
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
~GNECalibrator()
Destructor.
std::vector< GNEContour * > * myCalibratorContours
calibrator contours
SUMOTime myFrequency
Frequency of calibrator.
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
double myPositionOverLane
position over Lane
std::vector< std::string > myVTypes
vTypes
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
double getAttributeDouble(SumoXMLAttr key) const
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
bool checkDrawMoveContour() const
check if draw move contour (red)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
GNECalibrator(SumoXMLTag tag, GNENet *net)
Default constructor.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
GNEMoveOperation * getMoveOperation()
get move operation
void openAdditionalDialog()
open Calibrator Dialog
std::vector< GUIGeometry > myEdgeCalibratorGeometries
extra calibrator geometries
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
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...)
void calculateContourRectangleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, const double width, const double height, const double layer, const double offsetX, const double offsetY, const double rot, const double scale, const GUIGlObject *boundaryParent) const
calculate contour (for rectangled elements)
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
const GNEHierarchicalContainerParents< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const GNEHierarchicalContainerParents< GNEEdge * > & getParentEdges() const
get parent edges
const GNEHierarchicalContainerChildren< GNEAdditional * > & getChildAdditionals() const
return child additionals
const GNEHierarchicalContainerParents< GNELane * > & getParentLanes() const
get parent lanes
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
move operation
move result
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:146
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2194
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
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
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
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
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.
Stores the information about how to visualize structures.
bool checkDrawAdditional(Detail d, const bool selected) const
check if draw additionals
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
static const std::vector< SumoXMLTag > calibrators
calibrators namespace
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
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
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
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.
double length() const
Returns the length.
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
static const RGBColor BLACK
Definition RGBColor.h:196
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
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)
Definition json.hpp:4471
bool showAdditionals() const
check if additionals has to be drawn
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
bool showSubAdditionals() const
check if show sub-additionals
static const RGBColor calibratorColor
color for Calibrators
static const double calibratorWidth
Calibrator width.
static const double calibratorHeight
Calibrator height.
RGBColor selectionColor
basic selection color
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
static const double segmentWidth
width of dotted contour segments