93 FXIMPLEMENT(
GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
106 GNEFrame(horizontalFrameParent, viewNet, "Inspector"),
107 myPreviousElementInspect(
nullptr),
108 myPreviousElementDelete(
nullptr) {
112 myHeaderLeftFrame->hide();
113 myBackButton->hide();
156 std::vector<GNEAttributeCarrier*> itemsToInspect;
161 for (
auto i : selectedACs) {
162 if (i->getTag() == AC->
getTag()) {
163 itemsToInspect.push_back(i);
167 itemsToInspect.push_back(AC);
191 std::string headerString;
193 headerString =
"Net: ";
194 }
else if (dynamic_cast<GNEAdditional*>(
myInspectedACs.front())) {
195 headerString =
"Additional: ";
197 headerString =
"Shape: ";
327 const std::vector<GNEAttributeCarrier*>&
338 myAttributesEditorParent(attributeEditorParent),
375 myMultiple = GNEAttributeCarrier::parse<std::vector<std::string>>(value).size() > 1;
380 if (attrValue.isColor()) {
390 if (attrValue.isBool()) {
402 if (attrValue.isNonEditable()) {
407 }
else if (attrValue.isDiscrete()) {
409 if ((attrValue.getDiscreteValues().size() > 0) && attrValue.isCombinable()) {
422 for (
auto it : attrValue.getDiscreteValues()) {
426 myChoicesCombo->setNumVisible((
int)attrValue.getDiscreteValues().size());
431 if (attrValue.isNonEditable()) {
442 if (attrValue.isNonEditable()) {
448 }
else if (attrValue.isFloat() || attrValue.isTime()) {
454 if (attrValue.isNonEditable()) {
459 }
else if (attrValue.isInt()) {
465 if (attrValue.isNonEditable()) {
476 if (attrValue.isNonEditable()) {
511 if (
myTextFieldInt->getTextColor() == FXRGB(0, 0, 0) || forceRefresh) {
517 if (
myTextFieldReal->getTextColor() == FXRGB(0, 0, 0) || forceRefresh) {
529 if (
myChoicesCombo->getTextColor() == FXRGB(0, 0, 0) || forceRefresh) {
550 FXColorDialog colordialog(
this, tr(
"Color Dialog"));
551 colordialog.setTarget(
this);
559 if (colordialog.execute()) {
595 throw ProcessError(
"Invalid call to onCmdOpenAttributeDialog");
604 bool refreshGEOAndNeteditEditors =
false;
607 const auto& attrValues = tagValues.getAttribute(
myAttr);
609 if (attrValues.isBool()) {
618 }
else if (attrValues.isDiscrete()) {
620 if ((attrValues.getDiscreteValues().size() > 0) &&
621 attrValues.isCombinable()) {
631 }
else if (attrValues.isFloat() || attrValues.isTime()) {
633 if (
myTextFieldReal->getText().empty() && attrValues.hasDefaultValue()) {
634 newVal = tagValues.getDefaultValue(
myAttr);
640 }
else if (attrValues.isInt()) {
642 if (
myTextFieldInt->getText().empty() && attrValues.hasDefaultValue()) {
643 newVal = tagValues.getDefaultValue(
myAttr);
649 }
else if (attrValues.isString()) {
652 newVal = tagValues.getDefaultValue(
myAttr);
664 refreshGEOAndNeteditEditors =
true;
687 if (attrValues.isCombinable()) {
692 }
else if (attrValues.isDiscrete()) {
695 }
else if (attrValues.isFloat() || attrValues.isTime()) {
706 if (refreshGEOAndNeteditEditors) {
712 if (attrValues.isCombinable()) {
715 }
else if (attrValues.isDiscrete()) {
718 }
else if (attrValues.isFloat() || attrValues.isTime()) {
734 std::string result(stringValue);
735 while (result.find(
", ") != std::string::npos) {
791 std::set<std::string> occuringValues;
793 occuringValues.insert(it_ac->getAttribute(it.first));
796 std::ostringstream oss;
797 for (
auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
798 if (it_val != occuringValues.begin()) {
830 std::pair<GNEInspectorFrame::AttributesEditor::AttributeInput*, std::string> myAllowAttribute(
nullptr,
"");
831 std::pair<GNEInspectorFrame::AttributesEditor::AttributeInput*, std::string> myDisallowAttribute(
nullptr,
"");
843 std::set<std::string> occuringValues;
845 occuringValues.insert(it_ac->getAttribute(it.first));
848 std::ostringstream oss;
849 for (
auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
850 if (it_val != occuringValues.begin()) {
860 myAllowAttribute.second = oss.str();
863 myDisallowAttribute.second = oss.str();
879 if (myAllowAttribute.first && myDisallowAttribute.first) {
881 if (myAllowAttribute.first->isCurrentAttributeValid() && !myDisallowAttribute.first->isCurrentAttributeValid()) {
883 myDisallowAttribute.first->refreshAttributeInput(myDisallowAttribute.second,
true);
886 if (myDisallowAttribute.first->isCurrentAttributeValid() && !myAllowAttribute.first->isCurrentAttributeValid()) {
888 myAllowAttribute.first->refreshAttributeInput(myAllowAttribute.second,
true);
953 if (tagValue.canBlockMovement()) {
973 if (tagValue.canBlockShape()) {
993 if (tagValue.canCloseShape()) {
1013 if (tagValue.hasParent() && tagValue.canBeReparent()) {
1205 if (tagValue.hasGEOPosition() || tagValue.hasGEOShape()) {
1211 value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(
SUMO_ATTR_GEO));
1275 if (tagValue.hasGEOPosition()) {
1277 }
else if (tagValue.hasGEOShape()) {
1293 if (tagValue.hasGEOPosition()) {
1301 }
else if (tagValue.hasGEOShape()) {
1310 throw ProcessError(
"myGEOAttributeTextField must be hidden becaurse there isn't GEO Attribute to edit");
1334 FXDialogBox* helpDialog =
new FXDialogBox(
this,
"GEO attributes Help",
GUIDesignDialogBox);
1335 std::ostringstream help;
1337 <<
" SUMO uses the World Geodetic System 84 (WGS84/UTM).\n" 1338 <<
" For a GEO-referenced network, geo coordinates are represented as pairs of Longitude and Latitude\n" 1339 <<
" in decimal degrees without extra symbols. (N,W..)\n" 1340 <<
" - Longitude: East-west position of a point on the Earth's surface.\n" 1341 <<
" - Latitude: North-south position of a point on the Earth's surface.\n" 1342 <<
" - CheckBox 'geo' enables or disables saving position in GEO coordinates\n";
1346 helpDialog->create();
1358 myEdgeTemplate(nullptr) {
1458 sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
1460 caption =
"No edge Template Set";
1461 sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
1463 sender->handle(
this, FXSEL(SEL_COMMAND, FXLabel::ID_SETSTRINGVALUE), (
void*)&caption);
void hideGenericParametersEditor()
hide netedit attributes editor
void refreshNeteditAttributesEditor(bool forceRefresh)
refresh netedit attributes
void copyTemplate(GNEEdge *tpl, GNEUndoList *undolist)
copy edge attributes from tpl
void showTemplateEditor()
show template editor
FXLabel * myLabelBlockMovement
Label for Check blocked movement.
SumoXMLTag
Numbers representing SUMO-XML - element names.
#define GUIDesignComboBoxNCol
number of column of every combo box
static RGBColor parseColor(std::string coldef)
Parses a color information.
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
void removeInspectedAC(GNEAttributeCarrier *ac)
remove AC from current inspected ACs
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
FXHorizontalFrame * myHorizontalFrameBlockMovement
horizontal frame for block movement
long onCmdNeteditAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
GNEInspectorFrame * myInspectorFrameParent
pointer to GNEInspectorFrame parent
std::vector< GNEAttributeCarrier * > myInspectedACs
the multi-selection currently being inspected
begin/end of the description of a junction
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
TemplateEditor()
FOX needs this.
FXButton * mySetTemplateButton
set template button
AttributesEditor * myAttributesEditor
Attribute editor.
block shape of a graphic element (Used mainly in GNEShapes)
FXHorizontalFrame * myGEOAttributeFrame
horizontal frame for GEOAttribute
void showACHierarchy(GNEAttributeCarrier *AC)
show ACHierarchy
#define GUIDesignComboBoxAttribute
Combo box static (cannot be edited) extended over the matrix column.
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
void show()
show delete frame
void hideACHierarchy()
hide ACHierarchy
NeteditAttributesEditor()
FOX needs this.
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
GNEViewParent * getViewParent() const
get the net object
go back to the previous element
FXTextField * myGEOAttributeTextField
textField for GEOAttribute
static int getHigherNumberOfAttributes()
return the number of attributes of the tag with the most highter number of attributes ...
void refreshGEOAttributesEditor(bool forceRefresh)
refresh GEO attributes editor
Close shape of a polygon (Used by GNEPolys)
link,node: the traffic light id responsible for this link
FXCheckButton * myUseGEOCheckButton
checkBox for use GEO
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
GEOAttributesEditor()
FOX needs this.
GNEFrame::ACHierarchy * myACHierarchy
Attribute Carrier Hierarchy.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
FXHorizontalFrame * myUseGEOFrame
horizontal frame for use GEO
void hideTemplateEditor()
hide template editor
void openHelpAttributesDialog(SumoXMLTag tag) const
Open help attributes dialog.
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers()
get all selected attribute carriers
void showNeteditAttributesEditor()
show netedit attributes editor
GNEViewNet * getViewNet() const
get view net
long onCmdSetGEOAttribute(FXObject *, FXSelector, void *)
Called when user change the current GEO Attribute.
FXTextField * myTextFieldAdditionalParent
pointer for change additional parent
FXLabel * myLabelCloseShape
Label for close shape.
~GNEInspectorFrame()
Destructor.
GenericParametersEditor * myGenericParametersEditor
Generic parameters editor.
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
Called when user change the current GEO Attribute.
GNEViewNet * myViewNet
View Net for changes.
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
const std::vector< GNEAttributeCarrier * > & getInspectedACs() const
get current list of inspected ACs
void hide()
hide inspector frame
FXHorizontalFrame * myHorizontalFrameAdditionalParent
horizontal frame for change additional parent
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
FXButton * myHelpButton
button for help
#define GUIDesignButtonIconRectangular
button only with icon (46x23)
void showGEOAttributesEditor()
show GEO attributes editor
GNEUndoList * getUndoList() const
get the undoList object
AttributesEditor()
FOX needs this.
#define GUIDesignTextField
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
FXHorizontalFrame * myHorizontalFrameBlockShape
horizontal frame for block shape
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
~NeteditAttributesEditor()
destructor
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
FXButton * myHelpButton
button for help
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
GNEFrame::ACHierarchy * getACHierarchy() const
get ACHierarchy
virtual bool isAttributeCarrierSelected() const =0
check if attribute carrier is selected
FXButton * myCopyTemplateButton
copy template button
block movement of a graphic element
attribute edited trought dialog
static bool parseStringToANDBool(const std::string &string)
parse a string of booleans (1 0 1 1....) using AND operation
node: the type of traffic light
FXLabel * myLabelAdditionalParent
Label for additional parent.
edge: the shape in xml-definition
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
copy edge attributes from edge template
FXHorizontalFrame * myHorizontalFrameCloseShape
horizontal frame for close shape
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
const std::string getID() const
function to support debugging
void clearInspectedAC()
Clear all current inspected ACs.
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
void incRef(const std::string &debugMsg="")
Increarse reference.
Dialog for edit rerouters.
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
long onUpdCopyTemplate(FXObject *, FXSelector, void *)
update the copy button with the name of the template
GNEAttributeCarrier * myPreviousElementInspect
pointer to previous element called by Inspector Frame
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
FXCheckButton * myCheckBoxBlockShape
pointer to check box "Block Shape"
void showAttributeEditor()
show attributes of ac
void decRef(const std::string &debugMsg="")
Decrease reference.
GNEEdge * myEdgeTemplate
the edge template
void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition)
refresh attribute editor (only the valid values will be refresh)
begin/end of the description of an edge
FXCheckButton * myCheckBoxBlockMovement
pointer to check box "Block movement"
A road/street connecting two junctions (netedit-version)
~TemplateEditor()
destructor
#define GUIDesignTextFieldNCol
Num of column of text field.
long onCmdGEOAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
static std::string replace(std::string str, const char *what, const char *by)
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
void setACUnderCursor(const GNEAttributeCarrier *AC)
set attributeCarrier under cursor
virtual void show()
show Frame
#define GUIDesignDialogBox
An Element which don't belongs to GNENet but has influency in the simulation.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
const AttributeValues & getAttribute(SumoXMLAttr attr) const
get attribute (throw error if doesn't exist)
GEOAttributesEditor * myGEOAttributesEditor
GEO Attributes editor.
void showGenericParametersEditor(GNEAttributeCarrier *AC)
show netedit attributes editor (used for edit generic parameters of an existent AC) ...
FXLabel * myUseGEOLabel
Label for use GEO.
~GEOAttributesEditor()
destructor
TemplateEditor * getTemplateEditor() const
get template editor
NeteditAttributesEditor * myNeteditAttributesEditor
Netedit Attributes editor.
GNEInspectorFrame * getInspectorFrameParent() const
get InspectorFrame Parent
TemplateEditor * myTemplateEditor
Template editor.
FXLabel * myLabelBlockShape
Label for Check blocked shape.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
#define GUIDesignTextFieldInt
text field extended over Frame with thick frame and limited to Integers
virtual void hide()
hide Frame
void setEdgeTemplate(GNEEdge *tpl)
seh the template edge (we assume shared responsibility via reference counting)
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_MODE_DELETE
void show()
show inspector frame
GNENet * getNet() const
get the net object
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to Doubles/doubles
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
void hideNeteditAttributesEditor()
hide netedit attributes editor
FXCheckButton * myCheckBoxCloseShape
pointer to check box "Block movement"
#define GUIDesignButtonOK
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
void hideAttributesEditor()
hide attribute editor
FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[]
parent of an additional element
static const TagValues & getTagProperties(SumoXMLTag tag)
get Tag Properties
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
void hideGEOAttributesEditor()
hide GEO attributes editor
FXButton * myBackButton
back Button
void inspectMultisection(const std::vector< GNEAttributeCarrier *> &ACs)
Inspect the given multi-selection.
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame and height of 23
FXLabel * myGEOAttributeLabel
Label for GEOAttribute.
FXButton * myHelpButton
button for help
std::vector< GNEInspectorFrame::AttributesEditor::AttributeInput * > myVectorOfAttributeInputs
list of Attribute inputs
GNEInspectorFrame * myInspectorFrameParent
pointer to inspector frame parent
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
long onCmdAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
bool unreferenced()
check if object ins't referenced
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
SumoXMLTag getTag() const
get XML Tag assigned to this object