BALL  1.5.0
sphere.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: sphere.h,v 1.9.16.1 2007-03-25 21:26:11 oliver Exp $
5 //
6 
7 #ifndef BALL_VIEW_PRIMITIV_SPHERE_H
8 #define BALL_VIEW_PRIMITIV_SPHERE_H
9 
10 #ifndef BALL_VIEW_KERNEL_GEOMETRICOBJECT_H
12 #endif
13 
14 #ifndef BALL_VIEW_MATHS_SPHERE3_H
15 # include <BALL/MATHS/sphere3.h>
16 #endif
17 
18 namespace BALL
19 {
20  namespace VIEW
21  {
22 
31  : public GeometricObject,
32  protected Sphere3
33  {
34  public:
35 
37 
38 
41 
44  Sphere();
45 
49  Sphere(const Sphere& sphere);
50 
52 
54 
57  virtual ~Sphere();
58 
63  virtual void clear();
64 
66 
69 
72  void set(const Sphere& sphere);
73 
76  const Sphere& operator = (const Sphere& sphere);
77 
80  void swap(Sphere& sphere);
81 
83  void setRadius(float new_radius)
84  { radius = new_radius;}
85 
87  float getRadius() const
88  { return radius;}
89 
91  void setPosition(const Vector3& v3)
92  { point_ptr_->set(v3);}
93 
95  const Vector3& getPosition() const
96  { return *point_ptr_;}
97 
99  void setPositionAddress(const Vector3& v3)
100  { point_ptr_ = (Vector3 *)&v3;}
101 
104  { return point_ptr_;}
105 
108  { return point_ptr_ == &p;}
109 
112  { point_ptr_ = & p;}
113 
115 
118 
128  virtual bool isValid() const;
129 
140  virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
141 
142  // Method to get all vertices from a geometric object
143  virtual void getVertices(vector<Vector3>& vertices) const;
144 
146 
147  protected:
148 
150  };
151 
152 } } // namespaces
153 
154 #endif // BALL_VIEW_PRIMITIV_SPHERE_H
BALL::VIEW::Sphere
Definition: sphere.h:33
geometricObject.h
BALL::VIEW::Sphere::setDefaultPositionAddress
void setDefaultPositionAddress()
Definition: sphere.h:111
BALL::VIEW::Sphere::getVertices
virtual void getVertices(vector< Vector3 > &vertices) const
BALL::VIEW::Sphere::point_ptr_
Vector3 * point_ptr_
Definition: sphere.h:149
BALL::VIEW::Sphere::setPosition
void setPosition(const Vector3 &v3)
Definition: sphere.h:91
BALL::VIEW::Sphere::getPosition
const Vector3 & getPosition() const
Definition: sphere.h:95
BALL::TSphere3
Definition: sphere3.h:33
BALL
Definition: constants.h:13
BALL::VIEW::GeometricObject
Definition: geometricObject.h:37
BALL::VIEW::Sphere::isDefaultPositionAddress
bool isDefaultPositionAddress()
Definition: sphere.h:107
BALL::VIEW::Sphere::isValid
virtual bool isValid() const
BALL_SIZE_TYPE
BALL::TVector3< float >
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
BALL::VIEW::Sphere::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::VIEW::Sphere::getPositionAddress
Vector3 * getPositionAddress()
Definition: sphere.h:103
sphere3.h
BALL::VIEW::Sphere::getRadius
float getRadius() const
Definition: sphere.h:87
BALL::VIEW::Sphere::setPositionAddress
void setPositionAddress(const Vector3 &v3)
Definition: sphere.h:99
BALL_CREATE
#define BALL_CREATE(name)
Definition: create.h:62