VAPoR
3.0.0
|
A class that performs rendering in a Visualizer. More...
#include <renderer.h>
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) |
RenderParams * | getRenderParams () |
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 () |
Visualizer * | GetVisualizer () |
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 Renderer * | CreateInstance (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 | |
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 |
A class that performs rendering in a Visualizer.
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.
typedef Renderer*(* VAPoR::Renderer::RendererCreateMethod) (Visualizer *, RenderParams *) |
typedef defining Renderer CreateInstance() methods.
Definition at line 108 of file renderer.h.
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 |
|
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] | orientation | is 0 1 or 2 for z, y, or x-axis orientation. |
[out] | a | is linear term of mapping |
[out] | b | is constant term of mapping |
[out] | constVal | is the coordinate along the axis orthogonal to the image of the mapping |
[out] | mappedDims | gives the three axes of the mapped image |
|
static |
Generic CreateInstance method to create a Renderer from a Params and Visualizer instance
[in] | tag | associated with renderer |
[in] | p | RenderParams instance associated with the Renderer |
[in] | viz | Pointer to visualizer where this will render. |
|
protected |
Disable the clipping planes that were previously enabled during enableClippingPlanes(), enableFullClippingPlanes(), enableRegionClippingPlanes, or enable2DClippingPlanes()
|
inline |
doAlwaysBypass is used in the presence of partial bypass. Indicates that the rendering should be bypassed at any resolution
[in] | int | timestep Time step |
bool | value of flag |
Definition at line 162 of file renderer.h.
|
inline |
doBypass indicates the state of the bypass flag.
[in] | timestep | indicates the timestep being checked |
bool | indicates that the rendering at the timestep should be bypassed. |
Definition at line 156 of file renderer.h.
|
protected |
Enable clipping planes associated with horizontal extents of the current VDC.
|
protected |
Enable specified clipping planes during the GL rendering Must be invoked during _paintGL()
[in] | extents | Specifies the extents of the clipping bounds |
|
protected |
Enable clipping planes associated with the full 3D data domain of the VDC.
|
protected |
Enable clipping planes associated with the current RegionParams extents
|
inlineprotected |
Obtain the current timestep (used during rendering):
Definition at line 261 of file renderer.h.
|
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.
[in] | dataMgr | The data manager that will be used for obtaining data |
[in] | ts | timestep being requested |
[in] | variable | name(s) being requested |
[in] | extents | requested. 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] | regMin | Minimum coordinates of containing region. |
[out] | regMix | Maximum coordinates of containing region. |
|
inline |
Obtain the current RenderParams instance
RenderParams* | current render params |
Definition at line 134 of file renderer.h.
|
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().
|
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 |
All OpenGL rendering is performed in the paintGL method. This invokes _paintGL on the renderer subclass
[in] | dataMgr | Current (valid) dataMgr |
int | zero if successful. |
|
static |
Register a Renderer class associated with a Params tag
[in] | tag | is the string that is the name of the associated Params class |
[in] | RendererCreateMethod | is the static CreateInstance() method that constructs the Renderer |
|
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.
[in] | val | indicates whether it is being turned on or off. |
Definition at line 151 of file renderer.h.
|
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.
|
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
[in] | int | timestep The timestep when the renderer fails |
Definition at line 139 of file renderer.h.
|
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.
[in] | timestep | Time step that should be bypassed |
Definition at line 145 of file renderer.h.
|
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
[in] | RenderParams* | rp Pointer to the current RenderParams instance |
Definition at line 130 of file renderer.h.
|
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.
[in] | isUndo | indicates whether an Undo or Redo is being performed |
[in] | instance | indicates the RenderParams instance that is enabled or disabled |
[in] | beforeP | is a copy of the InstanceParams at the start of the Command |
[in] | afterP | is a copy of the InstanceParams at the end of the Command |
[in] | auxPrev | is a copy of auxiliary InstanceParams at the start of the Command, not currently used |
[in] | afterP | is a copy of auxiliary InstanceParams at the end of the Command, not currently used |