90 FXIMPLEMENT(
GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
91 FXIMPLEMENT(
GNEInspectorFrame::AttributeInput, FXHorizontalFrame, AttrInputMap, ARRAYNUMBER(AttrInputMap))
98 GNEFrame(horizontalFrameParent, viewNet, "Inspector"),
101 myPreviousElementInspect(NULL),
102 myPreviousElementDelete(NULL) {
106 myHeaderLeftFrame->hide();
107 myBackButton->hide();
111 myGroupBoxForAttributes->hide();
115 myVectorOfAttributeInputs.push_back(
new AttributeInput(myGroupBoxForAttributes,
this));
120 myGroupBoxForEditor->hide();
126 myCheckBlocked->hide();
131 myGroupBoxForTreeList->hide();
135 myGroupBoxForTemplates->hide();
139 myCopyTemplateButton->hide();
143 mySetTemplateButton->hide();
167 std::vector<GNEAttributeCarrier*> itemToInspect;
169 itemToInspect.push_back(AC);
192 if (
myACs.size() > 0) {
194 std::string headerString;
195 if (
myACs.size() > 1) {
198 if (dynamic_cast<GNENetElement*>(
myACs.front())) {
200 }
else if (dynamic_cast<GNEAdditional*>(
myACs.front())) {
201 headerString =
"Additional: " +
toString(
myACs.front()->getTag());
212 (*i)->hideAttribute();
217 const std::vector<SumoXMLAttr>& attrs =
myACs.front()->getAttrs();
223 bool disableTLSinJunctions = (
dynamic_cast<GNEJunction*
>(
myACs.front()) && (dynamic_cast<GNEJunction*>(
myACs.front())->getNBNode()->getControllingTLS().empty()));
226 for (std::vector<SumoXMLAttr>::const_iterator it = attrs.begin(); it != attrs.end(); it++) {
233 std::set<std::string> occuringValues;
234 for (std::vector<GNEAttributeCarrier*>::const_iterator it_ac =
myACs.begin(); it_ac !=
myACs.end(); it_ac++) {
235 occuringValues.insert((*it_ac)->getAttribute(*it));
238 std::ostringstream oss;
239 for (std::set<std::string>::iterator it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
240 if (it_val != occuringValues.begin()) {
247 (*itAttrs)->showAttribute(
myACs.front()->getTag(), (*it), oss.str());
254 if (dynamic_cast<GNEAdditional*>(
myACs.front())) {
271 if (
myACs.size() == 1) {
276 if (dynamic_cast<GNEEdge*>(
myACs.front())) {
282 if (
myACs.size() == 1) {
342 for (std::vector<GNEAttributeCarrier*>::iterator it =
myACs.begin(); it !=
myACs.end(); it++) {
354 assert(
myACs.size() == 1);
367 sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE), NULL);
369 caption =
"No Template Set";
370 sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE), NULL);
372 sender->handle(
this, FXSEL(SEL_COMMAND, FXLabel::ID_SETSTRINGVALUE), (
void*)&caption);
412 const std::vector<GNEAttributeCarrier*>&
421 FXEvent* e = (FXEvent*) data;
422 FXTreeItem* item =
myTreelist->getItemAt(e->win_x, e->win_y);
449 assert(
myACs.size() == 1);
470 FXMenuPane* pane =
new FXMenuPane(
myTreelist);
475 new FXMenuSeparator(pane);
491 assert(
myACs.size() == 1);
498 switch (dynamic_cast<GUIGlObject*>(
myACs.front())->getType()) {
504 junctionItem->setExpanded(
true);
506 for (
int i = 0; i < (int)junction->
getGNEEdges().size(); i++) {
510 edgeItem->setExpanded(
true);
512 for (
int j = 0; j < (int)edge->
getLanes().size(); j++) {
516 laneItem->setExpanded(
true);
522 additionalItem->setExpanded(
true);
528 incomingConnections->setExpanded(
false);
533 connectionItem->setExpanded(
true);
540 outgoingConnections->setExpanded(
false);
545 connectionItem->setExpanded(
true);
554 additionalItem->setExpanded(
true);
563 crossingItem->setExpanded(
true);
572 edgeItem->setExpanded(
true);
574 for (
int i = 0; i < (int)edge->
getLanes().size(); i++) {
578 laneItem->setExpanded(
true);
584 additionalItem->setExpanded(
true);
590 incomingConnections->setExpanded(
false);
595 connectionItem->setExpanded(
true);
602 outgoingConnections->setExpanded(
false);
607 connectionItem->setExpanded(
true);
616 additionalItem->setExpanded(
true);
625 laneItem->setExpanded(
true);
631 additionalItem->setExpanded(
true);
637 incomingConnections->setExpanded(
false);
642 connectionItem->setExpanded(
true);
649 outgoingConnections->setExpanded(
false);
654 connectionItem->setExpanded(
true);
664 POIItem->setExpanded(
true);
672 polygonItem->setExpanded(
true);
680 crossingItem->setExpanded(
true);
688 additionalItem->setExpanded(
true);
696 connectionItem->setExpanded(
true);
712 myInspectorFrameParent(inspectorFrameParent),
750 std::vector<bool> boolValues = GNEAttributeCarrier::parse<std::vector<bool> >(value);
752 if (boolValues.size() == 1) {
756 for (std::vector<bool>::iterator i = boolValues.begin(); i != boolValues.end(); i++) {
760 if ((sum == 0) || (sum != (int)boolValues.size())) {
790 for (std::vector<std::string>::const_iterator it = choices.begin(); it != choices.end(); ++it) {
851 std::string disallowed =
"";
853 std::swap(allowed, disallowed);
856 std::string::size_type i = allowed.find(
" (combined!)");
857 if (i != std::string::npos) {
858 allowed.erase(i, 12);
861 if (allowed ==
"all") {
909 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
918 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
927 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
983 FXHorizontalFrame::show();
989 FXHorizontalFrame::hide();
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
#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
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_MODE_DELETE
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)
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
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
static int getHigherNumberOfAttributes()
return the number of attributes of the tag with the most highter number of attributes ...
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes ...
link,node: the traffic light id responsible for this link
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
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
go back to the previous element
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
#define GUIDesignTreeListFrame
Tree list used in frames to represent childs of elements.
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
GNEViewParent * getViewParent() const
get the net object
In GNEInspectFrame, delete element.
FXButton * mySetTemplateButton
set template button
GNEAdditional * myAdditional
pointer to additional element
#define WRITE_WARNING(msg)
~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
long onCmdSetBlocking(FXObject *, FXSelector, void *)
called when user toogle the blocking button
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
In GNEInspectFrame, inspect 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...
FXGroupBox * myGroupBoxForEditor
GropuBox for editor attributes.
tree list with the childs
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 ...
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
void markAttributeCarrier(GNEAttributeCarrier *ac)
mark attribute carrier (element)
node: the type of traffic light
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
const std::string getID() const
function to support debugging
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
void incRef(const std::string &debugMsg="")
Dialog for edit rerouters.
GNEViewNet * getViewNet() const
get view net
bool isTestingModeEnabled() const
check if netedit is running in testing mode
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="")
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
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
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
In GNEInspectFrame, center element.
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
void showAttributeCarrierChilds(GNEAttributeCarrier *ac)
show child of attributeCarrier in frame if previously there isn't a marked element ...
#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
bool isAdditionalBlocked() const
Check if additional item is currently blocked (i.e. cannot be moved with mouse)
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
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
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
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
FXGroupBox * myGroupBoxForAttributes
groupBox for attributes
bool isAdditionalMovable() const
check if additional element is movable
FXCheckButton * myCheckBlocked
pointer to menu check block