SUMO - Simulation of Urban MObility
GNESelectorFrame Class Reference

#include <GNESelectorFrame.h>

Inheritance diagram for GNESelectorFrame:
Inheritance graph
Collaboration diagram for GNESelectorFrame:
Collaboration graph

Data Structures

struct  ObjectTypeEntry
 

Public Types

enum  SetOperation {
  SET_ADD = 1, SET_SUB = 2, SET_RESTRICT = 3, SET_REPLACE = 4,
  SET_DEFAULT = 5
}
 FOX-declaration. More...
 

Public Member Functions

void focusUpperElement ()
 focus upper element of frame More...
 
GNEFrame::DrawingModegetDrawingMode () const
 get drawing mode editor More...
 
FXFont * getFrameHeaderFont () const
 get font of the header's frame More...
 
FXLabel * getFrameHeaderLabel () const
 get the label for the frame's header More...
 
GNEFrame::GEOAttributesgetGEOAttributes () const
 get GEO Parameters editor More...
 
GNEFrame::NeteditAttributesgetNeteditAttributes () const
 get netedit attributes editor More...
 
GNEViewNetgetViewNet () const
 get view net More...
 
 GNESelectorFrame (FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
 Constructor. More...
 
void handleIDs (std::vector< GUIGlID > ids, bool selectEdgesEnabled, SetOperation setop=SET_DEFAULT)
 apply list of ids to the current selection according to SetOperation, More...
 
void hide ()
 hide Frame More...
 
bool locked (GUIGlObjectType type)
 
void selectionUpdated ()
 called if currently registered for updates for changes of global selection More...
 
void setFrameWidth (int newWidth)
 set width of GNEFrame More...
 
void show ()
 show Frame More...
 
 ~GNESelectorFrame ()
 Destructor. More...
 
FOX-callbacks

called when user change type of selction operation

long onCmdSelectOperation (FXObject *, FXSelector, void *)
 
long onCmdSubset (FXObject *, FXSelector, void *)
 Called when the user change the type of element to search (netElement or Additional) More...
 
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. More...
 
long onCmdSelMBTag (FXObject *, FXSelector, void *)
 Called when the user selectes a tag in the match box. More...
 
long onCmdSelMBAttribute (FXObject *, FXSelector, void *)
 Called when the user selectes a tag in the match box. More...
 
long onCmdSelMBString (FXObject *, FXSelector, void *)
 Called when the user enters a new selection expression. More...
 
long onCmdHelp (FXObject *, FXSelector, void *)
 Called when the user clicks the help button. More...
 
long onCmdScaleSelection (FXObject *, FXSelector, void *)
 Called when the user changes visual scaling. More...
 

Protected Member Functions

 GNESelectorFrame ()
 FOX needs this. More...
 

Protected Attributes

FXVerticalFrame * myContentFrame
 Vertical frame that holds all widgets of frame. More...
 
GNEFrame::DrawingModemyDrawingMode
 drawing mode More...
 
GNEFrame::GEOAttributesmyGEOAttributes
 GEO Parameters. More...
 
FXHorizontalFrame * myHeaderFrame
 fame for header elements More...
 
FXHorizontalFrame * myHeaderLeftFrame
 fame for left header elements More...
 
FXHorizontalFrame * myHeaderRightFrame
 fame for right header elements More...
 
GNEFrame::NeteditAttributesmyNeteditAttributes
 Netedit parameter. More...
 
GNEViewNetmyViewNet
 View Net for changes. More...
 

Private Member Functions

std::vector< GUIGlIDgetMatches (SumoXMLTag ACTag, SumoXMLAttr ACAttr, char compOp, double val, const std::string &expr)
 return objects of the given type with matching attrs More...
 

Private Attributes

FXRadioButton * myAddRadioButton
 add radio button More...
 
SumoXMLAttr myCurrentAttribute
 current SumoXMLTag Attribute More...
 
SumoXMLTag myCurrentTag
 current SumoXMLTag tag More...
 
FXRadioButton * myKeepRadioButton
 keep button More...
 
FXComboBox * myMatchAttrComboBox
 attributes of the match box More...
 
FXTextField * myMatchString
 string of the match More...
 
FXComboBox * myMatchTagComboBox
 tag of the match box More...
 
FXRadioButton * myRemoveRadioButton
 remove radio button More...
 
FXRadioButton * myReplaceRadioButton
 replace radio button More...
 
FXRealSpinDial * mySelectionScaling
 selection scaling More...
 
FXComboBox * mySetComboBox
 tag of the sets of elements More...
 
SetOperation mySetOperation
 how to modify selection More...
 
std::map< GUIGlObjectType, ObjectTypeEntrymyTypeEntries
 check boxes for type-based selection locking and selected object counts More...
 

Detailed Description

The Widget for modifying selections of network-elements

Definition at line 46 of file GNESelectorFrame.h.

Member Enumeration Documentation

◆ SetOperation

FOX-declaration.

operations of selector

Enumerator
SET_ADD 
SET_SUB 
SET_RESTRICT 
SET_REPLACE 
SET_DEFAULT 

Definition at line 52 of file GNESelectorFrame.h.

Constructor & Destructor Documentation

◆ GNESelectorFrame() [1/2]

◆ ~GNESelectorFrame()

GNESelectorFrame::~GNESelectorFrame ( )

Destructor.

Definition at line 168 of file GNESelectorFrame.cpp.

References gSelected, and GUISelectedStorage::remove2Update().

◆ GNESelectorFrame() [2/2]

GNESelectorFrame::GNESelectorFrame ( )
inlineprotected

FOX needs this.

Definition at line 143 of file GNESelectorFrame.h.

Member Function Documentation

◆ focusUpperElement()

void GNEFrame::focusUpperElement ( )
inherited

◆ getDrawingMode()

GNEFrame::DrawingMode * GNEFrame::getDrawingMode ( ) const
inherited

◆ getFrameHeaderFont()

FXFont * GNEFrame::getFrameHeaderFont ( ) const
inherited

get font of the header's frame

Definition at line 583 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderFont.

◆ getFrameHeaderLabel()

FXLabel * GNEFrame::getFrameHeaderLabel ( ) const
inherited

get the label for the frame's header

Definition at line 577 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderLabel.

Referenced by GNEInspectorFrame::inspectMultisection().

◆ getGEOAttributes()

GNEFrame::GEOAttributes * GNEFrame::getGEOAttributes ( ) const
inherited

get GEO Parameters editor

Definition at line 599 of file GNEFrame.cpp.

References GNEFrame::myGEOAttributes.

◆ getMatches()

std::vector< GUIGlID > GNESelectorFrame::getMatches ( SumoXMLTag  ACTag,
SumoXMLAttr  ACAttr,
char  compOp,
double  val,
const std::string &  expr 
)
private

return objects of the given type with matching attrs

Parameters
[in]ACTagXML Tag of AttributeCarrier
[in]ACAttrXML Attribute of AttributeCarrier
[in]compOpOne of {<,>,=} for matching against val or '@' for matching against expr

Definition at line 687 of file GNESelectorFrame.cpp.

References GNEAttributeCarrier::getAttribute(), GNEAttributeCarrier::getAttributeForSelection(), GNENet::getGlIDs(), GNEViewNet::getNet(), GNEAttributeCarrier::getTag(), GUIGlObjectStorage::gIDStorage, GNEAttributeCarrier::isNumerical(), GNEFrame::myViewNet, GNENet::retrieveAttributeCarrier(), and GUIGlObjectStorage::unblockObject().

Referenced by onCmdSelMBString().

◆ getNeteditAttributes()

GNEFrame::NeteditAttributes * GNEFrame::getNeteditAttributes ( ) const
inherited

get netedit attributes editor

Definition at line 589 of file GNEFrame.cpp.

References GNEFrame::myNeteditAttributes.

Referenced by GNEFrame::DrawingMode::stopDrawing().

◆ getViewNet()

◆ handleIDs()

◆ hide()

void GNESelectorFrame::hide ( )
virtual

hide Frame

Reimplemented from GNEFrame.

Definition at line 576 of file GNESelectorFrame.cpp.

References gSelected, GNEFrame::hide(), and GUISelectedStorage::remove2Update().

◆ locked()

bool GNESelectorFrame::locked ( GUIGlObjectType  type)
inline

Definition at line 129 of file GNESelectorFrame.h.

References handleIDs(), myTypeEntries, selectionUpdated(), and SET_DEFAULT.

Referenced by handleIDs(), and GNEViewNet::onLeftBtnPress().

◆ onCmdClear()

long GNESelectorFrame::onCmdClear ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Clear-button.

Note
Clear the internal list and calls GUISelectedStorage::clear and repaints itself

Definition at line 327 of file GNESelectorFrame.cpp.

References GNEViewNet::getNet(), GUISelectedStorage::getSelected(), GNEViewNet::getUndoList(), gSelected, GNEFrame::myViewNet, GNEUndoList::p_begin(), and GNEUndoList::p_end().

◆ onCmdHelp()

long GNESelectorFrame::onCmdHelp ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user clicks the help button.

Note
pop up help window

Definition at line 524 of file GNESelectorFrame.cpp.

References GUIIconSubSys::getIcon(), GUIDesignButtonOK, GUIDesignDialogBox, GUIDesignLabelFrameInformation, and ICON_ACCEPT.

◆ onCmdInvert()

◆ onCmdLoad()

long GNESelectorFrame::onCmdLoad ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Load-button.

Note
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 267 of file GNESelectorFrame.cpp.

References gCurrentFolder, OptionsCont::getBool(), GUIIconSubSys::getIcon(), OptionsCont::getOptions(), gSelected, handleIDs(), ICON_EMPTY, GUISelectedStorage::loadIDs(), GNEFrame::myViewNet, and WRITE_WARNING.

◆ onCmdSave()

long GNESelectorFrame::onCmdSave ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Save-button.

Note
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 302 of file GNESelectorFrame.cpp.

References gCurrentFolder, OptionsCont::getBool(), MFXUtils::getFilename2Write(), GUIIconSubSys::getIcon(), OptionsCont::getOptions(), gSelected, ICON_EMPTY, GUISelectedStorage::save(), and WRITE_WARNING.

◆ onCmdScaleSelection()

long GNESelectorFrame::onCmdScaleSelection ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user changes visual scaling.

Definition at line 558 of file GNESelectorFrame.cpp.

References FX::FXRealSpinDial::getValue(), mySelectionScaling, GNEFrame::myViewNet, and GNEViewNet::setSelectionScaling().

◆ onCmdSelectOperation()

long GNESelectorFrame::onCmdSelectOperation ( FXObject *  obj,
FXSelector  ,
void *   
)

◆ onCmdSelMBAttribute()

long GNESelectorFrame::onCmdSelMBAttribute ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user selectes a tag in the match box.

Note
updates the attr listbox and repaints itself

Definition at line 453 of file GNESelectorFrame.cpp.

References GNEAttributeCarrier::allowedAttributes(), myCurrentAttribute, myCurrentTag, myMatchAttrComboBox, myMatchString, SUMO_ATTR_NOTHING, and toString().

Referenced by onCmdSelMBTag().

◆ onCmdSelMBString()

long GNESelectorFrame::onCmdSelMBString ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user enters a new selection expression.

Note
validates expression and modifies current selection

Definition at line 473 of file GNESelectorFrame.cpp.

References getMatches(), handleIDs(), GNEAttributeCarrier::isNumerical(), myCurrentAttribute, myCurrentTag, and myMatchString.

◆ onCmdSelMBTag()

long GNESelectorFrame::onCmdSelMBTag ( FXObject *  ,
FXSelector  ,
void *   
)

◆ onCmdSubset()

long GNESelectorFrame::onCmdSubset ( FXObject *  ,
FXSelector  ,
void *   
)

◆ selectionUpdated()

void GNESelectorFrame::selectionUpdated ( )
virtual

called if currently registered for updates for changes of global selection

Implements GUISelectedStorage::UpdateTarget.

Definition at line 585 of file GNESelectorFrame.cpp.

References OptionsCont::getOptions(), GUISelectedStorage::getSelected(), GLO_ADDITIONAL, GLO_CONNECTION, GLO_CROSSING, GLO_EDGE, GLO_JUNCTION, GLO_LANE, GLO_POI, GLO_POLYGON, gSelected, myTypeEntries, toString(), and WRITE_WARNING.

Referenced by locked(), and show().

◆ setFrameWidth()

void GNEFrame::setFrameWidth ( int  newWidth)
inherited

set width of GNEFrame

Definition at line 564 of file GNEFrame.cpp.

References GNEFrame::myScrollWindowsContents.

◆ show()

void GNESelectorFrame::show ( )
virtual

show Frame

Reimplemented from GNEFrame.

Definition at line 566 of file GNESelectorFrame.cpp.

References GUISelectedStorage::add2Update(), gSelected, selectionUpdated(), and GNEFrame::show().

Referenced by GNEViewNet::updateModeSpecificControls().

Field Documentation

◆ myAddRadioButton

FXRadioButton* GNESelectorFrame::myAddRadioButton
private

add radio button

Definition at line 150 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), and onCmdSelectOperation().

