69 #ifdef CHECK_MEMORY_LEAKS 71 #endif // CHECK_MEMORY_LEAKS 107 FXIMPLEMENT(
GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
116 GNEFrame(horizontalFrameParent, viewNet, "Inspector"),
117 myEdgeTemplate(NULL),
119 myPreviousElementInspect(NULL),
120 myPreviousElementDelete(NULL) {
124 myHeaderLeftFrame->hide();
125 myBackButton->hide();
129 myGroupBoxForAttributes->hide();
133 vectorOfAttrInput.push_back(
new AttrInput(myGroupBoxForAttributes,
this));
138 myGroupBoxForEditor->hide();
142 myCheckBlocked->hide();
147 myGroupBoxForTreeList->hide();
151 myGroupBoxForTemplates->hide();
155 myCopyTemplateButton->hide();
159 mySetTemplateButton->hide();
182 std::vector<GNEAttributeCarrier*> itemToInspect;
184 itemToInspect.push_back(AC);
207 if (
myACs.size() > 0) {
209 std::string headerString;
210 if (
myACs.size() > 1) {
213 if (dynamic_cast<GNENetElement*>(
myACs.front())) {
215 }
else if (dynamic_cast<GNEAdditional*>(
myACs.front())) {
216 headerString =
"Additional: " +
toString(
myACs.front()->getTag());
227 (*i)->hideAttribute();
232 const std::vector<SumoXMLAttr>& attrs =
myACs.front()->getAttrs();
235 std::vector<GNEInspectorFrame::AttrInput*>::iterator itAttrs =
vectorOfAttrInput.begin();
238 for (std::vector<SumoXMLAttr>::const_iterator it = attrs.begin(); it != attrs.end(); it++) {
245 std::set<std::string> occuringValues;
246 for (std::vector<GNEAttributeCarrier*>::const_iterator it_ac =
myACs.begin(); it_ac !=
myACs.end(); it_ac++) {
247 occuringValues.insert((*it_ac)->getAttribute(*it));
250 std::ostringstream oss;
251 for (std::set<std::string>::iterator it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
252 if (it_val != occuringValues.begin()) {
258 (*itAttrs)->showAttribute(
myACs.front()->getTag(), *it, oss.str());
263 if (dynamic_cast<GNEAdditional*>(
myACs.front())) {
266 bool showGroupBoxForEditor =
false;
272 showGroupBoxForEditor =
true;
275 if (showGroupBoxForEditor ==
true) {
281 if (
myACs.size() == 1) {
286 if (dynamic_cast<GNEEdge*>(
myACs.front())) {
292 if (
myACs.size() == 1) {
352 for (std::vector<GNEAttributeCarrier*>::iterator it =
myACs.begin(); it !=
myACs.end(); it++) {
364 assert(
myACs.size() == 1);
377 sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE), NULL);
379 caption =
"No Template Set";
380 sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE), NULL);
382 sender->handle(
this, FXSEL(SEL_COMMAND, FXLabel::ID_SETSTRINGVALUE), (
void*)&caption);
420 const std::vector<GNEAttributeCarrier*>&
429 FXEvent* e = (FXEvent*) data;
430 FXTreeItem* item =
myTreelist->getItemAt(e->win_x, e->win_y);
457 assert(
myACs.size() == 1);
478 FXMenuPane* pane =
new FXMenuPane(
myTreelist);
483 new FXMenuSeparator(pane);
499 assert(
myACs.size() == 1);
506 switch (dynamic_cast<GUIGlObject*>(
myACs.front())->getType()) {
512 junctionItem->setExpanded(
true);
514 for (
int i = 0; i < (int)junction->
getGNEEdges().size(); i++) {
518 edgeItem->setExpanded(
true);
520 for (
int j = 0; j < (int)edge->
getLanes().size(); j++) {
524 laneItem->setExpanded(
true);
530 additionalItem->setExpanded(
true);
536 incomingConnections->setExpanded(
false);
541 connectionItem->setExpanded(
true);
548 outgoingConnections->setExpanded(
false);
553 connectionItem->setExpanded(
true);
562 additionalItem->setExpanded(
true);
571 crossingItem->setExpanded(
true);
580 edgeItem->setExpanded(
true);
582 for (
int i = 0; i < (int)edge->
getLanes().size(); i++) {
586 laneItem->setExpanded(
true);
592 additionalItem->setExpanded(
true);
598 incomingConnections->setExpanded(
false);
603 connectionItem->setExpanded(
true);
610 outgoingConnections->setExpanded(
false);
615 connectionItem->setExpanded(
true);
624 additionalItem->setExpanded(
true);
633 laneItem->setExpanded(
true);
639 additionalItem->setExpanded(
true);
645 incomingConnections->setExpanded(
false);
650 connectionItem->setExpanded(
true);
657 outgoingConnections->setExpanded(
false);
662 connectionItem->setExpanded(
true);
672 POIItem->setExpanded(
true);
680 polygonItem->setExpanded(
true);
688 crossingItem->setExpanded(
true);
696 additionalItem->setExpanded(
true);
704 connectionItem->setExpanded(
true);
720 myInspectorFrameParent(inspectorFrameParent),
762 myCheckBox->setCheck(GNEAttributeCarrier::parse<bool>(value));
786 for (std::vector<std::string>::const_iterator it = choices.begin(); it != choices.end(); ++it) {
805 myTimeSpinDial->setValue((
int)GNEAttributeCarrier::parse<SUMOReal>(value));
883 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
892 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
904 newVal = GNEAttributeCarrier::getDefaultValue<std::string>(
myTag,
myAttr);
975 myAttrInputParent(attrInputParent),
976 myTextFieldAttr(textFieldAttr) {
990 for (
int i = 0; i < (int)choices.size(); i++) {
994 if (oldValue.find(choices.at(i)) != std::string::npos) {
1016 std::vector<std::string> attrSolution;
1042 for (
int i = 0; i < (int)choices.size(); i++) {
1043 if (oldValue.find(choices.at(i)) != std::string::npos) {
void copyTemplate(GNEEdge *tpl, GNEUndoList *undolist)
copy edge attributes from tpl
In GNEInspectFrame, center element.
FXHorizontalFrame * frameButtons
frame for the buttons
SumoXMLTag
Numbers representing SUMO-XML - element names.
In GNEInspectFrame, delete element.
#define GUIDesignHorizontalFrame
#define GUIDesignComboBoxNCol
number of column of every combo box
static bool isFloat(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical of type float
tree list with the childs
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
virtual void centerTo(GUIGlID id, bool applyZoom, SUMOReal zoomDist=20)
centers to the chosen artifact
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_MODE_DELETE
#define GUIDesignTextFieldAttributeStr
text field extended over the matrix column with thick frame
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
long onCmdReset(FXObject *, FXSelector, void *)
call when user press button reset
#define GUIDesignTextFieldAttributeReal
text field extended over the matrix column with thick frame and limited to real
#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 ...
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes ...
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
FXButton * myCancelButton
Button Cancel.
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.
GNEViewParent * getViewParent() const
get the net object
FXButton * mySetTemplateButton
set template button
FXMatrix * myCheckBoxMatrix
GNEAdditional * myAdditional
pointer to additional element
#define GUIDesignMatrixAttributes
Matrix design extended over Frame and used for represent attributes and their values.
FXButton * myAcceptButton
Button Accept.
~GNEInspectorFrame()
Destructor.
GNEUndoList * getUndoList() const
get the undoList object
static bool isString(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type string
go back to the previous element
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
void showAttributeCarrierChilds()
show child of current attributeCarrier
static bool isTime(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is time
#define GUIDesignButtonDialog
button with size limited by text, centered over Frame with thick and raise frame
#define GUIDesignHorizontalSeparator
std::vector< FXMenuCheck * > myVectorOfCheckBox
vector of Menuchecks
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.
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
GNEAttributeCarrier * myRightClickedAC
pointer to current right clicked Attribute Carrier
AttrEditor()
FOX needs this.
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
AttrInput * myAttrInputParent
Pointer to AttrInput parent.
#define GUIDesignMenuCheck
void markAttributeCarrier(GNEAttributeCarrier *ac)
mark attribute carrier (element)
#define GUIDesignMenuCheckAttribute
MenuCheck button for attributes extended over the matrix column.
#define GUIDesignSpinDialAttribute
spin dial extended over the matrix column with thick frame
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="")
GNEViewNet * getViewNet() const
get view net
#define GUIDesignTextFieldAttributeInt
text field extended over the matrix column with thick frame and limited to integers ...
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="")
FXButton * myResetButton
Button Reset.
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
#define GUIDesignButtonHelp
little button for help in frames
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.
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
void showAttributeCarrierChilds(GNEAttributeCarrier *ac)
show child of attributeCarrier in frame if previously there isn't a marked element ...
static bool discreteCombinableChoices(SumoXMLTag tag, SumoXMLAttr attr)
return whether the given attribute allows for a combination of discrete values
virtual void hide()
hide Frame
FXTextField * myTextFieldAttr
void show()
show inspector frame
bool isAdditionalBlocked() const
Check if additional item is currently blocked (i.e. cannot be moved with mouse)
const int MAXNUMBEROFATTRCONNECTIONS
SumoXMLTag getTag() const
get XML Tag assigned to this object
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
FXMenuCheck * myCheckBlocked
pointer to menu check block
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::set< FXTreeItem * > myTreeItesmWithoutAC
set used to save tree items without AC assigned (for example, Incoming/Outcoming connections) ...
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
In GNEInspectFrame, inspect element.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
FXGroupBox * myGroupBoxForAttributes
groupBox for attributes
std::vector< GNEInspectorFrame::AttrInput * > vectorOfAttrInput
list of Attribute inputs
bool isAdditionalMovable() const
check if additional element is movable