Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_block_2d3.h
Go to the documentation of this file.
1 /*
2 Copyright 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_2D3_H_
17 #define _A_BLOCK_2D3_H_
18 
19 #include "a_block.h"
20 
21 class a_block_2d3 : public a_block
22 {
23 public:
24  a_block_2d3();
25  ~a_block_2d3();
27  a_block_2d3(a_point* p1, a_point* p2, a_point* p3, double thickness=1.);
29  static const std::string help();
31  virtual void copy(const a_block_2d3&);
33  virtual void deepcopy(const a_block_2d3&);
35  virtual std::string name() const {return "a_block_2d3";}
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 6;}
47  inline int nit() const {return 5;}
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_2d3 * cb_2d3(a_block *b)
Definition: a_block_2d3.cxx:21
virtual void write(std::ostream &o) const
virtual std::string name() const
get type of the pointer
Definition: a_block_2d3.h:35
int nit() const
get number of faces (here 5, from 3 which are defined)
Definition: a_block_2d3.h:47
virtual void writeb(std::ostream &o) const
write a blender description of the block
a_point normal() const
normal to the definition plan of the block (world coordinates)
virtual void writetri(std::ostream &o) const
write a triangle face representation of the block
a_point v3d(const int i) const
get vertex (world coordinate, 3D: 8 points: order v0-n, v0+n, v1+n, v1-n
void thickness(const double thickness)
set block thickness
Definition: a_block_2d3.h:37
virtual void read(std::istream &i)
input/output
static const std::string help()
get information about the class
Definition: a_block_2d3.cxx:62
double * thickness_p() const
get block thickness pointer
Definition: a_block_2d3.h:41
double thickness() const
get block thickness
Definition: a_block_2d3.h:39
virtual a_point cl() const
centre of gravity of the face (local coordinate system)
virtual void deepcopy(const a_block_2d3 &)
copy the block. create new edges
Definition: a_block_2d3.cxx:94
void trianglecloud(a_trianglecloud &) const
virtual void writeg(std::ostream &o) const
write a brlcad description of the block
void writefaces(std::ostream &o, const int base) const
write a triangle file description of the block
int nvt() const
get number of vertices (here 6, from 3 which are defined)
Definition: a_block_2d3.h:45
a_point normall() const
normal to the definition plan of the block (local coordinates)
double * thickness_
Definition: a_block_2d3.h:67
virtual void copy(const a_block_2d3 &)
copy the block. do not create new edges
Definition: a_block_2d3.cxx:86
double V() const
volume of the block
a_face * i(const int i)
get pointer to face
Definition: a_block.cxx:148