Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_shape_cylinder.h
Go to the documentation of this file.
1 /*
2  Copyright 2015-20 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 _SHAPE_CYLINDER_H_
17 #define _SHAPE_CYLINDER_H_
18 
19 // .NAME a_shape_cylinder
20 // .SECTION Author
21 // Pierre Smars
22 #include "a_shape_quadric.h"
23 #include <vnl/vnl_double_3.h>
24 #include <vnl/vnl_double_3x3.h>
25 
28 {
29  public:
30  a_shape_cylinder(): a_shape_quadric(), radius_(0.), center_(), dir_() {};
31  virtual const std::string classname() const {return "a_shape_cylinder";}
32  static const std::string help();
33  void p9pts(const a_point * pt); //cylinder passes through 9 points
34 
35  double radius() const;
36  void radius(const double r);
37 
38  a_point center() const;
39  void center(const a_point c);
40 
41  a_point dir() const;
42  void dir(const a_point d);
43 
44  a_point closest_point(const a_point pt) const;
45  int threshold_cloud(const std::vector<a_point>& pts, std::vector<a_point>& pts2);
46  void fit_cloud(std::vector<a_point>& pts, short nl = 1);
47  void export_points(const unsigned int nseg, const std::vector<a_point>& pts) const;
48  void export_triangles(const unsigned int nseg, const std::vector<a_point>& pts) const;
49  void export_matrices() const;
50  private:
51  double radius_;
52  a_point center_;
53  a_point dir_;
54 };
55 
56 #endif
double radius() const
virtual const std::string classname() const
void export_triangles(const unsigned int nseg, const std::vector< a_point > &pts) const
a_point center() const
void p9pts(const a_point *pt)
int threshold_cloud(const std::vector< a_point > &pts, std::vector< a_point > &pts2)
a_point dir() const
static const std::string help()
void export_points(const unsigned int nseg, const std::vector< a_point > &pts) const
void export_matrices() const
void fit_cloud(std::vector< a_point > &pts, short nl=1)
a_point closest_point(const a_point pt) const
Definition: stlb2stla.cxx:21