73 FXIMPLEMENT(
GNEFrame::ACHierarchy, FXGroupBox, GNEFrameACHierarchyMap, ARRAYNUMBER(GNEFrameACHierarchyMap))
87 myFrameParent(frameParent),
132 FXEvent* e = (FXEvent*)eventData;
134 FXTreeItem* item =
myTreelist->getItemAt(e->win_x, e->win_y);
171 if (currentInspectedACs.size() == 1) {
185 FXMenuPane* pane =
new FXMenuPane(
myTreelist);
190 new FXMenuSeparator(pane);
214 junctionDestinyItem->setExpanded(
true);
219 return junctionDestinyItem;
233 junctionDestinyItem->setExpanded(
true);
236 edgeItem->setExpanded(
true);
258 junctionDestinyItem->setExpanded(
true);
261 edgeItem->setExpanded(
true);
264 laneItem->setExpanded(
true);
284 junctionItem->setExpanded(
true);
299 edgeFromItem->setExpanded(
true);
302 edgeToItem->setExpanded(
true);
305 connectionItem->setExpanded(
true);
311 return connectionItem;
320 if (tagValue.isAdditional()) {
325 if (tagValue.hasParent()) {
329 additionalParentItem->setExpanded(
true);
339 junctionDestinyItem->setExpanded(
true);
342 edgeItem->setExpanded(
true);
357 junctionDestinyItem->setExpanded(
true);
360 edgeItem->setExpanded(
true);
363 laneItem->setExpanded(
true);
408 for (
int i = 0; i < (int)edge->
getLanes().size(); i++) {
431 FXTreeItem* incomingConnections =
myTreelist->insertItem(0, laneItem,
"Incomings", incomingLaneConnections.front()->getIcon(), lane->
getGNEIncomingConnections().front()->getIcon());
433 incomingConnections->setExpanded(
false);
435 for (
auto i : incomingLaneConnections) {
442 FXTreeItem* outgoingConnections =
myTreelist->insertItem(0, laneItem,
"Outcomings", outcomingLaneConnections.front()->getIcon(), lane->
getGNEOutcomingConnections().front()->getIcon());
444 outgoingConnections->setExpanded(
false);
446 for (
auto i : outcomingLaneConnections) {
485 item->setExpanded(
true);
497 myGenericParameters(nullptr) {
530 if (ACs.size() > 0) {
534 bool differentsGenericParameters =
false;
536 for (
auto i :
myACs) {
538 differentsGenericParameters =
true;
542 if (differentsGenericParameters) {
569 }
else if (
myACs.size()) {
573 for (
auto i :
myACs) {
575 genericParameter =
"different generic attributes";
589 result += i->first +
"=" + i->second +
"|";
592 if (!result.empty()) {
606 }
else if (
myACs.size() > 0) {
608 for (
auto i :
myACs) {
623 std::vector<std::string> parsedValues;
625 while (st.hasNext()) {
626 parsedValues.push_back(st.next());
629 for (
auto i : parsedValues) {
631 WRITE_WARNING(
"Invalid format of Generic Parameter (" + i +
")");
637 std::sort(parsedValues.begin(), parsedValues.end());
638 for (
auto i = parsedValues.begin(); i != parsedValues.end(); i++) {
639 if (((i + 1) != parsedValues.end())) {
640 std::vector<std::string> firstKey, secondKey;
645 firstKey.push_back(stKey1.
next());
648 secondKey.push_back(stKey2.
next());
651 if ((firstKey.size() != 2) || (secondKey.size() != 2) || (firstKey.front() == secondKey.front())) {
652 WRITE_WARNING(
"Generic Parameters wit the same key aren't allowed (" + (*i) +
"," + * (i + 1) +
")");
663 for (
auto i : parsedValues) {
664 std::vector<std::string> parsedParameters;
667 parsedParameters.push_back(stParam.
next());
671 myGenericParameters->push_back(std::make_pair(parsedParameters.front(), parsedParameters.back()));
677 }
else if (
myACs.size() > 0) {
679 for (
auto i :
myACs) {
710 myHeaderRightFrame->hide();
725 FXVerticalFrame::hide();
743 FXVerticalFrame::show();
752 FXVerticalFrame::hide();
785 FXDialogBox* attributesHelpDialog =
new FXDialogBox(
myScrollWindowsContents, (
"Parameters of " +
toString(elementTag)).c_str(),
GUIDesignDialogBoxResizable, 0, 0, 0, 0, 10, 10, 10, 38, 4, 4);
790 int sizeColumnDescription = 0;
791 int sizeColumnDefinitions = 0;
792 myTable->setVisibleRows((FXint)(attrs.getNumberOfAttributes()));
793 myTable->setVisibleColumns(3);
794 myTable->setTableSize((FXint)(attrs.getNumberOfAttributes()), 3);
795 myTable->setBackColor(FXRGB(255, 255, 255));
796 myTable->setColumnText(0,
"Attribute");
797 myTable->setColumnText(1,
"Description");
798 myTable->setColumnText(2,
"Definition");
799 myTable->getRowHeader()->setWidth(0);
802 for (
auto i : attrs) {
804 FXTableItem* attribute =
new FXTableItem(
toString(i.first).c_str());
805 attribute->setJustify(FXTableItem::CENTER_X);
806 myTable->setItem(itemIndex, 0, attribute);
808 FXTableItem* type =
new FXTableItem(
"");
809 type->setText(i.second.getDescription().c_str());
810 sizeColumnDescription =
MAX2(sizeColumnDescription, (
int)i.second.getDescription().size());
811 type->setJustify(FXTableItem::CENTER_X);
812 myTable->setItem(itemIndex, 1, type);
814 FXTableItem* definition =
new FXTableItem(i.second.getDefinition().c_str());
815 definition->setJustify(FXTableItem::LEFT);
816 myTable->setItem(itemIndex, 2, definition);
817 sizeColumnDefinitions =
MAX2(sizeColumnDefinitions, (
int)i.second.getDefinition().size());
821 FXHeader* header = myTable->getColumnHeader();
822 header->setItemJustify(0, JUSTIFY_CENTER_X);
823 header->setItemSize(0, 120);
824 header->setItemJustify(1, JUSTIFY_CENTER_X);
825 header->setItemSize(1, sizeColumnDescription * 7);
826 header->setItemJustify(2, JUSTIFY_CENTER_X);
827 header->setItemSize(2, sizeColumnDefinitions * 6);
837 WRITE_DEBUG(
"Opening HelpAttributes dialog for tag '" +
toString(elementTag) +
"' showing " +
toString(attrs.getNumberOfAttributes()) +
" attributes");
839 attributesHelpDialog->create();
841 attributesHelpDialog->show(PLACEMENT_CURSOR);
845 getApp()->runModalFor(attributesHelpDialog);
void hideGenericParametersEditor()
hide netedit attributes editor
GNEFrame()
FOX needs this.
SumoXMLTag
Numbers representing SUMO-XML - element names.
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
void hideFramesArea()
hide frames area if all GNEFrames are hidden
void hide()
hide delete frame
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
begin/end of the description of a junction
begin/end of the description of a single lane
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
FXTreeItem * showAttributeCarrierParents()
show child of current attributeCarrier
FXFont * myFrameHeaderFont
Font for the Header.
FXHorizontalFrame * myHeaderRightFrame
fame for right header elements
void showACHierarchy(GNEAttributeCarrier *AC)
show ACHierarchy
connectio between two lanes
void hideACHierarchy()
hide ACHierarchy
In GNEINSPECTORFRAME, inspect element.
GNEViewParent * getViewParent() const
get the net object
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
GNEConnection * retrieveConnection(const std::string &id, bool failHard=true) const
get Connection by id
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user select option "delte item" of child menu
void showFramesArea()
show frames area if at least a GNEFrame is showed
#define GUIDesignContentsFrame
design for the main content frame of every frame/dialog
GNEFrame * myFrameParent
pointer to inspector frame parent
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
GNEAttributeCarrier * myRightClickedAC
pointer to current right clicked Attribute Carrier
void refreshGenericParametersEditor()
refresh netedit attributes
FXIcon * getIcon() const
get FXIcon associated to this AC
FXScrollWindow * myScrollWindowsContents
scroll windows that holds the content frame
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
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...
FXFont * getFrameHeaderFont() const
get font of the header's frame
FXHorizontalFrame * myHeaderFrame
fame for header elements
begin/end of the description of a Point of interest
#define GUIDesignTreeListFrame
Tree list used in frames to represent childs of elements.
GNELane * getLane() const
get GNELane
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
void openHelpAttributesDialog(SumoXMLTag tag) const
Open help attributes dialog.
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
FXDEFMAP(GNEFrame::ACHierarchy) GNEFrameACHierarchyMap[]
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
virtual std::vector< std::pair< std::string, std::string > > getGenericParameters() const =0
return generic parameters as vector of pairs format
GNEViewNet * getViewNet() const
get view net
GNEFrame * myFrameParent
Frame Parent.
virtual std::string getAttribute(SumoXMLAttr key) const =0
~GenericParametersEditor()
destructor
#define WRITE_WARNING(msg)
GNEEdge * getEdgeTo() const
get the name of the edge the vehicles may reach when leaving "from"
FXTreeItem * addACIntoList(GNEAttributeCarrier *AC, FXTreeItem *itemParent)
add item into list
std::set< FXTreeItem * > myTreeItemsConnections
set used to save tree items without AC assigned, the Incoming/Outcoming connections ...
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
GNEViewNet * myViewNet
View Net for changes.
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
std::vector< GNEAttributeCarrier * > myACs
list of edited ACs
const std::vector< GNEAttributeCarrier * > & getInspectedACs() const
get current list of inspected ACs
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Dialog for edit generic parameters.
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
std::string getGenericParametersStr() const
get generic parameters as string
GNEUndoList * getUndoList() const
get the undoList object
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
GNEAttributeCarrier * myAC
edited Attribute Carrier
virtual std::string getPopUpID() const =0
get PopPup ID (Used in AC Hierarchy)
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
#define GUIDesignHorizontalSeparator
#define GUIDesignTextField
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
GNEEdge & getParentEdge()
Returns underlying parent edge.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void showAttributeCarrierChilds(GNEAttributeCarrier *AC, FXTreeItem *itemParent)
show child of current attributeCarrier
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.
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
#define GUIDesignContentsScrollWindow
design for the content frame of every frame
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
FXLabel * myFrameHeaderLabel
the label for the frame's header
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
std::vector< std::pair< std::string, std::string > > * myGenericParameters
pointer to current vector of generic parameters
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
void refreshACHierarchy()
refresh ACHierarchy
attribute edited trought dialog
GUIMainWindow * getGUIMainWindow() const
get GUIMainWindow App
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
void setFrameWidth(int newWidth)
set width of GNEFrame
const std::string getID() const
function to support debugging
In GNEINSPECTORFRAME, delete element.
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *ac)
#define GUIDesignDialogBoxResizable
design for standard dialog box (for example, about dialog)
void focusUpperElement()
focus upper element of frame
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
GNEAttributeCarrier * myAC
Attribute carrier.
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
GNEJunction * getGNEJunctionSource() const
returns the source-junction
begin/end of the description of an edge
GenericParametersEditor()
FOX needs this.
A road/street connecting two junctions (netedit-version)
#define GUIDesignTextFieldNCol
Num of column of text field.
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
virtual void show()
show Frame
An Element which don't belongs to GNENet but has influency in the simulation.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
void showGenericParametersEditor(GNEAttributeCarrier *AC)
show netedit attributes editor (used for edit generic parameters of an existent AC) ...
long onCmdSetGenericParameter(FXObject *, FXSelector, void *)
Called when user udpate the generic parameter text field.
crossing between edges for pedestrians
virtual void hide()
hide Frame
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_MODE_DELETE
FXTextField * myTextFieldGenericParameter
text field for write generic parameter
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user select option "center item" of child Menu
#define GUIDesignTableNotEditable
design for table extended over frame that cannot be edited
#define GUIDesignButtonOK
void removeAttributeCarrier(GNEAttributeCarrier *ac, bool ignoreOptions=false)
remove attribute carrier (element)
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
FXTreeList * myTreelist
tree list to show the childs of the element to erase
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
parent of an additional element
static const TagValues & getTagProperties(SumoXMLTag tag)
get Tag Properties
In GNEINSPECTORFRAME, center element.
begin/end of the description of a Point of interest over Lane (used by Netedit)
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
long onCmdEditGenericParameter(FXObject *, FXSelector, void *)
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
FXButton * myEditGenericParameterButton
button for add generic parameter
begin/end of the description of a polygon
GNEJunction * getParentJunction() const
get parent Junction
SumoXMLTag getTag() const
get XML Tag assigned to this object