Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNENeteditAttributes.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// Modul for edit netedit attributes
19/****************************************************************************/
20
21#include <netedit/GNENet.h>
23#include <netedit/GNEViewNet.h>
29
31
32// ===========================================================================
33// FOX callback mapping
34// ===========================================================================
35
36FXDEFMAP(GNENeteditAttributes) NeteditAttributesMap[] = {
38 FXMAPFUNC(SEL_COMMAND, MID_HELP, GNENeteditAttributes::onCmdHelp)
39};
40
41// Object implementation
42FXIMPLEMENT(GNENeteditAttributes, MFXGroupBoxModule, NeteditAttributesMap, ARRAYNUMBER(NeteditAttributesMap))
43
44
45// ===========================================================================
46// method definitions
47// ===========================================================================
48
50 MFXGroupBoxModule(frameParent, TL("Netedit attributes")),
51 myFrameParent(frameParent),
52 myReferencePoint(ReferencePoint::LEFT) {
53 // fill reference points
54 myReferencePoints.push_back(std::make_pair(TL("Reference Left"), ReferencePoint::LEFT));
55 myReferencePoints.push_back(std::make_pair(TL("Reference Right"), ReferencePoint::RIGHT));
56 myReferencePoints.push_back(std::make_pair(TL("Center"), ReferencePoint::CENTER));
57 myReferencePoints.push_back(std::make_pair(TL("Extended Left"), ReferencePoint::EXTENDEDLEFT));
58 myReferencePoints.push_back(std::make_pair(TL("Extended Right"), ReferencePoint::EXTENDEDRIGHT));
59 myReferencePoints.push_back(std::make_pair(TL("Extended"), ReferencePoint::EXTENDED));
60 // Create FXListBox for the reference points and fill it
61 myReferencePointComboBox = new MFXComboBoxIcon(getCollapsableFrame(), GUIDesignComboBoxNCol, false, GUIDesignComboBoxVisibleItems,
63 for (const auto& referencePoint : myReferencePoints) {
64 myReferencePointComboBox->appendIconItem(referencePoint.first.c_str());
65 }
66 myReferencePointComboBox->setCurrentItem(0);
67 // Create Frame for Length Label and textField
68 myLengthFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
69 new FXLabel(myLengthFrame, toString(SUMO_ATTR_LENGTH).c_str(), 0, GUIDesignLabelThickedFixed(100));
70 myLengthTextField = new FXTextField(myLengthFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldRestricted(TEXTFIELD_REAL));
71 myLengthTextField->setText("10");
72 // Create Frame for force length
73 myForceLengthFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
74 new FXLabel(myForceLengthFrame, TL("Force leng."), 0, GUIDesignLabelThickedFixed(100));
75 myForceLengthCheckButton = new FXCheckButton(myForceLengthFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
76 // Create Frame for block close polygon and checkBox (By default disabled)
77 myCloseShapeFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
78 new FXLabel(myCloseShapeFrame, TL("Close shape"), 0, GUIDesignLabelThickedFixed(100));
79 myCloseShapeCheckButton = new FXCheckButton(myCloseShapeFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
80 // Create Frame for center element after creation (By default enabled)
81 myCenterViewAfterCreationFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
82 new FXLabel(myCenterViewAfterCreationFrame, TL("Center view"), 0, GUIDesignLabelThickedFixed(100));
83 myCenterViewAfterCreationButton = new FXCheckButton(myCenterViewAfterCreationFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
84 myCenterViewAfterCreationButton->setCheck(true);
85 // Create help button
86 GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Help"), "", "", 0, this, MID_HELP, GUIDesignButtonRectangular);
87}
88
89
91
92
93void
95 // we assume that frame will not be show
96 bool showFrame = false;
97 // check if length text field has to be showed
98 if (templateAC->getTagProperty()->canMaskStartEndPos()) {
99 myLengthFrame->show();
100 myForceLengthFrame->show();
102 showFrame = true;
103 } else {
104 myForceLengthFrame->hide();
105 myLengthFrame->hide();
107 }
108 // check if close shape check button has to be show
109 if (templateAC->getTagProperty()->canCloseShape()) {
110 myCloseShapeFrame->show();
111 showFrame = true;
112 } else {
113 myCloseShapeFrame->hide();
114 }
115 // check if center camera after creation check button has to be show
116 if (templateAC->getTagProperty()->canCenterCameraAfterCreation()) {
118 showFrame = true;
119 } else {
121 }
122 // if at least one element is show, show modul
123 if (showFrame) {
124 recalc();
125 show();
126 } else {
127 hide();
128 }
129}
130
131
132void
136
137
138bool
140 // check if we need to obtain a start and end position over an edge
141 if (myReferencePointComboBox->shown()) {
142 // declare error message
143 std::string errorMessage;
144 // get element length
145 const double elementLength = getElementLength();
146 // we need a valid lane to calculate position over lane
147 if (lane == nullptr) {
148 // stop creating element, but without showing error message
149 return false;
151 // write warning and stop
152 errorMessage = TL("Current selected reference point isn't valid");
153 myFrameParent->getViewNet()->setStatusBarText(errorMessage);
154 WRITE_WARNING(errorMessage);
155 return false;
156 } else if (elementLength == INVALID_DOUBLE) {
157 // write warning and stop
158 errorMessage = TL("Invalid length");
159 myFrameParent->getViewNet()->setStatusBarText(errorMessage);
160 WRITE_WARNING(errorMessage);
161 return false;
162 } else {
163 // Obtain position of the mouse over lane (limited over grid)
165 // get start and end positions
166 const double startPos = setStartPosition(mousePosOverLane, elementLength);
167 const double endPos = setEndPosition(mousePosOverLane, elementLength, lane->getLaneShape().length2D());
168 // check if force length
169 if (myForceLengthFrame->shown() && (myForceLengthCheckButton->getCheck() == TRUE) && (endPos - startPos) != elementLength) {
170 // write warning and stop
171 errorMessage = TL("Invalid position. Uncheck 'Force length' to create element with flexible length");
172 myFrameParent->getViewNet()->setStatusBarText(errorMessage);
173 WRITE_WARNING(errorMessage);
174 return false;
175 }
176 // set start and end position
177 baseObject->addDoubleAttribute(SUMO_ATTR_STARTPOS, startPos);
178 baseObject->addDoubleAttribute(SUMO_ATTR_ENDPOS, endPos);
179 }
180 }
181 // add close shape value if shape's element can be closed
182 if (myCloseShapeFrame->shown()) {
183 baseObject->addBoolAttribute(GNE_ATTR_CLOSE_SHAPE, myCloseShapeCheckButton->getCheck() == TRUE);
184 }
185 // add center element after creation
186 if (myCenterViewAfterCreationFrame->shown()) {
188 }
189 // all ok, then return true to continue creating element
190 return true;
191}
192
193
194void
196 // get element length
197 const double elementLength = getElementLength();
198 // check lane
199 if (lane && shown() && myReferencePointComboBox->shown() && (myReferencePoint != ReferencePoint::INVALID) &&
200 (elementLength != INVALID_DOUBLE)) {
201 // Obtain position of the mouse over lane (limited over grid)
203 // continue depending of mouse pos over lane
204 if (mousePosOverLane >= 0) {
205 // set start and end position
206 const double startPos = setStartPosition(mousePosOverLane, elementLength);
207 const double endPos = setEndPosition(mousePosOverLane, elementLength, lane->getLaneShape().length2D());
208 // get lane geometry
209 const auto laneShape = lane->getLaneGeometry().getShape();
210 // difference between start-end position and elementLength
211 const auto lengthDifference = (endPos - startPos) - elementLength;
212 // set color
213 RGBColor segmentColor;
214 // check if force length
215 if (myForceLengthFrame->shown() && (myForceLengthCheckButton->getCheck() == TRUE) && abs(lengthDifference) >= 0.1) {
216 segmentColor = RGBColor::RED;
217 } else {
218 segmentColor = RGBColor::ORANGE;
219 }
220 // declare geometries
221 GUIGeometry geometry;
222 // trim geomtry
223 geometry.updateGeometry(laneShape,
224 (startPos == INVALID_DOUBLE) ? -1 : startPos,
226 (endPos == INVALID_DOUBLE) ? -1 : endPos,
228 // push layer matrix
230 // translate to temporal shape layer
231 glTranslated(0, 0, GLO_TEMPORALSHAPE);
232 // set color
233 GLHelper::setColor(segmentColor);
234 // draw temporal edge
235 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 0.45);
236 // check if draw starPos
237 if (startPos != INVALID_DOUBLE) {
238 // cut start pos
239 geometry.updateGeometry(laneShape, startPos, Position::INVALID, startPos + 0.5, Position::INVALID);
240 // draw startPos
242 } else {
243 // push circle matrix
245 // translate to test layer, but under magenta square
246 glTranslated(laneShape.front().x(), laneShape.front().y(), 0);
247 // draw circle
249 // pop circle matrix
251 }
252 // check if draw endPos
253 if (endPos != INVALID_DOUBLE) {
254 // cut endPos
255 geometry.updateGeometry(laneShape, endPos - 0.5, Position::INVALID, endPos, Position::INVALID);
256 // draw endPos
258 } else {
259 // push circle matrix
261 // translate to test layer, but under magenta square
262 glTranslated(laneShape.back().x(), laneShape.back().y(), 0);
263 // draw circle
265 // pop circle matrix
267 }
268 // set color
269 GLHelper::setColor(segmentColor.changedBrightness(-32));
270 // translate to front
271 glTranslated(0, 0, 2);
272 // check if draw at end, or over circle
273 if (endPos == INVALID_DOUBLE) {
274 // cut endPos
275 geometry.updateGeometry(laneShape, laneShape.length() - 0.5, Position::INVALID, laneShape.length(), Position::INVALID);
276 // draw triangle at end
277 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, 0.3);
278 } else {
279 // draw triangle at end
280 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, -0.1);
281 }
282 // pop layer matrix
284 }
285 }
286}
287
288
289long
290GNENeteditAttributes::onCmdSetNeteditAttribute(FXObject* obj, FXSelector, void*) {
291 if (obj == myForceLengthCheckButton) {
292 if (myForceLengthCheckButton->getCheck()) {
293 myForceLengthCheckButton->setText(TL("true"));
294 } else {
295 myForceLengthCheckButton->setText(TL("false"));
296 }
297 } else if (obj == myCloseShapeCheckButton) {
298 if (myCloseShapeCheckButton->getCheck()) {
299 myCloseShapeCheckButton->setText(TL("true"));
300 } else {
301 myCloseShapeCheckButton->setText(TL("false"));
302 }
303 } else if (obj == myCenterViewAfterCreationButton) {
304 if (myCenterViewAfterCreationButton->getCheck()) {
305 myCenterViewAfterCreationButton->setText(TL("true"));
306 } else {
307 myCenterViewAfterCreationButton->setText(TL("false"));
308 }
309 } else if (obj == myLengthTextField) {
310 // change color of text field depending of the input length
312 myLengthTextField->setTextColor(FXRGB(0, 0, 0));
313 myLengthTextField->killFocus();
314 } else {
315 myLengthTextField->setTextColor(FXRGB(255, 0, 0));
316 }
317 // set background color
318 if (myLengthTextField->getText().empty()) {
319 myLengthTextField->setBackColor(FXRGBA(255, 213, 213, 255));
320 } else {
321 myLengthTextField->setBackColor(FXRGBA(255, 255, 255, 255));
322 }
323 // Update additional frame
324 update();
325 } else if (obj == myReferencePointComboBox) {
326 // iterate over all reference points
327 for (const auto& referencePoint : myReferencePoints) {
328 if (myReferencePointComboBox->getText().text() == referencePoint.first) {
329 // update reference point
330 myReferencePoint = referencePoint.second;
331 // update comboBox
332 myReferencePointComboBox->setTextColor(FXRGB(0, 0, 0));
333 myReferencePointComboBox->killFocus();
334 myReferencePointComboBox->setBackColor(FXRGBA(255, 255, 255, 255));
335 // enable text fierld
336 myLengthTextField->enable();
337 // check if show force length
341 myForceLengthFrame->show();
342 } else {
343 myForceLengthFrame->hide();
344 }
345 // recalf modul
346 recalc();
347 return 1;
348 }
349 }
350 // set invalid reference point
352 // update comboBox
353 myReferencePointComboBox->setTextColor(FXRGB(255, 0, 0));
354 // disable text field for length
355 myLengthTextField->disable();
356 // hide force length frame
357 myForceLengthFrame->hide();
358 // recalc modul
359 recalc();
360 // set background color
361 if (myReferencePointComboBox->getText().empty()) {
362 myReferencePointComboBox->setBackColor(FXRGBA(255, 213, 213, 255));
363 } else {
364 myReferencePointComboBox->setBackColor(FXRGBA(255, 255, 255, 255));
365 }
366 }
367 return 1;
368}
369
370
371long
372GNENeteditAttributes::onCmdHelp(FXObject*, FXSelector, void*) {
373 // Create dialog box
374 FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(getCollapsableFrame(), TL("Netedit Parameters Help"), GUIDesignDialogBox);
375 additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL));
376 // set help text
377 std::ostringstream help;
378 help
379 << TL("- Reference point: Mark the initial position of the additional element.") << "\n"
380 << TL(" Example: If you want to create a busStop with a length of 30 in the point 100 of the lane:") << "\n"
381 // references
382 << TL(" - Reference Left: will have startPos = 70 and endPos = 100.") << "\n"
383 << TL(" - Reference Right: will have startPos = 100 and endPos = 130.") << "\n"
384 << TL(" - Center: will have startPos = 85 and endPos = 115.") << "\n"
385 // extended
386 << TL(" - Extended Left: will have startPos = 85 and endPos until lane's length.") << "\n"
387 << TL(" - Extended Right: will have startPos from start and endPos = 115.") << "\n"
388 << TL(" - Extended: will have startPos from start and endPos until lane's length.") << "\n"
389 // other options
390 << TL("- Block movement: if is enabled, the created additional element will be blocked. i.e. cannot be moved with") << "\n"
391 << TL(" the mouse. This option can be modified inspecting element.") << "\n"
392 << TL("- Center view: if is enabled, view will be center over created element.");
393 // Create label with the help text
394 new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), 0, GUIDesignLabelFrameInformation);
395 // Create horizontal separator
396 new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
397 // Create frame for OK Button
398 FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
399 // Create Button Close (And two more horizontal frames to center it)
400 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
401 GUIDesigns::buildFXButton(myHorizontalFrameOKButton, TL("OK"), "", TL("close"), GUIIconSubSys::getIcon(GUIIcon::ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
402 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
403 // create Dialog
404 additionalNeteditAttributesHelpDialog->create();
405 // show in the given position
406 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
407 // refresh APP
408 getApp()->refresh();
409 // open as modal dialog (will block all windows until stop() or stopModal() is called)
410 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
411 return 1;
412}
413
414
415double
417 if (GNEAttributeCarrier::canParse<double>(myLengthTextField->getText().text())) {
418 const double elementLength = GNEAttributeCarrier::parse<double>(myLengthTextField->getText().text());
419 if (elementLength > 0) {
420 return elementLength;
421 } else {
422 return INVALID_DOUBLE;
423 }
424 } else {
425 return INVALID_DOUBLE;
426 }
427}
428
429
430double
431GNENeteditAttributes::setStartPosition(const double mouseOverLanePos, double elementLength) const {
432 switch (myReferencePoint) {
434 return mouseOverLanePos;
436 if ((mouseOverLanePos - elementLength) <= 0) {
437 return INVALID_DOUBLE;
438 } else {
439 return mouseOverLanePos - elementLength;
440 }
442 if ((mouseOverLanePos - (elementLength * 0.5)) <= 0) {
443 return INVALID_DOUBLE;
444 } else {
445 return mouseOverLanePos - (elementLength * 0.5);
446 }
448 return INVALID_DOUBLE;
450 return mouseOverLanePos;
452 return INVALID_DOUBLE;
453 default:
454 throw InvalidArgument("Reference Point invalid");
455 }
456}
457
458
459double
460GNENeteditAttributes::setEndPosition(const double mouseOverLanePos, double elementLength, const double laneLength) const {
461 switch (myReferencePoint) {
463 if ((mouseOverLanePos + elementLength) >= laneLength) {
464 return INVALID_DOUBLE;
465 } else {
466 return mouseOverLanePos + elementLength;
467 }
469 return mouseOverLanePos;
471 if ((mouseOverLanePos + (elementLength * 0.5)) >= laneLength) {
472 return INVALID_DOUBLE;
473 } else {
474 return mouseOverLanePos + (elementLength * 0.5);
475 }
477 return mouseOverLanePos;
479 return INVALID_DOUBLE;
481 return INVALID_DOUBLE;
482 default:
483 throw InvalidArgument("Reference Point invalid");
484 }
485}
486
487/****************************************************************************/
FXDEFMAP(GNENeteditAttributes) NeteditAttributesMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition GUIAppEnum.h:939
@ MID_HELP
help button
Definition GUIAppEnum.h:653
#define GUIDesignComboBox
Definition GUIDesigns.h:293
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition GUIDesigns.h:311
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:399
#define GUIDesignDialogBox
Definition GUIDesigns.h:599
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
Definition GUIDesigns.h:94
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:74
#define GUIDesignButtonOK
Definition GUIDesigns.h:153
#define GUIDesignComboBoxVisibleItems
Definition GUIDesigns.h:49
#define GUIDesignCheckButton
checkButton placed in left position
Definition GUIDesigns.h:192
#define GUIDesignTextFieldRestricted(type)
text field extended over Frame with thick frame (int)
Definition GUIDesigns.h:62
#define GUIDesignHorizontalSeparator
Definition GUIDesigns.h:463
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition GUIDesigns.h:252
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:279
@ GLO_TEMPORALSHAPE
temporal shape (used in netedit)
@ MODEADDITIONAL
#define WRITE_WARNING(msg)
Definition MsgHandler.h:283
#define TL(string)
Definition MsgHandler.h:301
@ LEFT
At the leftmost side of the lane.
@ SUMO_ATTR_STARTPOS
@ GNE_ATTR_CENTER_AFTER_CREATION
flag to center camera after element creation
@ SUMO_ATTR_ENDPOS
@ GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
@ SUMO_ATTR_LENGTH
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:64
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth, const double extraOffset=0)
Draws a triangle at the end of the given line.
Definition GLHelper.cpp:624
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
Definition GLHelper.cpp:564
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:153
GUIVisualizationSettings::Detail getDetail() const
get detail
Definition GNELane.cpp:141
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:211
double getLengthGeometryFactor() const
get length geometry factor
Definition GNELane.cpp:1962
const DrawingConstants * getDrawingConstants() const
get lane drawing constants (previously calculated in drawGL())
Definition GNELane.cpp:233
const GUIGeometry & getLaneGeometry() const
get lane geometry
Definition GNELane.cpp:205
FXHorizontalFrame * myLengthFrame
horizontal frame for length
FXHorizontalFrame * myCenterViewAfterCreationFrame
horizontal frame for center view after creation frame
void drawLaneReference(const GNELane *lane) const
draw lane reference
double getElementLength() const
get element length
double setEndPosition(const double mouseOverLanePos, double elementLength, const double laneLength) const
return the end position
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
Called when user changes some element of GNENeteditAttributes.
double setStartPosition(const double mouseOverLanePos, double elementLength) const
return the start position
ReferencePoint myReferencePoint
current reference point
MFXComboBoxIcon * myReferencePointComboBox
match box with the list of reference points
FXHorizontalFrame * myForceLengthFrame
horizontal frame for force length
long onCmdHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
std::vector< std::pair< std::string, ReferencePoint > > myReferencePoints
map with all references
FXTextField * myLengthTextField
textField for length
FXCheckButton * myCenterViewAfterCreationButton
checkbox to enable/disable center element after creation
void showNeteditAttributesModule(GNEAttributeCarrier *templateAC)
show Netedit attributes modul
FXCheckButton * myForceLengthCheckButton
checkbox to enable/disable force length
FXHorizontalFrame * myCloseShapeFrame
horizontal frame for close polygon
void hideNeteditAttributesModule()
hide Netedit attributes modul
FXCheckButton * myCloseShapeCheckButton
checkbox to enable/disable close polygon
bool getNeteditAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, const GNELane *lane) const
fill valuesMap with netedit attributes
GNEFrame * myFrameParent
pointer to frame parent
bool canMaskStartEndPos() const
return true if tag correspond to an element that can mask the attributes "start" and "end" position a...
bool canCenterCameraAfterCreation() const
return true if tag correspond to an element that center camera after creation
bool canCloseShape() const
return true if tag correspond to an element that can close their shape
void setStatusBarText(const std::string &text)
set statusBar text
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
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
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
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.
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
ComboBox with icon.
void setBackColor(FXColor clr)
Set window background color.
FXString getText() const
Get the text.
void setTextColor(FXColor clr)
Change text color.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
double length() const
Computes the length of the given vector.
Definition Position.h:169
static const Position INVALID
used to indicate that a position is valid
Definition Position.h:319
double length2D() const
Returns the length.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
static const RGBColor ORANGE
Definition RGBColor.h:191
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition RGBColor.cpp:200
static const RGBColor RED
named colors
Definition RGBColor.h:185