Developer documentation | Axl-2.5.1

axlSphere Class Reference

Class axlSphere defines 3D spheres. More...

#include <axlSphere.h>

Inheritance diagram for axlSphere:
axlAbstractData

Public Slots

void onXChanged (double x)
 
void onYChanged (double y)
 
void onZChanged (double z)
 
void onRadiusChanged (double radius)
 
- Public Slots inherited from axlAbstractData
void touchGeometry (void)
 
void touchProperty (void)
 
void touchStructure (void)
 
virtual void touchField (void)
 
void setColor (const QColor &color)
 
void setOpacity (const double &opacity)
 
void setSize (const double &size)
 
void setShader (const QString &shader)
 
void setEditable (bool edit)
 

Public Member Functions

 axlSphere (QObject *parent=0)
 Constructs a axel sphere of zero coordinates and 1.0 radius with parent parent of QObject type. More...
 
 axlSphere (double x, double y, double z=0, double radius=1.0, QObject *parent=0)
 Constructs a axel sphere of coordinates (x, y, z) and radius (radius) with parent parent of QObject type. More...
 
 axlSphere (const axlSphere &other)
 Constructs a copy of other. More...
 
 ~axlSphere (void)
 Destroys the axel sphere. More...
 
virtual QString description (void) const
 
virtual QString identifier (void) const
 
double x (void) const
 Returns x-coordinate of this sphere. More...
 
double y (void) const
 Returns y-coordinate of this sphere. More...
 
double z (void) const
 Returns z-coordinate of this sphere. More...
 
double * coordinates (void) const
 Returns coordinates of this sphere. More...
 
double radius (void) const
 
void setRadius (double radius)
 
void touchRadius (double radius)
 
void touchCenter (axlPoint center)
 
axlPoint centerPoint (void)
 
void setValues (double x, double y, double z, double radius)
 Change coordinates of this sphere. More...
 
void setCenter (double x, double y, double z)
 
void normalize ()
 
axlSphereoperator= (const axlSphere &other)
 Assigns other to this sphere and returns a reference to this sphere. More...
 
axlSphereoperator+= (const axlSphere &other)
 Adds the coordinates and radius of the other sphere to this sphere and returns a reference to this sphere. More...
 
axlSphereoperator-= (const axlSphere &other)
 Substracts the coordinates and radius of the other sphere to this sphere and returns a reference to this sphere. More...
 
axlSphereoperator*= (double scalar)
 Multiplies the coordinates and radius of this sphere by a scalar value and returns a reference to this sphere. More...
 
axlSphereoperator/= (double scalar)
 Divides the coordinates and radius of this sphere by a scalar value and returns a reference to this sphere. More...
 
axlSphere operator+ (const axlSphere &other) const
 Returns a sphere that results from the addition of this sphere and the other sphere. More...
 
axlSphere operator- (const axlSphere &other) const
 Returns a sphere that results from the substraction of this sphere and the other sphere. More...
 
axlSphere operator* (double scalar) const
 Returns a sphere that results from the multiplication of the scalar with this sphere. More...
 
axlSphere operator/ (double scalar) const
 Returns a sphere that results from the division of the scalar with this sphere. More...
 
QVariantList convertDataToQVariant (void) const
 Convert an axlAbstractData into a QVariantList that specifies all properties of the axlAbstractData. More...
 
int convertQVariantToData (const QVariantList &data)
 Modify properties and geometry variables of the axlAbstractData. Return 1 if the modification was sucessfully made. Otherwise return 0. More...
 
- Public Member Functions inherited from axlAbstractData
 axlAbstractData (axlAbstractData *parent=NULL)
 
 axlAbstractData (const axlAbstractData &data)
 
virtual ~axlAbstractData (void)
 
const QColor & color (void) const
 
const double & opacity (void) const
 
const double & size (void) const
 
const QString & shader (void) const
 
const bool & editable (void)
 
const bool & updateView (void)
 
void setColor (double r, double g, double b)
 
void addField (axlAbstractField *field)
 Add a field to the field list of the object. More...
 
bool updateFieldList (QString nameField)
 Check if a field with the same name is already applied on the object. More...
 
QString changeFieldName (QString fieldName)
 
