VAPOR3 3.9.4
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
VAPoR::Renderer Class Referenceabstract

A class that performs rendering in a Visualizer. More...

#include <Renderer.h>

Inheritance diagram for VAPoR::Renderer:
VAPoR::RendererBase Wasp::MyBase VAPoR::BarbRenderer VAPoR::ContourRenderer VAPoR::FlowRenderer VAPoR::HelloRenderer VAPoR::ModelRenderer VAPoR::ParticleRenderer VAPoR::RayCaster VAPoR::SliceRenderer VAPoR::TwoDRenderer VAPoR::VolumeRenderer VAPoR::WireFrameRenderer

Public Member Functions

 Renderer (const ParamsMgr *pm, string winName, string dataSetName, string paramsType, string classType, string instName, DataMgr *dataMgr)
 
virtual ~Renderer ()
 
double GetDefaultZ (DataMgr *dataMgr, size_t ts) const
 
virtual int paintGL (bool fast)
 
void ClearCache ()
 
void renderColorbar ()
 Render the colorbar for this renderer (if it has one)
 
RenderParamsGetActiveParams () const
 
ViewpointParamsGetViewpointParams () const
 
AnnotationParamsGetAnnotationParams () const
 
TransformGetDatasetTransform () const
 
- Public Member Functions inherited from VAPoR::RendererBase
 RendererBase (const ParamsMgr *pm, string winName, string dataSetName, string paramsType, string classType, string instName, DataMgr *dataMgr)
 
virtual ~RendererBase ()
 
virtual int initializeGL (GLManager *glManager)
 
string GetVisualizer ()
 Obtain the Visualizer associated with this Renderer.
 
string GetMyName () const
 
string GetInstanceName () const
 
string GetMyType () const
 
string GetMyParamsType () const
 
string GetMyDatasetName () const
 
bool IsGLInitialized () const
 
void FlagForDeletion ()
 
bool IsFlaggedForDeletion () const
 
 RendererBase ()
 
- Public Member Functions inherited from Wasp::MyBase
 MyBase ()
 
const string & getClassName () const
 

Static Public Member Functions

static void ApplyTransform (GLManager *gl, const Transform *dataset, const Transform *renderer)
 
static void ApplyDatasetTransform (GLManager *gl, const Transform *dataset)
 
- 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 ()
 

Protected Member Functions

 Renderer ()
 
virtual std::string _getColorbarVariableName () const
 
virtual int _paintGL (bool fast)=0
 All OpenGL rendering is performed in the pure virtual paintGL method.
 
void EnableClipToBox (ShaderProgram *shader, float haloFrac=0.0) const
 
void DisableClippingPlanes ()
 
void GetClippingPlanes (float planes[24]) const
 
virtual bool VariableExists (size_t ts, std::vector< string > &varnames, int level, int lod, bool zeroOK) const
 
virtual void _clearCache ()=0
 
- Protected Member Functions inherited from VAPoR::RendererBase
virtual int _initializeGL ()=0
 
- Protected Member Functions inherited from Wasp::MyBase
void SetClassName (const string &name)
 

Protected Attributes

unsigned char * _colorbarTexture
 
string _fontName
 
- Protected Attributes inherited from VAPoR::RendererBase
const ParamsMgr_paramsMgr
 
string _winName
 
string _dataSetName
 
string _paramsType
 
string _classType
 
string _instName
 
DataMgr_dataMgr
 
GLManager_glManager
 

Static Protected Attributes

static const int _imgHgt
 
static const int _imgWid
 

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 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
 

Detailed Description

A class that performs rendering in a Visualizer.

Author
Alan Norton
Version
3.0
Date
July 2015

Renderer class is a pure virtual class that supports OpenGL rendering in the VAPOR visualizer window, using a RenderParams instance to describe the rendering. All Renderer classes must derive from this class.

Definition at line 121 of file Renderer.h.

Constructor & Destructor Documentation

◆ Renderer() [1/2]

VAPoR::Renderer::Renderer ( const ParamsMgr pm,
string  winName,
string  dataSetName,
string  paramsType,
string  classType,
string  instName,
DataMgr dataMgr 
)

Constructor should be invoked by any derived renderers. It is invoked when the user enables a renderer. Provides any needed setup of renderer state, but not of OpenGL state.

◆ ~Renderer()

virtual VAPoR::Renderer::~Renderer ( )
virtual

◆ Renderer() [2/2]

VAPoR::Renderer::Renderer ( )
inlineprotected

