Vector3D Class Reference

#include <Vector3D.h>

List of all members.

Public Member Functions

 Vector3D ()
 Vector3D (Vector3D *vector)
 Vector3D (GLfloat x_coord, GLfloat y_coord, GLfloat z_coord, GLfloat w_coord)
GLfloat getXCoord () const
GLfloat getYCoord () const
GLfloat getZCoord () const
GLfloat getWCoord () const
void setXCoord (GLfloat x_coord)
void setYCoord (GLfloat y_coord)
void setZCoord (GLfloat z_coord)
void setWCoord (GLfloat w_coord)
Vector3D operator+ (Vector3D an_other_vector)
Vector3D operator- (Vector3D an_other_vector)
Vector3D operator * (GLfloat scalar)
Vector3D operator/ (GLfloat scalar)

Protected Attributes

GLfloat x_coordinate_
 The X-coordinate of the vector.

GLfloat y_coordinate_
 The Y-coordinate of the vector.

GLfloat z_coordinate_
 The Z-coordinate of the vector.

GLfloat w_coordinate_
 The W-coordinate of the vector.


Constructor & Destructor Documentation

Vector3D::Vector3D  )  [inline]
 

The default constructor.

Definition at line 37 of file Vector3D.h.

Referenced by operator *(), operator+(), operator-(), and operator/().

00037 {};

Vector3D::Vector3D Vector3D vector  )  [inline]
 

The copy constructor.

Definition at line 43 of file Vector3D.h.

References getWCoord(), getXCoord(), getYCoord(), getZCoord(), w_coordinate_, x_coordinate_, y_coordinate_, and z_coordinate_.

00043 : 00044 x_coordinate_(vector->getXCoord()), 00045 y_coordinate_(vector->getYCoord()), 00046 z_coordinate_(vector->getZCoord()), 00047 w_coordinate_(vector->getWCoord()) 00048 { 00049 }

Here is the call graph for this function:

Vector3D::Vector3D GLfloat  x_coord,
GLfloat  y_coord,
GLfloat  z_coord,
GLfloat  w_coord
[inline]
 

The second constructor which allows the initialization of the object variables.

Parameters:
x_coord The X-coordinate of the vector.
y_coord The Y-coordinate of the vector.
z_coord The Z-coordinate of the vector.
w_coord The W-coordinate of the vector.

Definition at line 61 of file Vector3D.h.

References w_coordinate_, x_coordinate_, y_coordinate_, and z_coordinate_.

00061 : 00062 x_coordinate_(x_coord), 00063 y_coordinate_(y_coord), 00064 z_coordinate_(z_coord), 00065 w_coordinate_(w_coord) 00066 { 00067 }


Member Function Documentation

GLfloat Vector3D::getWCoord  )  const [inline]
 

Returns the W-coordinate of the vector.

Returns:
the W-coordinate of the vector

Definition at line 107 of file Vector3D.h.

References w_coordinate_.

Referenced by operator+(), operator-(), and Vector3D().

00108 { 00109 return(w_coordinate_); 00110 }

GLfloat Vector3D::getXCoord  )  const [inline]
 

Returns the X-coordinate of the vector.

Returns:
the X-coordinate of the vector

Definition at line 74 of file Vector3D.h.

References x_coordinate_.

Referenced by operator+(), operator-(), and Vector3D().

00075 { 00076 return(x_coordinate_); 00077 }

GLfloat Vector3D::getYCoord  )  const [inline]
 

Returns the Y-coordinate of the vector.

Returns:
the Y-coordinate of the vector

Definition at line 85 of file Vector3D.h.

References y_coordinate_.

Referenced by operator+(), operator-(), and Vector3D().

00086 { 00087 return(y_coordinate_); 00088 }

GLfloat Vector3D::getZCoord  )  const [inline]
 

Returns the Z-coordinate of the vector.

Returns:
the Z-coordinate of the vector

Definition at line 96 of file Vector3D.h.

References z_coordinate_.

Referenced by operator+(), operator-(), and Vector3D().

00097 { 00098 return(z_coordinate_); 00099 }

Vector3D Vector3D::operator * GLfloat  scalar  )  [inline]
 

Operator overoading of * to multiply this vector with a skalar.

Parameters:
skalar The scalar coordinate to multiply the vector.
Returns:
The result of the multiplication of this vector and a 'scalar'.

Definition at line 195 of file Vector3D.h.

References Vector3D(), w_coordinate_, x_coordinate_, y_coordinate_, and z_coordinate_.

00196 { 00197 return(Vector3D(x_coordinate_ * scalar, 00198 y_coordinate_ * scalar, 00199 z_coordinate_ * scalar, 00200 w_coordinate_ * scalar)); 00201 }

Here is the call graph for this function:

Vector3D Vector3D::operator+ Vector3D  an_other_vector  )  [inline]
 

Operator overoading of + to add two vectors.

Parameters:
an_other_vector An other vector which is going to be added to this 'Vector3D'.
Returns:
The result of the addition of this vector and 'an_other_vector'.

