Points&Forces (core)
Software tools facilitating the task of surveying architecture
a_pos2.h
Go to the documentation of this file.
1 /*
2 Copyright 2010-2011 Pierre SMARS (smars@yuntech.edu.tw)
3 This program is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, either version 2 of the License, or
6 (at your option) any later version.
7 
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 #ifndef _VE_POST2_H_
17 #define _VE_POST2_H_
18 
19 #include "a_mat.h"
20 
21 // .NAME a_pos2
22 // .SECTION Author
23 // Pierre Smars
24 
25 #include <iostream>
26 
28 class a_pos2 : public a_mat
29 {
30 public:
31  inline a_pos2() : a_mat(4,4) {for (int i = 0; i<4; i++) (*this)(i,i)=1; }
32  a_pos2(const a_mat& m);
33  inline void origin(double x, double y, double z)
34  {
35  ox_ = x; oy_ = y; oz_ = z;
36  this->compute_or();
37  }
38  inline void angle(double x, double y, double z)
39  {
40  ax_ = x; ay_ = y; az_ = z;
41  this->compute_rot();
42  }
43  inline void ox(double v) {ox_ = v; this->compute_or();}
44  inline double ox() const {return ox_;}
45  inline void oy(double v) {oy_ = v; this->compute_or();}
46  inline double oy() const {return oy_;}
47  inline void oz(double v) {oz_ = v; this->compute_or();}
48  inline double oz() const {return oz_;}
49  inline void ax(double v) {ax_ = v; this->compute_rot();}
50  inline double ax() const {return ax_;}
51  inline void ay(double v) {ay_ = v; this->compute_rot();}
52  inline double ay() const {return ay_;}
53  inline void az(double v) {az_ = v; this->compute_rot();}
54  inline double az() const {return az_;}
55 
56  //: input/output
57  friend std::istream& operator>> (std::istream& i, a_pos2& l);
58 
59 protected:
60  void compute_or();
61  void compute_rot();
62  void compute_or_inv();
63  void compute_rot_inv();
64 
65  double ox_,oy_,oz_;
66  double ax_,ay_,az_;
67 };
68 
69 #endif
Definition: a_mat.h:42
std::valarray< double > & x() const
Definition: a_mat.h:53
a position matrix
Definition: a_pos2.h:29
void compute_rot()
Definition: a_pos2.cxx:27
double ay() const
Definition: a_pos2.h:52
void ay(double v)
Definition: a_pos2.h:51
double ax() const
Definition: a_pos2.h:50
void origin(double x, double y, double z)
Definition: a_pos2.h:33
double ax_
Definition: a_pos2.h:66
a_pos2()
Definition: a_pos2.h:31
double oz_
Definition: a_pos2.h:65
void ox(double v)
Definition: a_pos2.h:43
void oz(double v)
Definition: a_pos2.h:47
double ay_
Definition: a_pos2.h:66
void ax(double v)
Definition: a_pos2.h:49
double oz() const
Definition: a_pos2.h:48
void compute_or_inv()
Definition: a_pos2.cxx:83
friend std::istream & operator>>(std::istream &i, a_pos2 &l)
Definition: a_pos2.cxx:90
void angle(double x, double y, double z)
Definition: a_pos2.h:38
double oy() const
Definition: a_pos2.h:46
double ox_
Definition: a_pos2.h:65
double az() const
Definition: a_pos2.h:54
double ox() const
Definition: a_pos2.h:44
void az(double v)
Definition: a_pos2.h:53
double az_
Definition: a_pos2.h:66
void oy(double v)
Definition: a_pos2.h:45
double oy_
Definition: a_pos2.h:65
void compute_rot_inv()
Definition: a_pos2.cxx:49
void compute_or()
Definition: a_pos2.cxx:75