VAPoR
3.0.0
|
A class for performing OpenGL rendering in VAPOR GUI Window. More...
#include <visualizer.h>
Public Member Functions | |
Visualizer (int winnum) | |
~Visualizer () | |
ViewpointParams * | getActiveViewpointParams () |
RegionParams * | getActiveRegionParams () |
AnimationParams * | getActiveAnimationParams () |
VizFeatureParams * | getActiveVizFeatureParams () |
void | initializeGL () |
Method to initialize GL rendering. Must be called from a GL context. More... | |
Trackball * | GetTrackball () |
void | SetTrackballCoordsChanged (bool val) |
int | paintEvent () |
void | resizeGL (int w, int h) |
int | getWindowNum () |
void | resetTrackball () |
Reset the trackball, creating a new trackball in default state for this visualizer. More... | |
void | resetNearFar (ViewpointParams *vpParams) |
bool | projectPointToWin (double userCoords[3], double winCoords[2]) |
int | pointIsOnBox (double corners[8][3], double pickPt[2]) |
bool | pixelToVector (double winCoords[2], const vector< double > cameraPos, double dirVec[3]) |
Renderer * | getRenderer (int i) |
int | getNumRenderers () |
Renderer * | getRenderer (RenderParams *p) |
VizFeatureRenderer * | getVizFeatureRenderer () |
int | insertSortedRenderer (RenderParams *p, Renderer *ren) |
bool | removeRenderer (RenderParams *p) |
void | removeAllRenderers () |
Remove (and delete) all the renderers in the renderer queue. More... | |
void | removeDisabledRenderers () |
Remove all disabled renderers from the queue. More... | |
TranslateStretchManip * | getManip (const std::string ¶mTag) |
double | getPixelSize () |
int | getWidth () |
int | getHeight () |
double * | getModelViewMatrix () |
void | setImageCaptureEnabled (bool onOff, string filename) |
Public Member Functions inherited from VetsUtil::MyBase | |
MyBase () | |
const string & | getClassName () const |
Static Public Member Functions | |
static void | setActiveWinNum (int winnum) |
static void | setRegionShareFlag (bool regionIsShared) |
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) |
Additional Inherited Members | |
Public Types inherited from VetsUtil::MyBase | |
typedef void(* | ErrMsgCB_T) (const char *msg, int err_code) |
typedef void(* | DiagMsgCB_T) (const char *msg) |
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 Member Functions inherited from VetsUtil::MyBase | |
void | SetClassName (const string &name) |
A class for performing OpenGL rendering in VAPOR GUI Window.
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 61 of file visualizer.h.
VAPoR::Visualizer::Visualizer | ( | int | winnum | ) |
VAPoR::Visualizer::~Visualizer | ( | ) |
AnimationParams* VAPoR::Visualizer::getActiveAnimationParams | ( | ) |
Method that returns the AnimationParams that is active in this window.
AnimationParams* | current active AnimationParams |
RegionParams* VAPoR::Visualizer::getActiveRegionParams | ( | ) |
Method that returns the RegionParams that is active in this window.
RegionParams* | current active RegionParams |
ViewpointParams* VAPoR::Visualizer::getActiveViewpointParams | ( | ) |
Method that returns the ViewpointParams that is active in this window.
ViewpointParams* | current active ViewpointParams |
VizFeatureParams* VAPoR::Visualizer::getActiveVizFeatureParams | ( | ) |
Method that returns the VizFeatureParams that is active in this window.
VizFeatureParams* | current active VizFeatureParams |
|
inline |
Determine the height of this visualizer
Definition at line 212 of file visualizer.h.
|
inline |
Obtain the manip that is associated with a specified Params type
[in] | tag | associated with the Params that owns the manip |
Definition at line 188 of file visualizer.h.
References VAPoR::MouseModeParams::getModeFromParams().
double* VAPoR::Visualizer::getModelViewMatrix | ( | ) |
Identify the current modelview matrix as an array of doubles Return pointer to the current 4x4 model-view matrix
|
inline |
Determine the number of renderers in the renderer list
Definition at line 156 of file visualizer.h.
double VAPoR::Visualizer::getPixelSize | ( | ) |
Determine the approximate size of a pixel in terms of user coordinates, at the center of the scene.
|
inline |
Determine the renderer in the renderer list associated with a specific index
[in] | index |
Definition at line 152 of file visualizer.h.
Renderer* VAPoR::Visualizer::getRenderer | ( | RenderParams * | p | ) |
Determine the renderer associated with a particular RenderParams instance
[in] | RenderParams | to be checked for renderer |
Trackball* VAPoR::Visualizer::GetTrackball | ( | ) |
Obtain the current trackball (either shared or local) based on current viewpoint params
|
inline |
Identify the VizFeatureRenderer associated with this Visualizer
Definition at line 165 of file visualizer.h.
|
inline |
Determine the width of this visualizer
Definition at line 208 of file visualizer.h.
|
inline |
Identify the visualizer index associated with this visualizer
visualizer | index; |
Definition at line 111 of file visualizer.h.
void VAPoR::Visualizer::initializeGL | ( | ) |
Method to initialize GL rendering. Must be called from a GL context.
|
inline |
Insert a renderer in the queue using the default (5) render order
[in] | RenderParams | instance associated with the renderer |
[out] | Renderer | instance that is inserted in the queue |
Definition at line 172 of file visualizer.h.
int VAPoR::Visualizer::paintEvent | ( | ) |
all the OpenGL rendering is performed in the paintEvent method. It must be invoked from a current OpenGL context.
bool VAPoR::Visualizer::pixelToVector | ( | double | winCoords[2], |
const vector< double > | cameraPos, | ||
double | dirVec[3] | ||
) |
Determine a unit direction vector associated with a pixel, pointing from the camera, through the pixel into the scene. Uses OpenGL screencoords I.e. y = 0 at bottom. Returns false on failure. Used during mouseMoveEvent.
[in] | winCoords | pixel coordinates (converted to double) |
[in] | cameraPos | current camera position in world coordinates. |
[out] | dirVec | resulting unit direction vector |
int VAPoR::Visualizer::pointIsOnBox | ( | double | corners[8][3], |
double | pickPt[2] | ||
) |
Determine if a point is over (and not inside) a box, specified by 8 3-D coords. the first four corners are the counter-clockwise (from outside) vertices of one face, the last four are the corresponding back vertices, clockwise from outside Returns index of face (0..5), or -1 if not on Box
[in] | corners | Eight 3D coordinates of box corners in required order |
[in] | pickPt | test point coordinates |
bool VAPoR::Visualizer::projectPointToWin | ( | double | userCoords[3], |
double | winCoords[2] | ||
) |
Project a 3D point (in user coord system) to window coords. Return true if in front of camera. Used by pointIsOnQuad, as well as in building Axis labels.
[in] | userCoords[3] | coordinates of point |
[out] | winCoords[2] | window coordinates of projection |
void VAPoR::Visualizer::removeAllRenderers | ( | ) |
Remove (and delete) all the renderers in the renderer queue.
void VAPoR::Visualizer::removeDisabledRenderers | ( | ) |
Remove all disabled renderers from the queue.
bool VAPoR::Visualizer::removeRenderer | ( | RenderParams * | p | ) |
Remove a specific renderer from the renderer queue
[in] | RenderParams | whose renderer will be removed |
void VAPoR::Visualizer::resetNearFar | ( | ViewpointParams * | vpParams | ) |
Reset the near/far clipping, so that the near and far clipping planes are wide enough to view twice the entire region from the current camera position. If the camera is inside the doubled region, make the near clipping plane 1% of the region size.
[in] | vpParams | ViewpointParams* used to determine current camera position. |
void VAPoR::Visualizer::resetTrackball | ( | ) |
Reset the trackball, creating a new trackball in default state for this visualizer.
void VAPoR::Visualizer::resizeGL | ( | int | w, |
int | h | ||
) |
Issue the OpenGL resize call. Must be called from an OpenGL context.
[in] | w | Window width in pixels. |
[in] | h | Window height in pixels. |
|
inlinestatic |
Set the current active visualizer
[in] | active | visualizer number |
Definition at line 198 of file visualizer.h.
|
inline |
Turn on or off the capture enablement. If on, the next paintEvent will result in capture Also saves the capture file name
Definition at line 220 of file visualizer.h.
|
inlinestatic |
Set the region share flag, indicating whether the active visualizer is sharing the Region. This is needed for Manip rendering, and is set whenever the active visualizer is changed.
[in] | true | if the active visualizer uses the shared (global) Region |
Definition at line 204 of file visualizer.h.
|
inline |
Set/clear a flag indicating that the trackball has changed the viewpoint. This implies that the new viewpoint needs to be saved at render time.
[in] | bool | flag indicating whether the values have changed |
Definition at line 95 of file visualizer.h.