VAPOR3 3.9.4
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
VAPoR::ControlExec Class Reference

Provides API for VAPOR visualizer User Interfaces (UIs) More...

#include <ControlExecutive.h>

Inheritance diagram for VAPoR::ControlExec:
Wasp::MyBase

Classes

class  RelAndAbsPathsExistException
 

Public Types

enum class  LoadStateRelAndAbsPathsExistAction { Ask , LoadAbs , LoadRel }
 
- Public Types inherited from Wasp::MyBase
typedef void(* ErrMsgCB_T) (const char *msg, int err_code)
 
typedef void(* DiagMsgCB_T) (const char *msg)
 

Public Member Functions

 ControlExec (std::vector< string > appParamsNames=std::vector< string >(), std::vector< string > appRenderParamsNames=std::vector< string >(), size_t cacheSize=1000, int nThreads=0)
 
virtual ~ControlExec ()
 
virtual void LoadState ()
 
virtual void LoadState (const XmlNode *node)
 
virtual int LoadState (string stateFile, LoadStateRelAndAbsPathsExistAction relAndAbsPathsExistAction=LoadStateRelAndAbsPathsExistAction::LoadAbs)
 
void SetNumThreads (size_t nthreads)
 
size_t GetNumThreads () const
 
void SetCacheSize (size_t sizeMB)
 
int NewVisualizer (string name)
 
string GetNewVisualizerUndoTag () const
 Return tag pushed to the undo stack when NewVisualizer() is called.
 
void RemoveVisualizer (string name, bool hasOpenGLContext=false)
 
string GetRemoveVisualizerUndoTag () const
 Return tag pushed to the undo stack when RemoveVisualizer() is called.
 
int InitializeViz (string name, GLManager *glManager)
 
int ResizeViz (string name, int width, int height)
 
void ClearRenderCache (const string &winName, const string &inst)
 
void ClearAllRenderCaches ()
 
GLManager::Vendor GetGPUVendor () const
 
int GetNumVisualizers () const
 
vector< string > GetVisualizerNames () const
 
int Paint (string name, bool force=false)
 
int ActivateRender (string winName, string dataSetName, string renderType, string renderName, bool on)
 Activate or Deactivate a renderer.
 
int ActivateRender (string winName, string dataSetName, const RenderParams *rp, string renderName, bool on)
 
string GetActivateRendererUndoTag () const
 Return tag pushed to the undo stack when ActivateRender() is called.
 
void RemoveRenderer (string winName, string dataSetName, string renderType, string renderName, bool hasOpenGLContext)
 
string GetRemoveRendererUndoTag () const
 Return tag pushed to the undo stack when RemoveRenderer() is called.
 
void RemoveAllRenderers (string winName, bool hasOpenGLContext=false)
 
ParamsMgrGetParamsMgr () const
 
int SaveSession (string file)
 
int OpenData (const std::vector< string > &files, const std::vector< string > &options, string dataSetName, string type="vdc")
 
void CloseData (string dataSetName)
 
std::vector< string > GetDataNames () const
 
DataStatusGetDataStatus () const
 
RenderParamsGetRenderParams (string winName, string dataSetName, string renderType, string instName) const
 
std::vector< string > GetRenderClassNames (string winName) const
 
std::vector< string > GetRenderInstances (string winName, string renderType) const
 
bool RenderLookup (string instName, string &winName, string &dataSetName, string &rendererType) const
 
string MakeRendererNameUnique (string name) const
 
int DrawText (string winName, string text, int x, int y, int size, float color[3], int type=0)
 
int DrawTextNormalizedCoords (string winName, string text, float x, float y, int size, float color[3], int type=0)
 
int DrawText (string text, int x, int y, int size, float color[3], int type=0)
 
int DrawTextNormalizedCoords (string text, float x, float y, int size, float color[3], int type=0)
 
int ClearText ()
 
int ClearText (string winName)
 
bool Undo ()
 
bool Redo ()
 
void UndoRedoClear ()
 
size_t UndoSize () const
 
size_t RedoSize () const
 
void SetSaveStateEnabled (bool enabled)
 
bool GetSaveStateEnabled () const
 
void RebaseStateSave ()
 
int EnableImageCapture (string filename, string winName, bool fast=false)
 
int EnableAnimationCapture (string winName, bool doEnable, string filename="")
 