◆ myContentFrame

FXVerticalFrame* GNEFrame::myContentFrame
protectedinherited

◆ myCurrentAttribute

SumoXMLAttr GNESelectorFrame::myCurrentAttribute
private

current SumoXMLTag Attribute

Definition at line 180 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), onCmdSelMBAttribute(), and onCmdSelMBString().

◆ myCurrentTag

SumoXMLTag GNESelectorFrame::myCurrentTag
private

current SumoXMLTag tag

Definition at line 177 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), onCmdSelMBAttribute(), onCmdSelMBString(), and onCmdSelMBTag().

◆ myDrawingMode

GNEFrame::DrawingMode* GNEFrame::myDrawingMode
protectedinherited

◆ myGEOAttributes

GNEFrame::GEOAttributes* GNEFrame::myGEOAttributes
protectedinherited

◆ myHeaderFrame

FXHorizontalFrame* GNEFrame::myHeaderFrame
protectedinherited

fame for header elements

Definition at line 343 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

◆ myHeaderLeftFrame

FXHorizontalFrame* GNEFrame::myHeaderLeftFrame
protectedinherited

◆ myHeaderRightFrame

FXHorizontalFrame* GNEFrame::myHeaderRightFrame
protectedinherited

fame for right header elements

Definition at line 349 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

