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

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
Visualizer_visualizer
 
bool _initialized
 
size_t _timestep
 
string _rendererName
 
Params_params
 

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 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 ( )
virtual

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

Parameters
[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 
)
static

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

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

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

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

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

Parameters
[in]inttimestep Time step
Return values
boolvalue of flag

Definition at line 162 of file renderer.h.

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

doBypass indicates the state of the bypass flag.

Parameters
[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 ( )
protected

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

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

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

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

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

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

Enable clipping planes associated with the current RegionParams extents

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

Obtain the current timestep (used during rendering):

Returns
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 
)
static

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.

Parameters
[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.

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

Obtain the current RenderParams instance

Return values
RenderParams*current render params

Definition at line 134 of file renderer.h.

virtual void VAPoR::Renderer::invalidateCache ( )
inlinevirtual

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

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)
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.
static void VAPoR::Renderer::RegisterRenderer ( string  tag,
RendererCreateMethod   
)
static

Register a Renderer class associated with a Params tag

Parameters
[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)
inline

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.

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

Definition at line 151 of file renderer.h.

virtual void VAPoR::Renderer::setAllDataDirty ( )
inlinevirtual

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

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

Parameters
[in]inttimestep The timestep when the renderer fails

Definition at line 139 of file renderer.h.

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

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.

Parameters
[in]timestepTime step that should be bypassed

Definition at line 145 of file renderer.h.

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

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

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

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
UndoRedoHelpCB_T
Parameters
[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: