Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mlib::Wvec Class Reference
["World" Coordinate System]

A vector in World coordinates. More...

#include <points.H>

Inheritance diagram for mlib::Wvec:

Inheritance graph
[legend]
Collaboration diagram for mlib::Wvec:

Collaboration graph
[legend]
List of all members.

Public Types

typedef double value_type

Public Member Functions

 Vec3 ()
 Default constructor. Creates a zero length vector.
 Vec3 (double x, double y, double z)
 Constructor that sets the components of the vector to the values specified in the arguments.
const double * data () const
 Returns the elements of the vector as an array.
void set (double x, double y, double z)
 Sets the components of the vector to the values specified in the arguments.
double operator[] (int index) const
double & operator[] (int index)
Wvec operator+ (const Wvec &v) const
Wvec operator- (const Wvec &v) const
Wvec operator- () const
double operator * (const Wvec &v) const
Wvec operator * (double s) const
Wvec operator/ (double s) const
void operator+= (const Wvec &v)
void operator-= (const Wvec &v)
void operator *= (double s)
void operator/= (double s)
int operator> (const Wvec &v) const
int operator< (const Wvec &v) const
bool operator== (const Wvec &v) const
bool operator!= (const Wvec &v) const
double length () const
double length_sqrd () const
double length_rect () const
bool is_null (double epsSqrd=epsNorSqrdMath()) const
 Is the vector's length equal to zero?
double dist (const Wvec &v) const
 Compute the distance between the two vectors.
double dist_sqrd (const Wvec &v) const
 Compute the distance squared between the two vectors.
double angle (const Wvec &) const
 Compute the angle between the two vectors. The result will be in the range 0 to pi radians.
double tlen (const Wvec &b) const
 Returns (this * b) / (b * b).
Wvec projected (const Wvec &b) const
 Returns the projection of this onto b.
Wvec orthogonalized (const Wvec &b) const
 Returns this vector minus its projection onto b.
bool is_equal (const Wvec &v, double epsSqrd=epsNorSqrdMath()) const
 Are the two vectors equal?
bool is_parallel (const Wvec &) const
 Are the two vectors parallel?
bool is_perpend (const Wvec &) const
 Are the two vectors perpendicular?
Wvec normalized () const
 Return a unit-length copy of this vector.
Wvec perpend () const
 Return a vector perpendicular to this one using an arbitrary axis algorithm.
Constructors
 Wvec ()
 Wvec (CXYpt &)
 Wvec (CNDCZvec &, CWtransf &)
 Wvec (double x, double y, double z)
 Wvec (CWpt &, CVEXEL &)

Static Public Member Functions

static CWvecnull ()
static CWvecX ()
static CWvecY ()
static CWvecZ ()
static int dim ()

Protected Attributes

double _x
double _y
double _z

Static Protected Attributes

static CWvec _null_vec
static CWvec _x_axis
static CWvec _y_axis
static CWvec _z_axis

Detailed Description

A vector in World coordinates.

Definition at line 203 of file points.H.


Member Typedef Documentation

typedef double mlib::Vec3< Wvec >::value_type [inherited]
 

Definition at line 49 of file vec3.H.


Constructor & Destructor Documentation

mlib::Wvec::Wvec  )  [inline]
 

Definition at line 217 of file points.H.

mlib::Wvec::Wvec CXYpt  ) 
 

Definition at line 100 of file points.C.

References XYtoWvec.

mlib::Wvec::Wvec CNDCZvec ,
CWtransf
 

Definition at line 88 of file points.C.

mlib::Wvec::Wvec double  x,
double  y,
double  z
[inline]
 

Definition at line 220 of file points.H.

mlib::Wvec::Wvec CWpt ,
CVEXEL
 

Definition at line 111 of file points.C.


Member Function Documentation

double mlib::Vec3< Wvec >::angle const Wvec &   )  const [inline, inherited]
 

Compute the angle between the two vectors. The result will be in the range 0 to pi radians.

const double* mlib::Vec3< Wvec >::data  )  const [inline, inherited]
 

Returns the elements of the vector as an array.

Definition at line 58 of file vec3.H.

References mlib::Vec3< V >::_x.

