VAPOR3 3.9.4
|
A pure virtual class specifying the common properties of all the parameter tabs in the VAPOR GUI. More...
#include <EventRouter.h>
Public Member Functions | |
EventRouter (VAPoR::ControlExec *ce, string paramsType) | |
virtual | ~EventRouter () |
virtual VAPoR::ParamsBase * | GetActiveParams () const |
virtual void | hookUpTab () |
virtual void | GetWebHelp (std::vector< std::pair< string, string > > &help) const |
virtual void | updateTab () |
virtual void | confirmText () |
void | SetTextChanged (bool on) |
virtual void | captureMouseUp () |
virtual void | captureMouseDown (int mouseNum) |
virtual void | StartCursorMove () |
virtual void | EndCursorMove () |
GUIStateParams * | GetStateParams () const |
AnimationParams * | GetAnimationParams () const |
size_t | GetCurrentTimeStep () const |
virtual string | GetType () const =0 |
virtual void | LoadDataNotify (string dataSetName) |
Static Public Member Functions | |
static size_t | GetCurrentTimeStep (VAPoR::ControlExec *ce) |
Protected Member Functions | |
EventRouter () | |
virtual void | _initializeTab () |
virtual void | _updateTab ()=0 |
virtual void | _confirmText () |
Protected Attributes | |
VAPoR::ControlExec * | _controlExec |
bool | _textChangedFlag |
string | _paramsType |
A pure virtual class specifying the common properties of all the parameter tabs in the VAPOR GUI.
The EventRouter class manages communication between tabs in the GUI, visualizers, and params. Implementers of new tabs in vaporgui must implement an EventRouter class that translates user actions in the tab to changes in the corresponding Params instance, and conversely, populates the tab display based on the most recent state of the params.
EventRouter classes are currently of two types: Those that are associated with RenderParams and those that are not. Those that are associated with RenderParams support having multiple sub-tabs, and are presented in the RenderHolder that displays the parameters of the currently selected renderer. Other EventRouter classes are themselves tabs and have their content defined by a Qt Designer .ui file. Such EventRouter classes are derived from the _UI class that is based on the .ui widget.
Each widget in the tab is connected to slots in the EventRouter by signals emitted by the widget when its state is changed. The connections must be set up in the EventRouter::hookUpTab() method.
In addition to implementing the various pure virtual methods on this class, additional virtual methods must be implemented to support changes in rendering, Transfer Functions, etc., based on the functionality of the tab.
Specifically, each EventRouter subclass implementor must provide the following:
Implement hookUpTab() to connect all signals/slots that are permanent (not data dependent). If some widgets are created dynamically, the appropriate connections must be established at that time.
Implement _updateTab() to set the values of all gui elements based on current Params settings, whenever the tab is exposed.
Implement _confirmText() to read all the text values in the tab and set them in the Params
Implement a slot for each widget in the tab to respond to user changes, except QLineEdits get two slots (as described in EventRouter::hookUpTab()) )
Call confirmText() in the slots associated with each widget change, so that text changes are updated prior to committing the widget change.
If any data variables are associated with the tab (for RenderParams), include the VariablesWidget as a tab inside this gui tab. Note that the VariablesWidget handles its own signals and slots.
If there is a MouseMode (manipulator) associated with the tab, then EventRouter::captureMouseUp() and EventRouter::captureMouseDown() must be implemented.
Definition at line 107 of file EventRouter.h.
EventRouter::EventRouter | ( | VAPoR::ControlExec * | ce, |
string | paramsType | ||
) |
|
inlinevirtual |
Definition at line 111 of file EventRouter.h.
|
inlineprotected |
Definition at line 250 of file EventRouter.h.
|
inlineprotectedvirtual |
Pure virtual method to respond to changes in text in the tab. This method should be called whenever user presses enter, or changes the state of a widget (other than a textEdit) in the tab. In each implementation, the values of ALL QLineEdit's in the tab must be read and set in the corresponding Params instance.
[in] | p | Params instance associated with the current active tab. |
Reimplemented in AnnotationEventRouter, and RenderEventRouter.
Definition at line 277 of file EventRouter.h.
|
inlineprotectedvirtual |
Initialize params managed by this event router.
This method is invoked from updateTab() before _updateTab() the first time updateTab() is called with new params to manage
Definition at line 257 of file EventRouter.h.
|
protectedpure virtual |
Pure virtual method to set the values of all the gui elements in the tab based on current Params state. This is invoked whenever the tab is redisplayed and the values in the tab need to be refreshed. If there is a VariablesWidget, _updateTab() must invoke VariablesWidget::Update().
Implemented in AnimationTab, ContourEventRouter, FlowEventRouter, ViewpointTab, RenderEventRouterGUI, and RenderEventRouter.
|
inlinevirtual |
Method for classes that capture mouse event events (i.e. have manipulators) This must be reimplemented to respond appropriately when the mouse is pressed. The mouse press event is received by the VizWin instance, which then calls captureMouseDown() for the EventRouter that is associated with the current mouse mode. This method should forget any previous text changes, since that would confuse the extents calculation.
[in] | mouseNum | is 1,2, or 3 for left, middle, or right mouse. |
Definition at line 206 of file EventRouter.h.
|
inlinevirtual |
Method for classes that capture mouse event events from the visualizers (i.e. have manipulators) This must be reimplemented to respond when the mouse is released. The mouse release event is received by the VizWin instance, which then calls captureMouseUp() for the EventRouter that is associated with the current mouse mode. Ordinarily this method only needs to redisplay the layout and rerender.
Definition at line 192 of file EventRouter.h.
|
virtual |
Method to respond to changes in text in the tab. This method should be called whenever user presses enter, or changes the state of a widget (other than a textEdit) in the tab.
Reimplemented in AppSettingsEventRouter, and RenderEventRouter.
Referenced by RenderEventRouter::confirmText().
|
virtual |
Virtual method responds to cursor move in image window. Default just updates the window
|
virtual |
Return the currently active params instance for this event router.
Reimplemented in RenderEventRouter.
|
inline |
Definition at line 222 of file EventRouter.h.
References _controlExec, AnimationParams::GetClassType(), VAPoR::ParamsMgr::GetParams(), VAPoR::ControlExec::GetParamsMgr(), and VAssert.
|
inline |
Definition at line 228 of file EventRouter.h.
References _controlExec, and GetCurrentTimeStep().
Referenced by GetCurrentTimeStep().
|
inlinestatic |
Definition at line 230 of file EventRouter.h.
References AnimationParams::GetClassType(), AnimationParams::GetCurrentTimestep(), VAPoR::ParamsMgr::GetParams(), VAPoR::ControlExec::GetParamsMgr(), and VAssert.
|
inline |
Definition at line 216 of file EventRouter.h.
References _controlExec, GUIStateParams::GetClassType(), VAPoR::ParamsMgr::GetParams(), VAPoR::ControlExec::GetParamsMgr(), and VAssert.
|
pure virtual |
Return derived class type
Return a string identifier for the derived EventRouter type
Implemented in AnimationTab, AnnotationEventRouter, AppSettingsEventRouter, BarbEventRouter, ContourEventRouter, FlowEventRouter, ImageEventRouter, ModelEventRouter, ParticleEventRouter, SliceEventRouter, TwoDDataEventRouter, ViewpointTab, VolumeEventRouter, VolumeIsoEventRouter, and WireFrameEventRouter.
|
inlinevirtual |
Pure virual method that returns documentation URLs
[out] | help | A vector of string pairs. The first string is a descriptive text. The secone is a URL. |
Reimplemented in AppSettingsEventRouter.
Definition at line 135 of file EventRouter.h.
|
inlinevirtual |
Virtual method connects all the Qt signals and slots associated with the tab. Must also include connections that send signals when any QTextEdit box is changed and when enter is pressed. Each QLineEdit has a connection to a setTextChanged and enterPressed slot, to register when the value has changed, and when the user has pressed enter over the lineEdit. If there is a MapperFunction editor or IsoSelection panel in the tab, call MappingFrame::hookup() in this method
Reimplemented in AnnotationEventRouter, AppSettingsEventRouter, and RenderEventRouter.
Definition at line 128 of file EventRouter.h.
|
inlinevirtual |
Notify the event router that new data set has been loaded
Definition at line 247 of file EventRouter.h.
|
inline |
Set the TextChanged flag. The flag should be turned on whenever any textbox (affecting the state of the Params) changes in the tab. The change will not take effect until confirmText() is called. The flag will be turned off when confirmText() or updateTab() is called.
[in] | bool | on : true indicates the flag is set. |
Definition at line 175 of file EventRouter.h.
References _textChangedFlag.
|
virtual |
Virtual method responds to cursor move in image window. Default just updates the window
|
virtual |
Update GUI display
This method set the values of all the gui elements in the tab based on current Params state. This will do appropriate setup and then invoke the pure virtual method _updateTab(). This is invoked whenever the tab is redisplayed and the values in the tab need to be refreshed.
The method has three responsibilities:
Reimplemented in RenderEventRouter, and ViewpointTab.
|
protected |
Definition at line 279 of file EventRouter.h.
Referenced by GetAnimationParams(), GetCurrentTimeStep(), and GetStateParams().
|
protected |
Definition at line 283 of file EventRouter.h.
|
protected |
Definition at line 280 of file EventRouter.h.
Referenced by SetTextChanged().