int AddFunction (string scriptType, string dataSetName, string scriptName, string script, const vector< string > &inputVarNames, const vector< string > &outputVarNames, const vector< string > &outputVarMeshes, bool coordFlag=false)
 
void RemoveFunction (string scriptType, string dataSetName, string scriptName)
 
bool GetFunction (string scriptType, string dataSetName, string scriptName, string &script, vector< string > &inputVarNames, vector< string > &outputVarNames, vector< string > &outputVarMeshes, bool &coordFlag) const
 
string GetFunctionStdout (string scriptType, string dataSetName, string scriptName) const
 
std::vector< string > GetFunctionNames (string scriptType, string dataSetName) const
 
void CreateRenderers ()
 
- Public Member Functions inherited from Wasp::MyBase
 MyBase ()
 
const string & getClassName () const
 

Static Public Member Functions

static vector< string > GetAllRenderClasses ()
 
static string MakeStringConformant (string s)
 
- Static Public Member Functions inherited from Wasp::MyBase
static void SetErrMsg (const char *format,...)
 Record a formatted error message.
 
static void SetErrMsg (int errcode, const char *format,...)
 Record a formatted error message and an error code.
 
static const char * GetErrMsg ()
 
static void SetErrCode (int err_code)
 Record an error code.
 
static int GetErrCode ()
 Retrieve the current error code.
 
static void SetErrMsgCB (ErrMsgCB_T cb)
 
static ErrMsgCB_T GetErrMsgCB ()
 
static void SetErrMsgFilePtr (FILE *fp)
 
static const FILE * SetErrMsgFilePtr ()
 
static void SetDiagMsg (const char *format,...)
 Record a formatted diagnostic message.
 
static const char * GetDiagMsg ()
 
static void SetDiagMsgCB (DiagMsgCB_T cb)
 
static DiagMsgCB_T GetDiagMsgCB ()
 
static void SetDiagMsgFilePtr (FILE *fp)
 
static bool EnableErrMsg (bool enable)
 
static bool GetEnableErrMsg ()
 

Additional Inherited Members

- Static Public Attributes inherited from Wasp::MyBase
static char * ErrMsg
 
static int ErrCode
 
static int ErrMsgSize
 
static FILE * ErrMsgFilePtr
 
static ErrMsgCB_T ErrMsgCB
 
static char * DiagMsg
 
static int DiagMsgSize
 
static FILE * DiagMsgFilePtr
 
static DiagMsgCB_T DiagMsgCB
 
static bool Enabled
 
- Protected Member Functions inherited from Wasp::MyBase
void SetClassName (const string &name)
 

Detailed Description

Provides API for VAPOR visualizer User Interfaces (UIs)

Definition at line 25 of file ControlExecutive.h.

Member Enumeration Documentation

◆ LoadStateRelAndAbsPathsExistAction

Enumerator
Ask 
LoadAbs 
LoadRel 

Definition at line 60 of file ControlExecutive.h.

Constructor & Destructor Documentation

◆ ControlExec()

VAPoR::ControlExec::ControlExec ( std::vector< string >  appParamsNames = std::vector< string >(),
std::vector< string >  appRenderParamsNames = std::vector< string >(),
size_t  cacheSize = 1000,
int  nThreads = 0 
)

Initialize the control executive

Parameters
[in]appParamsNamesA vector of unique ParamsBase class
[in]cacheSizeMBSize of data cache expressed in Megabytes

names that will be passed to the ParamsMgr constructor

See also
ParamsMgr();

◆ ~ControlExec()

virtual VAPoR::ControlExec::~ControlExec ( )
virtual

Member Function Documentation

◆ ActivateRender() [1/2]

int VAPoR::ControlExec::ActivateRender ( string  winName,
string  dataSetName,
const RenderParams rp,
string  renderName,
bool  on 
)

◆ ActivateRender() [2/2]

int VAPoR::ControlExec::ActivateRender ( string  winName,
string  dataSetName,
string  renderType,
string  renderName,
bool  on 
)

Activate or Deactivate a renderer.

Create and activate a new renderer instance. This renderer instance is inserted in the queue of active renderers for the visualizer. To deactivate a renderer, the associated Renderer instance is removed from the queue of active renderers in the Visualizer, and then deleted.

Parameters
[in]winNameThe visualizer associated with this renderer
[in]typeThe type of renderer; i.e. the tag for the RenderParams.
[in]renderNameThe instance name associated with this renderer.
[in]onA boolean indicating if the renderer is to be made active (true) or inactive (off)
Returns
status A negative int is returned on failure, indicating that the renderer cannot be activated

