|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NLMISC::CVector Class ReferenceA 3D vector of float.
More...
#include <vector.h>
Collaboration diagram for NLMISC::CVector:
[legend]List of all members.
Public Methods |
std::string | asString () const |
| Returns the contents as a printable string "x y z". More...
|
|
| CVector () |
| Constructor wich do nothing. More...
|
| CVector (float _x, float _y, float _z) |
| Constructor . More...
|
| CVector (const CVector &v) |
| Copy Constructor. More...
|
|
CVector& | operator+= (const CVector &v) |
CVector& | operator-= (const CVector &v) |
CVector& | operator *= (float f) |
CVector& | operator/= (float f) |
CVector | operator+ (const CVector &v) const |
CVector | operator- (const CVector &v) const |
CVector | operator * (float f) const |
CVector | operator/ (float f) const |
CVector | operator- () const |
|
float | operator * (const CVector &v) const |
| Dot product. More...
|
CVector | operator^ (const CVector &v) const |
| Cross product. More...
|
float | norm () const |
| Return the norm of the vector. More...
|
float | sqrnorm () const |
| Return the square of the norm of the vector. More...
|
void | normalize () |
| Normalize the vector. More...
|
CVector | normed () const |
| Return the vector normalized. More...
|
|
void | set (float _x, float _y, float _z) |
bool | operator== (const CVector &v) const |
bool | operator!= (const CVector &v) const |
bool | isNull () const |
bool | operator< (const CVector &v) const |
| This operator is here just for map/set insertion(no meaning). comparison order is x,y,z. More...
|
void | sphericToCartesian (float r, float theta,float phi) |
| Setup the vector with spheric coordinates. More...
|
void | cartesianToSpheric (float &r, float &theta,float &phi) const |
| Get the sphreic coordinates of the vector. More...
|
void | minof (const CVector &a, const CVector &b) |
| Set all vector x/y/z as minimum of a/b x/y/z (respectively). More...
|
void | maxof (const CVector &a, const CVector &b) |
| Set all vector x/y/z as maximum of a/b x/y/z (respectively). More...
|
void | serial (IStream &f) |
| serial. More...
|
Public Attributes |
float | x |
float | y |
float | z |
Static Public Attributes |
const CVector | Null |
| Null vector (0,0,0). More...
|
const CVector | I |
| I vector (1,0,0). More...
|
const CVector | J |
| J vector (0,1,0). More...
|
const CVector | K |
| K vector (0,0,1). More...
|
Friends |
CVector | operator * (float f, const CVector &v0) |
Detailed Description
A 3D vector of float.
-
Author(s):
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 46 of file vector.h.
Constructor & Destructor Documentation
NLMISC::CVector::CVector (
|
) [inline]
|
|
|
Constructor wich do nothing.
Definition at line 65 of file vector.h. |
NLMISC::CVector::CVector (
|
float _x,
|
|
float _y,
|
|
float _z ) [inline]
|
|
|
Constructor .
Definition at line 67 of file vector.h. |
NLMISC::CVector::CVector (
|
const CVector & v ) [inline]
|
|
|
Copy Constructor.
Definition at line 69 of file vector.h. |
Member Function Documentation
string NLMISC::CVector::asString (
|
) const
|
|
|
Returns the contents as a printable string "x y z".
Definition at line 44 of file vector.cpp. |
void NLMISC::CVector::cartesianToSpheric (
|
float & r,
|
|
float & theta,
|
|
float & phi ) const [inline]
|
|
bool NLMISC::CVector::isNull (
|
) const [inline]
|
|
void NLMISC::CVector::maxof (
|
const CVector & a,
|
|
const CVector & b ) [inline]
|
|
|
Set all vector x/y/z as maximum of a/b x/y/z (respectively).
Definition at line 192 of file vector_inline.h. |
void NLMISC::CVector::minof (
|
const CVector & a,
|
|
const CVector & b ) [inline]
|
|
|
Set all vector x/y/z as minimum of a/b x/y/z (respectively).
Definition at line 186 of file vector_inline.h. |
float NLMISC::CVector::norm (
|
) const [inline]
|
|
void NLMISC::CVector::normalize (
|
) [inline]
|
|
CVector NLMISC::CVector::normed (
|
) const [inline]
|
|
float NLMISC::CVector::operator * (
|
const CVector & v ) const [inline]
|
|
CVector NLMISC::CVector::operator * (
|
float f ) const [inline]
|
|
CVector & NLMISC::CVector::operator *= (
|
float f ) [inline]
|
|
bool NLMISC::CVector::operator!= (
|
const CVector & v ) const [inline]
|
|
CVector NLMISC::CVector::operator+ (
|
const CVector & v ) const [inline]
|
|
CVector & NLMISC::CVector::operator+= (
|
const CVector & v ) [inline]
|
|
CVector NLMISC::CVector::operator- (
|
) const [inline]
|
|
CVector NLMISC::CVector::operator- (
|
const CVector & v ) const [inline]
|
|
CVector & NLMISC::CVector::operator-= (
|
const CVector & v ) [inline]
|
|
CVector NLMISC::CVector::operator/ (
|
float f ) const [inline]
|
|
CVector & NLMISC::CVector::operator/= (
|
float f ) [inline]
|
|
bool NLMISC::CVector::operator< (
|
const CVector & v ) const [inline]
|
|
|
This operator is here just for map/set insertion(no meaning). comparison order is x,y,z.
Definition at line 152 of file vector_inline.h. |
bool NLMISC::CVector::operator== (
|
const CVector & v ) const [inline]
|
|
CVector NLMISC::CVector::operator^ (
|
const CVector & v ) const [inline]
|
|
|
Cross product.
compute the cross product *this ^ v.
Definition at line 101 of file vector_inline.h. |
void NLMISC::CVector::serial (
|
IStream & f ) [inline]
|
|
void NLMISC::CVector::set (
|
float _x,
|
|
float _y,
|
|
float _z ) [inline]
|
|
void NLMISC::CVector::sphericToCartesian (
|
float r,
|
|
float theta,
|
|
float phi ) [inline]
|
|
|
Setup the vector with spheric coordinates.
sphericToCartesian(1,0,0) build the I vector ((1,0,0)). the formula is:
x= r*cos(theta)*cos(phi)
y= r*sin(theta)*cos(phi)
z= r*sin(phi)
-
See also:
-
cartesianToSpheric()
Definition at line 175 of file vector_inline.h. |
float NLMISC::CVector::sqrnorm (
|
) const [inline]
|
|
|
Return the square of the norm of the vector.
Definition at line 111 of file vector_inline.h. |
Friends And Related Function Documentation
CVector operator * (
|
float f,
|
|
const CVector & v ) [friend]
|
|
Member Data Documentation
const CVector NLMISC::CVector::I [static]
|
|
|
I vector (1,0,0).
Definition at line 55 of file vector.h. |
const CVector NLMISC::CVector::J [static]
|
|
|
J vector (0,1,0).
Definition at line 57 of file vector.h. |
const CVector NLMISC::CVector::K [static]
|
|
|
K vector (0,0,1).
Definition at line 59 of file vector.h. |
const CVector NLMISC::CVector::Null [static]
|
|
|
Null vector (0,0,0).
Definition at line 53 of file vector.h. |
The documentation for this class was generated from the following files:
|
|