Geophysical Inversion and Modeling Library  v1.0.11-38-g7483f4dd
GIMLI::Pos< ValueType > Class Template Reference

3 dimensional vector More...

+ Inheritance diagram for GIMLI::Pos< ValueType >:
+ Collaboration diagram for GIMLI::Pos< ValueType >:

Public Member Functions

 Pos ()
 
 Pos (bool valid)
 
 Pos (ValueType x, ValueType y)
 
 Pos (ValueType x, ValueType y, ValueType z)
 
 Pos (const Pos< ValueType > &pos)
 
Pos< ValueType > & operator= (const Pos< ValueType > &pos)
 
Pos< ValueType > & operator= (const Vector< ValueType > &v)
 
ValueType & operator[] (Index i)
 
const ValueType & operator[] (Index i) const
 
Pos< ValueType > operator- () const
 
void setValid (bool valid)
 
bool valid () const
 
void assign (const ValueType &x, const ValueType &y, const ValueType &z)
 
const ValueType & x () const
 
const ValueType & y () const
 
const ValueType & z () const
 
void setX (ValueType x)
 
void setY (ValueType y)
 
void setZ (ValueType z)
 
void setVal (const ValueType &val, Index i)
 
const ValueType & getVal (Index i) const
 
Pos< ValueType > & round (double tol)
 
double distSquared (const Pos< ValueType > &p) const
 
double dist (const Pos< ValueType > &p) const
 
double distance (const Pos< ValueType > &p) const
 
double abs () const
 
double distSquared () const
 
double length () const
 
double angle (const Pos< ValueType > &p) const
 
double angle (const RVector3 &p1, const RVector3 &p3) const
 
ValueType dot (const Pos< ValueType > &p) const
 
ValueType sum () const
 
Pos< ValueType > norm (const Pos< ValueType > &p1, const Pos< ValueType > &p2) const
 
Pos< ValueType > norm () const
 
Pos< ValueType > & normalize ()
 
Pos< ValueType > & normalise ()
 
Pos< ValueType > cross (const Pos< ValueType > &p) const
 
Pos< ValueType > normXY (const Pos< ValueType > &p) const
 
template<class Matrix >
Pos< ValueType > & transform (const Matrix &wm)
 
Pos< ValueType > & rotateX (double phi)
 
Pos< ValueType > & rotateY (double phi)
 
Pos< ValueType > & rotateZ (double phi)
 
Pos< ValueType > & rotate (const RVector3 &r)
 
Pos< ValueType > & rotate (double phiX, double phiY, double phiZ)
 
Pos< ValueType > & scale (const RVector3 &s)
 
Pos< ValueType > & translate (const RVector3 &t)
 
RVector vec () const
 

Protected Member Functions

void copy_ (const Pos< ValueType > &pos)
 

Protected Attributes

bool valid_
 
ValueType mat_ [3]
 

Detailed Description

template<class ValueType>
class GIMLI::Pos< ValueType >

3 dimensional vector

3 dimensional vector

Constructor & Destructor Documentation

◆ Pos() [1/2]

template<class ValueType>
GIMLI::Pos< ValueType >::Pos ( )
inline

Construct an empty in 3d at (0, 0, 0)

◆ Pos() [2/2]

template<class ValueType>
GIMLI::Pos< ValueType >::Pos ( bool  valid)
inline

Construct an empty in 3d at (0, 0, 0). Optional set valid flag.

Member Function Documentation

◆ abs()

template<class ValueType>
double GIMLI::Pos< ValueType >::abs ( ) const
inline

◆ angle() [1/2]

template<class ValueType>
double GIMLI::Pos< ValueType >::angle ( const Pos< ValueType > &  p) const
inline

Return the angle between (this, (origin), p).

◆ angle() [2/2]

template<class ValueType>
double GIMLI::Pos< ValueType >::angle ( const RVector3 p1,
const RVector3 p3 
) const
inline

Return the angle between (p1, this, p2).

◆ getVal()

template<class ValueType>
const ValueType& GIMLI::Pos< ValueType >::getVal ( Index  i) const
inline

Get a value. Throws out of range exception if index check fails.

◆ norm()

template<class ValueType>
Pos< ValueType > GIMLI::Pos< ValueType >::norm ( ) const
inline

Return normalised copy of this Pos.

◆ normalise()

template<class ValueType>
Pos< ValueType >& GIMLI::Pos< ValueType >::normalise ( )
inline

DEPRECATED Normalise for backward compatibility.

Referenced by GIMLI::RegionManager::fillConstraintsWeight().

◆ normalize()

template<class ValueType>
Pos< ValueType >& GIMLI::Pos< ValueType >::normalize ( )
inline

Normalize this Pos and return itself.

◆ operator=() [1/2]

template<class ValueType>
Pos< ValueType >& GIMLI::Pos< ValueType >::operator= ( const Pos< ValueType > &  pos)
inline

Assignment operator

◆ operator=() [2/2]

template<class ValueType>
Pos< ValueType >& GIMLI::Pos< ValueType >::operator= ( const Vector< ValueType > &  v)
inline

Assignment operator

◆ setVal()

template<class ValueType>
void GIMLI::Pos< ValueType >::setVal ( const ValueType &  val,
Index  i 
)
inline

Set a value. Throws out of range exception if index check fails.