Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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-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// Calibrator over edge or lane
19/****************************************************************************/
20#include <config.h>
21
23
26#include <netedit/GNENet.h>
27#include <netedit/GNEUndoList.h>
30
31#include "GNECalibrator.h"
32
33// ===========================================================================
34// member method definitions
35// ===========================================================================
36
38 GNEAdditional(net, tag),
39 myEdgeCalibratorContours(new std::vector<GNEContour*>()) {
40}
41
42
43GNECalibrator::GNECalibrator(const std::string& id, GNENet* net, FileBucket* fileBucket, GNEEdge* edge, double pos, SUMOTime frequency, const std::string& name,
44 const std::string& output, GNEAdditional* routeProbe, const double jamThreshold, const std::vector<std::string>& vTypes,
45 const Parameterised::Map& parameters) :
46 GNEAdditional(id, net, SUMO_TAG_CALIBRATOR, fileBucket, name),
47 Parameterised(parameters),
48 myPositionOverLane(pos),
49 myFrequency(frequency),
50 myOutput(output),
51 myJamThreshold(jamThreshold),
52 myVTypes(vTypes),
53 myEdgeCalibratorContours(new std::vector<GNEContour*>()) {
54 // set parents
55 setParent<GNEEdge*>(edge);
56 setParent<GNEAdditional*>(routeProbe);
57 // update centering boundary without updating grid
59}
60
61
62GNECalibrator::GNECalibrator(const std::string& id, GNENet* net, FileBucket* fileBucket, GNELane* lane, 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, GNE_TAG_CALIBRATOR_LANE, fileBucket, name),
66 Parameterised(parameters),
67 myPositionOverLane(pos),
68 myFrequency(frequency),
69 myOutput(output),
70 myJamThreshold(jamThreshold),
71 myVTypes(vTypes),
72 myEdgeCalibratorContours(new std::vector<GNEContour*>()) {
73 // set parents
74 setParent<GNELane*>(lane);
75 setParent<GNEAdditional*>(routeProbe);
76 // update centering boundary without updating grid
78}
79
80
82 for (auto it = myEdgeCalibratorContours->begin(); it != myEdgeCalibratorContours->end(); it++) {
83 delete *it;
84 }
86}
87
88
91 return nullptr;
92}
93
94
97 return this;
98}
99
100
101const Parameterised*
103 return this;
104}
105
106
107void
109 // open tag
111 // write common additional attributes
113 // write specific attributes
114 if (getParentEdges().size() > 0) {
115 device.writeAttr(SUMO_ATTR_EDGE, getParentEdges().front()->getID());
116 }
117 if (getParentLanes().size() > 0) {
118 device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID());
119 }
121 if (time2string(myFrequency) != "1.00") {
123 }
124 if (!myOutput.empty()) {
126 }
127 if (getParentAdditionals().at(0)) {
129 }
130 if (myJamThreshold != 0.5) {
132 }
133 if (myVTypes.size() > 0) {
135 }
136 // write calibrator flows
137 for (const auto& calibratorFlow : getChildAdditionals()) {
138 if (calibratorFlow->getTagProperty()->getTag() == GNE_TAG_CALIBRATOR_FLOW) {
139 calibratorFlow->writeAdditional(device);
140 }
141 }
142 // write parameters (Always after children to avoid problems with additionals.xsd)
143 XMLHelpers::writeParams(device, *this);
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
166void
168 // get shape depending of we have a edge or a lane
169 if (getParentLanes().size() > 0) {
170 // simply update geometry
172 } else if (getParentEdges().size() > 0) {
173 // clear all contours
174 for (auto it = myEdgeCalibratorContours->begin(); it != myEdgeCalibratorContours->end(); it++) {
175 delete *it;
176 }
177 // clear all edge geometries
180 // iterate over every lane and upadte geometries
181 for (const auto& lane : getParentEdges().front()->getChildLanes()) {
182 // this is needed for centering calibratorFlows as additional listed
183 if (lane == getParentEdges().front()->getChildLanes().front()) {
185 }
186 // add new calibrator geometry
187 GUIGeometry calibratorGeometry;
188 calibratorGeometry.updateGeometry(lane->getLaneShape(), myPositionOverLane, 0);
189 myEdgeCalibratorGeometries.push_back(calibratorGeometry);
190 // also add a new contour
191 myEdgeCalibratorContours->push_back(new GNEContour());
192 }
193 }
194 // update geometries of all children
195 for (const auto& rerouterElement : getChildAdditionals()) {
196 rerouterElement->updateGeometry();
197 }
198}
199
200
205
206
207void
208GNECalibrator::updateCenteringBoundary(const bool /*updateGrid*/) {
209 // nothing to update
210}
211
212
213void
214GNECalibrator::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* newElement, GNEUndoList* undoList) {
215 if (splitPosition < myPositionOverLane) {
216 // change lane or edge
217 if (newElement->getTagProperty()->getTag() == SUMO_TAG_LANE) {
218 setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
219 } else {
220 setAttribute(SUMO_ATTR_EDGE, newElement->getID(), undoList);
221 }
222 // now adjust start position
223 setAttribute(SUMO_ATTR_POSITION, toString(myPositionOverLane - splitPosition), undoList);
224 }
225}
226
227
228std::string
230 // get parent name depending of we have a edge or a lane
231 if (getParentLanes().size() > 0) {
232 return getParentLanes().front()->getID();
233 } else if (getParentEdges().size() > 0) {
234 return getParentEdges().front()->getChildLanes().at(0)->getID();
235 } else {
236 throw ProcessError(TL("Both myEdge and myLane aren't defined"));
237 }
238}
239
240
241void
243 const auto& inspectedElements = myNet->getViewNet()->getInspectedElements();
244 // first check if additional has to be drawn
246 // get values
247 const double exaggeration = getExaggeration(s);
248 // get detail level
249 const auto d = s.getDetailLevel(exaggeration);
250 if (myEdgeCalibratorGeometries.size() > 0) {
251 // draw all calibrator symbols
252 for (int i = 0; i < (int)myEdgeCalibratorGeometries.size(); i++) {
253 drawCalibratorSymbol(s, d, exaggeration, myEdgeCalibratorGeometries.at(i).getShape().front(),
254 myEdgeCalibratorGeometries.at(i).getShapeRotations().front(), i);
255 }
256 } else {
257 // draw single calibrator symbol
258 drawCalibratorSymbol(s, d, exaggeration, myAdditionalGeometry.getShape().front(),
260 }
261 // draw additional ID
263 // iterate over additionals and check if drawn
264 for (const auto& calibratorFlow : getChildAdditionals()) {
265 // if calibrator is being inspected or selected, then draw
267 isAttributeCarrierSelected() || inspectedElements.isACInspected(this) ||
268 calibratorFlow->isAttributeCarrierSelected() || inspectedElements.isACInspected(calibratorFlow) ||
269 calibratorFlow->isMarkedForDrawingFront()) {
270 calibratorFlow->drawGL(s);
271 }
272 }
273 }
274}
275
276
277bool
279 // get edit modes
280 const auto& editModes = myNet->getViewNet()->getEditModes();
281 // check if we're in move mode
282 if (!myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
284 (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && myNet->getViewNet()->checkOverLockedElement(this, mySelected)) {
285 // only move the first element
287 } else {
288 return false;
289 }
290}
291
292
293void
294GNECalibrator::openAdditionalDialog(FXWindow* /* restoringFocusWindow */) {
295 // Open calibrator dialog
296 GNECalibratorDialog calibratorDialog(this);
297}
298
299
300std::string
302 switch (key) {
303 case SUMO_ATTR_ID:
304 return getMicrosimID();
305 case SUMO_ATTR_EDGE:
306 return getParentEdges().front()->getID();
307 case SUMO_ATTR_LANE:
308 return getParentLanes().front()->getID();
311 case SUMO_ATTR_PERIOD:
313 return time2string(myFrequency);
314 case SUMO_ATTR_NAME:
315 return myAdditionalName;
316 case SUMO_ATTR_OUTPUT:
317 return myOutput;
319 if (isTemplate()) {
320 return myRouteProbeID;
321 } else if (getParentAdditionals().size() > 0) {
322 return getParentAdditionals().at(0)->getID();
323 } else {
324 return "";
325 }
327 return toString(myJamThreshold);
328 case SUMO_ATTR_VTYPES:
329 return toString(myVTypes);
331 return "";
332 default:
333 return getCommonAttribute(key);
334 }
335}
336
337
338double
342
343
348
349
354
355
356void
357GNECalibrator::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
358 switch (key) {
359 case SUMO_ATTR_ID:
360 case SUMO_ATTR_EDGE:
361 case SUMO_ATTR_LANE:
363 case SUMO_ATTR_PERIOD:
365 case SUMO_ATTR_NAME:
366 case SUMO_ATTR_OUTPUT:
369 case SUMO_ATTR_VTYPES:
371 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
372 break;
373 default:
374 setCommonAttribute(key, value, undoList);
375 break;
376 }
377
378}
379
380
381bool
382GNECalibrator::isValid(SumoXMLAttr key, const std::string& value) {
383 switch (key) {
384 case SUMO_ATTR_ID:
386 case SUMO_ATTR_EDGE:
387 if (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr) {
388 return true;
389 } else {
390 return false;
391 }
392 case SUMO_ATTR_LANE:
393 if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) {
394 return true;
395 } else {
396 return false;
397 }
399 if (canParse<double>(value)) {
400 // obtain position and check if is valid
401 const double newPosition = parse<double>(value);
402 if (isTemplate()) {
403 return (newPosition >= 0);
404 }
405 // get shape
406 PositionVector shape = (getParentLanes().size() > 0) ? getParentLanes().front()->getLaneShape() : getParentEdges().front()->getChildLanes().at(0)->getLaneShape();
407 if ((newPosition < 0) || (newPosition > shape.length())) {
408 return false;
409 } else {
410 return true;
411 }
412 } else {
413 return false;
414 }
415 case SUMO_ATTR_PERIOD:
417 return canParse<SUMOTime>(value) ? (parse<SUMOTime>(value) >= 0) : false;
418 case SUMO_ATTR_NAME:
419 return StringUtils::isValidAttribute(value);
420 case SUMO_ATTR_OUTPUT:
421 return StringUtils::isValidFilename(value);
423 if (value.empty()) {
424 return true;
425 } else {
426 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_ROUTEPROBE, value, false) != nullptr);
427 }
429 return canParse<double>(value) ? (parse<double>(value) >= 0) : false;
430 case SUMO_ATTR_VTYPES:
431 if (value.empty()) {
432 return true;
433 } else {
435 }
436 default:
437 return isCommonAttributeValid(key, value);
438 }
439}
440
441
442std::string
444 return getTagStr() + ": " + getID();
445}
446
447
448std::string
450 return getTagStr();
451}
452
453// ===========================================================================
454// private
455// ===========================================================================
456
457void
459 const Position& pos, const double rot, const int symbolIndex) const {
460 // draw geometry only if we'rent in drawForObjectUnderCursor mode
462 // push layer matrix
464 // translate to front
466 // translate to position
467 glTranslated(pos.x(), pos.y(), 0);
468 // rotate over lane
470 // scale
471 glScaled(exaggeration, exaggeration, 1);
472 // set drawing mode
473 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
474 // set color
476 // base
477 glBegin(GL_TRIANGLES);
478 glVertex2d(0 - s.additionalSettings.calibratorWidth, 0);
481 glVertex2d(0 + s.additionalSettings.calibratorWidth, 0);
482 glVertex2d(0 - s.additionalSettings.calibratorWidth, 0);
484 glEnd();
485 // draw text if isn't being drawn for selecting
487 // set color depending of selection status
489 // draw "C"
490 GLHelper::drawText("C", Position(0, 1.5), 0.1, 3, textColor, 180);
491 // draw "edge" or "lane "
492 if (getParentLanes().size() > 0) {
493 GLHelper::drawText("lane", Position(0, 3), .1, 1, textColor, 180);
494 } else if (getParentEdges().size() > 0) {
495 GLHelper::drawText("edge", Position(0, 3), .1, 1, textColor, 180);
496 } else {
497 throw ProcessError(TL("Both myEdge and myLane aren't defined"));
498 }
499 }
500 // pop layer matrix
502 // draw dotted contours
503 if (symbolIndex == -1) {
505 } else {
506 myEdgeCalibratorContours->at(symbolIndex)->drawDottedContours(s, d, this, s.dottedContourSettings.segmentWidth, true);
507 }
508 }
509 GUIGlObject* parentBoundary = nullptr;
510 if (getParentEdges().size() > 0) {
511 parentBoundary = getParentEdges().front();
512 } else if (getParentLanes().size() > 0) {
513 parentBoundary = getParentLanes().front();
514 }
515 // calculate dotted contour
516 if (symbolIndex == -1) {
519 exaggeration, parentBoundary);
520 } else {
521 if (symbolIndex == 0) {
524 exaggeration, parentBoundary);
525 }
526 myEdgeCalibratorContours->at(symbolIndex)->calculateContourRectangleShape(s, d, this, pos, s.additionalSettings.calibratorWidth,
528 exaggeration, parentBoundary);
529 }
530}
531
532void
533GNECalibrator::setAttribute(SumoXMLAttr key, const std::string& value) {
534 switch (key) {
535 case SUMO_ATTR_ID:
536 // update microsimID
537 setAdditionalID(value);
538 break;
539 case SUMO_ATTR_EDGE:
541 break;
542 case SUMO_ATTR_LANE:
544 break;
546 myPositionOverLane = parse<double>(value);
547 break;
548 case SUMO_ATTR_PERIOD:
550 myFrequency = parse<SUMOTime>(value);
551 break;
552 case SUMO_ATTR_NAME:
553 myAdditionalName = value;
554 break;
555 case SUMO_ATTR_OUTPUT:
556 myOutput = value;
557 break;
559 if (!isTemplate()) {
561 } else {
562 myRouteProbeID = value;
563 }
564 break;
566 myJamThreshold = parse<double>(value);
567 break;
568 case SUMO_ATTR_VTYPES:
569 myVTypes = parse<std::vector<std::string> >(value);
570 break;
573 break;
574 default:
575 setCommonAttribute(key, value);
576 break;
577 }
578}
579
580/****************************************************************************/
@ 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:316
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:107
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:57
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:742
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
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
std::string myAdditionalName
name of additional
void writeAdditionalAttributes(OutputDevice &device) const
write common additional attributes
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
double getCommonAttributeDouble(SumoXMLAttr key) const
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)
PositionVector getCommonAttributePositionVector(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
Position getCommonAttributePosition(SumoXMLAttr key) const
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * myNet
pointer to net
bool isCommonAttributeValid(SumoXMLAttr key, const std::string &value) const
std::string getCommonAttribute(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
bool isAdditionalValid() const override
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
std::string getParentName() const override
Returns the name of the parent object.
double myJamThreshold
jamThreshold
std::string myOutput
output of calibrator
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
void openAdditionalDialog(FXWindow *restoringFocusWindow) override
open Calibrator Dialog
std::vector< GNEContour * > * myEdgeCalibratorContours
edge calibrator contours
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this calibrator
double getAttributeDouble(SumoXMLAttr key) const override
~GNECalibrator()
Destructor.
SUMOTime myFrequency
Frequency of calibrator.
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
bool isValid(SumoXMLAttr key, const std::string &value) override
std::string getAttribute(SumoXMLAttr key) const override
double myPositionOverLane
position over Lane
std::vector< std::string > myVTypes
vTypes
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
bool checkDrawMoveContour() const override
check if draw move contour (red)
std::string myRouteProbeID
route probe ID (needed during creation)
Position getPositionInView() const override
Returns position of additional in view.
GNECalibrator(SumoXMLTag tag, GNENet *net)
Default constructor.
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
Position getAttributePosition(SumoXMLAttr key) const override
void updateGeometry() override
update pre-computed geometry information
Parameterised * getParameters() override
get parameters associated with this calibrator
std::vector< GUIGeometry > myEdgeCalibratorGeometries
edge 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)
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
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
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:174
GNEViewNet * getViewNet() const
get view net (used for simplify code)
Definition GNENet.cpp:144
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 & 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
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:212
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 isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
static OutputDevice & writeParams(OutputDevice &device, const Parameterised &params)
write the parameters of the given object as param tags
Definition json.hpp:5639
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