72 myFrameParent(frameParent),
73 myAttributesEditorParent(attributesEditorParent),
74 myEditorType(editorType),
75 myAttributeType(attributeType) {
77 if (attributeType == AttributeType::NETEDIT) {
80 myFrontButton->hide();
82 myOpenDialogButton->hide();
93 if (myAttributeType == AttributeType::EXTENDED) {
96 }
else if (myAttributeType == AttributeType::PARAMETERS) {
128const std::vector<GNEAttributeCarrier*>&
141 if (primaryAttributeEditor) {
156 for (
const auto& AC : ACs) {
159 if (primaryAttributeEditor) {
174 row->hideAttributeRow();
182 bool showButtons =
false;
185 const auto tagProperty =
myEditedACs.front()->getTagProperty();
189 if (tagProperty->isDrawable()) {
202 if ((
myEditedACs.size() == 1) && tagProperty->hasDialog()) {
221 if (tagProperty->hasExtendedAttributes()) {
225 if (tagProperty->hasParameters()) {
235 for (
const auto& attrProperty : tagProperty->getAttributeProperties()) {
237 bool validEditorType =
false;
239 validEditorType =
true;
242 validEditorType =
true;
245 bool validAttributeType =
true;
247 validAttributeType =
false;
250 validAttributeType =
false;
253 validAttributeType =
false;
256 validAttributeType =
false;
258 if (attrProperty->isExtendedEditor()) {
259 validAttributeType =
false;
262 validAttributeType =
false;
264 if (validEditorType && validAttributeType) {
282 if ((rowIndex == 0) && !showButtons) {
305 if (!row->isValueValid()) {
307 const std::string errorMessage =
TLF(
"Invalid value '%' in attribute %", row->getCurrentValue(), row->getAttrProperty()->getAttrStr());
324 if (row->isAttributeRowShown()) {
325 const auto fillResult = row->fillSumoBaseObject(baseObject, insertDefaultValues);
368 AC->markForDrawingFront();
378 const auto editedTag =
myEditedACs.front()->getTagProperty()->getTag();
434 AC->resetDefaultValues(
false);
439 AC->resetDefaultValues(
true);
453 const auto tagProperty =
myEditedACs.front()->getTagProperty();
458 editedAC->setAttribute(attr, value);
463 undoList->
begin(tagProperty->getGUIIcon(),
TLF(
"change multiple % attributes", tagProperty->getTagStr()));
466 undoList->begin(tagProperty->getGUIIcon(),
TLF(
"change % attribute", tagProperty->getTagStr()));
470 editedAC->setAttribute(attr, value, undoList);
486 const auto tagProperty =
myEditedACs.front()->getTagProperty();
491 editedAC->toggleAttribute(attr, value);
496 undoList->
begin(tagProperty->getGUIIcon(),
TLF(
"change multiple % attributes", tagProperty->getTagStr()));
501 editedAC->enableAttribute(attr, undoList);
503 editedAC->disableAttribute(attr, undoList);
519 if (
myEditedACs.front()->getTagProperty()->getXMLParentTags().size() > 0) {
568 double startPos = centerPosition - (size * 0.5);
569 double endPos = centerPosition + (size * 0.5);
571 startPos = centerPosition - size;
572 endPos = centerPosition;
574 startPos = centerPosition;
575 endPos = centerPosition + size;
584 if (endPos > laneLength) {
587 startPos = laneLength - size;
593 if (endPos > laneLength) {
611 for (
const auto type : types) {
612 int maxNumberOfRows = 0;
617 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfFlowAttributeRows();
619 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfGeoAttributeRows();
621 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfNeteditAttributesRows();
FXDEFMAP(GNEAttributesEditorType) GNEAttributeTableMap[]
@ MID_GNE_ATTRIBUTESEDITOR_PARAMETERS
open generic parameters editor
@ MID_GNE_ATTRIBUTESEDITOR_FRONT
mark element as front
@ MID_GNE_ATTRIBUTESEDITOR_DIALOG
open element dialog
@ MID_GNE_ATTRIBUTESEDITOR_EXTENDED
open extended attributes
@ MID_GNE_ATTRIBUTESEDITOR_RESET
reset attributes
@ MID_GNE_ATTRIBUTESEDITOR_HELP
open help dialog
#define GUIDesignButtonIcon
button only with icon
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
#define WRITE_WARNING(msg)
@ SUMO_TAG_REROUTER
A rerouter.
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ GNE_TAG_CALIBRATOR_LANE
A calibrator placed over lane.
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
@ SUMO_TAG_VSS
A variable speed sign.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_FORCESIZE
size (used in stopping places)
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ GNE_ATTR_SIZE
size (used in stopping places)
@ GNE_ATTR_REFERENCE
reference position (used creating stoppingPlaces)
@ GNE_ATTR_LANELENGTH
size (used in stopping places)
@ SUMO_ATTR_NOTHING
invalid attribute, must be the last one
bool hasBoolAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given bool attribute
bool hasStringAttribute(const SumoXMLAttr attr) const
has function
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
bool hasDoubleAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given double attribute
bool getBoolAttribute(const SumoXMLAttr attr) const
get bool attribute
double getDoubleAttribute(const SumoXMLAttr attr) const
get double attribute
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
GNEInternalTest * getInternalTest() const
get netedit test system
const std::string getID() const
get ID (all Attribute Carriers have one)
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
void refreshAttributesEditor()
refresh attribute editor
static void buildRows(GNEAttributesEditorType *editorParent)
build rows
SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject *baseObject, const bool insertDefaultValues) const
fill sumo Base object
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
static AttributesEditorRows mySecondSingletonAttributesEditorRows
second singleton with attributes editor rows
std::vector< GNEAttributesEditorRow * > myAttributesEditorRows
singleton with attributes editor rows
void abortReparenting()
abort selecting parent
bool isReparenting() const
bool isEditorTypeCreator() const
check if this is an attribute editor of type "creator"
const AttributeType myAttributeType
variable use for packing attribute type options
void setNewParent(const GNEAttributeCarrier *AC)
set new parent
static AttributesEditorRows myFirstSingletonAttributesEditorRows
first singleton with attributes editor rows
long onCmdOpenElementDialog(FXObject *, FXSelector, void *)
called when user press the "Element dialog" button
void hideAttributesEditor()
hide attribute editor
GNEAttributesEditor * myAttributesEditorParent
pointer to GNEAttributesEditor parent
FXHorizontalFrame * myFrameNeteditButtons
frame for netedit buttons (helps and reset)
void moveLaneDown()
move lane down
bool isEditorTypeEditor() const
check if this is an attribute editor of type "editor"
long onCmdAttributesEditorReset(FXObject *, FXSelector, void *)
called when user press the reset button
void refreshAttributesEditor()
refresh attribute editor
GNEFrame * myFrameParent
pointer to GNEFrame parent
void showAttributesEditor(GNEAttributeCarrier *AC, const bool primaryAttributeEditor)
edit attributes of the given AC (usually the edited template AC)
std::map< AttributeType, std::vector< GNEAttributesEditorRow * > > AttributesEditorRows
typedef used for pack attributes editor row
bool checkAttributes(const bool showWarning)
check if current edited attributes are valid
~GNEAttributesEditorType()
constructor
friend class GNEAttributesEditorRow
FOX-declaration.
std::vector< GNEAttributeCarrier * > myEditedACs
current edited ACs
void setAttribute(SumoXMLAttr attr, const std::string &value)
set attribute in the current ACs (Callend from row)
FXButton * myOpenDialogButton
pointer to open dialog button (usually additionals)
void moveLaneUp()
move lane up
long onCmdOpenExtendedAttributesDialog(FXObject *, FXSelector, void *)
called when user press the "Extended attributes" button
void fillStartEndAttributes(CommonXMLStructure::SumoBaseObject *baseObject) const
fill start end attributes
void inspectParent()
inspect parent (Callend from row)
FXButton * myOpenGenericParametersEditorButton
pointer to open generic parameters editor button
long onCmdAttributesEditorHelp(FXObject *, FXSelector, void *)
called when user press the help button
const EditorType myEditorType
variable use for packing editorType type options
long onCmdMarkAsFront(FXObject *, FXSelector, void *)
bool checkNewParent(const GNEAttributeCarrier *AC) const
check if the given AC can be a new parent
AttributeType
Attribute types.
void enableReparent()
void enable reparent
const std::vector< GNEAttributeCarrier * > & getEditedAttributeCarriers() const
get edited attribute carriers
void toggleEnableAttribute(SumoXMLAttr attr, const bool value)
set attribute in the current ACs (Callend from row)
SumoXMLTag myReparentTag
check if we're reparent
long onCmdOpenEditParametersDialog(FXObject *, FXSelector, void *)
called when user press the "Edit parameters" button
void disableAttributesEditor()
disable attribute editor
FXButton * myFrontButton
pointer to front button
Dialog for edit calibrators.
virtual void attributeUpdated(SumoXMLAttr attribute)
function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/....
GNEViewNet * getViewNet() const
get view net
void openHelpAttributesDialog(const GNEAttributeCarrier *AC) const
Open help attributes dialog.
void inspectElement(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect a single element.
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
const GNETagPropertiesDatabase * getTagPropertiesDatabase() const
get tag properties database
Dialog for edit rerouters.
Dialog for edit parameters.
int getMaxNumberOfEditableAttributeRows() const
max number of editable (non extended) attributes
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
Dialog for editing calibrator vehicle types.
GNENet * getNet() const
get the net object
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
void setStatusBarText(const std::string &text)
set statusBar text
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
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 FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXGroupBoxModule (based on FXGroupBox)
static StringBijection< ReferencePosition > ReferencePositions
reference positions (used creating certain elements in netedit)