VAPoR
3.0.0
|
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 () | |
virtual void | hookUpTab ()=0 |
void | updateTab () |
virtual void | confirmText () |
void | reinitTab (bool doOverride) |
virtual void | updateUrgentTabState () |
void | SetTextChanged (bool on) |
virtual void | captureMouseUp () |
virtual void | captureMouseDown (int mouseNum) |
string | getTag () |
virtual void | updateRenderer (RenderParams *rp, bool wasEnabled, int instance, bool newVis) |
virtual void | cleanParams (Params *rp) |
virtual void | sessionLoadTF (string name) |
virtual void | SetLocal (Params *p, bool lg) |
virtual void | SetEnabled (bool On, int instance) |
virtual void | setEditorDirty (RenderParams *) |
virtual void | updateMapBounds (RenderParams *) |
void | saveTF (RenderParams *rParams) |
void | fileSaveTF (RenderParams *rParams) |
void | loadInstalledTF (RenderParams *rParams, string varname) |
void | loadTF (RenderParams *rParams, string varname) |
void | fileLoadTF (RenderParams *rParams, string varname, const char *startPath, bool savePath) |
virtual Histo * | getHistogram (RenderParams *rParam, bool mustGet, bool isIsoWin=false) |
virtual void | refreshHistogram (RenderParams *rp) |
void | refresh2DHistogram (RenderParams *) |
void | calcSliceHistogram (RenderParams *rp, int ts, Histo *histo) |
virtual MappingFrame * | getMappingFrame () |
virtual void | StartCursorMove () |
virtual void | EndCursorMove () |
virtual void | SetDimension (int dim) |
virtual void | variableChanged () |
virtual void | invalidateRenderer (RenderParams *rParams) |
Static Public Member Functions | |
static void | SetVizWinMgr (VizWinMgr *vizMgr) |
static void | SetDataMgr (DataMgrV3_0 *dataMgr) |
static void | SetMainForm (MainForm *mainForm) |
static DataMgrV3_0 * | GetDataMgr () |
Obtain the current DataMgr. More... | |
Protected Member Functions | |
virtual void | _updateTab (Params *p)=0 |
virtual void | _confirmText (Params *p)=0 |
virtual void | _reinitTab (bool doOverride)=0 |
vector< QAction * > * | makeWebHelpActions (const char *text[], const char *urls[]) |
virtual float | calcCurrentValue (RenderParams *p, const double point[3]) |
Params * | GetActiveParams () |
Params * | GetActiveParams (string tag) |
int | GetActiveVizIndex () |
void | ForceRender (bool always=false) |
Visualizer * | GetActiveVisualizer () |
Identify the currently active Visualizer instance. More... | |
Static Protected Member Functions | |
static EventRouter * | GetEventRouter (const std::string &tag) |
A pure virtual class specifying the common properties of all the parameter tabs in the VAPOR GUI.
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 _reinitTab() to set up the gui whenever the DataMgr is changed.
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()) )
If the tab includes a BoxSliderFrame, implement a slot "changeExtents()" that responds to the signal BoxSliderFrame::extentsChanged() whenever the box extents have been changed by the user. Read BoxSliderFrame documentation for additional instructions.
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.
Provide text descriptions and URLs for Web-based help as described under EventRouter::makeWebHelpActions()
If there is a MappingFrame in the tab, invoke EventRouter::loadTF(), EventRouter::fileSaveTF(), EventRouter::loadInstalledTF(), EventRouter::saveTF() to load and save the transfer functions. Refer to MappingFrame documentation for additional instructions.
Various widgets associated with the TransferFunction editor are managed by the MappingFrame as described under MappingFrame::hookup(). These must implement EventRouter::refreshHistogram() to refresh the histogram in the Transfer Function Editor.
If there is a MouseMode (manipulator) associated with the tab, then EventRouter::captureMouseUp() and EventRouter::captureMouseDown() must be implemented.
Definition at line 101 of file eventrouter.h.
|
inline |
Definition at line 105 of file eventrouter.h.
|
protectedpure virtual |
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. |
Implemented in VAPoR::HelloEventRouter, and VAPoR::ArrowEventRouter.
|
protectedpure virtual |
Pure virtual method to set up the content in a tab based on a change in the DataMgr. Any widgets that are data-specific, such as variable selectors, must be initialized in this method. If there is a VariablesWidget, VariablesWidget::reinitTab() must be called in this method. The doOverride argument indicates that the user has requested default settings, so than any previous setup can be overridden, reverting to default state.
Implemented in VAPoR::HelloEventRouter, and VAPoR::ArrowEventRouter.
|
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::updateTab().
[in] | p | Params instance associated with the current active tab. |
Implemented in VAPoR::HelloEventRouter, and VAPoR::ArrowEventRouter.
|
protectedvirtual |
Determine the value of the current variable at specified point. Return _OUT_OF_BOUNDS if not in current extents but in full domain
[in] | RenderParams* | p is the params whose variable, fidelity, etc. is used for evaluation |
[in] | point[3] | coordinates of point to evaluate. |
void VAPoR::EventRouter::calcSliceHistogram | ( | RenderParams * | rp, |
int | ts, | ||
Histo * | histo | ||
) |
Helper method, calculate a histogram of a slice of 3d variables, such as Probe or IsoLines
[in] | rp | RenderParams* associated with the histogram |
[in] | ts | time step for the histogram |
[out] | histo | resulting Histo instance. |
|
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. |
Reimplemented in VAPoR::IsolineEventRouter, and VAPoR::ArrowEventRouter.
Definition at line 163 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.
Reimplemented in VAPoR::IsolineEventRouter, and VAPoR::ArrowEventRouter.
Definition at line 154 of file eventrouter.h.
|
inlinevirtual |
Virtual method invoked when a renderer/visualizer is deleted To make sure the params cleanly detaches from gui, to handle possible connections from editors, frames, etc. Must be implemented if tab is associated with RenderParams. Default does nothing
[in] | Params | associated with the tab. |
Definition at line 185 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.
|
virtual |
Virtual method responds to cursor move in image window. Default just updates the window
Reimplemented in VAPoR::IsolineEventRouter.
void VAPoR::EventRouter::fileLoadTF | ( | RenderParams * | rParams, |
string | varname, | ||
const char * | startPath, | ||
bool | savePath | ||
) |
Launch a dialog to enable user to load a transfer function from file.
[in] | rParams | RenderParams instance associated with the transfer function |
[in] | varname | name of the variable associated with the TF. |
[in] | startPath | file path for the dialog to initially present to user |
[in] | savePath | indicates whether or not the resulting path should be saved to user preferences. |
void VAPoR::EventRouter::fileSaveTF | ( | RenderParams * | rParams | ) |
Launch a dialog to save the current transfer function to file.
[in] | rParams | RenderParams instance associated with the transfer function |
|
inlineprotected |
Force a rerender of the scene associated with the current active params, provided the params are enabled.
[in] | always | If true, force render even if the params are not enabled |
Definition at line 384 of file eventrouter.h.
References GetActiveParams().
|
inlineprotected |
Provide the current Params instance of the type of this EventRouter
Definition at line 367 of file eventrouter.h.
References VAPoR::ControlExec::GetActiveParams().
Referenced by ForceRender().
|
inlineprotected |
Provide the current Params instance of specified type of this EventRouter
[in] | string | Params tag |
Definition at line 373 of file eventrouter.h.
References VAPoR::ControlExec::GetActiveParams().
|
inlineprotected |
Identify the currently active Visualizer instance.
Definition at line 390 of file eventrouter.h.
References GetActiveVizIndex(), and VAPoR::ControlExec::GetVisualizer().
|
inlineprotected |
Identify the index of the current active visualizer
Definition at line 379 of file eventrouter.h.
References VAPoR::ControlExec::GetActiveVizIndex().
Referenced by GetActiveVisualizer().
|
inlinestatic |
Obtain the current DataMgr.
Definition at line 308 of file eventrouter.h.
|
inlinestaticprotected |
Static method obtains the EventRouter instance associated with a particular Params tag
[in] | const | std::string& Tag of the Params |
EventRouter* | pointer to the associated EventRouter instance |
Definition at line 354 of file eventrouter.h.
References VAPoR::VizWinMgr::getEventRouter().
|
virtual |
Obtain the current valid histogram. Optionally will construct a new one if needed.
[in] | rParams | is RenderParams instance associated with the transfer function |
[in] | mustGet | : Boolean argument indicating that a new histogram is required. |
[in] | isIsoWin | : Boolean argument indicating this is associated with an IsoSelection panel |
Histo* | is resulting Histo instance. |
|
inlinevirtual |
Virtual method identifies the MappingFrame associated with an EventRouter. Must be implemented in every EventRouter with a MappingFrame
MappingFrame* | is MappingFrame associated with the EventRouter |
Reimplemented in VAPoR::IsolineEventRouter.
Definition at line 270 of file eventrouter.h.
|
inline |
Indicate the tag associated with this eventRouter
Definition at line 167 of file eventrouter.h.
|
pure virtual |
Pure 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 TransferFunction editor or IsoSelection panel in the tab, call MappingFrame::hookup() in this method
Implemented in VAPoR::IsolineEventRouter, VAPoR::HelloEventRouter, and VAPoR::ArrowEventRouter.
|
inlinevirtual |
Invalidate the current renderer, forcing rebuild of the cache. Default does nothing.
[in] | iParams | RenderParams* that is associated with the renderer. |
Definition at line 313 of file eventrouter.h.
void VAPoR::EventRouter::loadInstalledTF | ( | RenderParams * | rParams, |
string | varname | ||
) |
Launch a dialog to enable user to load an installed transfer function.
[in] | rParams | RenderParams instance associated with the transfer function |
[in] | varname | name of the variable associated with the TF. |
void VAPoR::EventRouter::loadTF | ( | RenderParams * | rParams, |
string | varname | ||
) |
Launch a dialog to enable user to load a transfer function from session or file.
[in] | rParams | RenderParams instance associated with the transfer function |
[in] | varname | name of the variable associated with the TF. |
|
protected |
To support Web help, implementers must provide a static char* array "_webHelpText" and another static char* array "_webHelpURLs" of URLs. The _webHelpText array must be initialized with one line of descriptive text for each help URL, plus an additional line consisting of the string "<>". The _webHelpURLs array must be initialized to the corresponding URL's (and is shorter by 1 than the _webHelpText array.)
In each EventRouter constructor, set the vector<QAction*> _webHelpActions equal to the result of calling makeWebHelpActions(). Also, in the method EventRouter::updateTab() include the following line: MainForm::getInstance()->buildWebTabHelpMenu(_webHelpActions);
[in] | text | is array of descriptive text, one line for each web help URL, terminated with "<>" |
[in] | urls | is array of url's, one URL for each web help text. |
vector<QAction*> | is resulting vector of QActions that is saved as the value of _webHelpActions. |
void VAPoR::EventRouter::refresh2DHistogram | ( | RenderParams * | ) |
Helper method to refresh the histogram for a 2D variable
[in] | rP | RenderParams* associated with the histogram |
|
inlinevirtual |
Virtual method to refresh the histogram for the associated EventRouter. Must be reimplemented in every EventRouter class with a Histogram.
[in] | rp | RenderParams* associated with the histogram. |
Definition at line 255 of file eventrouter.h.
void VAPoR::EventRouter::reinitTab | ( | bool | doOverride | ) |
Method to set up the content in a tab based on a change in the DataMgr. Any widgets that are data-specific, such as variable selectors, must be initialized in this method. This invokes _reinitTab() to perform the widget-specific initializations.
[in] | doOverride | is true if the values should revert to defaults, overriding current values. |
void VAPoR::EventRouter::saveTF | ( | RenderParams * | rParams | ) |
Method supporting loading/saving transfer functions in tabs with transfer functions Launch a dialog to save the current transfer function to session or file.
[in] | rParams | RenderParams instance associated with the transfer function |
|
inlinevirtual |
Virtual method supports loading a transfer function from the session, for tabs that have transfer functions. param[in] name indicates the name identifying the transfer function
Definition at line 190 of file eventrouter.h.
|
inlinestatic |
Set the current DataMgr. static method must be invoked whenever a new DataMgr is created.
[in] | DataMgrV3_0* | dataMgr |
Definition at line 300 of file eventrouter.h.
|
inlinevirtual |
Respond to user changing the dimension (2 or 3). Make any gui changes needed beyond updating the variable combos RenderParams will already be updated. Default does nothing.
[in] | dim | is new dimension (2 or 3) |
Reimplemented in VAPoR::IsolineEventRouter, and VAPoR::ArrowEventRouter.
Definition at line 285 of file eventrouter.h.
|
virtual |
Method to indicate that a transfer function has changed so the tab display must be refreshed. Used in all tabs with RenderParams and that have a transfer function. If Params* argument is null, uses default params. Must be reimplemented if there is more than one MappingFrame in the tab.
[in] | RenderParams* | is the Params that owns the Transfer Function |
|
virtual |
Method that results in enabling or disabling the renderer. It is invoked whenever the user checks or un-checks the enable checkbox in the instance selector.
[in] | bool | Turns on (true) or off the instance. |
[in] | int | Instance that is being enabled or disabled. |
|
virtual |
Virtual method should be invoked to respond to a change in the local/global setting in the tab Only used with non-render params. Default simply ensures that the active params are based on correct setting of local/global
[in] | Params* | p Current params associated with the tab |
[in] | bool | lg is true for local, false for global. |
|
inlinestatic |
Set the MainForm static method stores this unchanging instance in the EventRouter
[in] | MainForm* | mainForm |
Definition at line 305 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 147 of file eventrouter.h.
|
inlinestatic |
Specify the VizWinMgr static method stores this unchanging instance in the EventRouter
[in] | VizWinMgr* | vizMgr |
Definition at line 295 of file eventrouter.h.
|
virtual |
Virtual method responds to cursor move in image window. Default just updates the window
Reimplemented in VAPoR::IsolineEventRouter.
|
inlinevirtual |
Method used to indicate that the mapping bounds have changed, in the transfer function editor, requiring update of the display. Must be reimplemented in every EventRouter which has a transfer function.
[in] | RenderParams* | owner of the Transfer Function |
Reimplemented in VAPoR::IsolineEventRouter.
Definition at line 217 of file eventrouter.h.
|
virtual |
Virtual method to enable or disable rendering when turned on or off by a gui tab. Only useful if the tab corresponds to a renderer.
[in] | rp | RenderParams instance to be enabled/disabled |
[in] | wasEnabled | indicates if rendering was previously disabled |
[in] | instance | index being enabled |
[in] | newVis | indicates if the rendering is being enabled in a new visualizer. |
void VAPoR::EventRouter::updateTab | ( | ) |
method to 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. If there is a VariablesWidget, updateTab() must invoke VariablesWidget::updateTab().
|
inlinevirtual |
Virtual method to update only tab state that is most urgent after an error message. In particular, do not update any GL widgets in this method. This is to deal with error messages coming from the rendering thread that are trapped by the gui thread. Default does nothing.
Definition at line 141 of file eventrouter.h.
|
inlinevirtual |
Respond to a variable change Make any gui changes beyond updating the variable combos. Default does nothing
Reimplemented in VAPoR::IsolineEventRouter.
Definition at line 290 of file eventrouter.h.