Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_shape_sphere.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 _A_SHAPE_SPHERE_H_
17 #define _A_SHAPE_SPHERE_H_
18 
19 // .NAME a_shape_sphere
20 // .SECTION Author
21 // Pierre Smars
22 #include "a_shape.h"
23 
25 class a_shape_sphere : public a_shape
26 {
27  public:
28  a_shape_sphere(): a_shape(4) {for (short int i=0;i<4;i++) para_[i] = 0.;};
29  virtual const std::string classname() const {return "a_shape_sphere";}
30  static const std::string help();
31  a_point closest_point(const a_point p) const;
32  double dist_point(const a_point p) const;
33  void p4pts(const a_point p1, const a_point p2, const a_point p3, const a_point p4); //sphere passes through 4 points
34  a_point center() const {return a_point(para_[0],para_[1],para_[2]);}
35  double radius() const {return para_[3];}
36  void center(const a_point pt) {para_[0] = pt.x(); para_[1] = pt.y(); para_[2] = pt.z();}
37  void radius(double r) {para_[3] = r;}
38  void random_hint(const std::vector<a_point>& pts);
39  void fit_cloud(std::vector<a_point>& pts, short nl = 1);
40  void export_points(const unsigned int nseg, const std::vector<a_point>& pts) const;
41  void export_triangles(const unsigned int nseg, const std::vector<a_point>& pts) const;
42 };
43 #endif
44 
sphere shape
void export_points(const unsigned int nseg, const std::vector< a_point > &pts) const
static const std::string help()
void fit_cloud(std::vector< a_point > &pts, short nl=1)
void radius(double r)
double dist_point(const a_point p) const
double radius() const
void p4pts(const a_point p1, const a_point p2, const a_point p3, const a_point p4)
a_point center() const
void random_hint(const std::vector< a_point > &pts)
virtual const std::string classname() const
a_point closest_point(const a_point p) const
void center(const a_point pt)
void export_triangles(const unsigned int nseg, const std::vector< a_point > &pts) const
shape
Definition: a_shape.h:32
vnl_vector< double > para_
Definition: a_shape.h:68
Definition: stlb2stla.cxx:21
float y
Definition: stlb2stla.cxx:23
float z
Definition: stlb2stla.cxx:24
float x
Definition: stlb2stla.cxx:22