MeVisLab Toolbox Reference
|
Forward declarations to resolve header file dependencies. More...
#include <mlVector3.h>
Public Types | |
typedef FloatingPointVector< DT, 3, Vector3DataContainer< DT > > | Superclass |
A typedef as a shorthand for the base class. More... | |
typedef DT | ComponentType |
A typedef to 'export' the type of components. More... | |
![]() | |
enum | |
This enum grants access to the size during compile time, e.g., it can be used as a template argument. More... | |
typedef DT | ComponentType |
A typedef to 'export' the type of components. More... | |
Public Member Functions | |
void | assign (const DT px, const DT py, const DT pz) |
Sets all components to the passed values. More... | |
Tvec3< DT > | divideByLastComp () const |
Divides all vector components by its last component and returns it as Tvec3, which then has a 1 as last component. More... | |
Tvec4< DT > | affineVec () const |
Builds a homogeneous Tvec4 vector from *this and returns it, i.e., leaves all components unchanged and sets the fourth component to 0. More... | |
Tvec4< DT > | affinePoint () const |
Builds a homogeneous Tvec4 point from *this and returns it, i.e., leaves all components unchanged and sets the fourth component to 1. More... | |
Constructors | |
Tvec3 (const DT value=0) | |
Default and value constructor. More... | |
Tvec3 (const Superclass &v) | |
Copy constructor from FloatingPointVector. More... | |
Tvec3 (const DT px, const DT py, const DT pz) | |
Constructor building the vector px , py , and pz . More... | |
Tvec3 (const Tvec2< DT > &v, const DT pz) | |
Builds a Tvec3 from a Tvec2 and a scalar. Sets the third entry to user given value pz . More... | |
Tvec3 (const Tvec4< DT > &v, const bool normalizeV) | |
Casts a Tvec4 v to Tvec3. More... | |
Tvec3 (const Tvec4< DT > &v, const int axis) | |
Casts a Tvec4 v to Tvec3. More... | |
![]() | |
FloatingPointVector (DT value=DT(0)) | |
Default and value constructor. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > & | operator= (DT value) |
Assignment of scalar value to all components. More... | |
bool | operator== (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer) const |
Returns whether *this and buffer are component-wise equal. More... | |
bool | operator!= (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer) const |
Returns whether any components of *this and buffer are not equal. More... | |
bool | operator< (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer) const |
Defines an artificial order for use in sort algorithms (lexicographical order). More... | |
const DT & | operator[] (const size_t i) const |
Constant indexing operators. More... | |
DT & | operator[] (const size_t i) |
Indexing operators. More... | |
size_t | getSize () const |
Returns the number of elements of value buffer. More... | |
DT | norm2 () const |
Returns the Euclidean norm (the vector length), i.e., square root of sum of squares of all components. More... | |
DT | norm2 (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &weight) const |
Returns the weighted Euclidean norm, i.e., square root of sum of squares of all components multiplied with corresponding squared component of weight. More... | |
DT | dot (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer) const |
Returns the dot product, i.e., sum of all components multiplied with corresponding components of buffer. More... | |
DT | normalize () |
Normalizes the buffer and returns the Euclidean length of vector before normalization, i.e., norm2. More... | |
DT | length () const |
Returns the length of the vector, i.e., norm2(). More... | |
DT | distance (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer) const |
Returns the distance of this vector to a given one. More... | |
DT | distanceSquared (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer) const |
Returns the squared distance of this vector to a given one. More... | |
DT | lengthSquared () const |
Returns the squared length of the vector. More... | |
DT | compSum () const |
Returns the sum of all components. More... | |
DT | compMul () const |
Returns the product of all vector components. More... | |
DT | compMaxAbs () const |
Returns the maximum of absolute component values. More... | |
void | compMin (FloatingPointVector< DT, size, Vector3DataContainer< DT > > buffer) |
Sets the component-wise minimum of *this and buffer in *this. More... | |
void | compMax (FloatingPointVector< DT, size, Vector3DataContainer< DT > > buffer) |
Sets the component-wise maximum of *this and buffer in *this. More... | |
void | compAbs () |
Kills negative signs from all components. More... | |
void | compDiv (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &d) |
Divides each vector component by the corresponding one of d . More... | |
void | compSqr () |
Calculates and sets the square of all components. More... | |
void | compSqrt () |
Calculates and sets square root of all components. More... | |
void | clampMin (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &lower) |
Calculates and sets all components clamped to lower, i.e., if any component is smaller than the corresponding one in lower, then it is set to the one from lower. More... | |
void | clampMax (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &upper) |
Calculates and sets all components clamped to upper, i.e., if any component is greater than the corresponding one in upper, then it is set to the one from upper. More... | |
void | clamp (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &lower, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &upper) |
Calculates and sets all components of *this so that they are between minimum lower and maximum upper . More... | |
void | compRound () |
Rounds all components of this vector using floor(component + 0.5). More... | |
void | compFloor () |
Rounds all components of this vector using floor(component). More... | |
void | compCeil () |
Rounds all components of this vector to integer using ceil(component). More... | |
FloatingPointVector< DT, 3, Vector3DataContainer< DT > > | cross (const FloatingPointVector< DT, 3, Vector3DataContainer< DT > > &b) const |
Returns the cross product for elements, i.e., the returned vector is orthogonal to *this and b. More... | |
void | apply (ML_LA_FROM_DOUBLE_TO_DOUBLE f) |
Applies the function f to each component starting from index 0 to index size-1. More... | |
std::ostream & | writeOut (std::ostream &os) const |
Writes all components to ostream os starting from index 0 to size-1. More... | |
std::istream & | readIn (std::istream &is) |
Reads all components from istream is starting starting from index 0 to size-1. More... | |
Additional Inherited Members | |
![]() | |
union { | |
struct { | |
DT x | |
X-component of the vector, same as _buffer[0]. More... | |
DT y | |
Y-component of the vector, same as _buffer[1]. More... | |
DT z | |
Z-component of the vector, same as _buffer[2]. More... | |
} | |
DT _buffer [3] | |
Data members as vector to provide array access, same as x, y, and z members. More... | |
}; | |
![]() | |
DT | compMul (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &vec) |
Returns the product of all components. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | compMin (FloatingPointVector< DT, size, Vector3DataContainer< DT > > buffer1, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer2) |
Component-wise minimum of buffer1 and buffer2 . More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | compMax (FloatingPointVector< DT, size, Vector3DataContainer< DT > > buffer1, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer2) |
Component-wise maximum of buffer1 and buffer2 . More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | compAbs (FloatingPointVector< DT, size, Vector3DataContainer< DT > > vec) |
Returns a vector with all components from vec without negative sign. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | compDiv (FloatingPointVector< DT, size, Vector3DataContainer< DT > > vec, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &d) |
Component-wise division of vec / d . More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | compSqr (FloatingPointVector< DT, size, Vector3DataContainer< DT > > vec) |
Returns a vector with all components from vec squared. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | compSqrt (FloatingPointVector< DT, size, Vector3DataContainer< DT > > vec) |
Returns a vector with all components from vec square-rooted. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | clampMin (FloatingPointVector< DT, size, Vector3DataContainer< DT > > vec, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &m) |
Returns a new vector with all components from vec clamped to minimum m . More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | clampMax (FloatingPointVector< DT, size, Vector3DataContainer< DT > > vec, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &m) |
Returns a new vector with all components from vec clamped to maximum m . More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | clamp (FloatingPointVector< DT, size, Vector3DataContainer< DT > > vec, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &lower, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &upper) |
Returns a new vector with all components from vec clamped to range [lower, upper]. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > & | operator+= (FloatingPointVector< DT, size, Vector3DataContainer< DT > > &op1, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer) |
Arithmetic assignment: Component-wise addition. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > & | operator-= (FloatingPointVector< DT, size, Vector3DataContainer< DT > > &op1, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer) |
Arithmetic assignment: Component-wise subtraction of buffer from *this. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > & | operator*= (FloatingPointVector< DT, size, Vector3DataContainer< DT > > &op1, MLdouble value) |
Arithmetic assignment: Component-wise multiplication *this with specialized MLdouble scalar value. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > & | operator*= (FloatingPointVector< DT, size, Vector3DataContainer< DT > > &op1, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &op2) |
Arithmetic assignment: Component-wise multiplication *this with a vector of the same size. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > & | operator/= (FloatingPointVector< DT, size, Vector3DataContainer< DT > > &op1, MLdouble value) |
Arithmetic assignment: Component-wise division of *this by scalar value. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > & | operator/= (FloatingPointVector< DT, size, Vector3DataContainer< DT > > &op1, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &op2) |
Arithmetic assignment: Component-wise division of *this by the values of a vector of the same size. More... | |
bool | operator! (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &a) |
Returns whether all components are 0. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | operator+ (FloatingPointVector< DT, size, Vector3DataContainer< DT > > lhs, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &rhs) |
Return value is the component-wise addition of lhs and rhs . More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | operator+ (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer) |
Unary plus, for completeness and for those who really want to use that. More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | operator- (FloatingPointVector< DT, size, Vector3DataContainer< DT > > lhs, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &rhs) |
Return value is the component-wise subtraction of rhs from lhs . More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | operator- (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &buffer) |
Unary minus, all components of the vector are multiplied with -1. More... | |
DT | operator* (const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &a, const FloatingPointVector< DT, size, Vector3DataContainer< DT > > &b) |
Dot product, returns a.dot(b). More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | operator* (FloatingPointVector< DT, size, Vector3DataContainer< DT > > lhs, MLdouble rhs) |
Component-wise multiplication of lhs with rhs . More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | operator* (MLdouble lhs, FloatingPointVector< DT, size, Vector3DataContainer< DT > > rhs) |
Component-wise multiplication of rhs with lhs . More... | |
FloatingPointVector< DT, size, Vector3DataContainer< DT > > | operator/ (FloatingPointVector< DT, size, Vector3DataContainer< DT > > lhs, MLdouble rhs) |
Component-wise division of lhs by specialized rhs of type MLdouble. More... | |
Forward declarations to resolve header file dependencies.
A three dimensional vector class for floating point types.
Definition at line 65 of file mlVector3.h.
typedef DT ml::Tvec3< DT >::ComponentType |
A typedef to 'export' the type of components.
Definition at line 74 of file mlVector3.h.
typedef FloatingPointVector<DT, 3, Vector3DataContainer<DT> > ml::Tvec3< DT >::Superclass |
A typedef as a shorthand for the base class.
Definition at line 71 of file mlVector3.h.
Default and value constructor.
Sets all entries to a user given value. value
is the init value for all entries. 0 is the default value.
Definition at line 82 of file mlVector3.h.
|
inline |
Copy constructor from FloatingPointVector.
This allows the usage of SclarVectorTemplate objects of the same DT in operators using the Tvec3, because the FloatingPointVector objects can implicitly be cast.
Definition at line 89 of file mlVector3.h.
Constructor building the vector px
, py
, and pz
.
Definition at line 94 of file mlVector3.h.
Builds a Tvec3 from a Tvec2 and a scalar. Sets the third entry to user given value pz
.
Definition at line 102 of file mlVector3.h.
If normalize
is true
, then the first three components are divided by the last one to implement a homogeneous cast. In that case, it is up to the caller to avoid a division by zero. If normalize
is false
, then the first three components are taken unchanged.
Definition at line 114 of file mlVector3.h.
References DCMTree::DT, ML_BAD_PARAMETER, MLValuesDifferWOM(), and ml::printTemplateError().
axis
specifies component to be thrown away. All other components are copied sequentially. If axis is not within [0,3], then the last component is thrown away.
Definition at line 143 of file mlVector3.h.
Builds a homogeneous Tvec4 point from *this and returns it, i.e., leaves all components unchanged and sets the fourth component to 1.
Definition at line 203 of file mlVector3.h.
Referenced by ml::operator*(), and ml::Tmat4< DT >::transformPoint().
Builds a homogeneous Tvec4 vector from *this and returns it, i.e., leaves all components unchanged and sets the fourth component to 0.
Definition at line 196 of file mlVector3.h.
|
inline |
Sets all components to the passed values.
Definition at line 171 of file mlVector3.h.
Referenced by ml::PCLSupportTools::getBoxForPointCloud(), and ml::PCLMLTools::transformTo().
Divides all vector components by its last component and returns it as Tvec3, which then has a 1 as last component.
It is useful to scale the vector from homogeneous space to normal space. It is up to the caller to avoid a division by zero if last component is 0.
Definition at line 182 of file mlVector3.h.
References DCMTree::DT, and ML_CHECK_FLOAT.