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...
 
GNEViewNetgetViewNet () const
 get view net More...
 
 GNESelectorFrame (FXComposite *parent, 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 show ()
 show Frame More...
 
 ~GNESelectorFrame ()
 Destructor. More...
 
FOX-callbacks

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.
long onCmdLoad (FXObject *, FXSelector, void *)
 
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
 the panel to hold all member widgets More...
 
FXFont * myFrameHeaderFont
 Font for the Header. More...
 
FXLabel * myFrameHeaderLabel
 the label for the frame's header More...
 
GNEViewNetmyViewNet
 the window to inform when the tls is modfied More...
 

Private Member Functions

std::vector< GUIGlIDgetMatches (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...
 
FXListBox * myMatchAttrBox
 attributes of the match box More...
 
FXTextField * myMatchString
 string of the match More...
 
FXListBox * myMatchTagBox
 tag of the match box More...
 
FXRealSpinDial * mySelectionScaling
 selection scaling 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 ( FXComposite *  parent,
GNEViewNet viewNet 
)

Constructor.

parent FXFrame in which this GNEFrame is placed viewNet viewNet that uses this GNEFrame

Definition at line 81 of file GNESelectorFrame.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().

GNESelectorFrame::~GNESelectorFrame ( )

Destructor.

Definition at line 152 of file GNESelectorFrame.cpp.

References gSelected, and GUISelectedStorage::remove2Update().

GNESelectorFrame::GNESelectorFrame ( )
inlineprotected

FOX needs this.

Definition at line 121 of file GNESelectorFrame.h.

Member Function Documentation

FXFont * GNEFrame::getFrameHeaderFont ( ) const
inherited

get font of the header's frame

Definition at line 94 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderFont.

FXLabel * GNEFrame::getFrameHeaderLabel ( ) const
inherited

get the label for the frame's header

Definition at line 88 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderLabel.

Referenced by GNEInspectorFrame::inspect().

std::vector< GUIGlID > GNESelectorFrame::getMatches ( SumoXMLTag  tag,
SumoXMLAttr  attr,
char  compOp,
SUMOReal  val,
const std::string &  expr 
)
private
std::string GNESelectorFrame::getStats ( ) const
private
GNEViewNet * GNEFrame::getViewNet ( ) const
inherited

get view net

Definition at line 82 of file GNEFrame.cpp.

References GNEFrame::myViewNet.

Referenced by GNEInspectorFrame::AttrInput::onCmdSetAttribute().

void GNESelectorFrame::hide ( )
virtual
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 199 of file GNESelectorFrame.cpp.

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

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

Called when the user presses the Invert-button.

Note
invert the selection and repaints itself

Definition at line 207 of file GNESelectorFrame.cpp.

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

long GNESelectorFrame::onCmdLoad ( FXObject *  ,
FXSelector  ,
void *   
)
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 183 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 337 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 243 of file GNESelectorFrame.cpp.

References GNEAttributeCarrier::allowedAttributes(), GNEAttributeCarrier::allowedTags(), getMatches(), handleIDs(), GNEAttributeCarrier::isNumerical(), myMatchAttrBox, myMatchString, myMatchTagBox, and SUMOReal.

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

References GNEAttributeCarrier::allowedAttributes(), GNEAttributeCarrier::allowedTags(), myMatchAttrBox, myMatchTagBox, and toString().

void GNESelectorFrame::selectionUpdated ( )
virtual

called if currently registered for updates for changes of global selection

Implements GUISelectedStorage::UpdateTarget.

Definition at line 374 of file GNESelectorFrame.cpp.

References getStats(), and GNEFrame::myFrameHeaderLabel.

Referenced by show().

void GNESelectorFrame::show ( )
virtual

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 151 of file GNESelectorFrame.h.

Referenced by getMatches().

FXVerticalFrame* GNEFrame::myContentFrame
protectedinherited

the panel to hold all member widgets

Definition at line 94 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

FXFont* GNEFrame::myFrameHeaderFont
protectedinherited

Font for the Header.

Definition at line 88 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 91 of file GNEFrame.h.

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

FXListBox* GNESelectorFrame::myMatchAttrBox
private

attributes of the match box

Definition at line 134 of file GNESelectorFrame.h.

Referenced by onCmdSelMBString(), and onCmdSelMBTag().

FXTextField* GNESelectorFrame::myMatchString
private

string of the match

Definition at line 137 of file GNESelectorFrame.h.

Referenced by onCmdSelMBString().

FXListBox* GNESelectorFrame::myMatchTagBox
private

tag of the match box

Definition at line 131 of file GNESelectorFrame.h.

Referenced by onCmdSelMBString(), and onCmdSelMBTag().

FXRealSpinDial* GNESelectorFrame::mySelectionScaling
private

selection scaling

Definition at line 140 of file GNESelectorFrame.h.

Referenced by onCmdScaleSelection().

FXuint GNESelectorFrame::mySetOperation
private

how to modify selection

Definition at line 125 of file GNESelectorFrame.h.

Referenced by handleIDs().

FXDataTarget GNESelectorFrame::mySetOperationTarget
private

target of modify selection

Definition at line 128 of file GNESelectorFrame.h.

GNEViewNet* GNEFrame::myViewNet
protectedinherited

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