VAPOR3 3.9.4
|
A class for describing the viewpoint and lights in a 3D VAPOR scene. More...
#include <ViewpointParams.h>
Public Types | |
enum | ProjectionType { Perspective , Orthographic , MapOrthographic } |
Public Types inherited from Wasp::MyBase | |
typedef void(* | ErrMsgCB_T) (const char *msg, int err_code) |
typedef void(* | DiagMsgCB_T) (const char *msg) |
Public Member Functions | |
ViewpointParams (ParamsBase::StateSave *ssave) | |
ViewpointParams (ParamsBase::StateSave *ssave, XmlNode *node) | |
ViewpointParams (const ViewpointParams &rhs) | |
ViewpointParams & | operator= (const ViewpointParams &rhs) |
virtual | ~ViewpointParams () |
void | rescale (vector< double > scaleFac) |
int | getNumLights () const |
double | getExponent () const |
void | setNumLights (size_t nlights) |
double | getLightDirection (int lightNum, int dir) const |
void | setLightDirection (int lightNum, int dir, double val) |
double | getDiffuseCoeff (int lightNum) const |
double | getSpecularCoeff (int lightNum) const |
double | getAmbientCoeff () const |
void | setDiffuseCoeff (int lightNum, double val) |
void | setSpecularCoeff (int lightNum, double val) |
void | setExponent (double val) |
void | setAmbientCoeff (double val) |
void | SetCurrentViewpoint (Viewpoint *newVP) |
void | SetWindowSize (size_t width, size_t height) |
void | GetWindowSize (size_t &width, size_t &height) const |
void | SetFOV (float v) |
double | GetFOV () const |
void | SetOrthoProjectionSize (float f) |
double | GetOrthoProjectionSize () const |
void | SetProjectionType (ProjectionType type) |
ProjectionType | GetProjectionType () const |
vector< double > | GetStretchFactors () const |
Method to get stretch factors. | |
void | SetStretchFactors (vector< double > factors) |
virtual Viewpoint * | getCurrentViewpoint () const |
void | GetModelViewMatrix (double m[16]) const |
Return the current 4x4 model-view matrix. | |
std::vector< double > | GetModelViewMatrix () const |
void | SetModelViewMatrix (const double matrix[16]) |
void | SetModelViewMatrix (const std::vector< double > mvec) |
void | GetProjectionMatrix (double m[16]) const |
void | SetProjectionMatrix (const double m[16]) |
bool | ReconstructCamera (const double m[16], double position[3], double upVec[3], double viewDir[3]) const |
std::vector< double > | GetRotationCenter () const |
void | GetRotationCenter (double c[3]) const |
void | SetRotationCenter (vector< double > c) |
void | SetRotationCenter (const double c[3]) |
virtual Transform * | GetTransform (string dataSetName) |
vector< string > | GetTransformNames () const |
int | SetCameraFromFile (const std::string &path) |
int | SaveCameraToFile (const std::string &path) |
Public Member Functions inherited from VAPoR::ParamsBase | |
ParamsBase (StateSave *ssave, const string &classname) | |
ParamsBase (StateSave *ssave, XmlNode *node) | |
ParamsBase (const ParamsBase &rhs) | |
Copy constructor. | |
ParamsBase & | operator= (const ParamsBase &rhs) |
ParamsBase (ParamsBase &&)=delete | |
ParamsBase & | operator= (ParamsBase &)=delete |
bool | operator== (const ParamsBase &rhs) const |
Equivalence operator. | |
bool | operator!= (const ParamsBase &rhs) const |
virtual | ~ParamsBase () |
void | SetParent (ParamsBase *parent) |
XmlNode * | GetNode () const |
void | BeginGroup (const string &description) |
void | EndGroup () |
void | IntermediateChange () |
virtual vector< long > | GetValueLongVec (const string tag) const |
virtual vector< long > | GetValueLongVec (const string tag, const vector< long > &defaultVal) const |
virtual long | GetValueLong (const string tag, long defaultVal) const |
virtual vector< double > | GetValueDoubleVec (const string tag) const |
virtual vector< double > | GetValueDoubleVec (const string tag, const vector< double > &defaultVal) const |
virtual double | GetValueDouble (const string tag, double defaultVal) const |
virtual vector< string > | GetValueStringVec (const string tag) const |
virtual vector< string > | GetValueStringVec (const string tag, const vector< string > &defaultVal) const |
virtual string | GetValueString (const string tag, string defaultVal) const |
virtual void | SetValueLongVec (const string &tag, string description, const vector< long > &values) |
virtual void | SetValueLong (const string &tag, string description, long value) |
virtual void | SetValueDoubleVec (const string &tag, string description, const vector< double > &values) |
virtual void | SetValueDouble (const string &tag, string description, double value) |
virtual void | SetValueStringVec (const string &tag, string description, const vector< string > &values) |
virtual void | SetValueString (const string &tag, string description, const string &value) |
string | GetName () const |
Public Member Functions inherited from Wasp::MyBase | |
MyBase () | |
const string & | getClassName () const |
Additional Inherited Members | |
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 () |
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 |
Protected Member Functions inherited from VAPoR::ParamsBase | |
ParamsBase (StateSave *ssave) | |
void | Remove (const string &name) |
const map< string, string > & | GetAttributes () |
void | Clear () |
Protected Member Functions inherited from Wasp::MyBase | |
void | SetClassName (const string &name) |
Protected Attributes inherited from VAPoR::ParamsBase | |
StateSave * | _ssave |
XmlNode * | _node |
A class for describing the viewpoint and lights in a 3D VAPOR scene.
This class describes the state of viewpoints and and the properties of light sources. If the ViewpointParams is shared (i.e. not local), all windows can use the same viewpoint and lights. Local viewpoints are just applicable in one visualizer.
Definition at line 43 of file ViewpointParams.h.
Enumerator | |
---|---|
Perspective | |
Orthographic | |
MapOrthographic |
Definition at line 160 of file ViewpointParams.h.
VAPoR::ViewpointParams::ViewpointParams | ( | ParamsBase::StateSave * | ssave | ) |
VAPoR::ViewpointParams::ViewpointParams | ( | ParamsBase::StateSave * | ssave, |
XmlNode * | node | ||
) |
VAPoR::ViewpointParams::ViewpointParams | ( | const ViewpointParams & | rhs | ) |
|
virtual |
|
inline |
Optain the ambient lighting coefficient of the lights
double | ambient coefficient |
Definition at line 111 of file ViewpointParams.h.
|
inlinevirtual |
Obtain the current viewpoint
Viewpoint* | current viewpoint. |
Definition at line 174 of file ViewpointParams.h.
References VAssert.
double VAPoR::ViewpointParams::getDiffuseCoeff | ( | int | lightNum | ) | const |
Optain the diffuse lighting coefficient of a light source
[in] | int | light number (0..2) |
double | diffuse coefficient |
|
inline |
Obtain the current specular exponent. This value should be used in setting the material properties of all geometry being rendered.
float | Specular exponent |
Definition at line 74 of file ViewpointParams.h.
double VAPoR::ViewpointParams::GetFOV | ( | ) | const |
double VAPoR::ViewpointParams::getLightDirection | ( | int | lightNum, |
int | dir | ||
) | const |
get one component of a light direction vector
[in] | int | lightNum identifies which light source |
[in] | int | dir coordinate of direction vector (0..3) |
double | requested component of light direction vector |
|
inline |
Definition at line 184 of file ViewpointParams.h.
|
inline |
Return the current 4x4 model-view matrix.
Definition at line 183 of file ViewpointParams.h.
|
inline |
This method tells how many lights are specified and whether lighting is on or not (i.e. if there are more than 0 lights). Note that only the first (light 0) is used in DVR and Isosurface rendering.
int | number of lights (0,1,2) |
Definition at line 63 of file ViewpointParams.h.
double VAPoR::ViewpointParams::GetOrthoProjectionSize | ( | ) | const |
|
inline |
Definition at line 200 of file ViewpointParams.h.
ProjectionType VAPoR::ViewpointParams::GetProjectionType | ( | ) | const |
|
inline |
Definition at line 205 of file ViewpointParams.h.
References GetRotationCenter().
Referenced by GetRotationCenter().
|
inline |
Definition at line 207 of file ViewpointParams.h.
References VAssert.
double VAPoR::ViewpointParams::getSpecularCoeff | ( | int | lightNum | ) | const |
Optain the specular lighting coefficient of a light source
[in] | int | light number (0..2) |
double | specular coefficient |
vector< double > VAPoR::ViewpointParams::GetStretchFactors | ( | ) | const |
Method to get stretch factors.
|
virtual |
Access the transform for a data set
Access the transform for data set dataSetName
Returns | a new transform if one does not exist |
|
inline |
Return list of transform names.
Return the list of transform names added with AddDatasetTransform()
Definition at line 233 of file ViewpointParams.h.
void VAPoR::ViewpointParams::GetWindowSize | ( | size_t & | width, |
size_t & | height | ||
) | const |
Get widow width and height
[out] | width | width of window in pixels |
[out] | height | height of window in pixels |
ViewpointParams & VAPoR::ViewpointParams::operator= | ( | const ViewpointParams & | rhs | ) |
|
inline |
Definition at line 203 of file ViewpointParams.h.
References ReconstructCamera().
Referenced by ReconstructCamera().
void VAPoR::ViewpointParams::rescale | ( | vector< double > | scaleFac | ) |
Rescale viewing parameters, e.g. when the scene stretch factors change
[in] | vector<double> | scaleFac scale factors to be applied, relative to previous scaling. |
int VAPoR::ViewpointParams::SaveCameraToFile | ( | const std::string & | path | ) |
Save the current camera position, direction, up vector, and origin to an xml file
integer | indicating success (0) or failure (-1) |
|
inline |
Set the ambient lighting coefficient
[in] | double | ambient coefficient |
int | 0 if successful |
Definition at line 133 of file ViewpointParams.h.
int VAPoR::ViewpointParams::SetCameraFromFile | ( | const std::string & | path | ) |
Set the current camera position, direction, up vector, and origin from a given xml file
integer | indicating success (0) or failure (-1) |
void VAPoR::ViewpointParams::SetCurrentViewpoint | ( | Viewpoint * | newVP | ) |
Set the current viewpoint to another viewpoint
[in] | Viewpoint* | viewpoint to be set |
int | 0 if successful |
void VAPoR::ViewpointParams::setDiffuseCoeff | ( | int | lightNum, |
double | val | ||
) |
Set the diffuse lighting coefficient of a light source
[in] | int | light number (0..2) |
[in] | double | diffuse coefficent |
int | 0 if successful |
|
inline |
Set the specular lighting exponent of all light sources
[in] | double | specular exponent |
int | 0 if successful |
Definition at line 128 of file ViewpointParams.h.
void VAPoR::ViewpointParams::SetFOV | ( | float | v | ) |
void VAPoR::ViewpointParams::setLightDirection | ( | int | lightNum, |
int | dir, | ||
double | val | ||
) |
Set one component of a light direction vector
[in] | int | lightNum identifies which light source |
[in] | int | dir coordinate of direction vector (0..3) |
[in] | double | value to be set |
int | 0 on success |
|
inline |
Definition at line 191 of file ViewpointParams.h.
|
inline |
Definition at line 192 of file ViewpointParams.h.
References VAssert.
|
inline |
Set the number of directional light sources
[in] | int | number of lights (0,1,2) |
0 | on success |
Definition at line 79 of file ViewpointParams.h.
void VAPoR::ViewpointParams::SetOrthoProjectionSize | ( | float | f | ) |
|
inline |
Definition at line 201 of file ViewpointParams.h.
void VAPoR::ViewpointParams::SetProjectionType | ( | ProjectionType | type | ) |
|
inline |
Definition at line 215 of file ViewpointParams.h.
|
inline |
Definition at line 214 of file ViewpointParams.h.
void VAPoR::ViewpointParams::setSpecularCoeff | ( | int | lightNum, |
double | val | ||
) |
Set the specular lighting coefficient of a light source
[in] | int | light number (0..2) |
[in] | double | specular coefficent |
int | 0 if successful |
void VAPoR::ViewpointParams::SetStretchFactors | ( | vector< double > | factors | ) |
method to set stretch factors
[in] | factors | 3-vector of stretch factors |
void VAPoR::ViewpointParams::SetWindowSize | ( | size_t | width, |
size_t | height | ||
) |
Set widow width and height
[in] | width | width of window in pixels |
[in] | height | height of window in pixels |