VAPoR  3.0.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | 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 VetsUtil::MyBase VAPoR::ArrowRenderer VAPoR::HelloRenderer VAPoR::IsolineRenderer

Public Types

typedef Renderer *(* RendererCreateMethod) (Visualizer *, RenderParams *)
 typedef defining Renderer CreateInstance() methods. More...
- Public Types inherited from VetsUtil::MyBase
typedef void(* ErrMsgCB_T) (const char *msg, int err_code)
typedef void(* DiagMsgCB_T) (const char *msg)

Public Member Functions

 Renderer (Visualizer *vw, RenderParams *rp, string name)
virtual ~Renderer ()
virtual int paintGL (DataMgrV3_0 *dataMgr)
virtual void setRenderParams (RenderParams *rp)
RenderParamsgetRenderParams ()
void setBypass (int timestep)
void setPartialBypass (int timestep)
void setAllBypass (bool val)
bool doBypass (int timestep)
bool doAlwaysBypass (int timestep)
virtual void setAllDataDirty ()
virtual void invalidateCache ()
- Public Member Functions inherited from VAPoR::RendererBase
 RendererBase (Visualizer *vw, Params *p, string name)
virtual ~RendererBase ()
virtual int initializeGL ()
VisualizerGetVisualizer ()
 Obtain the Visualizer associated with this Renderer. More...
bool isInitialized ()
const string getMyName () const
- Public Member Functions inherited from VetsUtil::MyBase
 MyBase ()
const string & getClassName () const

Static Public Member Functions

static void RegisterRenderer (string tag, RendererCreateMethod)
static RendererCreateInstance (RenderParams *p, Visualizer *viz)
static void invalidateRenderCache (RenderParams *rp)
static int getGrids (DataMgrV3_0 *dataMgr, size_t ts, const vector< string > &varnames, const double extents[6], int *refLevel, int *lod, RegularGrid **grids)
- Static Public Member Functions inherited from VetsUtil::MyBase
static void SetErrMsg (const char *format,...)
 Record a formatted error message. More...
static void SetErrMsg (int errcode, const char *format,...)
 Record a formatted error message and an error code. More...
static const char * GetErrMsg ()
static void SetErrCode (int err_code)
 Record an error code. More...
static int GetErrCode ()
 Retrieve the current error code. More...
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. More...
static const char * GetDiagMsg ()
static void SetDiagMsgCB (DiagMsgCB_T cb)
static DiagMsgCB_T GetDiagMsgCB ()
static void SetDiagMsgFilePtr (FILE *fp)
static bool EnableErrMsg (bool enable)

Protected Member Functions

virtual int _paintGL (DataMgrV3_0 *)=0
 All OpenGL rendering is performed in the pure virtual paintGL method. More...
void enableClippingPlanes (const double extents[6])
void enableFullClippingPlanes ()
void enableRegionClippingPlanes ()
void enable2DClippingPlanes ()
void disableClippingPlanes ()
size_t GetCurrentTimestep ()
- Protected Member Functions inherited from VAPoR::RendererBase
virtual int _initializeGL ()=0
- Protected Member Functions inherited from VetsUtil::MyBase
void SetClassName (const string &name)


Internal methods not intended for general use

void buildLocal2DTransform (int dataOrientation, float a[2], float b[2], float *constVal, int mappedDims[3])
void getLocalContainingRegion (float regMin[3], float regMax[3])
static void UndoRedo (bool isUndo, int instance, Params *beforeP, Params *afterP, Params *auxPrev=0, Params *auxNext=0)

Additional Inherited Members

- Static Public Attributes inherited from VetsUtil::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 Attributes inherited from VAPoR::RendererBase
bool _initialized
size_t _timestep
string _rendererName

Detailed Description

A class that performs rendering in a Visualizer.

Alan Norton
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 95 of file renderer.h.

Member Typedef Documentation

