50 myFrameParent(frameParent),
51 myCurrentLengthValid(true),
55 myReferencePointMatchBox->appendItem(
"reference left");
56 myReferencePointMatchBox->appendItem(
"reference right");
57 myReferencePointMatchBox->appendItem(
"reference center");
62 myLengthTextField->setText(
"10");
71 myCenterViewAfterCreationButton->setCheck(
true);
75 myReferencePointMatchBox->setNumVisible((
int)myReferencePointMatchBox->getNumItems());
85 bool showFrame =
false;
130 if (lane ==
nullptr) {
137 std::string errorMessage =
"Current selected reference point isn't valid";
144 double length = GNEAttributeCarrier::parse<double>(
myLengthTextField->getText().text());
182 if (GNEAttributeCarrier::canParse<double>(
myLengthTextField->getText().text()) &&
228 std::ostringstream help;
230 <<
TL(
"- Reference point: Mark the initial position of the additional element.\n")
231 <<
TL(
" Example: If you want to create a busStop with a length of 30 in the point 100 of the lane:\n")
232 <<
TL(
" - Reference Left will create it with startPos = 70 and endPos = 100.\n")
233 <<
TL(
" - Reference Right will create it with startPos = 100 and endPos = 130.\n")
234 <<
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 <<
" 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");
281 return positionOfTheMouseOverLane;
283 return positionOfTheMouseOverLane - lengthOfAdditional;
285 return positionOfTheMouseOverLane - lengthOfAdditional / 2;
296 return positionOfTheMouseOverLane + lengthOfAdditional;
298 return positionOfTheMouseOverLane;
300 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 GUIDesignLabelAttribute
label extended over the matrix column with thick frame
#define GUIDesignDialogBox
#define GUIDesignButtonRectangular
little button rectangula 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 GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
@ 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