◆ AddFunction()

int VAPoR::ControlExec::AddFunction ( string  scriptType,
string  dataSetName,
string  scriptName,
string  script,
const vector< string > &  inputVarNames,
const vector< string > &  outputVarNames,
const vector< string > &  outputVarMeshes,
bool  coordFlag = false 
)

Add a variable calculation function

This method adds one or more derived variables to the data set specified by dataSetName. Each derived variable is calculated on-the-fly as needed by executing the script script.

Parameters
[in]scriptNameA string identifier for the collection of derived variables computed by script
[in]scriptTypeThe language the script contained in script is implemented in. Currently the only accepted value is "Python".
[in]dataSetNameThe name of the data set for which this script is to be run. See DataStatus::GetDataMgrNames()
[in]scriptA script that will be invoked each time one of the variables listed in outputs is accessed. The scope of the script will contain NumPy Array (numpy.array) variables named in inputs.
[in]inputVarNamesA list of input variable names. The named variables will be made available in the scope of the Python script as NumPy Arrays. The variables must exist as native variables of the dataset named by dataSetName. I.e. Input variables cannot be derived variables themselves.
[in]outputVarNamesA list of derived variable names. The named variables are expected to be computed by script as NumPy Arrays and will appear as derived variables in the dataset named by dataSetName.
[in]outVarMeshesA list of output mesh names, one for each output variable listed in outputVarNames. The output mesh names must be known to the dataset. Each output variable created by script is expected to be sampled by the named mesh. See DataMgr::GetMesh()
Return values
statusA negative integer is returned on failure and an error message is reported with MyBase::SetErrMsg(). AddFunction() will fail if any of the output variables named in outputVarNames already exist in the dataset as returned by DataMgr::GetDataVarNames(), or if any of the output mesh names in outVarMeshes are not known to the DataMgr (see DataMgr::GetMeshNames())
Note
The Python script script is executed when one of the output variables is read. Depending on the region requested only a subset of the native variable may be provided to script as a NumPy array. Currently this occurs if all of the input variables named by inputs and the requested output variable are sampled on the same mesh.
See also
PyEngine::AddFunction(), CalcEngineMgr::AddFunction()

◆ ClearAllRenderCaches()

void VAPoR::ControlExec::ClearAllRenderCaches ( )

◆ ClearRenderCache()

void VAPoR::ControlExec::ClearRenderCache ( const string &  winName,
const string &  inst 
)

◆ ClearText() [1/2]

int VAPoR::ControlExec::ClearText ( )

◆ ClearText() [2/2]

int VAPoR::ControlExec::ClearText ( string  winName)

◆ CloseData()

void VAPoR::ControlExec::CloseData ( string  dataSetName)

Unloads the specified data set

◆ CreateRenderers()

void VAPoR::ControlExec::CreateRenderers ( )
inline

Definition at line 672 of file ControlExecutive.h.

◆ DrawText() [1/2]

int VAPoR::ControlExec::DrawText ( string  text,
int  x,
int  y,
int  size,
float  color[3],
int  type = 0 
)

Draw 2D text to all visualizers

This method provides a simple interface for rendering text on all Visualizers. No text will actually be rendered until after Paint() is called. Text rendering will occur after all active renderers associated with viz have completed rendering.

Parameters
[in]textThe text to render
[in]xX coordinate in pixels coordinates of lower left corner of rectangle bounding the text.
[in]yY coordinate in pixels coordinates of lower left corner of rectangle bounding the text. \params[in] size Font size to be used \params[in] color Three tuple describing rgj values for the billboard

◆ DrawText() [2/2]

int VAPoR::ControlExec::DrawText ( string  winName,
string  text,
int  x,
int  y,
int  size,
float  color[3],
int  type = 0 
)

Draw 2D text on the screen

This method provides a simple interface for rendering text on the screen. No text will actually be rendered until after Paint() is called. Text rendering will occur after all active renderers associated with viz have completed rendering.

Parameters
[in]winNameA visualizer handle returned by NewVisualizer()
[in]textThe text to render
[in]xX coordinate in pixels coordinates of lower left corner of rectangle bounding the text.
[in]yY coordinate in pixels coordinates of lower left corner of rectangle bounding the text. \params[in] size Font size to be used \params[in] color Three tuple describing rgj values for the billboard