Definition at line 164 of file Vector3D.h.

References getWCoord(), getXCoord(), getYCoord(), getZCoord(), operator+(), Vector3D(), w_coordinate_, x_coordinate_, y_coordinate_, and z_coordinate_.

Referenced by operator+().

00165 { 00166 return(Vector3D(an_other_vector.getXCoord() + x_coordinate_, 00167 an_other_vector.getYCoord() + y_coordinate_, 00168 an_other_vector.getZCoord() + z_coordinate_, 00169 an_other_vector.getWCoord() + w_coordinate_)); 00170 }

Here is the call graph for this function:

Vector3D Vector3D::operator- Vector3D  an_other_vector  )  [inline]
 

Operator overoading of - to subtract two vectors.

Parameters:
an_other_vector An other vector which is going to be subtracted by 'Vector3D'.
Returns:
The result of the subtraction of this vector and 'an_other_vector'.

Definition at line 180 of file Vector3D.h.

References getWCoord(), getXCoord(), getYCoord(), getZCoord(), operator-(), Vector3D(), w_coordinate_, x_coordinate_, y_coordinate_, and z_coordinate_.

Referenced by operator-().

00181 { 00182 return(Vector3D(x_coordinate_ - an_other_vector.getXCoord(), 00183 y_coordinate_ - an_other_vector.getYCoord(), 00184 z_coordinate_ - an_other_vector.getZCoord(), 00185 w_coordinate_ - an_other_vector.getWCoord())); 00186 }

Here is the call graph for this function:

Vector3D Vector3D::operator/ GLfloat  scalar  )  [inline]
 

Operator overoading of / to divide this vector by a skalar.

Parameters:
scalar The scalar coordinate to divide the vector.
Returns:
The result of the division of this vector by a 'scalar'.

Definition at line 210 of file Vector3D.h.

References operator/(), Vector3D(), w_coordinate_, x_coordinate_, y_coordinate_, and z_coordinate_.

Referenced by operator/().

00211 { 00212 return(Vector3D(x_coordinate_ / scalar, 00213 y_coordinate_ / scalar, 00214 z_coordinate_ / scalar, 00215 w_coordinate_ / scalar)); 00216 }

Here is the call graph for this function:

void Vector3D::setWCoord GLfloat  w_coord  )  [inline]
 

Sets the W-coordinate of the vector.

Returns:
the W-coordinate of the vector

Definition at line 151 of file Vector3D.h.

References setWCoord(), and w_coordinate_.

Referenced by setWCoord().

00152 { 00153 w_coordinate_ = w_coord; 00154 }

Here is the call graph for this function:

void Vector3D::setXCoord GLfloat  x_coord  )  [inline]
 

Sets the X-coordinate of the vector.

Parameters:
the X-coordinate of the vector

Definition at line 118 of file Vector3D.h.

References setXCoord(), and x_coordinate_.

Referenced by setXCoord().

00119 { 00120 x_coordinate_ = x_coord; 00121 }

Here is the call graph for this function:

void Vector3D::setYCoord GLfloat  y_coord  )  [inline]
 

Sets the Y-coordinate of the vector.

Returns:
the Y-coordinate of the vector

Definition at line 129 of file Vector3D.h.

References setYCoord(), and y_coordinate_.

Referenced by setYCoord().

00130 { 00131 y_coordinate_ = y_coord; 00132 }

Here is the call graph for this function:

void Vector3D::setZCoord GLfloat  z_coord  )  [inline]
 

Sets the Z-coordinate of the vector.

Returns:
the Z-coordinate of the vector

Definition at line 140 of file Vector3D.h.

References setZCoord(), and z_coordinate_.

Referenced by setZCoord().

00141 { 00142 z_coordinate_ = z_coord; 00143 }

Here is the call graph for this function:


Member Data Documentation

GLfloat Vector3D::w_coordinate_ [protected]
 

The W-coordinate of the vector.

Definition at line 30 of file Vector3D.h.

Referenced by getWCoord(), operator *(), operator+(), operator-(), operator/(), setWCoord(), and Vector3D().

GLfloat Vector3D::x_coordinate_ [protected]
 

The X-coordinate of the vector.

Definition at line 24 of file Vector3D.h.

Referenced by getXCoord(), operator *(), operator+(), operator-(), operator/(), setXCoord(), and Vector3D().

GLfloat Vector3D::y_coordinate_ [protected]
 

The Y-coordinate of the vector.

Definition at line 26 of file Vector3D.h.

Referenced by getYCoord(), operator *(), operator+(), operator-(), operator/(), setYCoord(), and Vector3D().

GLfloat Vector3D::z_coordinate_ [protected]
 

The Z-coordinate of the vector.

Definition at line 28 of file Vector3D.h.

Referenced by getZCoord(), operator *(), operator+(), operator-(), operator/(), setZCoord(), and Vector3D().


The documentation for this class was generated from the following file:
Generated on Mon Jun 14 12:49:13 2004 for InfoVis by doxygen 1.3.7