51 myFrameParent(frameParent),
52 myCurrentLengthValid(true),
56 myReferencePointMatchBox->appendItem(
TL(
"reference left"));
57 myReferencePointMatchBox->appendItem(
TL(
"reference right"));
58 myReferencePointMatchBox->appendItem(
TL(
"reference center"));
63 myLengthTextField->setText(
"10");
72 myCenterViewAfterCreationButton->setCheck(
true);
76 myReferencePointMatchBox->setNumVisible((
int)myReferencePointMatchBox->getNumItems());
86 bool showFrame =
false;
131 if (lane ==
nullptr) {
138 std::string errorMessage =
TL(
"Current selected reference point isn't valid");
145 double length = GNEAttributeCarrier::parse<double>(
myLengthTextField->getText().text());
183 if (GNEAttributeCarrier::canParse<double>(
myLengthTextField->getText().text()) &&
229 std::ostringstream help;
231 <<
TL(
"- Reference point: Mark the initial position of the additional element.") <<
"\n"
232 <<
TL(
" Example: If you want to create a busStop with a length of 30 in the point 100 of the lane:") <<
"\n"
233 <<
TL(
" - Reference Left will create it with startPos = 70 and endPos = 100.") <<
"\n"
234 <<
TL(
" - Reference Right will create it with startPos = 100 and endPos = 130.") <<
"\n"
235 <<
TL(
" - Reference Center will create it with startPos = 85 and endPos = 115.") <<
"\n"
236 <<
TL(
"- Block movement: if is enabled, the created additional element will be blocked. i.e. cannot be moved with") <<
"\n"
237 <<
TL(
" the mouse. This option can be modified inspecting element.") <<
"\n"
238 <<
TL(
"- Center view: if is enabled, view will be center over created element.");
250 WRITE_DEBUG(
"Opening GNENeteditAttributes help dialog");
252 additionalNeteditAttributesHelpDialog->create();
254 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
258 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
260 WRITE_DEBUG(
"Closing GNENeteditAttributes help dialog");
269 return positionOfTheMouseOverLane;
271 return positionOfTheMouseOverLane - lengthOfAdditional;
273 return positionOfTheMouseOverLane - lengthOfAdditional / 2;
284 return positionOfTheMouseOverLane + lengthOfAdditional;
286 return positionOfTheMouseOverLane;
288 return positionOfTheMouseOverLane + lengthOfAdditional / 2;
FXDEFMAP(GNENeteditAttributes) NeteditAttributesMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
#define GUIDesignComboBox
#define GUIDesignComboBoxNCol
number of column of every combo box
#define GUIDesignTextField
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignDialogBox
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
#define GUIDesignTextFieldNCol
Num of column of text field.
#define GUIDesignButtonOK
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignHorizontalSeparator
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
@ LEFT
At the leftmost side of the lane.
@ GNE_ATTR_CENTER_AFTER_CREATION
flag to center camera after element creation
@ GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNEViewNet * getViewNet() const
get view net
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const PositionVector & getLaneShape() const
get elements shape
double getLengthGeometryFactor() const
get length geometry factor
FXHorizontalFrame * myLengthFrame
horizontal frame for length
FXHorizontalFrame * myCenterViewAfterCreationFrame
horizontal frame for center view after creation frame
double setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the End position values of StoppingPlaces and E2 detector over the lane
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
double setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the Start position values of StoppingPlaces and E2 detector over the lane
AdditionalReferencePoint myActualAdditionalReferencePoint
actual additional reference point selected in the match Box
FXComboBox * myReferencePointMatchBox
match box with the list of reference points
long onCmdHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
bool myCurrentLengthValid
Flag to check if current length is valid.
FXTextField * myLengthTextField
textField for length
FXCheckButton * myCenterViewAfterCreationButton
checkbox to enable/disable center element after creation
void showNeteditAttributesModule(GNEAttributeCarrier *templateAC)
show Netedit attributes modul
FXHorizontalFrame * myCloseShapeFrame
horizontal frame for close polygon
~GNENeteditAttributes()
destructor
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
AdditionalReferencePoint
list of the reference points
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 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.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D