◆ myKeepRadioButton

FXRadioButton* GNESelectorFrame::myKeepRadioButton
private

keep button

Definition at line 156 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), and onCmdSelectOperation().

◆ myMatchAttrComboBox

FXComboBox* GNESelectorFrame::myMatchAttrComboBox
private

attributes of the match box

Definition at line 168 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), onCmdSelMBAttribute(), onCmdSelMBTag(), and onCmdSubset().

◆ myMatchString

FXTextField* GNESelectorFrame::myMatchString
private

string of the match

Definition at line 171 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), onCmdSelMBAttribute(), onCmdSelMBString(), onCmdSelMBTag(), and onCmdSubset().

◆ myMatchTagComboBox

FXComboBox* GNESelectorFrame::myMatchTagComboBox
private

tag of the match box

Definition at line 165 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), onCmdSelMBTag(), and onCmdSubset().

◆ myNeteditAttributes

GNEFrame::NeteditAttributes* GNEFrame::myNeteditAttributes
protectedinherited

◆ myRemoveRadioButton

FXRadioButton* GNESelectorFrame::myRemoveRadioButton
private

remove radio button

Definition at line 153 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), and onCmdSelectOperation().

◆ myReplaceRadioButton

FXRadioButton* GNESelectorFrame::myReplaceRadioButton
private