static int mlib::Vec3< Wvec >::dim  )  [inline, static, inherited]
 

Definition at line 50 of file vec3.H.

double mlib::Vec3< Wvec >::dist const Wvec &  v  )  const [inline, inherited]
 

Compute the distance between the two vectors.

Definition at line 120 of file vec3.H.

double mlib::Vec3< Wvec >::dist_sqrd const Wvec &  v  )  const [inline, inherited]
 

Compute the distance squared between the two vectors.

Definition at line 122 of file vec3.H.

bool mlib::Vec3< Wvec >::is_equal const Wvec &  v,
double  epsSqrd = epsNorSqrdMath()
const [inline, inherited]
 

Are the two vectors equal?

Note:
Checks to see if the distance between the two vectors is less than or equal to epsSqrd.

Definition at line 148 of file vec3.H.

References mlib::Vec3< V >::dist_sqrd().

bool mlib::Vec3< Wvec >::is_null double  epsSqrd = epsNorSqrdMath()  )  const [inline, inherited]
 

Is the vector's length equal to zero?

Definition at line 111 of file vec3.H.

References mlib::Vec3< V >::length_sqrd().

bool mlib::Vec3< Wvec >::is_parallel const Wvec &   )  const [inline, inherited]
 

Are the two vectors parallel?

bool mlib::Vec3< Wvec >::is_perpend const Wvec &   )  const [inline, inherited]
 

Are the two vectors perpendicular?

double mlib::Vec3< Wvec >::length  )  const [inline, inherited]
 

Definition at line 106 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

double mlib::Vec3< Wvec >::length_rect  )  const [inline, inherited]
 

Definition at line 108 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

double mlib::Vec3< Wvec >::length_sqrd  )  const [inline, inherited]
 

Definition at line 107 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

Wvec mlib::Vec3< Wvec >::normalized  )  const [inline, inherited]
 

Return a unit-length copy of this vector.

static CWvec& mlib::Wvec::null  )  [inline, static]
 

Definition at line 225 of file points.H.

References _null_vec.

Wvec mlib::Vec3< Wvec >::operator * double  s  )  const [inline, inherited]
 

Definition at line 76 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

double mlib::Vec3< Wvec >::operator * const Wvec &  v  )  const [inline, inherited]
 

Definition at line 74 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

void mlib::Vec3< Wvec >::operator *= double  s  )  [inline, inherited]
 

Definition at line 81 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

bool mlib::Vec3< Wvec >::operator!= const Wvec &  v  )  const [inline, inherited]
 

Definition at line 99 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

Wvec mlib::Vec3< Wvec >::operator+ const Wvec &  v  )  const [inline, inherited]
 

Definition at line 72 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

void mlib::Vec3< Wvec >::operator+= const Wvec &  v  )  [inline, inherited]
 

Definition at line 79 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

Wvec mlib::Vec3< Wvec >::operator-  )  const [inline, inherited]
 

Definition at line 75 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

Wvec mlib::Vec3< Wvec >::operator- const Wvec &  v  )  const [inline, inherited]
 

Definition at line 73 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

void mlib::Vec3< Wvec >::operator-= const Wvec &  v  )  [inline, inherited]
 

Definition at line 80 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

Wvec mlib::Vec3< Wvec >::operator/ double  s  )  const [inline, inherited]
 

Definition at line 77 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

void mlib::Vec3< Wvec >::operator/= double  s  )  [inline, inherited]
 

Definition at line 82 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

int mlib::Vec3< Wvec >::operator< const Wvec &  v  )  const [inline, inherited]
 

Provided so that min(V, V) and max(V, V) work.

Note:
Comparison is done by length (not by comparing individual components).

Definition at line 96 of file vec3.H.

References mlib::Vec3< V >::length().

bool mlib::Vec3< Wvec >::operator== const Wvec &  v  )  const [inline, inherited]
 

Definition at line 98 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

int mlib::Vec3< Wvec >::operator> const Wvec &  v  )  const [inline, inherited]
 

Provided so that min(V, V) and max(V, V) work.

Note:
Comparison is done by length (not by comparing individual components).

Definition at line 92 of file vec3.H.

