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
24#include <netedit/GNENet.h>
25#include <netedit/GNEUndoList.h>
28
29#include "GNECalibrator.h"
30
31// ===========================================================================
32// member method definitions
33// ===========================================================================
34
36 GNEAdditional(net, tag),
37 myEdgeCalibratorContours(new std::vector<GNEContour*>()) {
38}
39
40
41GNECalibrator::GNECalibrator(const std::string& id, GNENet* net, FileBucket* fileBucket, GNEEdge* edge, double pos, SUMOTime frequency, const std::string& name,
42 const std::string& output, GNEAdditional* routeProbe, const double jamThreshold, const std::vector<std::string>& vTypes,
43 const Parameterised::Map& parameters) :
44 GNEAdditional(id, net, SUMO_TAG_CALIBRATOR, fileBucket, name),
45 Parameterised(parameters),
46 myPositionOverLane(pos),
47 myFrequency(frequency),
48 myOutput(output),
49 myJamThreshold(jamThreshold),
50 myVTypes(vTypes),
51 myEdgeCalibratorContours(new std::vector<GNEContour*>()) {
52 // set parents
53 setParent<GNEEdge*>(edge);
54 setParent<GNEAdditional*>(routeProbe);
55 // update centering boundary without updating grid
57}
58
59
60GNECalibrator::GNECalibrator(const std::string& id, GNENet* net, FileBucket* fileBucket, GNELane* lane, double pos, SUMOTime frequency, const std::string& name,
61 const std::string& output, GNEAdditional* routeProbe, const double jamThreshold, const std::vector<std::string>& vTypes,
62 const Parameterised::Map& parameters) :
63 GNEAdditional(id, net, GNE_TAG_CALIBRATOR_LANE, fileBucket, name),
64 Parameterised(parameters),
65 myPositionOverLane(pos),
66 myFrequency(frequency),
67 myOutput(output),
68 myJamThreshold(jamThreshold),
69 myVTypes(vTypes),
70 myEdgeCalibratorContours(new std::vector<GNEContour*>()) {
71 // set parents
72 setParent<GNELane*>(lane);
73 setParent<GNEAdditional*>(routeProbe);
74 // update centering boundary without updating grid
76}
77
78
80 for (auto it = myEdgeCalibratorContours->begin(); it != myEdgeCalibratorContours->end(); it++) {
81 delete *it;
82 }
84}
85
86
89 return nullptr;
90}
91
92
95 return this;
96}
97
98
99const Parameterised*
101 return this;
102}
103
104
105void
107 // open tag
109 // write common additional attributes
111 // write specific attributes
112 if (getParentEdges().size() > 0) {
113 device.writeAttr(SUMO_ATTR_EDGE, getParentEdges().front()->getID());
114 }
115 if (getParentLanes().size() > 0) {
116 device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID());
117 }
119 if (time2string(myFrequency) != "1.00") {
121 }
122 if (!myOutput.empty()) {
124 }
125 if (getParentAdditionals().at(0)) {
127 }
128 if (myJamThreshold != 0.5) {
130 }
131 if (myVTypes.size() > 0) {
133 }
134 // write calibrator flows
135 for (const auto& calibratorFlow : getChildAdditionals()) {
136 if (calibratorFlow->getTagProperty()->getTag() == GNE_TAG_CALIBRATOR_FLOW) {
137 calibratorFlow->writeAdditional(device);
138 }
139 }
140 // write parameters (Always after children to avoid problems with additionals.xsd)
141 writeParams(device);
142 device.closeTag();
143}
144
145
146bool
148 return true;
149}
150
151
152std::string
154 return "";
155}
156
157
158void
160 // nothing to fix
161}
162
163
164void
166 // get shape depending of we have a edge or a lane
167 if (getParentLanes().size() > 0) {
168 // simply update geometry
170 } else if (getParentEdges().size() > 0) {
171 // clear all contours
172 for (auto it = myEdgeCalibratorContours->begin(); it != myEdgeCalibratorContours->end(); it++) {
173 delete *it;
174 }
175 // clear all edge geometries
178 // iterate over every lane and upadte geometries
179 for (const auto& lane : getParentEdges().front()->getChildLanes()) {
180 // this is needed for centering calibratorFlows as additional listed
181 if (lane == getParentEdges().front()->getChildLanes().front()) {
183 }
184 // add new calibrator geometry
185 GUIGeometry calibratorGeometry;
186 calibratorGeometry.updateGeometry(lane->getLaneShape(), myPositionOverLane, 0);
187 myEdgeCalibratorGeometries.push_back(calibratorGeometry);
188 // also add a new contour
189 myEdgeCalibratorContours->push_back(new GNEContour());
190 }
191 }
192 // update geometries of all children
193 for (const auto& rerouterElement : getChildAdditionals()) {
194 rerouterElement->updateGeometry();
195 }
196}
197
198
203
204
205void
206GNECalibrator::updateCenteringBoundary(const bool /*updateGrid*/) {
207 // nothing to update
208}
209
210
211void
212GNECalibrator::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* newElement, GNEUndoList* undoList) {
213 if (splitPosition < myPositionOverLane) {
214 // change lane or edge
215 if (newElement->getTagProperty()->getTag() == SUMO_TAG_LANE) {
216 setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
217 } else {
218 setAttribute(SUMO_ATTR_EDGE, newElement->getID(), undoList);
219 }
220 // now adjust start position
221 setAttribute(SUMO_ATTR_POSITION, toString(myPositionOverLane - splitPosition), undoList);
222 }
223}
224
225
226std::string
228 // get parent name depending of we have a edge or a lane
229 if (getParentLanes().size() > 0) {
230 return getParentLanes().front()->getID();
231 } else if (getParentEdges().size() > 0) {
232 return getParentEdges().front()->getChildLanes().at(0)->getID();
233 } else {
234 throw ProcessError(TL("Both myEdge and myLane aren't defined"));
235 }
236}
237
238
239void
241 const auto& inspectedElements = myNet->getViewNet()->getInspectedElements();
242 // first check if additional has to be drawn
244 // get values
245 const double exaggeration = getExaggeration(s);
246 // get detail level
247 const auto d = s.getDetailLevel(exaggeration);
248 if (myEdgeCalibratorGeometries.size() > 0) {
249 // draw all calibrator symbols
250 for (int i = 0; i < (int)myEdgeCalibratorGeometries.size(); i++) {
251 drawCalibratorSymbol(s, d, exaggeration, myEdgeCalibratorGeometries.at(i).getShape().front(),
252 myEdgeCalibratorGeometries.at(i).getShapeRotations().front(), i);
253 }
254 } else {
255 // draw single calibrator symbol
256 drawCalibratorSymbol(s, d, exaggeration, myAdditionalGeometry.getShape().front(),
258 }
259 // draw additional ID
261 // iterate over additionals and check if drawn
262 for (const auto& calibratorFlow : getChildAdditionals()) {
263 // if calibrator is being inspected or selected, then draw
265 isAttributeCarrierSelected() || inspectedElements.isACInspected(this) ||
266 calibratorFlow->isAttributeCarrierSelected() || inspectedElements.isACInspected(calibratorFlow) ||
267 calibratorFlow->isMarkedForDrawingFront()) {
268 calibratorFlow->drawGL(s);
269 }
270 }
271 }
272}
273
274
275bool
277 // get edit modes
278 const auto& editModes = myNet->getViewNet()->getEditModes();
279 // check if we're in move mode
280 if (!myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
282 (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && myNet->getViewNet()->checkOverLockedElement(this, mySelected)) {
283 // only move the first element
285 } else {
286 return false;
287 }
288}
289
290
291void
292GNECalibrator::openAdditionalDialog(FXWindow* /* restoringFocusWindow */) {
293 // Open calibrator dialog
294 GNECalibratorDialog calibratorDialog(this);
295}
296
297
298std::string
300 switch (key) {
301 case SUMO_ATTR_ID:
302 return getMicrosimID();
303 case SUMO_ATTR_EDGE:
304 return getParentEdges().front()->getID();
305 case SUMO_ATTR_LANE:
306 return getParentLanes().front()->getID();
309 case SUMO_ATTR_PERIOD:
311 return time2string(myFrequency);
312 case SUMO_ATTR_NAME:
313 return myAdditionalName;
314 case SUMO_ATTR_OUTPUT:
315 return myOutput;
317 if (isTemplate()) {
318 return myRouteProbeID;
319 } else if (getParentAdditionals().size() > 0) {
320 return getParentAdditionals().at(0)->getID();
321 } else {
322 return "";
323 }
325 return toString(myJamThreshold);
326 case SUMO_ATTR_VTYPES:
327 return toString(myVTypes);
329 return "";
330 default:
331 return getCommonAttribute(key);
332 }
333}
334
335
336double
340
341
346
347
352
353
354void
355GNECalibrator::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
356 switch (key) {
357 case SUMO_ATTR_ID:
358 case SUMO_ATTR_EDGE:
359 case SUMO_ATTR_LANE:
361 case SUMO_ATTR_PERIOD:
363 case SUMO_ATTR_NAME:
364 case SUMO_ATTR_OUTPUT:
367 case SUMO_ATTR_VTYPES:
369 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
370 break;
371 default:
372 setCommonAttribute(key, value, undoList);
373 break;
374 }
375
376}
377
378
379bool
380GNECalibrator::isValid(SumoXMLAttr key, const std::string& value) {
381 switch (key) {
382 case SUMO_ATTR_ID:
384 case SUMO_ATTR_EDGE:
385 if (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr) {
386 return true;
387 } else {
388 return false;
389 }
390 case SUMO_ATTR_LANE:
391 if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) {
392 return true;
393 } else {
394 return false;
395 }
397 if (canParse<double>(value)) {
398 // obtain position and check if is valid
399 const double newPosition = parse<double>(value);
400 if (isTemplate()) {
401 return (newPosition >= 0);
402 }
403 // get shape
404 PositionVector shape = (getParentLanes().size() > 0) ? getParentLanes().front()->getLaneShape() : getParentEdges().front()->getChildLanes().at(0)->getLaneShape();
405 if ((newPosition < 0) || (newPosition > shape.length())) {
406 return false;
407 } else {
408 return true;
409 }
410 } else {
411 return false;
412 }
413 case SUMO_ATTR_PERIOD:
415 return canParse<SUMOTime>(value) ? (parse<SUMOTime>(value) >= 0) : false;
416 case SUMO_ATTR_NAME:
418 case SUMO_ATTR_OUTPUT:
421 if (value.empty()) {
422 return true;
423 } else {
424 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_ROUTEPROBE, value, false) != nullptr);
425 }
427 return canParse<double>(value) ? (parse<double>(value) >= 0) : false;
428 case SUMO_ATTR_VTYPES:
429 if (value.empty()) {
430 return true;
431 } else {
433 }
434 default:
435 return isCommonAttributeValid(key, value);
436 }
437}
438
439
440std::string
442 return getTagStr() + ": " + getID();
443}
444
445
446std::string
448 return getTagStr();
449}
450
451// ===========================================================================
452// private
453// ===========================================================================
454
455void
457 const Position& pos, const double rot, const int symbolIndex) const {
458 // draw geometry only if we'rent in drawForObjectUnderCursor mode
460 // push layer matrix
462 // translate to front
464 // translate to position
465 glTranslated(pos.x(), pos.y(), 0);
466 // rotate over lane
468 // scale
469 glScaled(exaggeration, exaggeration, 1);
470 // set drawing mode
471 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
472 // set color
474 // base
475 glBegin(GL_TRIANGLES);
476 glVertex2d(0 - s.additionalSettings.calibratorWidth, 0);
479 glVertex2d(0 + s.additionalSettings.calibratorWidth, 0);
480 glVertex2d(0 - s.additionalSettings.calibratorWidth, 0);
482 glEnd();
483 // draw text if isn't being drawn for selecting
485 // set color depending of selection status
487 // draw "C"
488 GLHelper::drawText("C", Position(0, 1.5), 0.1, 3, textColor, 180);
489 // draw "edge" or "lane "
490 if (getParentLanes().size() > 0) {
491 GLHelper::drawText("lane", Position(0, 3), .1, 1, textColor, 180);
492 } else if (getParentEdges().size() > 0) {
493 GLHelper::drawText("edge", Position(0, 3), .1, 1, textColor, 180);
494 } else {
495 throw ProcessError(TL("Both myEdge and myLane aren't defined"));
496 }
497 }
498 // pop layer matrix
500 // draw dotted contours
501 if (symbolIndex == -1) {
503 } else {
504 myEdgeCalibratorContours->at(symbolIndex)->drawDottedContours(s, d, this, s.dottedContourSettings.segmentWidth, true);
505 }
506 }
507 GUIGlObject* parentBoundary = nullptr;
508 if (getParentEdges().size() > 0) {
509 parentBoundary = getParentEdges().front();
510 } else if (getParentLanes().size() > 0) {
511 parentBoundary = getParentLanes().front();
512 }
513 // calculate dotted contour
514 if (symbolIndex == -1) {
517 exaggeration, parentBoundary);
518 } else {
519 if (symbolIndex == 0) {
522 exaggeration, parentBoundary);
523 }
524 myEdgeCalibratorContours->at(symbolIndex)->calculateContourRectangleShape(s, d, this, pos, s.additionalSettings.calibratorWidth,
526 exaggeration, parentBoundary);
527 }
528}
529
530void
531GNECalibrator::setAttribute(SumoXMLAttr key, const std::string& value) {
532 switch (key) {
533 case SUMO_ATTR_ID:
534 // update microsimID
535 setAdditionalID(value);
536 break;
537 case SUMO_ATTR_EDGE:
539 break;
540 case SUMO_ATTR_LANE:
542 break;
544 myPositionOverLane = parse<double>(value);
545 break;
546 case SUMO_ATTR_PERIOD:
548 myFrequency = parse<SUMOTime>(value);
549 break;
550 case SUMO_ATTR_NAME:
551 myAdditionalName = value;
552 break;
553 case SUMO_ATTR_OUTPUT:
554 myOutput = value;
555 break;
557 if (!isTemplate()) {
559 } else {
560 myRouteProbeID = value;
561 }
562 break;
564 myJamThreshold = parse<double>(value);
565 break;
566 case SUMO_ATTR_VTYPES:
567 myVTypes = parse<std::vector<std::string> >(value);
568 break;
571 break;
572 default:
573 setCommonAttribute(key, value);
574 break;
575 }
576}
577
578/****************************************************************************/
@ 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:304
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:49
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
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:206
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