◆ DrawTextNormalizedCoords() [1/2]

int VAPoR::ControlExec::DrawTextNormalizedCoords ( string  text,
float  x,
float  y,
int  size,
float  color[3],
int  type = 0 
)

◆ DrawTextNormalizedCoords() [2/2]

int VAPoR::ControlExec::DrawTextNormalizedCoords ( string  winName,
string  text,
float  x,
float  y,
int  size,
float  color[3],
int  type = 0 
)

◆ EnableAnimationCapture()

int VAPoR::ControlExec::EnableAnimationCapture ( string  winName,
bool  doEnable,
string  filename = "" 
)

Start or stop capturing a sequence of rendered images When this method is called, the next time Paint() is called for the specified visualizer, the rendered image will be written to the specified (.jpg, .tif, ...) file. The UI must call Paint(viz, true) after this method is called. Subsequent renders in the same visualizer will result in capture to a file and the filename will be incremented by 1. The starting filename should terminate with digits to permit incrementing. filename is ignored if capture is being disabled

Parameters
[in]vizValid visualizer handle
[in]doEnabletrue to start capture, false to end.
[in]filestartis either .jpg, .tif, or .tiff file name for first capture. Ignored if doEnable = false.

◆ EnableImageCapture()

int VAPoR::ControlExec::EnableImageCapture ( string  filename,
string  winName,
bool  fast = false 
)

Capture the next rendered image to a file When this method is called, the next time Paint() is called for the specified visualizer, the rendered image will be written to the specified (.jpg, .tif, ...) file. The UI must call Paint(viz, true) after this method is called. If this is called concurrently with a call to Paint(), the image will not be captured until that rendering completes and another Paint() is initiated. Only one image will be captured.

Parameters
[in]filenameis either .jpg, .tif, or .tiff file name to capture
[in]vizValid visualizer handle

◆ GetActivateRendererUndoTag()

string VAPoR::ControlExec::GetActivateRendererUndoTag ( ) const
inline

Return tag pushed to the undo stack when ActivateRender() is called.

Definition at line 241 of file ControlExecutive.h.

◆ GetAllRenderClasses()

static vector< string > VAPoR::ControlExec::GetAllRenderClasses ( )
static

Get all available render class types

Return a vector of all availble render class type names

◆ GetDataNames()

std::vector< string > VAPoR::ControlExec::GetDataNames ( ) const
inline

Return list of currently open data set names

See also
OpenData(), CloseData()

Definition at line 345 of file ControlExecutive.h.

◆ GetDataStatus()

DataStatus * VAPoR::ControlExec::GetDataStatus ( ) const
inline

Obtain the current DataStatus Needed to store in GUI when the DataStatus changes.

Returns
DataStatus*

Definition at line 350 of file ControlExecutive.h.

◆ GetFunction()

bool VAPoR::ControlExec::GetFunction ( string  scriptType,
string  dataSetName,
string  scriptName,
string &  script,
vector< string > &  inputVarNames,
vector< string > &  outputVarNames,
vector< string > &  outputVarMeshes,
bool &  coordFlag 
) const

Return the script for a named function

This method returns as a string the script associated with the function named by name. It also returns the input and output variable names, and the output variable mesh names.

Parameters
[in]scriptTypeType of script
[in]dataSetNameName of data set
[in]scriptNameName of script
[out]scriptScript returned as a string
[out]inputVarNamesVector of input variable names to script
[out]outputVarNamesVector of output variable names generated by script
[out]outputVarMeshesVector of output variable mesh names associated with outputVarNames
Return values
statusReturns true upon success. If the tupple scriptName dataSetName, scriptName is invalid false is returned.
See also
AddFunction(), RemoveFunction()

◆ GetFunctionNames()

std::vector< string > VAPoR::ControlExec::GetFunctionNames ( string  scriptType,
string  dataSetName 
) const

Return a list of all active function names

This method returns a vector of names for all active (not previously removed) functions created with AddFunction() for the specified dataset dataSetName and the specifed script language type scriptType

See also
AddFunction();

◆ GetFunctionStdout()

string VAPoR::ControlExec::GetFunctionStdout ( string  scriptType,
string  dataSetName,
string  scriptName 
) const

Return any standard output from the last invocation of a script

This method returns as a string any standard output from the last (most recent) invocation of the named script

