Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_plucker.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 _A_PLUCKER_H_
17 #define _A_PLUCKER_H_
18 
19 #include <iostream>
20 #include <sstream>
21 #include "a_point.h"
22 
30 class a_plucker
31 {
32 public:
33  a_plucker(); //v : value
34  a_plucker(double ax, double ay, double az, double bx, double by, double bz);
35  a_plucker(a_point p1, a_point p2);
36  a_plucker(const a_plucker& m);
37  //~a_plucker() {std::cerr << "destroyed a_plucker" << std::endl;}
39  virtual std::string name() const {return "a_plucker";}
40 
41  inline a_point p1() const {return p1_;}
42  inline a_point p2() const {return p2_;}
43  inline void p1(const a_point & p) {p1_=p;}
44  inline void p2(const a_point & p) {p2_=p;}
45 
46  a_plucker& operator=(const a_plucker& m);
47  bool operator==(const a_plucker& a);
49  virtual a_plucker operator+(const a_plucker& a);
50  a_plucker operator-(const a_plucker& a);
51  a_plucker& operator+=(const a_plucker& a);
52  a_plucker& operator-=(const a_plucker& a);
53  a_plucker& operator*=(double v);
54  a_plucker& operator/=(double v);
55  bool operator==(const a_plucker& a) const;
56  bool operator!=(const a_plucker& a) const;
57 
58  //: input/output
59  virtual void read(std::istream &i);
60  virtual void write(std::ostream &o) const;
61 
62 protected:
63  a_point p1_;
64  a_point p2_;
65 };
66 //'reciprocal product' or 'virtual product'
67 double operator*(const a_plucker& a, const a_plucker& b);
68 
69 std::istream& operator>> (std::istream& i, a_plucker& f);
70 std::ostream& operator<< (std::ostream& o, const a_plucker& f);
71 std::istream& operator>> (std::istream& i, a_plucker* f);
72 std::ostream& operator<< (std::ostream& o, const a_plucker* f);
73 #endif
74 
std::istream & operator>>(std::istream &i, a_plucker &f)
Definition: a_plucker.cxx:111
std::ostream & operator<<(std::ostream &o, const a_plucker &f)
Definition: a_plucker.cxx:117
double operator*(const a_plucker &a, const a_plucker &b)
Definition: a_plucker.cxx:136
a plucker class
Definition: a_plucker.h:31
~a_plucker()
Definition: a_plucker.h:38
a_point p1_
Definition: a_plucker.h:63
a_plucker & operator=(const a_plucker &m)
Definition: a_plucker.cxx:35
a_plucker & operator*=(double v)
Definition: a_plucker.cxx:75
a_point p2_
Definition: a_plucker.h:64
bool operator!=(const a_plucker &a) const
Definition: a_plucker.cxx:94
a_plucker & operator/=(double v)
Definition: a_plucker.cxx:82
a_plucker & operator-()
Definition: a_plucker.cxx:42
virtual a_plucker operator+(const a_plucker &a)
Definition: a_plucker.cxx:49
bool operator==(const a_plucker &a)
virtual void write(std::ostream &o) const
Definition: a_plucker.cxx:105
virtual std::string name() const
Definition: a_plucker.h:39
a_point p2() const
Definition: a_plucker.h:42
a_point p1() const
Definition: a_plucker.h:41
void p2(const a_point &p)
Definition: a_plucker.h:44
virtual void read(std::istream &i)
Definition: a_plucker.cxx:99
a_plucker & operator-=(const a_plucker &a)
Definition: a_plucker.cxx:68
void p1(const a_point &p)
Definition: a_plucker.h:43
a_plucker(a_point p1, a_point p2)
a_plucker & operator+=(const a_plucker &a)
Definition: a_plucker.cxx:61