typedef Renderer*(* VAPoR::Renderer::RendererCreateMethod) (Visualizer *, RenderParams *)

typedef defining Renderer CreateInstance() methods.

Definition at line 108 of file renderer.h.

Constructor & Destructor Documentation

VAPoR::Renderer::Renderer ( Visualizer vw,
RenderParams rp,
string  name 

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.

virtual VAPoR::Renderer::~Renderer ( )

Member Function Documentation

virtual int VAPoR::Renderer::_paintGL ( DataMgrV3_0 )
protectedpure virtual

All OpenGL rendering is performed in the pure virtual paintGL method.

Implemented in VAPoR::HelloRenderer, and VAPoR::IsolineRenderer.

void VAPoR::Renderer::buildLocal2DTransform ( int  dataOrientation,
float  a[2],
float  b[2],
float *  constVal,
int  mappedDims[3] 

Construct transform of form (x,y)-> (a[0]x+b[0],a[1]y+b[1],const) Mapping [-1,1]X[-1,1] into local 3D volume coordinates. This is used to map plane coordinates (for various 2D renderers) into User coordinates

[in]orientationis 0 1 or 2 for z, y, or x-axis orientation.
[out]ais linear term of mapping
[out]bis constant term of mapping
[out]constValis the coordinate along the axis orthogonal to the image of the mapping
[out]mappedDimsgives the three axes of the mapped image
static Renderer* VAPoR::Renderer::CreateInstance ( RenderParams p,
Visualizer viz 

Generic CreateInstance method to create a Renderer from a Params and Visualizer instance

[in]tagassociated with renderer
[in]pRenderParams instance associated with the Renderer
[in]vizPointer to visualizer where this will render.
void VAPoR::Renderer::disableClippingPlanes ( )

Disable the clipping planes that were previously enabled during enableClippingPlanes(), enableFullClippingPlanes(), enableRegionClippingPlanes, or enable2DClippingPlanes()

bool VAPoR::Renderer::doAlwaysBypass ( int  timestep)

doAlwaysBypass is used in the presence of partial bypass. Indicates that the rendering should be bypassed at any resolution

[in]inttimestep Time step
Return values
boolvalue of flag

Definition at line 162 of file renderer.h.

bool VAPoR::Renderer::doBypass ( int  timestep)

doBypass indicates the state of the bypass flag.

[in]timestepindicates the timestep being checked
Return values
boolindicates that the rendering at the timestep should be bypassed.

Definition at line 156 of file renderer.h.

void VAPoR::Renderer::enable2DClippingPlanes ( )

Enable clipping planes associated with horizontal extents of the current VDC.

See also
void VAPoR::Renderer::enableClippingPlanes ( const double  extents[6])

Enable specified clipping planes during the GL rendering Must be invoked during _paintGL()

See also
[in]extentsSpecifies the extents of the clipping bounds
void VAPoR::Renderer::enableFullClippingPlanes ( )

Enable clipping planes associated with the full 3D data domain of the VDC.

See also
void VAPoR::Renderer::enableRegionClippingPlanes ( )

Enable clipping planes associated with the current RegionParams extents

See also
size_t VAPoR::Renderer::GetCurrentTimestep ( )

Obtain the current timestep (used during rendering):

the current timestep of

Definition at line 261 of file renderer.h.

static int VAPoR::Renderer::getGrids ( DataMgrV3_0 dataMgr,
size_t  ts,
const vector< string > &  varnames,
const double  extents[6],
int *  refLevel,
int *  lod,
RegularGrid **  grids 

Method that obtains one or more regular grids at specified timestep, extents, refinement, and lod. If the data is available, but not at the requested extents, refinement or lod, then the extents may be reduced, and the data accuracy may be reduced.

[in]dataMgrThe data manager that will be used for obtaining data
[in]tstimestep being requested
[in]variablename(s) being requested
[in]extentsrequested. If data is 2D the third dimension is ignored.
void VAPoR::Renderer::getLocalContainingRegion ( float  regMin[3],
float  regMax[3] 

Obtain the extents of a region that contains a rotated (3D) box associated with a renderer.

[out]regMinMinimum coordinates of containing region.
[out]regMixMaximum coordinates of containing region.
RenderParams* VAPoR::Renderer::getRenderParams ( )

Obtain the current RenderParams instance

Return values
RenderParams*current render params

Definition at line 134 of file renderer.h.

virtual void VAPoR::Renderer::invalidateCache ( )

Invalidate all caches associated with a Renderer instance Default does nothing

Reimplemented from VAPoR::RendererBase.

Reimplemented in VAPoR::IsolineRenderer.

Definition at line 181 of file renderer.h.

Referenced by invalidateRenderCache().

static void VAPoR::Renderer::invalidateRenderCache ( RenderParams rp)

Invalidate any render cache associated with a specific RenderParams Does nothing if the renderer does not exist or does not have a cache

Definition at line 174 of file renderer.h.

References invalidateCache().

virtual int VAPoR::Renderer::paintGL ( DataMgrV3_0 dataMgr)

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

[in]dataMgrCurrent (valid) dataMgr
Return values
intzero if successful.
static void VAPoR::Renderer::RegisterRenderer ( string  tag,

Register a Renderer class associated with a Params tag

[in]tagis the string that is the name of the associated Params class
[in]RendererCreateMethodis the static CreateInstance() method that constructs the Renderer
void VAPoR::Renderer::setAllBypass ( bool  val)

SetAllBypass is set to indicate all (or no) timesteps should be bypassed Should be set true when render failure is independent of timestep Should be set false when state changes and rendering should be reattempted.

[in]valindicates whether it is being turned on or off.

Definition at line 151 of file renderer.h.

virtual void VAPoR::Renderer::setAllDataDirty ( )

General method to force a renderer to re-obtain its data. Default does nothing Must be re-implemented if there is state or a cache that is retained between renderings.

Reimplemented in VAPoR::IsolineRenderer.

Definition at line 170 of file renderer.h.

void VAPoR::Renderer::setBypass ( int  timestep)

Call setBypass to indicate that the renderer will not work until the state of the params is changed This will result in the renderer not being invoked for the specified timestep

[in]inttimestep The timestep when the renderer fails

Definition at line 139 of file renderer.h.

void VAPoR::Renderer::setPartialBypass ( int  timestep)

Partial bypass is currently only used by DVR and Isosurface renderers. Indicates a renderer that should be bypassed at full resolution but not necessarily at interactive resolution.

[in]timestepTime step that should be bypassed

Definition at line 145 of file renderer.h.

virtual void VAPoR::Renderer::setRenderParams ( RenderParams rp)

Whenever the Params associated with the renderer is changed, setRenderParams must be called. This virtual method should be overridden if there are additional settings necessary

[in]RenderParams*rp Pointer to the current RenderParams instance

Definition at line 130 of file renderer.h.

static void VAPoR::Renderer::UndoRedo ( bool  isUndo,
int  instance,
Params beforeP,
Params afterP,
Params auxPrev = 0,
Params auxNext = 0 

Static method invoked during Undo and Redo of Renderer enable or disable. This function must be passed in Command::CaptureStart for enable and disable rendering. It causes the Undo and Redo operations on enable/disable renderer to actually create or destroy the renderer.

See also
[in]isUndoindicates whether an Undo or Redo is being performed
[in]instanceindicates the RenderParams instance that is enabled or disabled
[in]beforePis a copy of the InstanceParams at the start of the Command
[in]afterPis a copy of the InstanceParams at the end of the Command
[in]auxPrevis a copy of auxiliary InstanceParams at the start of the Command, not currently used
[in]afterPis a copy of auxiliary InstanceParams at the end of the Command, not currently used

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