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
18namespace BALL
19{
20 namespace VIEW
21 {
22
31 : public GeometricObject,
32 protected Sphere3
33 {
34 public:
35
37
38
41
42
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
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
#define BALL_CREATE(name)
Definition: create.h:62
Definition: constants.h:13
void setPositionAddress(const Vector3 &v3)
Definition: sphere.h:99
const Vector3 & getPosition() const
Definition: sphere.h:95
bool isDefaultPositionAddress()
Definition: sphere.h:107
virtual bool isValid() const
Vector3 * point_ptr_
Definition: sphere.h:149
float getRadius() const
Definition: sphere.h:87
virtual void getVertices(vector< Vector3 > &vertices) const
Vector3 * getPositionAddress()
Definition: sphere.h:103
void setPosition(const Vector3 &v3)
Definition: sphere.h:91
void setDefaultPositionAddress()
Definition: sphere.h:111
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52