◆ GetGPUVendor()

GLManager::Vendor VAPoR::ControlExec::GetGPUVendor ( ) const

◆ GetNewVisualizerUndoTag()

string VAPoR::ControlExec::GetNewVisualizerUndoTag ( ) const
inline

Return tag pushed to the undo stack when NewVisualizer() is called.

Definition at line 131 of file ControlExecutive.h.

◆ GetNumThreads()

size_t VAPoR::ControlExec::GetNumThreads ( ) const

◆ GetNumVisualizers()

int VAPoR::ControlExec::GetNumVisualizers ( ) const
inline

Determine how many visualizer windows are present

Returns
number of visualizers

Definition at line 189 of file ControlExecutive.h.

◆ GetParamsMgr()

ParamsMgr * VAPoR::ControlExec::GetParamsMgr ( ) const
inline

Obtain the ParamsMgr, for use in accessing the Params instances.

Returns
ParamsMgr*

Definition at line 268 of file ControlExecutive.h.

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

◆ GetRemoveRendererUndoTag()

string VAPoR::ControlExec::GetRemoveRendererUndoTag ( ) const
inline

Return tag pushed to the undo stack when RemoveRenderer() is called.

Definition at line 254 of file ControlExecutive.h.

◆ GetRemoveVisualizerUndoTag()

string VAPoR::ControlExec::GetRemoveVisualizerUndoTag ( ) const
inline

Return tag pushed to the undo stack when RemoveVisualizer() is called.

Definition at line 152 of file ControlExecutive.h.

◆ GetRenderClassNames()

std::vector< string > VAPoR::ControlExec::GetRenderClassNames ( string  winName) const

Get all activated render class names

Get a list of all render class names currently active for the visualizer named by winName

◆ GetRenderInstances()

std::vector< string > VAPoR::ControlExec::GetRenderInstances ( string  winName,
string  renderType 
) const

Get all activated render class instance names

Get a list of all render class instance names currently active for the visualizer named by winName of type renderType

◆ GetRenderParams()

RenderParams * VAPoR::ControlExec::GetRenderParams ( string  winName,
string  dataSetName,
string  renderType,
string  instName 
) const

Get RenderParams for an active renderer

Return the RenderParams for a render of type renderType, associated the visualizer winName, and named instName with the specified

◆ GetSaveStateEnabled()

bool VAPoR::ControlExec::GetSaveStateEnabled ( ) const
inline

Definition at line 494 of file ControlExecutive.h.

◆ GetVisualizerNames()

vector< string > VAPoR::ControlExec::GetVisualizerNames ( ) const

Return the names of all of the defined visualizers

◆ InitializeViz()

int VAPoR::ControlExec::InitializeViz ( string  name,
GLManager glManager 
)

Perform OpenGL initialization of specified visualizer

Parameters
[in]namehandle to existing visualizer returned by NewVisualizer(). This method is a no-op if a Visualizer named

This method should be called by the UI once before any rendering is performed. The UI should make the OGL context associated with viz current prior to calling this method.

◆ LoadState() [1/3]

virtual void VAPoR::ControlExec::LoadState ( )
virtual

Set the ControlExec to a default state: Remove all visualizers

◆ LoadState() [2/3]

virtual void VAPoR::ControlExec::LoadState ( const XmlNode node)
virtual

Load state from an Xml tree

Load state from an Xml state tree. Any unrecognized nodes in the tree are simply ignored.

See also
ParamsMgr::LoadState(const XmlNode *node);

◆ LoadState() [3/3]

virtual int VAPoR::ControlExec::LoadState ( string  stateFile,
LoadStateRelAndAbsPathsExistAction  relAndAbsPathsExistAction = LoadStateRelAndAbsPathsExistAction::LoadAbs 
)
virtual

Restore the session state from a session state file

This method sets the session state based on the contents of the session file specified by file. It also has the side effect of deactivating all renderers and unloading any data set previously loaded by LoadData(). If successful, the state of all Params objects may have changed.

Parameters
[in]filePath to the input file
Returns
status A negative int indicates failure. If the method fails the session state remains unchanged

◆ MakeRendererNameUnique()

string VAPoR::ControlExec::MakeRendererNameUnique ( string  name) const

◆ MakeStringConformant()

static string VAPoR::ControlExec::MakeStringConformant ( string  s)
static

Make string conformant for library

