Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_twist.h
Go to the documentation of this file.
1 /*
2 Copyright 2010-2014 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 _A_TWIST_H_
17 #define _A_TWIST_H_
18 
19 #include <iostream>
20 #include "a_plucker.h"
21 #include "a_quaternion.h"
22 #include "a_mat_sq.h"
23 
30 class a_twist : public a_plucker
31 {
32 public:
39  void set(const a_point& p, a_point d, double t, double r);
40  void set(double x, double y, double z, double dx, double dy, double dz, double t, double r=0.);
41  a_twist();
42  a_twist(const a_plucker& m) : a_plucker(m) {};
43  a_twist(const a_point& p, a_point d, double t, double r);
44  a_twist(double x, double y, double z, double dx, double dy, double dz, double t, double r=0.);
45  ~a_twist() {};
46  std::string name() const {return "a_twist";}
48  static const std::string help();
50  inline double dx() const {return p2_.x();}
51  inline double dy() const {return p2_.y();}
52  inline double dz() const {return p2_.z();}
54  inline double rx() const {return p1_.x();}
55  inline double ry() const {return p1_.y();}
56  inline double rz() const {return p1_.z();}
57  inline double d() const {return p2_.norm();}
58  inline double r() const {return p1_.norm();}
59 
60  void reset();
62  a_quaternion quaternion() const;
63  void quaternion(a_quaternion q);
64  a_mat_sq matrix() const;
65  void matrix(const a_mat_sq& mat);
67  void translate(const a_point& d);
68  void translate(const double& x, const double& y, const double& z) {this->translate(a_point(x,y,z));}
69  void rotate(const a_point& pt, const a_point& dir, double v);
71  a_point operator* (a_point p) const;
72 
73 // protected:
74 };
75 
76 a_point operator* (a_point p, const a_twist& t);
77 
78 #endif
79 
a_point operator*(a_point p, const a_twist &t)
Definition: a_twist.cxx:231
a plucker class
Definition: a_plucker.h:31
a_point p1_
Definition: a_plucker.h:63
a_point p2_
Definition: a_plucker.h:64
a twist class
Definition: a_twist.h:31
double dy() const
Definition: a_twist.h:51
a_point operator*(a_point p) const
transform a point using the screw
Definition: a_twist.cxx:89
double dz() const
Definition: a_twist.h:52
a_quaternion quaternion() const
conversion routines
Definition: a_twist.cxx:156
double d() const
Definition: a_twist.h:57
a_twist()
Definition: a_twist.cxx:77
double rx() const
p1_ : rotation (applied first, norm is rotation in radian, direction is axis of rotation)
Definition: a_twist.h:54
a_mat_sq matrix() const
Definition: a_twist.cxx:178
void translate(const double &x, const double &y, const double &z)
Definition: a_twist.h:68
std::string name() const
Definition: a_twist.h:46
void rotate(const a_point &pt, const a_point &dir, double v)
Definition: a_twist.cxx:209
double ry() const
Definition: a_twist.h:55
void reset()
Definition: a_twist.cxx:145
a_twist(const a_plucker &m)
Definition: a_twist.h:42
void set(const a_point &p, a_point d, double t, double r)
Definition: a_twist.cxx:20
void translate(const a_point &d)
iterative transformation
Definition: a_twist.cxx:151
double dx() const
p2_ : translation
Definition: a_twist.h:50
~a_twist()
Definition: a_twist.h:45
double rz() const
Definition: a_twist.h:56
static const std::string help()
get information about the class
Definition: a_twist.cxx:112
double r() const
Definition: a_twist.h:58