Logo Search packages:      
Sourcecode: 3depict version File versions  Download package

Point3D Class Reference

#include <basics.h>

List of all members.


Detailed Description

A 3D point data class storage.

A 3D point data class contains operator overloads and some basic mathematical functions

Definition at line 319 of file basics.h.


Public Member Functions

void add (const Point3D &obj)
 Add a point to this, without generating a return value.
float angle (const Point3D &pt) const
 Calculate the angle between two position vectors in radiians.
void copyValueArr (float *value) const
 get into an array (note array must hold sizeof(float)*3 bytes of valid mem
Point3D crossProd (const Point3D &pt) const
 Calculate the cross product of this and another point.
float dotProd (const Point3D &pt) const
 Calculate the dot product of this and another pint.
float getValue (unsigned int ui) const
 Get value of ith dim (0, 1, 2).
const float * getValueArr () const
bool insideBox (const Point3D &lowPoint, const Point3D &highPoint) const
 Tests if this point lies inside the rectangular prism.
bool insideBox (const Point3D &farPoint) const
 Is a given point stored inside a box bounded by orign and this pt?
void negate ()
 Makes each value negative of old value.
Point3D normalise ()
 make point unit magnitude, maintaining direction
Point3D operator* (float scale) const
 multiplication
Point3D operator*= (const float scale)
 multiplication= operator
Point3D operator+ (const Point3D &pt) const
 Addition operator.
Point3D operator+ (float f)
Point3D operator+= (const Point3D &pt)
 += operator
Point3D operator- () const
 returns a negative of the existing value
Point3D operator- (const Point3D &pt) const
 Subtraction.
Point3D operator/ (float scale) const
 Division.
Point3D operator= (const Point3D &pt)
 assignemnt operator
bool operator== (const Point3D &pt) const
 Equality operator.
float & operator[] (unsigned int ui)
 Retrieve element by referene.
float operator[] (unsigned int ui) const
 Retrieve by value.
bool parse (const std::string &str)
 Point3D (float x, float y, float z)
 Constructor with initialising values.
 Point3D ()
 Constructor.
void setValue (float fX, float fY, float fZ)
 Set all values.
void setValue (unsigned int ui, float val)
 Set by value (ith dim 0, 1 2).
void setValueArr (const float *val)
 Set by pointer.
float sqrDist (const Point3D &pt) const
 returns the square of distance another pt
float sqrMag () const
 overload for array indexing returns |pt|^2

Private Attributes

float value [3]
 Value data.

Friends

std::ostream & operator<< (std::ostream &stream, const Point3D &)
 Output streaming operator. Users (x,y,z) as format for output.

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

Generated by  Doxygen 1.6.0   Back to index