99 FXIMPLEMENT(
GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
108 GNEFrame(horizontalFrameParent, viewNet, "Inspector"),
109 myEdgeTemplate(NULL),
110 myPreviousElementInspect(NULL),
111 myPreviousElementDelete(NULL) {
115 myHeaderLeftFrame->hide();
116 myBackButton->hide();
120 myGroupBoxForAttributes->hide();
124 myVectorOfAttributeInputs.push_back(
new AttributeInput(myGroupBoxForAttributes,
this));
136 myGroupBoxForTreeList->hide();
140 myGroupBoxForTemplates->hide();
144 myCopyTemplateButton->hide();
148 mySetTemplateButton->hide();
172 std::vector<GNEAttributeCarrier*> itemToInspect;
174 itemToInspect.push_back(AC);
196 if (
myACs.size() > 0) {
198 std::string headerString;
199 if (dynamic_cast<GNENetElement*>(
myACs.front())) {
200 headerString =
"Net: ";
201 }
else if (dynamic_cast<GNEAdditional*>(
myACs.front())) {
202 headerString =
"Additional: ";
203 }
else if (dynamic_cast<GNEShape*>(
myACs.front())) {
204 headerString =
"Shape: ";
206 if (
myACs.size() > 1) {
210 if (
myACs.size() > 1) {
226 const std::vector<SumoXMLAttr>& ACFrontAttrs =
myACs.front()->getAttrs();
229 std::vector<GNEInspectorFrame::AttributeInput*>::iterator itAttrs = myVectorOfAttributeInputs.begin();
232 bool disableTLSinJunctions = (
dynamic_cast<GNEJunction*
>(
myACs.front()) && (dynamic_cast<GNEJunction*>(
myACs.front())->getNBNode()->getControllingTLS().empty()));
235 for (
auto it : ACFrontAttrs) {
241 std::set<std::string> occuringValues;
242 for (
auto it_ac :
myACs) {
243 occuringValues.insert(it_ac->getAttribute(it));
246 std::ostringstream oss;
247 for (
auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
248 if (it_val != occuringValues.begin()) {
255 (*itAttrs)->showAttribute(myACs.front()->getTag(), it, oss.str());
268 if (
myACs.size() == 1) {
273 if (dynamic_cast<GNEEdge*>(
myACs.front())) {
279 if (
myACs.size() == 1) {
323 i->refreshAttribute();
350 for (
auto it :
myACs) {
362 assert(
myACs.size() == 1);
375 sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE), NULL);
377 caption =
"No Template Set";
378 sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE), NULL);
380 sender->handle(
this, FXSEL(SEL_COMMAND, FXLabel::ID_SETSTRINGVALUE), (
void*)&caption);
405 const std::vector<GNEAttributeCarrier*>&
414 FXEvent* e = (FXEvent*) eventData;
415 FXTreeItem* item =
myTreelist->getItemAt(e->win_x, e->win_y);
458 FXMenuPane* pane =
new FXMenuPane(
myTreelist);
463 new FXMenuSeparator(pane);
482 assert(
myACs.size() == 1);
489 switch (
myACs.front()->getGUIGLObject()->getType()) {
495 junctionItem->setExpanded(
true);
497 for (
int i = 0; i < (int)junction->
getGNEEdges().size(); i++) {
501 edgeItem->setExpanded(
true);
503 for (
int j = 0; j < (int)edge->
getLanes().size(); j++) {
507 laneItem->setExpanded(
true);
513 additionalItem->setExpanded(
true);
519 incomingConnections->setExpanded(
false);
524 connectionItem->setExpanded(
true);
531 outgoingConnections->setExpanded(
false);
536 connectionItem->setExpanded(
true);
545 additionalItem->setExpanded(
true);
554 crossingItem->setExpanded(
true);
563 edgeItem->setExpanded(
true);
565 for (
int i = 0; i < (int)edge->
getLanes().size(); i++) {
569 laneItem->setExpanded(
true);
575 additionalItem->setExpanded(
true);
581 incomingConnections->setExpanded(
false);
586 connectionItem->setExpanded(
true);
593 outgoingConnections->setExpanded(
false);
598 connectionItem->setExpanded(
true);
607 additionalItem->setExpanded(
true);
616 laneItem->setExpanded(
true);
622 additionalItem->setExpanded(
true);
628 incomingConnections->setExpanded(
false);
633 connectionItem->setExpanded(
true);
640 outgoingConnections->setExpanded(
false);
645 connectionItem->setExpanded(
true);
657 POIItem->setExpanded(
true);
664 POILaneItem->setExpanded(
true);
673 polygonItem->setExpanded(
true);
681 crossingItem->setExpanded(
true);
689 additionalItem->setExpanded(
true);
697 connectionItem->setExpanded(
true);
708 const std::vector<GNEAttributeCarrier*>&
719 myInspectorFrameParent(inspectorFrameParent),
757 std::vector<bool> boolValues = GNEAttributeCarrier::parse<std::vector<bool> >(value);
759 if (boolValues.size() == 1) {
763 for (
auto i : boolValues) {
767 if ((sum == 0) || (sum != (int)boolValues.size())) {
797 for (
auto it : choices) {
843 std::set<std::string> occuringValues;
845 occuringValues.insert(it_ac->getAttribute(
myAttr));
848 std::ostringstream oss;
849 for (
auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
850 if (it_val != occuringValues.begin()) {
921 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
930 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
939 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
974 i->refreshAttribute();
1020 FXHorizontalFrame::show();
1026 FXHorizontalFrame::hide();
1032 std::string result(stringValue);
1033 while (result.find(
", ") != std::string::npos) {
1079 bool movementBlocked =
true;
1087 if (movementBlocked) {
1098 bool shapeBlocked =
true;
1112 bool shapeClosed =
true;
void copyTemplate(GNEEdge *tpl, GNEUndoList *undolist)
copy edge attributes from tpl
std::string getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
SumoXMLTag
Numbers representing SUMO-XML - element names.
#define GUIDesignComboBoxNCol
number of column of every combo box
FXCheckButton * myCheckBoxBlockMovement
pointer to check box "Block movement"
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
static bool isFloat(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical of type float
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
GNEFrame::GEOAttributes * myGEOAttributes
GEO Parameters.
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
FXHorizontalFrame * myHorizontalFrameAdditionalParent
horizontal frame for change additional parent
begin/end of the description of a junction
FXHorizontalFrame * myHorizontalFrameBlockMovement
horizontal frame for block movement
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
GNEInspectorFrame * myInspectorFrameParent
pointer to inspector frame parent
In GNEINSPECTORFRAME, delete element.
block shape of a graphic element (Used mainly in GNEShapes)
static bool isDiscrete(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is Discrete
FXGroupBox * myGroupBoxForTemplates
groupBox for templates
void removeAttributeCarrier(GNEAttributeCarrier *ac)
remove attribute carrier (element)
~NeteditParameters()
destructor
void refreshValues()
Refresh inspected values (used when values can be changed externally by other modul) ...
FXButton * myCopyTemplateButton
copy template button
#define GUIDesignComboBoxAttribute
Combo box static (cannot be edited) extended over the matrix column.
FXLabel * myLabelAdditionalParent
Label for additional parent.
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
GNEViewParent * getViewParent() const
get the net object
const std::vector< GNEAttributeCarrier * > & getACs() const
get current list of ACs
static int getHigherNumberOfAttributes()
return the number of attributes of the tag with the most highter number of attributes ...
Close shape of a polygon (Used by GNEPolys)
link,node: the traffic light id responsible for this link
NeteditParameters * myNeteditParameters
Netedit Parameters.
FXIcon * getIcon() const
get FXIcon assigned to this object
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void showChildsOfMarkedAttributeCarrier()
show childs of marked attribute carrier
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
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...
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
called when user press right click over an item of list of childs
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a Point of interest
#define GUIDesignTreeListFrame
Tree list used in frames to represent childs of elements.
FXLabel * myLabelBlockMovement
Label for Check blocked movement.
const SVCPermissions SVCAll
all VClasses are allowed
FXLabel * myLabelCloseShape
Label for close shape.
FXButton * mySetTemplateButton
set template button
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
void show()
show NeteditParameters
GNEViewNet * getViewNet() const
get view net
#define WRITE_WARNING(msg)
static OptionsCont & getOptions()
Retrieves the options.
~GNEInspectorFrame()
Destructor.
static bool isString(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type string
GNEViewNet * myViewNet
View Net for changes.
const std::vector< GNEAttributeCarrier * > & getInspectedACs() const
get reference to current inspected Attribute carriers
void refreshGEOAttributes()
refresh TextFields with the new GEO Attributes
static const std::vector< std::string > & discreteChoices(SumoXMLTag tag, SumoXMLAttr attr)
return a list of discrete choices for this attribute or an empty vector
static bool isInt(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical or type int
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
#define GUIDesignButtonIconRectangular
button only with icon (46x23)
void showAttributeCarrierChilds()
show child of current attributeCarrier
static bool isTime(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is time
GNEUndoList * getUndoList() const
get the undoList object
In GNEINSPECTORFRAME, center element.
go back to the previous element
#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...
static bool canBlockMovement(SumoXMLTag tag)
return true if element tag can block their movement
static bool hasDefaultValue(SumoXMLTag tag, SumoXMLAttr attr)
check if attribute of an element has a default avlue
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.
GNEEdge * myEdgeTemplate
the edge template
std::set< FXTreeItem * > myTreeItemsWithoutAC
set used to save tree items without AC assigned (for example, Incoming/Outcoming connections) ...
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
GNEAttributeCarrier * myRightClickedAC
pointer to current right clicked Attribute Carrier
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
void setEdgeTemplate(GNEEdge *tpl)
seh the template edge (we assume shared responsibility via reference counting)
block movement of a graphic element
FXLabel * myLabelBlockShape
Label for Check blocked shape.
void markAttributeCarrier(GNEAttributeCarrier *ac)
mark attribute carrier (element)
node: the type of traffic light
edge: the shape in xml-definition
NeteditParameters()
FOX needs this.
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
long onCmdSetBlockingMovement(FXObject *, FXSelector, void *)
called when user toogle the blocking movement CheckBox
long onCmdSetBlockingShape(FXObject *, FXSelector, void *)
called when user toogle the blocking shape CheckBox
FXCheckButton * myCheckBoxCloseShape
pointer to check box "Block movement"
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
void incRef(const std::string &debugMsg="")
Increarse reference.
Dialog for edit rerouters.
GNEAttributeCarrier * myPreviousElementInspect
pointer to previous element called by Inspector Frame
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
void decRef(const std::string &debugMsg="")
Decrease reference.
open edit attribute dialog
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
FXCheckButton * myCheckBoxBlockShape
pointer to check box "Block Shape"
long onCmdSetClosingShape(FXObject *, FXSelector, void *)
called when user toogle the closiong shape CheckBox
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
A road/street connecting two junctions (netedit-version)
static bool isUnique(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is unique (may not be edited for a multi-selection and don't have a default valu...
#define GUIDesignTextFieldNCol
Num of column of text field.
long onUpdCopyTemplate(FXObject *, FXSelector, void *)
update the copy button with the name of the template
FXGroupBox * myGroupBoxForTreeList
groupBox for AttrConnection
static std::string replace(std::string str, const char *what, const char *by)
void hide()
hide all NeteditParameters
FXTreeList * myTreelist
tree list to show the childs of the element to erase
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *ac)
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
virtual void show()
show Frame
long onCmdChangeAdditionalParent(FXObject *, FXSelector, void *)
An Element which don't belongs to GNENet but has influency in the simulation.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
GUIMainWindow * getApp() const
get App (GUIMainWindow)
GNEAdditional * getAdditionalParent() const
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user select option "delte item" of child menu
static bool isBool(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type bool for a certain tag
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user select option "center item" of child Menu
void hideGEOAttributes()
hide GEOAttributes
In GNEINSPECTORFRAME, inspect element.
std::vector< GNEInspectorFrame::AttributeInput * > myVectorOfAttributeInputs
list of Attribute inputs
#define GUIDesignTextFieldInt
text field extended over Frame with thick frame and limited to Integers
static bool discreteCombinableChoices(SumoXMLTag tag, SumoXMLAttr attr)
return whether the given attribute allows for a combination of discrete values
virtual void hide()
hide Frame
FXHorizontalFrame * myHorizontalFrameBlockShape
horizontal frame for block shape
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_MODE_DELETE
void show()
show inspector frame
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to Doubles/doubles
GUIGlID getGlID() const
Returns the numerical id of the object.
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) ...
FXTextField * myTextFieldAdditionalParent
pointer for change additional parent
FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[]
std::vector< GNEAttributeCarrier * > myACs
the multi-selection currently being inspected
parent of an additional element
FXHorizontalFrame * myHorizontalFrameCloseShape
horizontal frame for close shape
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
FXButton * myBackButton
back Button
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
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
C++ TraCI client API implementation.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
bool unreferenced()
check if object ins't referenced
static bool canBlockShape(SumoXMLTag tag)
return true if element tag can block their shape
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
FXGroupBox * myGroupBoxForAttributes
groupBox for attributes
void showGEOAttributes(const std::vector< GNEAttributeCarrier *> &ACs)
show GEOAttribute for the current AttributeCarriers
const GUIGlObject * getGUIGLObject() const
get const pointer to GUIGlObject vinculated with this Attribute Carrier
SumoXMLTag getTag() const
get XML Tag assigned to this object