Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

TVector3 Class Template Reference
[Math3]

Template class for 3D geometric vectors. More...

#include <gmlvector3.h>

List of all members.

Element access

T & operator[] (int i)
const T & operator[] (int i) const
void SetValue (double x0, double y0, double z0)
 Set elements by 3 double components.

void SetValue (double a)
 Set all the elements to the same T value.

 GetDim ()

Public Member Functions

Constructors
 TVector3 ()
 No initialization.

 TVector3 (double v)
 Initialization by scalar.

 TVector3 (double x0, double y0, double z0)
 Initialization by given components.

 TVector3 (T *data)
 TVector3 (const TVector3< T > &data)
Conversions
 operator T * ()
 Convert a TVector to array of (3) elements.

 operator const T * () const
 Convert a TVector to array of (3) elements.

Binary operations
TVector3< T > & operator+= (const TVector3< T > &u)
TVector3< T > & operator-= (const TVector3< T > &u)
TVector3< T > operator+ (const TVector3< T > &u) const
TVector3< T > operator- (const TVector3< T > &u) const
TVector3< T > & operator *= (const double d)
TVector3< T > MultVec (const TVector3< T > &u) const
 Vector scaling (this vector is not modified).

TVector3< T > DivVec (const TVector3< T > &u) const
 Vector-by vector division (this vector is not modified).

TVector3< T > & operator/= (const double d)
TVector3< T > operator * (const double d) const
TVector3< T > operator/ (const double d) const
TVector3< T > operator/ (const TVector3< T > v) const
double operator * (const TVector3< T > &rhs) const
 dot product

TVector3< T > operator^ (const TVector3< T > &rhs) const
 cross product

double DotProduct (const TVector3< T > &rhs) const
 dot product

TVector3< T > CrossProduct (const TVector3< T > &rhs) const
 cross product

Unary operations
void Negate ()
 Vector (self) negation.

TVector3< T > operator- () const
 Unary negation operator.

TVector3< double > operator~ () const
 returns normalized vector (always double)

TVector3< T > & Normalize ()
 Normalize this vector, return vector itself.

double Length () const
 Length of the vector.

double operator! () const
 Length of the vector.

Service methods
Clip elements of this TVector to constraints from vmin to vmax

void Clip (double vmin, double vmax)
bool Normalized () const
 Test whether the TVector is normalized.

double SqrLength () const
 Squared length of vector.

bool LessOrEqual (const TVector3< T > &u) const
 Return true if all components of this vector less of equal than u.

MaxValue () const
 Return C-norm of the vector (maximal value among coords).

MFC, VCL, OWL - specific functions (defined only if proper defines are found)
 TVector3 (const TPoint &p)
TVector3< T > & operator= (const TPoint &p)
 operator TPoint ()
 TVector3 (const CPoint &p)
 TVector3 (const CSize &p)
TVector3< T > & operator= (const CPoint &p)
TVector3< T > & operator= (const CSize &p)
 operator CPoint ()
 operator CvPoint ()
 TVector3 (const CvPoint &p)
TVector3 operator= (const CvPoint &p)

Static Public Member Functions

const TVector3< T > & Cast (const T *u)
 Treat array of (3) elements as a TVector.

TVector3< T > & Cast (T *u)
 Treat array of (3) elements as a TVector.


Related Functions

(Note that these are not member functions.)

TVector3< T > operator * (const double d, const TVector3< T > &u)
 Multiplication of scalar d by TVector u.

double SqrLength (const TVector3< T > &u)
 Squared length of given vector.

double Length (const TVector3< T > &u)
 Length of the vector.

double DotProduct (const TVector3< T > &v1, const TVector3< T > &v2)
 Dot product.

TVector3< T > CrossProduct (const TVector3< T > &v1, const TVector3< T > &v2)
 Cross product.

double Cos (const TVector3< T > &a, const TVector3< T > &b)
 cos between two vectors

double Sin (const TVector3< T > &a, const TVector3< T > &b)
 sin between two vectors

TVector3< T_TO > Conv (const TVector3< T_FROM > &u)
 Convert TVector3<T_FROM> to TVector3<T_TO>.

TVector3< float > ConvF (const TVector3< T > &u)
 Convert TVector3<T> to TVector3<float>.

TVector3< double > ConvD (const TVector3< T > &u)
 Convert TVector3<T> to TVector3<double>.

TVector3< int > ConvI (const TVector3< T > &u)
 Convert TVector3<T> to TVector3<int>.

TVector3< short > ConvS (const TVector3< T > &u)
 Convert TVector3<T> to TVector3<int>.


Detailed Description

template<class T>
class gml::TVector3< T >

Template class for 3D geometric vectors.

Parameters:
T - template type of TVector elements
Warning:
Use it with some SIGNED integral type, or a real type


The documentation for this class was generated from the following file:
Generated on Tue Jan 13 21:12:07 2004 for Graphics and Media Lab CSL by doxygen 1.3.4