Loading...
Searching...
No Matches
sphere.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: sphere.h,v 1.9.16.1 2007-03-25 21:26:11 oliver Exp $
//
#ifndef BALL_VIEW_PRIMITIV_SPHERE_H
#define BALL_VIEW_PRIMITIV_SPHERE_H
#ifndef BALL_VIEW_KERNEL_GEOMETRICOBJECT_H
# include <BALL/VIEW/KERNEL/geometricObject.h>
#endif
#ifndef BALL_VIEW_MATHS_SPHERE3_H
# include <BALL/MATHS/sphere3.h>
#endif
namespace BALL
{
namespace VIEW
{
class BALL_VIEW_EXPORT Sphere
: public GeometricObject,
protected Sphere3
{
public:
BALL_CREATE(Sphere)
//@{
Sphere();
Sphere(const Sphere& sphere);
virtual ~Sphere();
virtual void clear();
void set(const Sphere& sphere);
const Sphere& operator = (const Sphere& sphere);
void swap(Sphere& sphere);
void setRadius(float new_radius)
{ radius = new_radius;}
float getRadius() const
{ return radius;}
void setPosition(const Vector3& v3)
{ point_ptr_->set(v3);}
const Vector3& getPosition() const
{ return *point_ptr_;}
void setPositionAddress(const Vector3& v3)
{ point_ptr_ = (Vector3 *)&v3;}
Vector3* getPositionAddress()
{ return point_ptr_;}
bool isDefaultPositionAddress()
{ return point_ptr_ == &p;}
void setDefaultPositionAddress()
{ point_ptr_ = & p;}
virtual bool isValid() const;
virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
// Method to get all vertices from a geometric object
virtual void getVertices(vector<Vector3>& vertices) const;
protected:
Vector3* point_ptr_;
};
} } // namespaces
#endif // BALL_VIEW_PRIMITIV_SPHERE_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::TSphere3< float >::p
TVector3< float > p
Definition sphere3.h:250
BALL::TSphere3< float >::radius
float radius
Definition sphere3.h:254
BALL::VIEW::GeometricObject::GeometricObject
GeometricObject()
BALL::VIEW::Sphere::swap
void swap(Sphere &sphere)
BALL::VIEW::Sphere::Sphere
Sphere()
BALL::VIEW::Sphere::setPositionAddress
void setPositionAddress(const Vector3 &v3)
Definition sphere.h:99
BALL::VIEW::Sphere::getPosition
const Vector3 & getPosition() const
Definition sphere.h:95
BALL::VIEW::Sphere::isDefaultPositionAddress
bool isDefaultPositionAddress()
Definition sphere.h:107
BALL::VIEW::Sphere::set
void set(const Sphere &sphere)
BALL::VIEW::Sphere::isValid
virtual bool isValid() const
BALL::VIEW::Sphere::point_ptr_
Vector3 * point_ptr_
Definition sphere.h:149
BALL::VIEW::Sphere::getRadius
float getRadius() const
Definition sphere.h:87
BALL::VIEW::Sphere::setRadius
void setRadius(float new_radius)
Definition sphere.h:83
BALL::VIEW::Sphere::clear
virtual void clear()
BALL::VIEW::Sphere::getVertices
virtual void getVertices(vector< Vector3 > &vertices) const
BALL::VIEW::Sphere::getPositionAddress
Vector3 * getPositionAddress()
Definition sphere.h:103
BALL::VIEW::Sphere::setPosition
void setPosition(const Vector3 &v3)
Definition sphere.h:91
BALL::VIEW::Sphere::setDefaultPositionAddress
void setDefaultPositionAddress()
Definition sphere.h:111
BALL::VIEW::Sphere::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
geometricObject.h
BALL::Sphere3
TSphere3< float > Sphere3
Definition sphere3.h:299
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Vector3
TVector3< float > Vector3
Definition vector3.h:1084
sphere3.h