replace radio button

Definition at line 159 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), and onCmdSelectOperation().

◆ mySelectionScaling

FXRealSpinDial* GNESelectorFrame::mySelectionScaling
private

selection scaling

Definition at line 174 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), and onCmdScaleSelection().

◆ mySetComboBox

FXComboBox* GNESelectorFrame::mySetComboBox
private

tag of the sets of elements

Definition at line 162 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), onCmdSelMBTag(), and onCmdSubset().

◆ mySetOperation

SetOperation GNESelectorFrame::mySetOperation
private

how to modify selection

Definition at line 147 of file GNESelectorFrame.h.

Referenced by handleIDs(), and onCmdSelectOperation().

◆ myTypeEntries

std::map<GUIGlObjectType, ObjectTypeEntry> GNESelectorFrame::myTypeEntries
private

check boxes for type-based selection locking and selected object counts

Definition at line 191 of file GNESelectorFrame.h.

Referenced by GNESelectorFrame(), handleIDs(), locked(), and selectionUpdated().

◆ myViewNet

GNEViewNet* GNEFrame::myViewNet
protectedinherited

View Net for changes.

Definition at line 337 of file GNEFrame.h.

Referenced by GNEAdditionalFrame::addAdditional(), GNEPolygonFrame::addPOI(), GNEPolygonFrame::addPOILane(), GNEPolygonFrame::addPolygon(), GNETLSEditorFrame::buildIinternalLanes(), GNEPolygonFrame::buildPoly(), GNEDeleteFrame::createPopUpMenu(), GNEInspectorFrame::createPopUpMenu(), GNETLSEditorFrame::editJunction(), GNEAdditionalFrame::generateID(), getMatches(), GNEFrame::getViewNet(), GNETLSEditorFrame::handleChange(), handleIDs(), GNEConnectorFrame::handleLaneClick(), GNETLSEditorFrame::handleMultiChange(), GNEFrame::hide(), GNEConnectorFrame::initTargets(), GNEConnectorFrame::onCmdCancel(), GNETLSEditorFrame::onCmdCancel(), GNEDeleteFrame::onCmdCenterChildItem(), GNEInspectorFrame::onCmdCenterItem(), onCmdClear(), GNEConnectorFrame::onCmdClearSelectedConnections(), GNEInspectorFrame::onCmdCopyTemplate(), GNECrossingFrame::onCmdCreateCrossing(), GNETLSEditorFrame::onCmdDefCreate(), GNETLSEditorFrame::onCmdDefDelete(), GNETLSEditorFrame::onCmdDefSwitch(), GNEInspectorFrame::onCmdDeleteItem(), GNEInspectorFrame::onCmdGoBack(), GNEDeleteFrame::onCmdInspectChildItem(), onCmdInvert(), onCmdLoad(), GNEConnectorFrame::onCmdOK(), GNETLSEditorFrame::onCmdOK(), GNETLSEditorFrame::onCmdPhaseSwitch(), GNEConnectorFrame::onCmdResetSelectedConnections(), onCmdScaleSelection(), GNEConnectorFrame::onCmdSelectConflicts(), GNEConnectorFrame::onCmdSelectDeadEnds(), GNEConnectorFrame::onCmdSelectDeadStarts(), GNEConnectorFrame::onCmdSelectPass(), GNEPolygonFrame::processClick(), GNEAdditionalFrame::removeAdditional(), GNEDeleteFrame::removeAttributeCarrier(), and GNEFrame::show().


The documentation for this class was generated from the following files: