/usr/include/gmsh/Camera.h is in libgmsh-dev 3.0.6+dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | // Gmsh - Copyright (C) 1997-2017 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
//
// Contributed by Gilles Marckmann <gilles.marckmann@ec-nantes.fr>
#ifndef _CAMERA_H_
#define _CAMERA_H_
class Quaternion;
class XYZ {
public:
XYZ() : x(0.), y(0.), z(0.){};
~XYZ(){};
XYZ(double _x,double _y,double _z);
double x, y, z;
void set(const double & _x, const double & _y ,const double & _z);
XYZ (const Quaternion &R);
};
double length(XYZ &p);
void normalize(XYZ &p);
void rotate(Quaternion omega,XYZ axe) ;
XYZ operator* (const double &a,const XYZ &T);
XYZ operator+ (const XYZ &L,const XYZ &R);
XYZ operator- (const XYZ &L,const XYZ &R);
XYZ operator- (const XYZ &R);
class Quaternion{
public:
double x,y,z,w;
Quaternion();
Quaternion(const XYZ &R);
Quaternion(const XYZ &R, const double &A);
~Quaternion();
};
double length(Quaternion &quat);
void normalize(Quaternion &quat);
Quaternion conjugate(Quaternion quat);
Quaternion mult(const Quaternion& A,const Quaternion& B);
Quaternion operator *(const Quaternion &A, const Quaternion &B);
class Camera {
public:
Camera();
~Camera();
bool on;
XYZ position; /* camera position */
XYZ front; /* View direction vector */
XYZ up; /* View up direction */
XYZ right; /* View right direction */
XYZ target; /* center of rotation and screen */
double focallength; /* Focal Length along vd */
double focallength_ratio;
double aperture; /* Camera aperture */
double eyesep; /* Eye separation */
int screenwidth,screenheight;
double screenratio, distance, ref_distance;
bool button_left_down, button_middle_down, button_right_down;
bool stereoEnable;
double Lc, eye_sep_ratio, closeness, ndfl, glFnear, glFfar, radians, wd2;
double glFleft,glFright,glFtop,glFbottom;
void giveViewportDimension(const int& W,const int& H);
void lookAtCg();
void init();
void rotate(double* q);
//
void move_and_look(double _movfront,double _movright,double _movup,
double _rotfront,double _rotright,double _rotup,
double _azimut,double _elevation);
//
void moveRight(double& theta);
void moveUp(double& theta);
void zoom(double& factor);
void update();
void affiche();
void alongX();
void alongY();
void alongZ();
void upX();
void upY();
void upZ();
void tiltHeadLeft();
void tiltHeadRight();
};
class mouseAndKeyboard {
public:
bool button_left_down;
bool button_middle_down;
bool button_right_down;
int key;
int mode;
mouseAndKeyboard() {};
~mouseAndKeyboard() {};
};
#endif
|