6 #include <vapor/ExpatParseMgr.h>
28 vector<double> campos(3,0.);
29 vector<double> vdir(3,0.);
30 vector<double> upvec(3,0.);
31 vector<double> rotctr(3,0.);
37 setCameraPosLocal(campos,0);
38 setRotationCenterLocal(rotctr,0);
56 return ( GetValueDoubleVec(_camPosTag));
68 vector<double> campos= vector<double>(getCameraPosLocal());
70 return SetValueDouble(_camPosTag,
"Set camera position",campos,p);
77 return SetValueDouble(_camPosTag,
"Set camera position", val,p);
82 return ( GetValueDoubleVec(_viewDirTag));
94 vector<double> vdir = vector<double>(getViewDir());
96 return SetValueDouble(_viewDirTag,
"Set view direction", vdir,p);
103 return SetValueDouble(_viewDirTag,
"Set view direction", val,p);
108 return ( GetValueDoubleVec(_upVecTag));
121 vector<double> vdir = vector<double>(getUpVec());
123 return SetValueDouble(_upVecTag,
"Set up vector", vdir,p);
131 return SetValueDouble(_upVecTag,
"Set up vector", val,p);
136 return ( GetValueDoubleVec(_rotCenterTag));
148 vector<double> vdir(getRotationCenterLocal());
150 return SetValueDouble(_rotCenterTag,
"Set rotation center", vdir,p);
157 return SetValueDouble(_rotCenterTag,
"Set rotation center", val, p);
161 void alignCenter(
Params* p);
168 const vector<double> rvec = getRotationCenterLocal();
169 for (
int i = 0; i<3; i++) vec[i] = stretch[i]*rvec[i];
177 vector<double> rotCtr;
178 for (
int i = 0; i<3; i++) rotCtr.push_back(vec[i]/stretch[i]);
179 return setRotationCenterLocal(rotCtr, p);
185 const vector<double> cpos = getCameraPosLocal();
186 for (
int i = 0; i<3; i++) vec[i] = stretch[i]*cpos[i];
195 for (
int i = 0; i<3; i++) cpos.push_back(vec[i]/stretch[i]);
196 return setCameraPosLocal(cpos, p);
200 #ifndef DOXYGEN_SKIP_THIS
202 static const string _viewpointTag;
205 static const string _camPosTag;
206 static const string _viewDirTag;
207 static const string _upVecTag;
208 static const string _rotCenterTag;
210 #endif //DOXYGEN_SKIP_THIS
const vector< double > getViewDir()
int setViewDir(int coord, double val, Params *p)
static ParamsBase * CreateDefaultInstance()
int setCameraPosLocal(int coord, double val, Params *p)
A pure virtual class for managing parameters used in visualization.
const vector< double > getRotationCenterLocal()
int setViewDir(const vector< double > &val, Params *p)
int setRotationCenterLocal(const vector< double > &val, Params *p)
void getStretchedRotCtrLocal(double *vec)
int setStretchedCamPosLocal(const double *vec, Params *p)
int setUpVec(int coord, double val, Params *p)
virtual ~Viewpoint()
Destructor.
Nodes with state in Xml tree representation.
const vector< double > getUpVec()
void getStretchedCamPosLocal(double *vec)
class that indicates location and direction of view
int setCameraPosLocal(const vector< double > &val, Params *p)
int setUpVec(const vector< double > &val, Params *p)
const vector< double > getCameraPosLocal()
Viewpoint()
Constructor, set everything to default view.
int setRotationCenterLocal(int coord, double val, Params *p)
int setStretchedRotCtrLocal(const double *vec, Params *p)
double getRotationCenterLocal(int i)
static const vector< double > getStretchFactors()
double getCameraPosLocal(int i)