VAPOR3 3.9.4
Public Member Functions | List of all members
VAPoR::Visualizer Class Reference

A class for performing OpenGL rendering in VAPOR GUI Window. More...

#include <Visualizer.h>

Inheritance diagram for VAPoR::Visualizer:
Wasp::MyBase

Public Member Functions

 Visualizer (const ParamsMgr *pm, const DataStatus *dataStatus, string winName)
 
 ~Visualizer ()
 
ViewpointParamsgetActiveViewpointParams () const
 
RegionParamsgetActiveRegionParams () const
 
AnnotationParamsgetActiveAnnotationParams () const
 
int InitializeGL (GLManager *glManager)
 
int paintEvent (bool fast)
 
int resizeGL (int w, int h)
 
string GetWindowName () const
 
int GetNumRenderers () const
 
int CreateRenderer (string dataSetName, string renderType, string renderName)
 
void DestroyRenderer (string renderType, string renderName, bool hasOpenGLContext)
 
void DestroyAllRenderers (bool hasOpenGLContext)
 
bool HasRenderer (string renderType, string renderName) const
 
void MoveRendererToFront (string renderType, string renderName)
 
void MoveRenderersOfTypeToFront (const std::string &type)
 
double getPixelSize () const
 
int SetImageCaptureEnabled (bool onOff, string filename)
 
int SetAnimationCaptureEnabled (bool onOff, string filename)
 
void DrawText (string text, int x, int y, int size, float color[3], int type=0)
 Draw a text banner at x, y coordinates.
 
void DrawTextNormalizedCoords (string text, float x, float y, int size, float color[3], int type=0)
 
void ClearText ()
 
void ClearRenderCache ()
 
void ClearRenderCache (const string &inst)
 
- Public Member Functions inherited from Wasp::MyBase
 MyBase ()
 
const string & getClassName () const
 

Additional Inherited Members

- Public Types inherited from Wasp::MyBase
typedef void(* ErrMsgCB_T) (const char *msg, int err_code)
 
typedef void(* DiagMsgCB_T) (const char *msg)
 
- 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 ()
 
- 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

A class for performing OpenGL rendering in VAPOR GUI Window.

Author
Alan Norton
Version
3.0
Date
October 2013

The Visualizer class performs OpenGL rendering for the main VAPOR visualizers. The Visualizer class is not a GL Window itself, however it will issue the OpenGL calls to perform rendering in a context that is already current.

Definition at line 46 of file Visualizer.h.

Constructor & Destructor Documentation

◆ Visualizer()

VAPoR::Visualizer::Visualizer ( const ParamsMgr pm,
const DataStatus dataStatus,
string  winName 
)

◆ ~Visualizer()

VAPoR::Visualizer::~Visualizer ( )

Member Function Documentation

◆ ClearRenderCache() [1/2]

void VAPoR::Visualizer::ClearRenderCache ( )

Force each renderer to empty its cache

This method calls ClearCache on every renderer

◆ ClearRenderCache() [2/2]

void VAPoR::Visualizer::ClearRenderCache ( const string &  inst)

◆ ClearText()

void VAPoR::Visualizer::ClearText ( )
inline

Definition at line 162 of file Visualizer.h.

◆ CreateRenderer()

int VAPoR::Visualizer::CreateRenderer ( string  dataSetName,
string  renderType,
string  renderName 
)
Note
A render params instance must have been previously created for this renderer.

◆ DestroyAllRenderers()

void VAPoR::Visualizer::DestroyAllRenderers ( bool  hasOpenGLContext)

Flag all rendereres for destruction.

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.

◆ DestroyRenderer()

void VAPoR::Visualizer::DestroyRenderer ( string  renderType,
string  renderName,
bool  hasOpenGLContext 
)

Flag a renderer for destruction.

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.

◆ DrawText()

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

Draw a text banner at x, y coordinates.

Definition at line 158 of file Visualizer.h.

◆ DrawTextNormalizedCoords()

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

Definition at line 160 of file Visualizer.h.

◆ getActiveAnnotationParams()

AnnotationParams * VAPoR::Visualizer::getActiveAnnotationParams ( ) const

Method that returns the AnnotationParams that is active in this window.

Return values
AnnotationParams*current active AnnotationParams

◆ getActiveRegionParams()

RegionParams * VAPoR::Visualizer::getActiveRegionParams ( ) const

Method that returns the RegionParams that is active in this window.

Return values
RegionParams*current active RegionParams

◆ getActiveViewpointParams()

ViewpointParams * VAPoR::Visualizer::getActiveViewpointParams ( ) const

Method that returns the ViewpointParams that is active in this window.

Return values
ViewpointParams*current active ViewpointParams

◆ GetNumRenderers()

int VAPoR::Visualizer::GetNumRenderers ( ) const
inline

Determine the number of renderers in the renderer list

Returns
number of renderers

Definition at line 84 of file Visualizer.h.

◆ getPixelSize()

double VAPoR::Visualizer::getPixelSize ( ) const

Determine the approximate size of a pixel in terms of user coordinates, at the center of the scene.

◆ GetWindowName()

string VAPoR::Visualizer::GetWindowName ( ) const
inline

Identify the visualizer index associated with this visualizer

Return values
visualizerindex;

Definition at line 80 of file Visualizer.h.

◆ HasRenderer()

bool VAPoR::Visualizer::HasRenderer ( string  renderType,
string  renderName 
) const

◆ InitializeGL()

int VAPoR::Visualizer::InitializeGL ( GLManager glManager)

Method to initialize GL rendering. Must be called from a GL context.

Parameters
[in]glManagerA pointer to a GLManager

◆ MoveRenderersOfTypeToFront()

void VAPoR::Visualizer::MoveRenderersOfTypeToFront ( const std::string &  type)

◆ MoveRendererToFront()

void VAPoR::Visualizer::MoveRendererToFront ( string  renderType,
string  renderName 
)

Move the renderer to the front of the render queue

Parameters
[out]Rendererinstance that is moved to front

◆ paintEvent()

int VAPoR::Visualizer::paintEvent ( bool  fast)

Set/clear a flag indicating that the trackball has changed the viewpoint. all the OpenGL rendering is performed in the paintEvent method. It must be invoked from a current OpenGL context.

Returns
zero if successful.

◆ resizeGL()

int VAPoR::Visualizer::resizeGL ( int  w,
int  h 
)

Issue the OpenGL resize call. Must be called from an OpenGL context.

Parameters
[in]wWindow width in pixels.
[in]hWindow height in pixels.

◆ SetAnimationCaptureEnabled()

int VAPoR::Visualizer::SetAnimationCaptureEnabled ( bool  onOff,
string  filename 
)
inline

Turn on or off the animation capture enablement. If on, all paintEvents will result in capture until it is turned off

Definition at line 138 of file Visualizer.h.

◆ SetImageCaptureEnabled()

int VAPoR::Visualizer::SetImageCaptureEnabled ( bool  onOff,
string  filename 
)
inline

Turn on or off the image capture enablement. If on, the next paintEvent will result in capture Also saves the capture file name

Definition at line 122 of file Visualizer.h.


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