SUMO - Simulation of Urban MObility
GNESelector Class Reference

#include <GNESelector.h>

Inheritance diagram for GNESelector:
Inheritance graph
Collaboration diagram for GNESelector:
Collaboration graph

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< 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
 

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...
 
GNEUndoListmyUndoList
 
GNEViewNetmyUpdateTarget
 

Static Private Attributes

static const int WIDTH = 140
 

Detailed Description

The Widget for modifying selections of network-elements

Definition at line 54 of file GNESelector.h.

Member Enumeration Documentation

Enumerator
SET_ADD 
SET_SUB 
SET_RESTRICT 
SET_REPLACE 
SET_DEFAULT 

Definition at line 60 of file GNESelector.h.

Constructor & Destructor Documentation

GNESelector::GNESelector ( FXComposite *  parent,
GNEViewNet updateTarget,
GNEUndoList undoList 
)
GNESelector::~GNESelector ( )

Destructor.

Definition at line 164 of file GNESelector.cpp.

References gSelected, myHeaderFont, and GUISelectedStorage::remove2Update().

GNESelector::GNESelector ( )
inlineprotected

FOX needs this.

Definition at line 149 of file GNESelector.h.

Member Function Documentation

std::vector< GUIGlID > GNESelector::getMatches ( SumoXMLTag  tag,
SumoXMLAttr  attr,
char  compOp,
SUMOReal  val,
const std::string &  expr 
)
private
std::string GNESelector::getStats ( ) const
private
void GNESelector::hide ( )
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().

void GNESelector::selectionUpdated ( )
virtual

Implements GUISelectedStorage::UpdateTarget.

Definition at line 377 of file GNESelector.cpp.

References getStats(), and myStats.

Referenced by getHeaderFont(), and show().

void GNESelector::show ( )

Field Documentation

const std::string GNESelector::ALL_VCLASS_NAMES_MATCH_STRING
private

Definition at line 192 of file GNESelector.h.

Referenced by getMatches().

FXVerticalFrame* GNESelector::myContentFrame
private

the panel to hold all member widgets

Definition at line 153 of file GNESelector.h.

FXFont* GNESelector::myHeaderFont
private

Font for the widget.

Definition at line 156 of file GNESelector.h.

Referenced by getHeaderFont(), and ~GNESelector().

FXListBox* GNESelector::myMatchAttrBox
private

Definition at line 172 of file GNESelector.h.

Referenced by onCmdSelMBString(), and onCmdSelMBTag().

FXTextField* GNESelector::myMatchString
private

Definition at line 173 of file GNESelector.h.

Referenced by onCmdSelMBString().

FXListBox* GNESelector::myMatchTagBox
private

state variables for the match box

Definition at line 171 of file GNESelector.h.

Referenced by onCmdSelMBString(), and onCmdSelMBTag().

FXRealSpinDial* GNESelector::mySelectionScaling
private

Definition at line 175 of file GNESelector.h.

Referenced by onCmdScaleSelection().

FXuint GNESelector::mySetOperation
private

how to modify selection

Definition at line 167 of file GNESelector.h.

Referenced by handleIDs().

FXDataTarget GNESelector::mySetOperationTarget
private

Definition at line 168 of file GNESelector.h.

FXLabel* GNESelector::myStats
private

the label for selection statistics

Definition at line 159 of file GNESelector.h.

Referenced by selectionUpdated().

GNEUndoList* GNESelector::myUndoList
private

Definition at line 179 of file GNESelector.h.

Referenced by handleIDs(), and onCmdClear().

GNEViewNet* GNESelector::myUpdateTarget
private
const int GNESelector::WIDTH = 140
staticprivate

Definition at line 177 of file GNESelector.h.


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