References mlib::Vec3< V >::length().

double& mlib::Vec3< Wvec >::operator[] int  index  )  [inline, inherited]
 

Definition at line 65 of file vec3.H.

References mlib::Vec3< V >::_x.

double mlib::Vec3< Wvec >::operator[] int  index  )  const [inline, inherited]
 

Definition at line 64 of file vec3.H.

References mlib::Vec3< V >::_x.

Wvec mlib::Vec3< Wvec >::orthogonalized const Wvec &  b  )  const [inline, inherited]
 

Returns this vector minus its projection onto b.

Definition at line 138 of file vec3.H.

References mlib::Vec3< V >::projected().

Wvec mlib::Vec3< Wvec >::perpend  )  const [inline, inherited]
 

Return a vector perpendicular to this one using an arbitrary axis algorithm.

The arbitrary perpendicular vector is found as follows. First, the minimum length component of the vector is found. Second, a new vector is created that is the unit vector along the direction of the minimum component. Third, the perpendicular vector is found by taking the cross product of the vector with the minimum component set to zero and the original vector. Fourth, the perpendicular vector is normalized.

Wvec mlib::Vec3< Wvec >::projected const Wvec &  b  )  const [inline, inherited]
 

Returns the projection of this onto b.

Definition at line 135 of file vec3.H.

References mlib::Vec3< V >::tlen().

void mlib::Vec3< Wvec >::set double  x,
double  y,
double  z
[inline, inherited]
 

Sets the components of the vector to the values specified in the arguments.

Definition at line 62 of file vec3.H.

References mlib::Vec3< V >::_x, mlib::Vec3< V >::_y, and mlib::Vec3< V >::_z.

double mlib::Vec3< Wvec >::tlen const Wvec &  b  )  const [inline, inherited]
 

Returns (this * b) / (b * b).

Definition at line 129 of file vec3.H.

References mlib::isZero().

mlib::Vec3< Wvec >::Vec3 double  x,
double  y,
double  z
[inline, inherited]
 

Constructor that sets the components of the vector to the values specified in the arguments.

Definition at line 42 of file vec3.H.

mlib::Vec3< Wvec >::Vec3  )  [inline, inherited]
 

Default constructor. Creates a zero length vector.

Definition at line 39 of file vec3.H.

static CWvec& mlib::Wvec::X  )  [inline, static]
 

Definition at line 226 of file points.H.

References _x_axis.

Referenced by ToonTexCB::faceCB(), XToonStripCB::faceCB(), and Cam_int_edit::rot_x().

static CWvec& mlib::Wvec::Y  )  [inline, static]
 

Definition at line 227 of file points.H.

References _y_axis.

Referenced by GEOM::do_cam_focus(), ToonTexCB::faceCB(), XToonStripCB::faceCB(), Cam_int_edit::rot(), Cam_int_edit::rot_y(), and CamOrbit::tick().

static CWvec& mlib::Wvec::Z  )  [inline, static]
 

Definition at line 228 of file points.H.

References _z_axis.

Referenced by ToonTexCB::faceCB(), XToonStripCB::faceCB(), and Cam_int_edit::rot_z().


Member Data Documentation

CWvec mlib::Wvec::_null_vec [static, protected]
 

Definition at line 207 of file points.H.

Referenced by null().

double mlib::Vec3< Wvec >::_x [protected, inherited]
 

Definition at line 31 of file vec3.H.

CWvec mlib::Wvec::_x_axis [static, protected]
 

Definition at line 208 of file points.H.

Referenced by X().

double mlib::Vec3< Wvec >::_y [protected, inherited]
 

Definition at line 31 of file vec3.H.

CWvec mlib::Wvec::_y_axis [static, protected]
 

Definition at line 209 of file points.H.

Referenced by Y().

double mlib::Vec3< Wvec >::_z [protected, inherited]
 

Definition at line 31 of file vec3.H.

CWvec mlib::Wvec::_z_axis [static, protected]
 

Definition at line 210 of file points.H.

Referenced by Z().


The documentation for this class was generated from the following files:
Generated on Mon Sep 18 11:48:12 2006 for jot by  doxygen 1.4.4