Many of the methods provided by the API accept string arguments defining names of objects. These user-defined names must conform to Xml element name requirements:

  • Element names are case-sensitive
  • Element names must start with a letter or underscore
  • Element names cannot start with the letters xml (or XML, or Xml, etc)
  • Element names can contain letters, digits, hyphens, underscores, and periods
  • Element names cannot contain spaces

This method ensures s is conformant, returning a possibly modified string meeting the above requirements

Parameters
[in]sa string
Return values
Returnss, possibly modified to be XML element conformant

◆ NewVisualizer()

int VAPoR::ControlExec::NewVisualizer ( string  name)

Create a new visualizer

This method creates a new visualizer. A visualizer is a drawable OpenGL object (e.g. window or pbuffer). The caller is responsible for establishing an OpenGL drawable object and making its context current before calling NewVisualizer().

Parameters
[in]nameSpecifies the name for the new visualizer. If name visualizer with name name already exists the existing visualizer will be destroyed and a new one created with the same name.
[in]withDatasetsis the list of currently opened datasets. When a dataset is loaded, it loops over the existing visualizers and adds params for the currently loading dataset. Since datasets could've been loaded prior to the creation of this visualizer, they need to be manually added here.
Note
Need to establish what OpenGL state mgt, if any, is performed by UI. For example, who calls swapbuffers?
Since the UI is responsible for setting up the graphics contexts we may need a method that allows the ControlExec to provide hints about what kind of graphics context is needed (e.g. double buffering)

◆ OpenData()

int VAPoR::ControlExec::OpenData ( const std::vector< string > &  files,
const std::vector< string > &  options,
string  dataSetName,
string  type = "vdc" 
)

Load a data set into the current session

Loads a data set specified by the list of files in files

Parameters
[in]filesA vector of data file paths. For data sets not containing explicit time information the ordering of time varying data will be determined by the order of the files in files.
Note
The proposed DataMgr API doesn't provide methods to easily query some of the information that will be required by the UI, for example, the coordinate extents of a variable. These methods should either be added to the DataMgr, or the current DataStatus class might be cleaned up. Hence, DataInfo might be an enhanced DataMgr, or a class object designed specifically for returning metadata to the UI.
(AN) It would be much better to incorporate the DataStatus methods into the DataMgr class, rather than keeping them separate.

◆ Paint()

int VAPoR::ControlExec::Paint ( string  name,
bool  force = false 
)

Render the contents of a drawable

Tells the control executive to invoke all active renderers associated with the visualizer name. The control executive may elect to ignore this method if it believes the rendering state to be current, unless force is true.

The UI should make the OGL context associated with viz current prior to calling this method.

Parameters
[in]namehandle to existing visualizer returned by NewVisualizer().
[in]forceIf true all active renderers will rerender their scenes. If false, rendering will only be performed if the params objects associated with any of the active renderers on this visualizer have changed state.
Returns
rc is 0 if actual painting occurred, -1 if not.

◆ RebaseStateSave()

void VAPoR::ControlExec::RebaseStateSave ( )
inline

Re-base state saving

Set's the base state to the current node

Definition at line 500 of file ControlExecutive.h.

◆ Redo()

bool VAPoR::ControlExec::Redo ( )

Redo the next session state change Restores the state of the session to what it was before the last change made via Undo,Redo() can be called repeatedly to undo multiple state changes.

State changes do not trigger rendering. It is the UI's responsibility to call Paint() after Redo(), and to make any UI internal changes necessary to reflect the new state.

Returns
status A boolean indicating whether state was succefully restored to previous state.
See also
UnDo()

◆ RedoSize()

size_t VAPoR::ControlExec::RedoSize ( ) const
inline

Return number of elements in Redo history

See also
Redo()

Definition at line 480 of file ControlExecutive.h.

◆ RemoveAllRenderers()

void VAPoR::ControlExec::RemoveAllRenderers ( string  winName,
bool  hasOpenGLContext = false 
)

Remove (destroy) all renderers on this window

Parameters
[in]hasOpenGLContextIf true it is the callers job to ensure that the OpenGL Context for the window winName is active. In this case the renderer is destroyed immediately. If false the renderer is queue'd for later destruction when winName has an active OpenGL context.

◆ RemoveFunction()

void VAPoR::ControlExec::RemoveFunction ( string  scriptType,
string  dataSetName,
string  scriptName 
)

Remove a previously defined function

