97 FXIMPLEMENT(
GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
98 FXIMPLEMENT(
GNEInspectorFrame::AttributeInput, FXHorizontalFrame, AttributeInputMap, ARRAYNUMBER(AttributeInputMap))
99 FXIMPLEMENT(
GNEInspectorFrame::NeteditParameters, FXGroupBox, NeteditParameterstMap, ARRAYNUMBER(NeteditParameterstMap))
106 GNEFrame(horizontalFrameParent, viewNet, "Inspector"),
107 myEdgeTemplate(NULL),
108 myPreviousElementInspect(NULL),
109 myPreviousElementDelete(NULL) {
113 myHeaderLeftFrame->hide();
114 myBackButton->hide();
118 myGroupBoxForAttributes->hide();
122 myVectorOfAttributeInputs.push_back(
new AttributeInput(myGroupBoxForAttributes,
this));
126 myNeteditParameters =
new NeteditParameters(
this);
131 myGroupBoxForTreeList->hide();
135 myGroupBoxForTemplates->hide();
139 myCopyTemplateButton->hide();
143 mySetTemplateButton->hide();
167 std::vector<GNEAttributeCarrier*> itemToInspect;
169 itemToInspect.push_back(AC);
190 if (
myACs.size() > 0) {
192 std::string headerString;
193 if (
myACs.size() > 1) {
196 if (dynamic_cast<GNENetElement*>(
myACs.front())) {
198 }
else if (dynamic_cast<GNEAdditional*>(
myACs.front())) {
199 headerString =
"Additional: " +
toString(
myACs.front()->getTag());
200 }
else if (dynamic_cast<GNEShape*>(
myACs.front())) {
201 headerString =
"Shape: " +
toString(
myACs.front()->getTag());
219 const std::vector<SumoXMLAttr>& ACFrontAttrs =
myACs.front()->getAttrs();
222 std::vector<GNEInspectorFrame::AttributeInput*>::iterator itAttrs = myVectorOfAttributeInputs.begin();
225 bool disableTLSinJunctions = (
dynamic_cast<GNEJunction*
>(
myACs.front()) && (dynamic_cast<GNEJunction*>(
myACs.front())->getNBNode()->getControllingTLS().empty()));
228 for (
auto it : ACFrontAttrs) {
235 std::set<std::string> occuringValues;
236 for (
auto it_ac :
myACs) {
237 occuringValues.insert(it_ac->getAttribute(it));
240 std::ostringstream oss;
241 for (
auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
242 if (it_val != occuringValues.begin()) {
249 (*itAttrs)->showAttribute(myACs.front()->getTag(), (it), oss.str());
259 if (
myACs.size() == 1) {
264 if (dynamic_cast<GNEEdge*>(
myACs.front())) {
270 if (
myACs.size() == 1) {
330 for (
auto it :
myACs) {
342 assert(
myACs.size() == 1);
355 sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE), NULL);
357 caption =
"No Template Set";
358 sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE), NULL);
360 sender->handle(
this, FXSEL(SEL_COMMAND, FXLabel::ID_SETSTRINGVALUE), (
void*)&caption);
385 const std::vector<GNEAttributeCarrier*>&
394 FXEvent* e = (FXEvent*) eventData;
395 FXTreeItem* item =
myTreelist->getItemAt(e->win_x, e->win_y);
422 assert(
myACs.size() == 1);
443 FXMenuPane* pane =
new FXMenuPane(
myTreelist);
448 new FXMenuSeparator(pane);
464 assert(
myACs.size() == 1);
471 switch (dynamic_cast<GUIGlObject*>(
myACs.front())->getType()) {
477 junctionItem->setExpanded(
true);
479 for (
int i = 0; i < (int)junction->
getGNEEdges().size(); i++) {
483 edgeItem->setExpanded(
true);
485 for (
int j = 0; j < (int)edge->
getLanes().size(); j++) {
489 laneItem->setExpanded(
true);
495 additionalItem->setExpanded(
true);
501 incomingConnections->setExpanded(
false);
506 connectionItem->setExpanded(
true);
513 outgoingConnections->setExpanded(
false);
518 connectionItem->setExpanded(
true);
527 additionalItem->setExpanded(
true);
536 crossingItem->setExpanded(
true);
545 edgeItem->setExpanded(
true);
547 for (
int i = 0; i < (int)edge->
getLanes().size(); i++) {
551 laneItem->setExpanded(
true);
557 additionalItem->setExpanded(
true);
563 incomingConnections->setExpanded(
false);
568 connectionItem->setExpanded(
true);
575 outgoingConnections->setExpanded(
false);
580 connectionItem->setExpanded(
true);
589 additionalItem->setExpanded(
true);
598 laneItem->setExpanded(
true);
604 additionalItem->setExpanded(
true);
610 incomingConnections->setExpanded(
false);
615 connectionItem->setExpanded(
true);
622 outgoingConnections->setExpanded(
false);
627 connectionItem->setExpanded(
true);
637 POIItem->setExpanded(
true);
645 polygonItem->setExpanded(
true);
653 crossingItem->setExpanded(
true);
661 additionalItem->setExpanded(
true);
669 connectionItem->setExpanded(
true);
680 const std::vector<GNEAttributeCarrier*>&
691 myInspectorFrameParent(inspectorFrameParent),
729 std::vector<bool> boolValues = GNEAttributeCarrier::parse<std::vector<bool> >(value);
731 if (boolValues.size() == 1) {
735 for (
auto i : boolValues) {
739 if ((sum == 0) || (sum != (int)boolValues.size())) {
769 for (
auto it : choices) {
815 std::set<std::string> occuringValues;
817 occuringValues.insert(it_ac->getAttribute(
myAttr));
820 std::ostringstream oss;
821 for (
auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
822 if (it_val != occuringValues.begin()) {
893 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
902 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
911 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
946 i->refreshAttribute();
990 FXHorizontalFrame::show();
996 FXHorizontalFrame::hide();
1002 std::string result(stringValue);
1003 while (result.find(
", ") != std::string::npos) {
1041 bool movementBlocked =
true;
1050 if (movementBlocked) {
1061 bool shapeBlocked =
true;
1076 bool shapeClosed =
true;
go back to the previous element
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
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
begin/end of the description of a junction
GNEInspectorFrame * myInspectorFrameParent
pointer to inspector frame parent
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_MODE_DELETE
block shape of a graphic element (Used mainly in GNEShapes)
static bool isDiscrete(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is Discrete
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
FXGroupBox * myGroupBoxForTemplates
groupBox for templates
void removeAttributeCarrier(GNEAttributeCarrier *ac)
remove attribute carrier (element)
~NeteditParameters()
destructor
FXButton * myCopyTemplateButton
copy template button
#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
const std::vector< GNEAdditional * > & getAdditionalChilds() const
get additional childs of lane
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.
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.
#define GUIDesignTreeListFrame
Tree list used in frames to represent childs of elements.
FXLabel * myLabelBlockMovement
Label for Check blocked movement.
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return list of additionals associated with this edge
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
const SVCPermissions SVCAll
all VClasses are allowed
FXLabel * myLabelCloseShape
Label for close shape.
GNEViewParent * getViewParent() const
get the net object
FXButton * mySetTemplateButton
set template button
void show()
show NeteditParameters
In GNEInspectFrame, center element.
#define WRITE_WARNING(msg)
static OptionsCont & getOptions()
Retrieves the options.
~GNEInspectorFrame()
Destructor.
GNEUndoList * getUndoList() const
get the undoList object
static bool isString(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type string
GNEViewNet * myViewNet
the window to inform when the tls is modfied
static const std::vector< std::string > & discreteChoices(SumoXMLTag tag, SumoXMLAttr attr)
return a list of discrete choices for this attribute or an empty vector
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
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
#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
#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
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
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 ...
In GNEInspectFrame, delete element.
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.
long onCmdSetBlockingMovement(FXObject *, FXSelector, void *)
long onCmdSetBlockingShape(FXObject *, FXSelector, void *)
called when user toogle the blocking shape CheckBox
const std::string getID() const
function to support debugging
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.
GNEViewNet * getViewNet() const
get view net
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.
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)
FXIcon * getIcon() const
get FXIcon assigned to this object
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
const std::vector< GNEAttributeCarrier * > & getInspectedACs() const
get reference to current inspected Attribute carriers
An Element which don't belongs to GNENet but has influency in the simulation.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
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
GUIMainWindow * getApp() const
get App (GUIMainWindow)
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
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
void show()
show inspector frame
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to Doubles/doubles
SumoXMLTag getTag() const
get XML Tag assigned to this object
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
const std::vector< GNEAttributeCarrier * > & getACs() const
get current list of ACs
FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[]
std::vector< GNEAttributeCarrier * > myACs
the multi-selection currently being inspected
tree list with the childs
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
In GNEInspectFrame, inspect element.
FXButton * myBackButton
back Button
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
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