VAPOR3 3.9.4
Viewpoint.h
Go to the documentation of this file.
1#ifndef VIEWPOINT_H
2#define VIEWPOINT_H
3/*
4 * This class describes a viewpoint
5 */
6#include <vapor/ParamsBase.h>
7
8namespace VAPoR {
9
16
21
23public:
25
27
28 virtual ~Viewpoint();
29
31 //
32 void GetModelViewMatrix(double m[16]) const;
33 void SetModelViewMatrix(const double m[16]);
34
35 void GetProjectionMatrix(double m[16]) const;
36 void SetProjectionMatrix(const double m[16]);
37
38 bool ReconstructCamera(const double m[16], double position[3], double upVec[3], double viewDir[3]) const;
39
40 void SetRotationCenter(const std::vector<double> &v)
41 {
42 VAssert(v.size() == 3);
43 SetValueDoubleVec(_rotationCenterTag, "Camera rotation center", v);
44 }
45
46 std::vector<double> GetRotationCenter() const
47 {
48 vector<double> defaultv(3, 0.0);
49 return (GetValueDoubleVec(_rotationCenterTag, defaultv));
50 }
51
52 static string GetClassType() { return ("Viewpoint"); }
53
54private:
55 // ParamsContainer *_VPs;
56
57 static const string _modelViewMatrixTag;
58 static const string _projectionMatrixTag;
59 static const string _rotationCenterTag;
60
61 static double _defaultModelViewMatrix[16];
62 static double _defaultProjectionMatrix[16];
63
64 void _init();
65};
66}; // namespace VAPoR
67
68#endif // VIEWPOINT_H
#define VAssert(expr)
Definition: VAssert.h:9
State capture class.
Definition: ParamsBase.h:62
Nodes with state in Xml tree representation.
Definition: ParamsBase.h:50
class that indicates location and direction of view
Definition: Viewpoint.h:22
void GetModelViewMatrix(double m[16]) const
Return the current 4x4 model-view matrix.
Viewpoint(ParamsBase::StateSave *ssave, XmlNode *node)
bool ReconstructCamera(const double m[16], double position[3], double upVec[3], double viewDir[3]) const
void SetModelViewMatrix(const double m[16])
virtual ~Viewpoint()
void SetRotationCenter(const std::vector< double > &v)
Definition: Viewpoint.h:40
static string GetClassType()
Definition: Viewpoint.h:52
void GetProjectionMatrix(double m[16]) const
std::vector< double > GetRotationCenter() const
Definition: Viewpoint.h:46
void SetProjectionMatrix(const double m[16])
Viewpoint(ParamsBase::StateSave *ssave)
An Xml tree.
Definition: XmlNode.h:49
#define PARAMS_API
Definition: common.h:77