axlMeshmesh (void)
 Return the mesh of that object is computed. More...
 
void setMesh (axlMesh *mesh)
 Set a corresponding mesh for that object. More...
 
void setUpdateView (bool updateView)
 
QList< axlAbstractField * > fields (void)
 

Static Public Member Functions

static double distance (const axlSphere &lhs, const axlSphere &rhs)
 Returns the distance between lhs sphere and rhs sphere. More...
 
static double distance (axlSphere *lhs, axlSphere *rhs)
 Returns the distance between lhs sphere and rhs sphere. More...
 

Properties

double radius
 
axlPoint center
 
- Properties inherited from axlAbstractData
QColor color
 
double opacity
 
double size
 
QString shader
 

Friends

QDebug operator<< (QDebug dbg, axlSphere sphere)
 
QDebug operator<< (QDebug dbg, axlSphere &sphere)
 
QDebug operator<< (QDebug dbg, axlSphere *sphere)
 

Additional Inherited Members

- Signals inherited from axlAbstractData
void modifiedGeometry (void)
 
void modifiedStructure (void)
 
void modifiedField (void)
 
void modifiedProperty (void)
 

Detailed Description

Class axlSphere defines 3D spheres.

This class enables to represent and manipulate 3D spheres.

Example:

axlSphere *A = new axlSphere(0.0, 0.0, 0.0);
axlSphere *B = new axlSphere(1.0, 0.0, 0.0);
double length = axlSphere::distance(A, B);
axlSphere middle = *(A);
middle += *(B);
middle /= 2.;

Definition at line 33 of file axlSphere.h.

Constructor & Destructor Documentation

axlSphere::axlSphere ( QObject *  parent = 0)

Constructs a axel sphere of zero coordinates and 1.0 radius with parent parent of QObject type.

The parent of an object may be viewed as the object's owner. The destructor of a parent object destroys all child objects. Setting parent to 0 constructs a axel sphere with no parent.

Definition at line 46 of file axlSphere.cpp.

axlSphere::axlSphere ( double  x,
double  y,
double  z = 0,
double  radius = 1.0,
QObject *  parent = 0 
)

Constructs a axel sphere of coordinates (x, y, z) and radius (radius) with parent parent of QObject type.

The parent of an object may be viewed as the object's owner. The destructor of a parent object destroys all child objects. Setting parent to 0 constructs a axel sphere with no parent.

Definition at line 61 of file axlSphere.cpp.

axlSphere::axlSphere ( const axlSphere other)

Constructs a copy of other.

Definition at line 75 of file axlSphere.cpp.

axlSphere::~axlSphere ( void  )

Destroys the axel sphere.

Definition at line 90 of file axlSphere.cpp.

Member Function Documentation

axlPoint axlSphere::centerPoint ( void  )

Definition at line 283 of file axlSphere.cpp.

QVariantList axlSphere::convertDataToQVariant ( void  ) const
virtual

Convert an axlAbstractData into a QVariantList that specifies all properties of the axlAbstractData.

Reimplemented from axlAbstractData.

Definition at line 421 of file axlSphere.cpp.

int axlSphere::convertQVariantToData ( const QVariantList &  data)
virtual

Modify properties and geometry variables of the axlAbstractData. Return 1 if the modification was sucessfully made. Otherwise return 0.

Reimplemented from axlAbstractData.

Definition at line 439 of file axlSphere.cpp.

double * axlSphere::coordinates ( void  ) const

Returns coordinates of this sphere.

Definition at line 325 of file axlSphere.cpp.

QString axlSphere::description ( void  ) const
virtual

Definition at line 382 of file axlSphere.cpp.

double axlSphere::distance ( const axlSphere lhs,
const axlSphere rhs 
)
static

Returns the distance between lhs sphere and rhs sphere.

The distance is always positive.

Definition at line 334 of file axlSphere.cpp.

double axlSphere::distance ( axlSphere lhs,
axlSphere rhs 
)
static

Returns the distance between lhs sphere and rhs sphere.

The distance is always positive.

Definition at line 347 of file axlSphere.cpp.

QString axlSphere::identifier ( void  ) const
virtual

Definition at line 389 of file axlSphere.cpp.

