Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_block_2d4.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_BLOCK_2D4_H_
17 #define _A_BLOCK_2D4_H_
18 
19 #include "a_block.h"
20 
21 class a_block_2d4 : public a_block
22 {
23 public:
24  a_block_2d4();
25  ~a_block_2d4();
27  a_block_2d4(a_point* p1, a_point* p2, a_point* p3, a_point* p4, double thickness=1.);
29  static const std::string help();
31  virtual void copy(const a_block_2d4&);
33  virtual void deepcopy(const a_block_2d4&);
35  virtual std::string name() const {return "a_block_2d4";}
37  void thickness(const double thickness) {*thickness_=thickness;};
39  double thickness() const {return *thickness_;}
41  double * thickness_p() const {return thickness_;}
43  a_point v3d(const int i) const;
45  inline int nvt() const {return 8;}
47  inline int nit() const {return 6;}
49  double V() const;
51  virtual a_point cl() const;
53  a_point normall() const;
55  a_point normal() const;
56 // void compute();
57  virtual void read(std::istream &i);
58  virtual void write(std::ostream &o) const;
59  //write a triangle face representation of the block
60  virtual void writetri(std::ostream &o) const;
61  virtual void writeb(std::ostream &o) const;
62  virtual void writeg(std::ostream &o) const;
64  void writefaces(std::ostream &o, const int base) const;
65  void trianglecloud(a_trianglecloud&) const;
66 protected:
67  double * thickness_;
68 private:
69  void create_faces();
70 };
71 
73 
74 #endif
75 
a_block_2d4 * cb_2d4(a_block *b)
Definition: a_block_2d4.cxx:21
a_point v3d(const int i) const
get vertex (world coordinate, 3D: 8 points: order v0-n, v0+n, v1+n, v1-n
int nit() const
get number of faces (here 6, from 4 which are defined)
Definition: a_block_2d4.h:47
virtual void writeg(std::ostream &o) const
write a brlcad description of the block
double thickness() const
get block thickness
Definition: a_block_2d4.h:39
static const std::string help()
get information about the class
Definition: a_block_2d4.cxx:63
double V() const
volume of the block
virtual void writetri(std::ostream &o) const
write a triangle face representation of the block
a_point normall() const
normal to the definition plan of the block (local coordinates)
virtual void write(std::ostream &o) const
void thickness(const double thickness)
set block thickness
Definition: a_block_2d4.h:37
virtual a_point cl() const
centre of gravity of the face (local coordinate system)
virtual void writeb(std::ostream &o) const
write a blender description of the block
double * thickness_p() const
get block thickness pointer
Definition: a_block_2d4.h:41
void trianglecloud(a_trianglecloud &) const
virtual void deepcopy(const a_block_2d4 &)
copy the block. create new edges
Definition: a_block_2d4.cxx:95
void writefaces(std::ostream &o, const int base) const
write a triangle file description of the block
double * thickness_
Definition: a_block_2d4.h:67
int nvt() const
get number of vertices (here 8, from 4 which are defined)
Definition: a_block_2d4.h:45
virtual void read(std::istream &i)
input/output
virtual void copy(const a_block_2d4 &)
copy the block. do not create new edges
Definition: a_block_2d4.cxx:87
virtual std::string name() const
get type of the pointer
Definition: a_block_2d4.h:35
a_point normal() const
normal to the definition plan of the block (world coordinates)
a_face * i(const int i)
get pointer to face
Definition: a_block.cxx:148