GenGeo  1.1
Sphere.h
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2007-2014 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __SPHERE_H
14 #define __SPHERE_H
15 
16 //-- project includes --
17 #include "util/vector3.h"
18 
19 // --- IO includes ---
20 #include <iostream>
21 
22 using std::ostream;
23 
24 // --- project includes ---
25 #include "AGeometricObject.h"
26 
31 class Sphere : public AGeometricObject
32 {
33  protected:
35  double m_rad;
36  int m_id;
37  int m_tag;
38  bool m_valid;
39 
40  static double NearZero;
41  static int s_output_style;
42  static unsigned int s_current_id;
43 
44  public:
45  // constructors
46  Sphere();
47  Sphere(const Vector3&,double);
48  Sphere(const Sphere&);
49 
50  // access ops and the like
51  virtual double getDist(const Vector3&) const;
52  inline Vector3 Center() const {return m_center;};
53  inline double Radius() const {return m_rad;};
54  inline int Id() const {return m_id;};
55  inline int Tag() const {return m_tag;};
56  void setTag(int t){m_tag=t;};
57  void setId(int);
58 
59  // move it
60  void shift(const Vector3& s){m_center+=s;};
61 
62  // output
63  static void SetOutputStyle(int);
64  friend ostream& operator << (ostream&,const Sphere&);
65 } ;
66 
67 #endif // __SPHERE_H