VAPOR3 3.9.4
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EventRouter Class Referenceabstract

A pure virtual class specifying the common properties of all the parameter tabs in the VAPOR GUI. More...

#include <EventRouter.h>

Inheritance diagram for EventRouter:
AnimationTab AnnotationEventRouter AppSettingsEventRouter RenderEventRouter ViewpointTab RenderEventRouterGUI BarbEventRouter ContourEventRouter FlowEventRouter ImageEventRouter ModelEventRouter ParticleEventRouter SliceEventRouter TwoDDataEventRouter VolumeEventRouter VolumeIsoEventRouter WireFrameEventRouter

Public Member Functions

 EventRouter (VAPoR::ControlExec *ce, string paramsType)
 
virtual ~EventRouter ()
 
virtual VAPoR::ParamsBaseGetActiveParams () 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 ()
 
GUIStateParamsGetStateParams () const
 
AnimationParamsGetAnimationParams () 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
 

Detailed Description

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.

Author
Alan Norton
Version
3.0
Date
May 2015

Definition at line 107 of file EventRouter.h.

Constructor & Destructor Documentation

◆ EventRouter() [1/2]

EventRouter::EventRouter ( VAPoR::ControlExec ce,
string  paramsType 
)

◆ ~EventRouter()

virtual EventRouter::~EventRouter ( )
inlinevirtual

Definition at line 111 of file EventRouter.h.

◆ EventRouter() [2/2]

EventRouter::EventRouter ( )
inlineprotected

Definition at line 250 of file EventRouter.h.

Member Function Documentation

◆ _confirmText()

virtual void EventRouter::_confirmText ( )
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.

Parameters
[in]pParams instance associated with the current active tab.

Reimplemented in AnnotationEventRouter, and RenderEventRouter.

Definition at line 277 of file EventRouter.h.

◆ _initializeTab()

virtual void EventRouter::_initializeTab ( )
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.

◆ _updateTab()

virtual void EventRouter::_updateTab ( )
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.

◆ captureMouseDown()

virtual void EventRouter::captureMouseDown ( int  mouseNum)
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.

Parameters
[in]mouseNumis 1,2, or 3 for left, middle, or right mouse.

Definition at line 206 of file EventRouter.h.

◆ captureMouseUp()

virtual void EventRouter::captureMouseUp ( )
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.

◆ confirmText()

virtual void EventRouter::confirmText ( )
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().

◆ EndCursorMove()

virtual void EventRouter::EndCursorMove ( )
virtual

Virtual method responds to cursor move in image window. Default just updates the window

◆ GetActiveParams()

virtual VAPoR::ParamsBase * EventRouter::GetActiveParams ( ) const
virtual

Return the currently active params instance for this event router.

Reimplemented in RenderEventRouter.

◆ GetAnimationParams()

AnimationParams * EventRouter::GetAnimationParams ( ) const
inline

◆ GetCurrentTimeStep() [1/2]

size_t EventRouter::GetCurrentTimeStep ( ) const
inline

Definition at line 228 of file EventRouter.h.

References _controlExec, and GetCurrentTimeStep().

Referenced by GetCurrentTimeStep().

◆ GetCurrentTimeStep() [2/2]

static size_t EventRouter::GetCurrentTimeStep ( VAPoR::ControlExec ce)
inlinestatic

◆ GetStateParams()

GUIStateParams * EventRouter::GetStateParams ( ) const
inline

◆ GetType()

virtual string EventRouter::GetType ( ) const
pure virtual

◆ GetWebHelp()

virtual void EventRouter::GetWebHelp ( std::vector< std::pair< string, string > > &  help) const
inlinevirtual

Pure virual method that returns documentation URLs

Parameters
[out]helpA 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.

◆ hookUpTab()

virtual void EventRouter::hookUpTab ( )
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.

◆ LoadDataNotify()

virtual void EventRouter::LoadDataNotify ( string  dataSetName)
inlinevirtual

Notify the event router that new data set has been loaded

Definition at line 247 of file EventRouter.h.

◆ SetTextChanged()

void EventRouter::SetTextChanged ( bool  on)
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.

Parameters
[in]boolon : true indicates the flag is set.

Definition at line 175 of file EventRouter.h.

References _textChangedFlag.

◆ StartCursorMove()

virtual void EventRouter::StartCursorMove ( )
virtual

Virtual method responds to cursor move in image window. Default just updates the window

◆ updateTab()

virtual void EventRouter::updateTab ( )
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:

  1. Reconcile any anomalous conditions between the DataMgr and the Params instance managed by this event router. Thus if the Params instance contains values that would be viable with the current DataMgr (e.g. a variable name that is not present in the DataMgr) the method will attempt to change the Params instance to a valid state.
  2. Refresh (rebuild) the GUI to reflect the state of the Params.
  3. Ensure that the options presented by the GUI are viable for the current DataMgr.

Reimplemented in RenderEventRouter, and ViewpointTab.

Member Data Documentation

◆ _controlExec

VAPoR::ControlExec* EventRouter::_controlExec
protected

Definition at line 279 of file EventRouter.h.

Referenced by GetAnimationParams(), GetCurrentTimeStep(), and GetStateParams().

◆ _paramsType

string EventRouter::_paramsType
protected

Definition at line 283 of file EventRouter.h.

◆ _textChangedFlag

bool EventRouter::_textChangedFlag
protected

Definition at line 280 of file EventRouter.h.

Referenced by SetTextChanged().


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