Definition at line 262 of file Renderer.h.

Member Function Documentation

◆ _clearCache()

virtual void VAPoR::Renderer::_clearCache ( )
protectedpure virtual

◆ _getColorbarVariableName()

virtual std::string VAPoR::Renderer::_getColorbarVariableName ( ) const
protectedvirtual

◆ _paintGL()

virtual int VAPoR::Renderer::_paintGL ( bool  fast)
protectedpure virtual

◆ ApplyDatasetTransform()

static void VAPoR::Renderer::ApplyDatasetTransform ( GLManager gl,
const Transform dataset 
)
static

◆ ApplyTransform()

static void VAPoR::Renderer::ApplyTransform ( GLManager gl,
const Transform dataset,
const Transform renderer 
)
static

◆ ClearCache()

void VAPoR::Renderer::ClearCache ( )
inline

Clear render cache

Called whenever renderer should clear any cached data

Definition at line 147 of file Renderer.h.

◆ DisableClippingPlanes()

void VAPoR::Renderer::DisableClippingPlanes ( )
protected

Disable clipping planes. If clipping is enabled this method should be called prior to returning from _paintGL()

◆ EnableClipToBox()

void VAPoR::Renderer::EnableClipToBox ( ShaderProgram shader,
float  haloFrac = 0.0 
) const
protected

Enable specified clipping planes during the GL rendering. This method clips the scene to the bounding box. See ! RenderParams::GetBox() May be invoked during _paintGL() by classes derived from this class. Clipping planes are specified in User coordinates.

Parameters
[in]haloFracFraction of bounding box that should be used to extend the min and max clippig planes. For example, if a min extent is zero, and a max extent is 1.0, and haloFrac is 0.1 then the min clipping plane will be set to -0.1 and the max to 1.1
See also
DisableClippingPlanes

◆ GetActiveParams()

RenderParams * VAPoR::Renderer::GetActiveParams ( ) const
inline

Obtain the current RenderParams instance

Return values
RenderParams*current render params

Definition at line 249 of file Renderer.h.

◆ GetAnnotationParams()

AnnotationParams * VAPoR::Renderer::GetAnnotationParams ( ) const
inline

Definition at line 253 of file Renderer.h.

◆ GetClippingPlanes()

void VAPoR::Renderer::GetClippingPlanes ( float  planes[24]) const
protected

Get clipping planes in the model/user coordinates. There are six planes in total that get stored in "planes" It is the caller's responsibility to allocate memory for 24 floats.

◆ GetDatasetTransform()

Transform * VAPoR::Renderer::GetDatasetTransform ( ) const
inline

Definition at line 255 of file Renderer.h.

◆ GetDefaultZ()

double VAPoR::Renderer::GetDefaultZ ( DataMgr dataMgr,
size_t  ts 
) const

Get default z value at the base of the domain. Useful for applying a height value to 2D renderers.

Parameters
[in]dataMgrCurrent (valid) dataMgr
Return values
defaultheight value for current dataset

◆ GetViewpointParams()

ViewpointParams * VAPoR::Renderer::GetViewpointParams ( ) const
inline

Definition at line 251 of file Renderer.h.

◆ paintGL()

virtual int VAPoR::Renderer::paintGL ( bool  fast)
virtual

All OpenGL rendering is performed in the paintGL method. This invokes _paintGL on the renderer subclass

Parameters
[in]dataMgrCurrent (valid) dataMgr
Return values
intzero if successful.

◆ renderColorbar()

void VAPoR::Renderer::renderColorbar ( )

Render the colorbar for this renderer (if it has one)

◆ VariableExists()

virtual bool VAPoR::Renderer::VariableExists ( size_t  ts,
std::vector< string > &  varnames,
int  level,
int  lod,
bool  zeroOK 
) const
protectedvirtual

return true if all of the specified variables exist in the DataMgr at the specified timestep, refinement level, and lod. If zeroOK is true variables named "0" or "" evaluate to true.

Member Data Documentation

◆ _colorbarTexture

unsigned char* VAPoR::Renderer::_colorbarTexture
protected

Definition at line 304 of file Renderer.h.

◆ _fontName

string VAPoR::Renderer::_fontName
protected

Definition at line 305 of file Renderer.h.

◆ _imgHgt

const int VAPoR::Renderer::_imgHgt
staticprotected

Definition at line 302 of file Renderer.h.

◆ _imgWid

const int VAPoR::Renderer::_imgWid
staticprotected

Definition at line 303 of file Renderer.h.


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