Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_wrench.h
Go to the documentation of this file.
1 /*
2 Copyright 2010-2016 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_WRENCH_H_
17 #define _A_WRENCH_H_
18 
19 #include <iostream>
20 #include "a_plucker.h"
21 #include "a_point.h"
22 #include "a_plane.h"
23 
29 class a_wrench : public a_plucker
30 {
31 public:
32  a_wrench() : a_plucker() {};
34  a_wrench(const a_plucker& m) : a_plucker(m) {};
35  ~a_wrench() {}
36  //~a_wrench() {std::cerr << "destroyed a_wrench!" << std::endl; }
37  std::string name() const {return "a_wrench";}
39  static const std::string help();
41  void set(const a_point& p, a_point f, double m = 0);
43  void set(double x, double y, double z, double fx, double fy, double fz, double m = 0);
45  a_wrench(const a_point& p, a_point f, double m = 0);
47  a_wrench(double x, double y, double z, double fx, double fy, double fz, double m = 0);
49  a_wrench(const a_point& p1, const a_point& p2, const a_point& p3, const a_wrench& f1, const a_wrench& f2);
51  inline a_point F() const {return p1_;}
53  inline double fx() const {return p1_.x();}
55  inline double fy() const {return p1_.y();}
57  inline double fz() const {return p1_.z();}
59  inline a_point M() const {return p2_;}
61  inline double mx() const {return p2_.x();}
63  inline double my() const {return p2_.y();}
65  inline double mz() const {return p2_.z();}
67  inline double f() const {return p1_.norm();}
69  inline double m() const {return p2_.norm();}
71  a_point pierce(const a_plane& p) const;
73  inline void clear() {p1_.clear(); p2_.clear();}
74  a_wrench operator+(const a_wrench& a) {return this->a_plucker::operator+(a);}
75  a_wrench operator-(const a_wrench& a) {return this->a_plucker::operator-(a);}
76  a_wrench& operator-() {this->a_plucker::operator-();return *this;}
78  void origin(a_point p);
80  a_point d0() const;
82  a_point torque(const a_point& p) const;
84  double torque(const a_point& p, const a_point& n) const;
85 
86 //protected:
87 };
88 
89 #endif
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_plucker & operator-()
Definition: a_plucker.cxx:42
virtual a_plucker operator+(const a_plucker &a)
Definition: a_plucker.cxx:49
a_point p2() const
Definition: a_plucker.h:42
a_point p1() const
Definition: a_plucker.h:41
a wrench class
Definition: a_wrench.h:30
void clear()
set to 0
Definition: a_wrench.h:73
std::string name() const
Definition: a_wrench.h:37
a_point M() const
torque
Definition: a_wrench.h:59
void set(const a_point &p, a_point f, double m=0)
apply a force f at p, possibly with a moment having same direction
Definition: a_wrench.cxx:68
double fx() const
force at the origin (x component)
Definition: a_wrench.h:53
double mz() const
torque at the origin (z component)
Definition: a_wrench.h:65
a_point F() const
force
Definition: a_wrench.h:51
double my() const
torque at the origin (y component)
Definition: a_wrench.h:63
a_wrench(const a_plucker &m)
copy constructor
Definition: a_wrench.h:34
double fz() const
force at the origin (z component)
Definition: a_wrench.h:57
double f() const
force at the origin
Definition: a_wrench.h:67
static const std::string help()
get information about the class
Definition: a_wrench.cxx:28
a_point torque(const a_point &p) const
torque at p
Definition: a_wrench.cxx:166
a_wrench & operator-()
Definition: a_wrench.h:76
~a_wrench()
Definition: a_wrench.h:35
double fy() const
force at the origin (y component)
Definition: a_wrench.h:55
void origin(a_point p)
change origin
Definition: a_wrench.cxx:128
a_point d0() const
point where wrench reduces to a pure force, return origin if f=0
Definition: a_wrench.cxx:144
a_point pierce(const a_plane &p) const
intersection with a plane
Definition: a_wrench.cxx:135
a_wrench operator+(const a_wrench &a)
Definition: a_wrench.h:74
double m() const
torque at the origin
Definition: a_wrench.h:69
a_wrench operator-(const a_wrench &a)
Definition: a_wrench.h:75
double mx() const
torque at the origin (x component)
Definition: a_wrench.h:61
a_wrench()
Definition: a_wrench.h:32