Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_contact.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_CONTACT_H_
17 #define _A_CONTACT_H_
18 
19 #include <vector>
20 #include "a_wrench.h"
21 #include "a_point.h"
22 #include "a_segment.h"
23 
27 class a_contact
28 {
29 public:
30  a_contact() : f_() {vertices_.clear();}
31  a_contact(const a_contact& c);
33  int nv() const {return vertices_.size();}
35  void av(const a_point p) {vertices_.push_back(p);}
37  a_point v(const int i) const {return vertices_[i];}
39  a_segment s(const int i) const;
41  void clean();
43  void f(const a_wrench& f) {f_=f;}
45  a_wrench f() const {return f_;}
46  virtual void read(std::istream &i);
47  virtual void write(std::ostream &o) const;
48  //: input/output
49  friend std::istream& operator>> (std::istream& i, a_contact& c);
50  friend std::ostream& operator<< (std::ostream& o, const a_contact& c);
51 
52 protected:
54  std::vector<a_point> vertices_;
57 };
58 
59 #endif
60 
void f(const a_wrench &f)
set force on the face
Definition: a_contact.h:43
std::vector< a_point > vertices_
points defining face
Definition: a_contact.h:54
void clean()
clean
Definition: a_contact.cxx:36
a_wrench f_
force on the face
Definition: a_contact.h:56
a_point v(const int i) const
get a vertex
Definition: a_contact.h:37
a_wrench f() const
get force on the face
Definition: a_contact.h:45
virtual void read(std::istream &i)
Definition: a_contact.cxx:69
a_segment s(const int i) const
get a segment
Definition: a_contact.cxx:30
void av(const a_point p)
add a vertex
Definition: a_contact.h:35
virtual void write(std::ostream &o) const
Definition: a_contact.cxx:82
int nv() const
get number of vertices
Definition: a_contact.h:33
friend std::ostream & operator<<(std::ostream &o, const a_contact &c)
Definition: a_contact.cxx:96
friend std::istream & operator>>(std::istream &i, a_contact &c)
Definition: a_contact.cxx:90
a_contact()
Definition: a_contact.h:30
a wrench class
Definition: a_wrench.h:30