Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_shape_quadric.h
Go to the documentation of this file.
1 /*
2  Copyright 2010-2020 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_QUADRIC_H_
17 #define _SHAPE_QUADRIC_H_
18 
19 // .NAME a_shape_quadric
20 // .SECTION Author
21 // Pierre Smars
22 #include "a_shape.h"
23 #include <vnl/vnl_double_3.h>
24 #include <vnl/vnl_double_3x3.h>
25 #include <vnl/algo/vnl_symmetric_eigensystem.h>
26 
28 class a_shape_quadric : public a_shape
29 {
30  public:
32  virtual const std::string classname() const {return "a_shape_quadric";}
33  static const std::string help();
34  virtual void p9pts(const a_point * pt); //quadric passes through 9 points
35  void p9pts(const a_point & p1, const a_point & p2, const a_point & p3,
36  const a_point & p4, const a_point & p5, const a_point & p6,
37  const a_point & p7, const a_point & p8, const a_point & p9);
38  a_point center() const;
39  a_point principals() const;
40  a_point n1() const;
41  a_point n2() const;
42  a_point n3() const;
43  virtual a_point closest_point(const a_point p) const;
44  virtual double dist_point(a_point p) const;
45  void random_hint(const std::vector<a_point>& pts);
46  void fit_cloud(std::vector<a_point>& pts, short nl = 1);
47  virtual void export_matrices() const;
48  void export_points(const unsigned int nseg, const std::vector<a_point>& pts) const;
49  void export_triangles(const unsigned int nseg, const std::vector<a_point>& pts) const;
50  // void export_triangles(const std::vector<a_point>& pts) const;
51  vnl_double_3x3 A() const;
52  void Ap();
53  vnl_double_3 b() const;
54  void init_dist();
55  void getA() const {std::cout << A_;}
56  void getb() const {std::cout << b_;}
57  void getAp() const {std::cout << Ap_;}
58  protected:
59  vnl_double_3x3 A_;
60  vnl_double_3x3 Ap_;
61  vnl_double_3 b_;
62  double d0_,d1_,d2_;
63  vnl_matrix<double> R_;
64 };
65 
66 #endif
a_point n2() const
a_point center() const
a_point n1() const
void getAp() const
vnl_double_3 b() const
void getA() const
a_point n3() const
vnl_double_3x3 A_
vnl_double_3x3 Ap_
void getb() const
a_point principals() const
vnl_matrix< double > R_
void export_triangles(const unsigned int nseg, const std::vector< a_point > &pts) const
void fit_cloud(std::vector< a_point > &pts, short nl=1)
vnl_double_3 b_
void random_hint(const std::vector< a_point > &pts)
vnl_double_3x3 A() const
static const std::string help()
virtual double dist_point(a_point p) const
virtual const std::string classname() const
virtual a_point closest_point(const a_point p) const
virtual void export_matrices() const
void export_points(const unsigned int nseg, const std::vector< a_point > &pts) const
virtual void p9pts(const a_point *pt)
shape
Definition: a_shape.h:32
Definition: stlb2stla.cxx:21