This method removes the function previously created by AddFunction() All of the associated derived variables are removed from the dataset. The method is a no-op if scriptName is not an active function.

Parameters
[in]scriptTypeLanguage of script. Currently only "Python" is supported
[in]dataSetNameName of data set for which scriptName is to be removed.
[in]scriptNameName of script to remove
See also
PyEngineMgr::RemoveFunction()

◆ RemoveRenderer()

void VAPoR::ControlExec::RemoveRenderer ( string  winName,
string  dataSetName,
string  renderType,
string  renderName,
bool  hasOpenGLContext 
)

Remove (destroy) the indicated renderer

Parameters
[in]hasOpenGLContextIf true it is the callers job to ensure that the OpenGL Context for the window winName is active. In this case the renderer is destroyed immediately. If false the renderer is queue'd for later destruction when winName has an active OpenGL context.

◆ RemoveVisualizer()

void VAPoR::ControlExec::RemoveVisualizer ( string  name,
bool  hasOpenGLContext = false 
)

Delete an existing visualizer

Deletes visualizer and all of its renderers

Parameters
[in]namehandle to existing visualizer returned by NewVisualizer(). This method is a no-op if a Visualizer named name doesn't exist
[in]hasOpenGLContextIf true it is the callers job to ensure that the OpenGL Context for the window winName is active. In this case the renderer is destroyed immediately. If false the renderer is queue'd for later destruction when winName has an active OpenGL context.

◆ RenderLookup()

bool VAPoR::ControlExec::RenderLookup ( string  instName,
string &  winName,
string &  dataSetName,
string &  rendererType 
) const

Lookup window, data set, and class name from a render instance name

This method returns the window name winName, data set name dataSetName, and render type rendererType that are associated with the render instance name instName.

Return values
statusTrue on success, false if instName is not a previously defined render instance name
See also
ActivateRender

◆ ResizeViz()

int VAPoR::ControlExec::ResizeViz ( string  name,
int  width,
int  height 
)

Notify the control executive that a drawing object has changed size.

Parameters
[in]namehandle to existing visualizer returned by NewVisualizer().
[in]widthWidth of visualizer
[in]heightHeight of visualizer

This method should be called by the UI whenever the drawing object (e.g. window) associated with viz has changed size. The UI should make the OGL context associated with viz current prior to calling this method.

◆ SaveSession()

int VAPoR::ControlExec::SaveSession ( string  file)

Save the current session state to a file

This method saves all current session state information to the file specified by path file. All session state information is stored in Params objects and their derivatives

Parameters
[in]filePath to the output file
Returns
status A negative int indicates failure
See also
RestoreSession()

◆ SetCacheSize()

void VAPoR::ControlExec::SetCacheSize ( size_t  sizeMB)

Set the data cache size

Set the size of the data cache in MBs. Has no effect until the next data set is loaded.

See also
DataMgr

◆ SetNumThreads()

void VAPoR::ControlExec::SetNumThreads ( size_t  nthreads)

Set number of execution threads

Set the number of execution threads. If nThreads == 0, the default, the system will attempt to set the number of threads equal to the number of cores detected. Has no effect until the next data set is loaded.

◆ SetSaveStateEnabled()

void VAPoR::ControlExec::SetSaveStateEnabled ( bool  enabled)
inline

Enable or disable state saving

Enable or disable session state saving. When enabled all state changes are recorded and it is possible to undo previous changes, or save current session state to a file

State saving is disabled by default

See also
Undo(), Redo(), SaveSession()

Definition at line 492 of file ControlExecutive.h.

◆ Undo()

bool VAPoR::ControlExec::Undo ( )

Undo the last session state change Restores the state of the session to what it was prior to the last change made via a Params object, or prior to the last call to Undo() or Redo(), whichever happened last. I.e. Undo() can be called repeatedly to undo multiple state changes.

State changes do not trigger rendering. It is the UI's responsibility to call Paint() after Undo(), and to make any UI internal changes necessary to reflect the new state.

Returns
status A boolean indicating whether state was succefully restored to previous state.
See also
Redo()

◆ UndoRedoClear()

void VAPoR::ControlExec::UndoRedoClear ( )

Clear history from the Undo & Redo stack

◆ UndoSize()

size_t VAPoR::ControlExec::UndoSize ( ) const
inline

Return number of elements in Undo history

See also
Undo()

Definition at line 475 of file ControlExecutive.h.


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