SUMO - Simulation of Urban MObility
GNESelectorFrame Class Reference

#include <GNESelectorFrame.h>

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

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

FXFont * getFrameHeaderFont () const
 get font of the header's frame More...
 
FXLabel * getFrameHeaderLabel () const
 get the label for the frame's header More...
 
GNEViewNet * getViewNet () const
 get view net More...
 
 GNESelectorFrame (FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
 Constructor. More...
 
void handleIDs (std::vector< GUIGlID > ids, bool selectEdges, SetOperation setop=SET_DEFAULT)
 apply list of ids to the current selection according to SetOperation, More...
 
void hide ()
 hide Frame More...
 
void selectionUpdated ()
 called if currently registered for updates for changes of global selection More...
 
void setFrameWidth (int width)
 set width of GNEFrame More...
 
void show ()
 show Frame More...
 
 ~GNESelectorFrame ()
 Destructor. More...
 
FOX-callbacks

Called when the user change the type of element to search (netElement or Additional)

long onCmdSubset (FXObject *, FXSelector, void *)
 
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 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...
 
FXFont * myFrameHeaderFont
 Font for the Header. More...
 
FXLabel * myFrameHeaderLabel
 the label for the frame's header More...
 
FXHorizontalFrame * myHeaderFrame
 fame for header elements More...
 
FXHorizontalFrame * myHeaderLeftFrame
 fame for left header elements More...
 
FXHorizontalFrame * myHeaderRightFrame
 fame for right header elements More...
 
GNEViewNet * myViewNet
 the window to inform when the tls is modfied 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
 get stats More...
 

Private Attributes

const std::string ALL_VCLASS_NAMES_MATCH_STRING
 the string that should be matched against if attr 'allowed' or 'disalloed' are set to "all" More...
 
FXComboBox * myMatchAttrComboBox
 attributes of the match box More...
 
FXTextField * myMatchString
 string of the match More...
 
FXComboBox * myMatchTagComboBox
 tag of the match box More...
 
FXRealSpinDial * mySelectionScaling
 selection scaling More...
 
FXComboBox * mySetComboBox
 tag of the sets of elements More...
 
FXuint mySetOperation
 how to modify selection More...
 
FXDataTarget mySetOperationTarget
 target of modify selection More...
 

Detailed Description

The Widget for modifying selections of network-elements

Definition at line 47 of file GNESelectorFrame.h.

Member Enumeration Documentation

FOX-declaration.

operations of selector

Enumerator
SET_ADD 
SET_SUB 
SET_RESTRICT 
SET_REPLACE 
SET_DEFAULT 

Definition at line 53 of file GNESelectorFrame.h.

Constructor & Destructor Documentation

GNESelectorFrame::GNESelectorFrame ( FXHorizontalFrame *  horizontalFrameParent,
GNEViewNet *  viewNet 
)
GNESelectorFrame::~GNESelectorFrame ( )

Destructor.

Definition at line 151 of file GNESelectorFrame.cpp.

References gSelected, and GUISelectedStorage::remove2Update().

GNESelectorFrame::GNESelectorFrame ( )
inlineprotected

FOX needs this.

Definition at line 124 of file GNESelectorFrame.h.

Member Function Documentation

FXFont * GNEFrame::getFrameHeaderFont ( ) const
inherited

get font of the header's frame

Definition at line 137 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderFont.

FXLabel * GNEFrame::getFrameHeaderLabel ( ) const
inherited

get the label for the frame's header

Definition at line 131 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderLabel.

Referenced by GNEInspectorFrame::inspectMultisection().

std::vector< GUIGlID > GNESelectorFrame::getMatches ( SumoXMLTag  tag,
SumoXMLAttr  attr,
char  compOp,
SUMOReal  val,
const std::string &  expr 
)
private
std::string GNESelectorFrame::getStats ( ) const
private
void GNESelectorFrame::hide ( )
virtual

hide Frame

Reimplemented from GNEFrame.

Definition at line 376 of file GNESelectorFrame.cpp.

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

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

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

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

Called when the user clicks the help button.

Note
pop up help window

Definition at line 324 of file GNESelectorFrame.cpp.

References GUIIconSubSys::getIcon(), GUIDesignButtonDialog, GUIDesignDialogBox, GUIDesignLabelLeft, and ICON_ACCEPT.

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

Called when the user presses the Invert-button.

Note
invert the selection and repaints itself

Definition at line 225 of file GNESelectorFrame.cpp.

References GNENet::getGlIDs(), GNEViewNet::getNet(), GLO_ADDITIONAL, GLO_CONNECTION, GLO_EDGE, GLO_JUNCTION, GLO_LANE, gSelected, GNEFrame::myViewNet, GNEViewNet::selectEdges(), and GUISelectedStorage::toggleSelection().

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

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

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

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

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

Called when the user changes visual scaling.

Definition at line 358 of file GNESelectorFrame.cpp.

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

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

References TplConvert::_2SUMOReal(), GNEAttributeCarrier::allowedAttributes(), GNEAttributeCarrier::allowedTags(), getMatches(), handleIDs(), GNEAttributeCarrier::isNumerical(), myMatchAttrComboBox, myMatchString, myMatchTagComboBox, and mySetComboBox.

long GNESelectorFrame::onCmdSelMBTag ( 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 248 of file GNESelectorFrame.cpp.

References GNEAttributeCarrier::allowedAttributes(), GNEAttributeCarrier::allowedTags(), myMatchAttrComboBox, myMatchTagComboBox, mySetComboBox, and toString().

Referenced by onCmdSubset().

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

called if currently registered for updates for changes of global selection

Implements GUISelectedStorage::UpdateTarget.

Definition at line 396 of file GNESelectorFrame.cpp.

References getStats(), and GNEFrame::myFrameHeaderLabel.

Referenced by show().

void GNEFrame::setFrameWidth ( int  width)
inherited

set width of GNEFrame

Definition at line 118 of file GNEFrame.cpp.

References GNEFrame::myScrollWindowsContents.

void GNESelectorFrame::show ( )
virtual

show Frame

Reimplemented from GNEFrame.

Definition at line 366 of file GNESelectorFrame.cpp.

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

Referenced by GNEViewNet::updateModeSpecificControls().

Field Documentation

const std::string GNESelectorFrame::ALL_VCLASS_NAMES_MATCH_STRING
private

the string that should be matched against if attr 'allowed' or 'disalloed' are set to "all"

Definition at line 157 of file GNESelectorFrame.h.

Referenced by getMatches().

FXVerticalFrame* GNEFrame::myContentFrame
protectedinherited

Vertical frame that holds all widgets of frame.

Definition at line 101 of file GNEFrame.h.

Referenced by GNECrossingFrame::GNECrossingFrame(), GNEFrame::GNEFrame(), and GNEInspectorFrame::inspectMultisection().

FXFont* GNEFrame::myFrameHeaderFont
protectedinherited

Font for the Header.

Definition at line 95 of file GNEFrame.h.

Referenced by GNEFrame::getFrameHeaderFont(), GNEFrame::GNEFrame(), and GNEFrame::~GNEFrame().

FXLabel* GNEFrame::myFrameHeaderLabel
protectedinherited

the label for the frame's header

Definition at line 98 of file GNEFrame.h.

Referenced by GNEFrame::getFrameHeaderLabel(), GNEFrame::GNEFrame(), and selectionUpdated().

FXHorizontalFrame* GNEFrame::myHeaderFrame
protectedinherited

fame for header elements

Definition at line 104 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

FXHorizontalFrame* GNEFrame::myHeaderLeftFrame
protectedinherited
FXHorizontalFrame* GNEFrame::myHeaderRightFrame
protectedinherited

fame for right header elements

Definition at line 110 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

FXComboBox* GNESelectorFrame::myMatchAttrComboBox
private

attributes of the match box

Definition at line 140 of file GNESelectorFrame.h.

Referenced by onCmdSelMBString(), and onCmdSelMBTag().

FXTextField* GNESelectorFrame::myMatchString
private

string of the match

Definition at line 143 of file GNESelectorFrame.h.

Referenced by onCmdSelMBString().

FXComboBox* GNESelectorFrame::myMatchTagComboBox
private

tag of the match box

Definition at line 137 of file GNESelectorFrame.h.

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

FXRealSpinDial* GNESelectorFrame::mySelectionScaling
private

selection scaling

Definition at line 146 of file GNESelectorFrame.h.

Referenced by onCmdScaleSelection().

FXComboBox* GNESelectorFrame::mySetComboBox
private

tag of the sets of elements

Definition at line 134 of file GNESelectorFrame.h.

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

FXuint GNESelectorFrame::mySetOperation
private

how to modify selection

Definition at line 128 of file GNESelectorFrame.h.

Referenced by handleIDs().

FXDataTarget GNESelectorFrame::mySetOperationTarget
private

target of modify selection

Definition at line 131 of file GNESelectorFrame.h.

GNEViewNet* GNEFrame::myViewNet
protectedinherited

the window to inform when the tls is modfied

Definition at line 92 of file GNEFrame.h.

Referenced by GNEAdditionalFrame::addAdditional(), GNETLSEditorFrame::buildIinternalLanes(), 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::onCmdCenterItem(), GNEInspectorFrame::onCmdCenterItem(), onCmdClear(), GNEConnectorFrame::onCmdClearSelectedConnections(), GNEInspectorFrame::onCmdCopyTemplate(), GNECrossingFrame::onCmdCreateCrossing(), GNETLSEditorFrame::onCmdDefCreate(), GNETLSEditorFrame::onCmdDefDelete(), GNETLSEditorFrame::onCmdDefSwitch(), GNEInspectorFrame::onCmdDeleteItem(), GNEInspectorFrame::onCmdGoBack(), GNEDeleteFrame::onCmdInspectItem(), onCmdInvert(), onCmdLoad(), GNEConnectorFrame::onCmdOK(), GNETLSEditorFrame::onCmdOK(), GNETLSEditorFrame::onCmdPhaseSwitch(), GNEConnectorFrame::onCmdResetSelectedConnections(), onCmdScaleSelection(), GNEConnectorFrame::onCmdSelectConflicts(), GNEConnectorFrame::onCmdSelectDeadEnds(), GNEConnectorFrame::onCmdSelectDeadStarts(), GNEConnectorFrame::onCmdSelectPass(), GNEAdditionalFrame::removeAdditional(), GNEDeleteFrame::removeAttributeCarrier(), and GNEFrame::show().


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