![]() |
SUMO - Simulation of Urban MObility
|
#include <GNESelector.h>
Public Types | |
enum | SetOperation { SET_ADD = 1, SET_SUB = 2, SET_RESTRICT = 3, SET_REPLACE = 4, SET_DEFAULT = 5 } |
Public Member Functions | |
FXFont * | getHeaderFont () |
GNESelector (FXComposite *parent, GNEViewNet *updateTarget, GNEUndoList *undoList) | |
Constructor. More... | |
void | handleIDs (std::vector< GUIGlID > ids, bool selectEdges, SetOperation setop=SET_DEFAULT) |
void | hide () |
void | selectionUpdated () |
void | show () |
~GNESelector () | |
Destructor. More... | |
FOX-callbacks | |
long | onCmdLoad (FXObject *, FXSelector, void *) |
Called when the user presses the Load-button. More... | |
long | onCmdSave (FXObject *, FXSelector, void *) |
Called when the user presses the Save-button. More... | |
long | onCmdClear (FXObject *, FXSelector, void *) |
Called when the user presses the Clear-button. More... | |
long | onCmdInvert (FXObject *, FXSelector, void *) |
Called when the user presses the Invert-button invert the selection Repaints itself. More... | |
long | onCmdSelMBTag (FXObject *, FXSelector, void *) |
Called when the user selectes a tag in the match box updates the attr listbox Repaints itself. More... | |
long | onCmdSelMBString (FXObject *, FXSelector, void *) |
Called when the user enters a new selection expression validates expression and modifies current selection. More... | |
long | onCmdHelp (FXObject *, FXSelector, void *) |
Called when the user clicks the help button pop up help window. More... | |
long | onCmdScaleSelection (FXObject *, FXSelector, void *) |
Called when the user changes visual scaling. More... | |
Protected Member Functions | |
GNESelector () | |
FOX needs this. More... | |
Private Member Functions | |
std::vector< GUIGlID > | getMatches (SumoXMLTag tag, SumoXMLAttr attr, char compOp, SUMOReal val, const std::string &expr) |
return objects of the given type with matching attrs More... | |
std::string | getStats () const |
Private Attributes | |
const std::string | ALL_VCLASS_NAMES_MATCH_STRING |
FXVerticalFrame * | myContentFrame |
the panel to hold all member widgets More... | |
FXFont * | myHeaderFont |
Font for the widget. More... | |
FXListBox * | myMatchAttrBox |
FXTextField * | myMatchString |
FXListBox * | myMatchTagBox |
state variables for the match box More... | |
FXRealSpinDial * | mySelectionScaling |
FXuint | mySetOperation |
how to modify selection More... | |
FXDataTarget | mySetOperationTarget |
FXLabel * | myStats |
the label for selection statistics More... | |
GNEUndoList * | myUndoList |
GNEViewNet * | myUpdateTarget |
Static Private Attributes | |
static const int | WIDTH = 140 |
The Widget for modifying selections of network-elements
Definition at line 54 of file GNESelector.h.
Enumerator | |
---|---|
SET_ADD | |
SET_SUB | |
SET_RESTRICT | |
SET_REPLACE | |
SET_DEFAULT |
Definition at line 60 of file GNESelector.h.
GNESelector::GNESelector | ( | FXComposite * | parent, |
GNEViewNet * | updateTarget, | ||
GNEUndoList * | undoList | ||
) |
Constructor.
[in] | parent | The parent window |
Definition at line 85 of file GNESelector.cpp.
References GNEAttributeCarrier::allowedTags(), MID_CHOOSEN_CLEAR, MID_CHOOSEN_INVERT, MID_CHOOSEN_LOAD, MID_CHOOSEN_SAVE, MID_GNE_SELECT_SCALE, MID_GNE_SELMB_STRING, MID_GNE_SELMB_TAG, MID_HELP, and toString().
GNESelector::~GNESelector | ( | ) |
Destructor.
Definition at line 164 of file GNESelector.cpp.
References gSelected, myHeaderFont, and GUISelectedStorage::remove2Update().
|
inlineprotected |
FOX needs this.
Definition at line 149 of file GNESelector.h.
|
inline |
Definition at line 78 of file GNESelector.h.
References handleIDs(), hide(), myHeaderFont, onCmdClear(), onCmdHelp(), onCmdInvert(), onCmdLoad(), onCmdSave(), onCmdScaleSelection(), onCmdSelMBString(), onCmdSelMBTag(), selectionUpdated(), SET_DEFAULT, and show().
|
private |
return objects of the given type with matching attrs
[in] | compOp | One of {<,>,=} for matching against val or '@' for matching against expr |
Definition at line 458 of file GNESelector.cpp.
References ALL_VCLASS_NAMES_MATCH_STRING, GNEAttributeCarrier::getAttribute(), GNENet::getGlIDs(), GNEViewNet::getNet(), GUIGlObjectStorage::getObjectBlocking(), GNEAttributeCarrier::getTag(), GUIGlObjectStorage::gIDStorage, GNEAttributeCarrier::isNumerical(), myUpdateTarget, SUMO_ATTR_ALLOW, SUMO_ATTR_DISALLOW, SUMOReal, toString(), and GUIGlObjectStorage::unblockObject().
Referenced by onCmdSelMBString().
|
private |
Definition at line 368 of file GNESelector.cpp.
References GUISelectedStorage::getSelected(), GLO_EDGE, GLO_JUNCTION, GLO_LANE, gSelected, and toString().
Referenced by selectionUpdated().
void GNESelector::handleIDs | ( | std::vector< GUIGlID > | ids, |
bool | selectEdges, | ||
SetOperation | setop = SET_DEFAULT |
||
) |
Definition at line 384 of file GNESelector.cpp.
References GNEViewNet::autoSelectNodes(), GNEEdge::getDest(), GUIGlObject::getGlID(), GUIGlObjectStorage::getObjectBlocking(), GUISelectedStorage::getSelected(), GNEEdge::getSource(), GUIGlObject::getType(), GUIGlObjectStorage::gIDStorage, GLO_LANE, gSelected, mySetOperation, myUndoList, myUpdateTarget, GNEUndoList::p_begin(), GNEUndoList::p_end(), SET_ADD, SET_DEFAULT, SET_REPLACE, SET_RESTRICT, SET_SUB, and GUIGlObjectStorage::unblockObject().
Referenced by getHeaderFont(), onCmdLoad(), GNEConnector::onCmdSelectConflicts(), GNEConnector::onCmdSelectDeadEnds(), GNEConnector::onCmdSelectDeadStarts(), GNEConnector::onCmdSelectPass(), onCmdSelMBString(), and GNEViewNet::onLeftBtnRelease().
void GNESelector::hide | ( | ) |
Definition at line 361 of file GNESelector.cpp.
References gSelected, and GUISelectedStorage::remove2Update().
Referenced by getHeaderFont(), and GNEViewNet::updateModeSpecificControls().
long GNESelector::onCmdClear | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user presses the Clear-button.
Clear the internal list and calls GUISelectedStorage::clear. Repaints itself
Definition at line 213 of file GNESelector.cpp.
References GUISelectedStorage::getSelected(), gSelected, myUndoList, and myUpdateTarget.
Referenced by getHeaderFont().
long GNESelector::onCmdHelp | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user clicks the help button pop up help window.
Definition at line 309 of file GNESelector.cpp.
Referenced by getHeaderFont().
long GNESelector::onCmdInvert | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user presses the Invert-button invert the selection Repaints itself.
Definition at line 221 of file GNESelector.cpp.
References GNENet::getGlIDs(), GNEViewNet::getNet(), GLO_EDGE, GLO_JUNCTION, GLO_LANE, gSelected, myUpdateTarget, GNEViewNet::selectEdges(), and GUISelectedStorage::toggleSelection().
Referenced by getHeaderFont().
long GNESelector::onCmdLoad | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user presses the Load-button.
Opens a file dialog and forces the parent to load the list of selected objects when a file was chosen. Rebuilds the list, then, and redraws itself.
Definition at line 171 of file GNESelector.cpp.
References gCurrentFolder, GUIIconSubSys::getIcon(), gSelected, handleIDs(), ICON_EMPTY, GUISelectedStorage::loadIDs(), and myUpdateTarget.
Referenced by getHeaderFont().
long GNESelector::onCmdSave | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user presses the Save-button.
Opens a file dialog and forces the selection container to save the list of selected objects when a file was chosen.
If the saveing failed, a message window is shown.
Definition at line 197 of file GNESelector.cpp.
References gCurrentFolder, MFXUtils::getFilename2Write(), GUIIconSubSys::getIcon(), gSelected, ICON_EMPTY, and GUISelectedStorage::save().
Referenced by getHeaderFont().
long GNESelector::onCmdScaleSelection | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user changes visual scaling.
Definition at line 345 of file GNESelector.cpp.
References FX::FXRealSpinDial::getValue(), mySelectionScaling, myUpdateTarget, and GNEViewNet::setSelectionScaling().
Referenced by getHeaderFont().
long GNESelector::onCmdSelMBString | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user enters a new selection expression validates expression and modifies current selection.
Definition at line 251 of file GNESelector.cpp.
References GNEAttributeCarrier::allowedAttributes(), GNEAttributeCarrier::allowedTags(), getMatches(), handleIDs(), GNEAttributeCarrier::isNumerical(), myMatchAttrBox, myMatchString, myMatchTagBox, and SUMOReal.
Referenced by getHeaderFont().
long GNESelector::onCmdSelMBTag | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user selectes a tag in the match box updates the attr listbox Repaints itself.
Definition at line 236 of file GNESelector.cpp.
References GNEAttributeCarrier::allowedAttributes(), GNEAttributeCarrier::allowedTags(), myMatchAttrBox, myMatchTagBox, and toString().
Referenced by getHeaderFont().
|
virtual |
Implements GUISelectedStorage::UpdateTarget.
Definition at line 377 of file GNESelector.cpp.
References getStats(), and myStats.
Referenced by getHeaderFont(), and show().
void GNESelector::show | ( | ) |
Definition at line 353 of file GNESelector.cpp.
References GUISelectedStorage::add2Update(), gSelected, and selectionUpdated().
Referenced by getHeaderFont(), and GNEViewNet::updateModeSpecificControls().
|
private |
Definition at line 192 of file GNESelector.h.
Referenced by getMatches().
|
private |
the panel to hold all member widgets
Definition at line 153 of file GNESelector.h.
|
private |
Font for the widget.
Definition at line 156 of file GNESelector.h.
Referenced by getHeaderFont(), and ~GNESelector().
|
private |
Definition at line 172 of file GNESelector.h.
Referenced by onCmdSelMBString(), and onCmdSelMBTag().
|
private |
Definition at line 173 of file GNESelector.h.
Referenced by onCmdSelMBString().
|
private |
state variables for the match box
Definition at line 171 of file GNESelector.h.
Referenced by onCmdSelMBString(), and onCmdSelMBTag().
|
private |
Definition at line 175 of file GNESelector.h.
Referenced by onCmdScaleSelection().
|
private |
|
private |
Definition at line 168 of file GNESelector.h.
|
private |
the label for selection statistics
Definition at line 159 of file GNESelector.h.
Referenced by selectionUpdated().
|
private |
Definition at line 179 of file GNESelector.h.
Referenced by handleIDs(), and onCmdClear().
|
private |
Definition at line 164 of file GNESelector.h.
Referenced by getMatches(), handleIDs(), onCmdClear(), onCmdInvert(), onCmdLoad(), and onCmdScaleSelection().
|
staticprivate |
Definition at line 177 of file GNESelector.h.