void axlSphere::normalize ( void  )

Definition at line 310 of file axlSphere.cpp.

void axlSphere::onRadiusChanged ( double  radius)
slot

Definition at line 415 of file axlSphere.cpp.

void axlSphere::onXChanged ( double  x)
slot

Definition at line 400 of file axlSphere.cpp.

void axlSphere::onYChanged ( double  y)
slot

Definition at line 405 of file axlSphere.cpp.

void axlSphere::onZChanged ( double  z)
slot

Definition at line 410 of file axlSphere.cpp.

axlSphere axlSphere::operator* ( double  scalar) const

Returns a sphere that results from the multiplication of the scalar with this sphere.

Definition at line 202 of file axlSphere.cpp.

axlSphere & axlSphere::operator*= ( double  scalar)

Multiplies the coordinates and radius of this sphere by a scalar value and returns a reference to this sphere.

Definition at line 143 of file axlSphere.cpp.

axlSphere axlSphere::operator+ ( const axlSphere other) const

Returns a sphere that results from the addition of this sphere and the other sphere.

Definition at line 176 of file axlSphere.cpp.

axlSphere & axlSphere::operator+= ( const axlSphere other)

Adds the coordinates and radius of the other sphere to this sphere and returns a reference to this sphere.

Definition at line 115 of file axlSphere.cpp.

axlSphere axlSphere::operator- ( const axlSphere other) const

Returns a sphere that results from the substraction of this sphere and the other sphere.

Definition at line 189 of file axlSphere.cpp.

axlSphere & axlSphere::operator-= ( const axlSphere other)

Substracts the coordinates and radius of the other sphere to this sphere and returns a reference to this sphere.

Definition at line 129 of file axlSphere.cpp.

axlSphere axlSphere::operator/ ( double  scalar) const

Returns a sphere that results from the division of the scalar with this sphere.

If the scalar value is zero, it returns a default sphere.

Definition at line 215 of file axlSphere.cpp.

axlSphere & axlSphere::operator/= ( double  scalar)

Divides the coordinates and radius of this sphere by a scalar value and returns a reference to this sphere.

If the scalar value is zero, the sphere remains unchanged.

Definition at line 157 of file axlSphere.cpp.

axlSphere & axlSphere::operator= ( const axlSphere other)

Assigns other to this sphere and returns a reference to this sphere.

Definition at line 101 of file axlSphere.cpp.

double axlSphere::radius ( void  ) const

Definition at line 257 of file axlSphere.cpp.

void axlSphere::setCenter ( double  x,
double  y,
double  z 
)

Definition at line 302 of file axlSphere.cpp.

void axlSphere::setRadius ( double  radius)

Definition at line 262 of file axlSphere.cpp.

void axlSphere::setValues ( double  x,
double  y,
double  z,
double  radius 
)

Change coordinates of this sphere.

Definition at line 293 of file axlSphere.cpp.

void axlSphere::touchCenter ( axlPoint  center)

Definition at line 274 of file axlSphere.cpp.

void axlSphere::touchRadius ( double  radius)

Definition at line 268 of file axlSphere.cpp.

double axlSphere::x ( void  ) const

Returns x-coordinate of this sphere.

Definition at line 234 of file axlSphere.cpp.

double axlSphere::y ( void  ) const

Returns y-coordinate of this sphere.

Definition at line 243 of file axlSphere.cpp.

double axlSphere::z ( void  ) const

Returns z-coordinate of this sphere.

Definition at line 252 of file axlSphere.cpp.

Friends And Related Function Documentation

QDebug operator<< ( QDebug  dbg,
axlSphere  sphere 
)
friend

Definition at line 361 of file axlSphere.cpp.

QDebug operator<< ( QDebug  dbg,
axlSphere sphere 
)
friend

Definition at line 368 of file axlSphere.cpp.

QDebug operator<< ( QDebug  dbg,
axlSphere sphere 
)
friend

Definition at line 375 of file axlSphere.cpp.

Property Documentation

axlPoint axlSphere::center
readwrite

Definition at line 36 of file axlSphere.h.

double axlSphere::radius
readwrite

Definition at line 36 of file axlSphere.h.


The documentation for this class was generated from the following files: