ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Tuple4Tpl< Type > Class Template Reference

4-Tuple structure (templated version) More...

#include <CVGeom.h>

Inheritance diagram for Tuple4Tpl< Type >:

Public Member Functions

std::size_t rows () const
 
std::size_t dimensions () const
 
Type * data ()
 
const Type * data () const
 
 Tuple4Tpl ()
 Default constructor. More...
 
 Tuple4Tpl (Type a, Type b, Type c, Type d)
 Constructor from a triplet of values. More...
 
 Tuple4Tpl (const Type p[])
 Constructor from an array of 4 elements. More...
 
 Tuple4Tpl (const Eigen::Matrix< float, 4, 1 > &v)
 Copy Function. More...
 
 Tuple4Tpl (const Eigen::Matrix< double, 4, 1 > &v)
 
Tuple4Tploperator= (const Eigen::Matrix< float, 4, 1 > &v)
 Assignment Function. More...
 
Tuple4Tploperator= (const Eigen::Matrix< double, 4, 1 > &v)
 
Tuple4Tpl operator- () const
 Inverse operator. More...
 
Tuple4Tploperator+= (const Tuple4Tpl &v)
 In-place addition operator. More...
 
Tuple4Tploperator-= (const Tuple4Tpl &v)
 In-place subtraction operator. More...
 
Tuple4Tploperator*= (Type v)
 In-place multiplication (by a scalar) operator. More...
 
Tuple4Tploperator/= (Type v)
 In-place division (by a scalar) operator. More...
 
Tuple4Tpl operator+ (const Tuple4Tpl &v) const
 Addition operator. More...
 
Tuple4Tpl operator- (const Tuple4Tpl &v) const
 Subtraction operator. More...
 
Tuple4Tpl operator* (Type s) const
 Multiplication operator. More...
 
Tuple4Tpl operator/ (Type s) const
 Division operator. More...
 
Type & operator[] (unsigned i)
 Direct coordinate access. More...
 
const Type & operator[] (unsigned i) const
 Direct coordinate access (const) More...
 
Type & operator() (unsigned i)
 Direct coordinate access. More...
 
const Type & operator() (unsigned i) const
 Direct coordinate access (const) More...
 

Static Public Member Functions

static Tuple4Tpl fromArray (const Eigen::Matrix< Type, 4, 1 > &a)
 Constructor from a Eigen vector. More...
 
static Eigen::Matrix< Type, 4, 1 > fromArray (const Tuple4Tpl< float > &a)
 
static Eigen::Matrix< Type, 4, 1 > fromArray (const Tuple4Tpl< double > &a)
 

Public Attributes

union {
   struct {
      Type   x
 
      Type   y
 
      Type   z
 
      Type   w
 
   } 
 
   Type   u [4]
 
}; 
 

Detailed Description

template<class Type>
class Tuple4Tpl< Type >

4-Tuple structure (templated version)

Definition at line 648 of file CVGeom.h.

Constructor & Destructor Documentation

◆ Tuple4Tpl() [1/5]

template<class Type >
Tuple4Tpl< Type >::Tuple4Tpl ( )
inline

Default constructor.

Inits tuple to (0, 0, 0, 0).

Definition at line 667 of file CVGeom.h.

Referenced by Tuple4Tpl< Type >::fromArray(), Tuple4Tpl< Type >::operator*(), Tuple4Tpl< Type >::operator+(), Tuple4Tpl< Type >::operator-(), and Tuple4Tpl< Type >::operator/().

◆ Tuple4Tpl() [2/5]

template<class Type >
Tuple4Tpl< Type >::Tuple4Tpl ( Type  a,
Type  b,
Type  c,
Type  d 
)
inline

Constructor from a triplet of values.

Inits typle to (a,b,c).

Definition at line 672 of file CVGeom.h.

◆ Tuple4Tpl() [3/5]

template<class Type >
Tuple4Tpl< Type >::Tuple4Tpl ( const Type  p[])
inlineexplicit

Constructor from an array of 4 elements.

Definition at line 675 of file CVGeom.h.

◆ Tuple4Tpl() [4/5]

template<class Type >
Tuple4Tpl< Type >::Tuple4Tpl ( const Eigen::Matrix< float, 4, 1 > &  v)
inline

Copy Function.

Definition at line 697 of file CVGeom.h.

◆ Tuple4Tpl() [5/5]

template<class Type >
Tuple4Tpl< Type >::Tuple4Tpl ( const Eigen::Matrix< double, 4, 1 > &  v)
inline

Definition at line 698 of file CVGeom.h.

Member Function Documentation

◆ data() [1/2]

template<class Type >
Type* Tuple4Tpl< Type >::data ( )
inline

Definition at line 661 of file CVGeom.h.

References Tuple4Tpl< Type >::u.

◆ data() [2/2]

template<class Type >
const Type* Tuple4Tpl< Type >::data ( ) const
inline

Definition at line 662 of file CVGeom.h.

References Tuple4Tpl< Type >::u.

◆ dimensions()

template<class Type >
std::size_t Tuple4Tpl< Type >::dimensions ( ) const
inline

Definition at line 659 of file CVGeom.h.

Referenced by Tuple4Tpl< Type >::rows().

◆ fromArray() [1/3]

template<class Type >
static Tuple4Tpl Tuple4Tpl< Type >::fromArray ( const Eigen::Matrix< Type, 4, 1 > &  a)
inlinestatic

Constructor from a Eigen vector.

Definition at line 679 of file CVGeom.h.

References Tuple4Tpl< Type >::Tuple4Tpl().

◆ fromArray() [2/3]

template<class Type >
static Eigen::Matrix<Type, 4, 1> Tuple4Tpl< Type >::fromArray ( const Tuple4Tpl< double > &  a)
inlinestatic

Definition at line 689 of file CVGeom.h.

◆ fromArray() [3/3]

template<class Type >
static Eigen::Matrix<Type, 4, 1> Tuple4Tpl< Type >::fromArray ( const Tuple4Tpl< float > &  a)
inlinestatic

Definition at line 683 of file CVGeom.h.

◆ operator()() [1/2]

template<class Type >
Type& Tuple4Tpl< Type >::operator() ( unsigned  i)
inline

Direct coordinate access.

Definition at line 774 of file CVGeom.h.

References Tuple4Tpl< Type >::u.

◆ operator()() [2/2]

template<class Type >
const Type& Tuple4Tpl< Type >::operator() ( unsigned  i) const
inline

Direct coordinate access (const)

Definition at line 776 of file CVGeom.h.

References Tuple4Tpl< Type >::u.

◆ operator*()

template<class Type >
Tuple4Tpl Tuple4Tpl< Type >::operator* ( Type  s) const
inline

Multiplication operator.

Definition at line 761 of file CVGeom.h.

References Tuple4Tpl< Type >::Tuple4Tpl(), Tuple4Tpl< Type >::w, Tuple4Tpl< Type >::x, Tuple4Tpl< Type >::y, and Tuple4Tpl< Type >::z.

◆ operator*=()

template<class Type >
Tuple4Tpl& Tuple4Tpl< Type >::operator*= ( Type  v)
inline

In-place multiplication (by a scalar) operator.

Definition at line 737 of file CVGeom.h.

References Tuple4Tpl< Type >::w, Tuple4Tpl< Type >::x, Tuple4Tpl< Type >::y, and Tuple4Tpl< Type >::z.

◆ operator+()

template<class Type >
Tuple4Tpl Tuple4Tpl< Type >::operator+ ( const Tuple4Tpl< Type > &  v) const
inline

◆ operator+=()

template<class Type >
Tuple4Tpl& Tuple4Tpl< Type >::operator+= ( const Tuple4Tpl< Type > &  v)
inline

In-place addition operator.

Definition at line 721 of file CVGeom.h.

References Tuple4Tpl< Type >::w, Tuple4Tpl< Type >::x, Tuple4Tpl< Type >::y, and Tuple4Tpl< Type >::z.

◆ operator-() [1/2]

template<class Type >
Tuple4Tpl Tuple4Tpl< Type >::operator- ( ) const
inline

Inverse operator.

Definition at line 716 of file CVGeom.h.

References Tuple4Tpl< Type >::w, Tuple4Tpl< Type >::x, Tuple4Tpl< Type >::y, and Tuple4Tpl< Type >::z.

◆ operator-() [2/2]

template<class Type >
Tuple4Tpl Tuple4Tpl< Type >::operator- ( const Tuple4Tpl< Type > &  v) const
inline

◆ operator-=()

template<class Type >
Tuple4Tpl& Tuple4Tpl< Type >::operator-= ( const Tuple4Tpl< Type > &  v)
inline

In-place subtraction operator.

Definition at line 729 of file CVGeom.h.

References Tuple4Tpl< Type >::w, Tuple4Tpl< Type >::x, Tuple4Tpl< Type >::y, and Tuple4Tpl< Type >::z.

◆ operator/()

template<class Type >
Tuple4Tpl Tuple4Tpl< Type >::operator/ ( Type  s) const
inline

◆ operator/=()

template<class Type >
Tuple4Tpl& Tuple4Tpl< Type >::operator/= ( Type  v)
inline

In-place division (by a scalar) operator.

Definition at line 745 of file CVGeom.h.

References Tuple4Tpl< Type >::w, Tuple4Tpl< Type >::x, Tuple4Tpl< Type >::y, and Tuple4Tpl< Type >::z.

◆ operator=() [1/2]

template<class Type >
Tuple4Tpl& Tuple4Tpl< Type >::operator= ( const Eigen::Matrix< double, 4, 1 > &  v)
inline

◆ operator=() [2/2]

template<class Type >
Tuple4Tpl& Tuple4Tpl< Type >::operator= ( const Eigen::Matrix< float, 4, 1 > &  v)
inline

Assignment Function.

Definition at line 700 of file CVGeom.h.

References Tuple4Tpl< Type >::w, Tuple4Tpl< Type >::x, Tuple4Tpl< Type >::y, and Tuple4Tpl< Type >::z.

◆ operator[]() [1/2]

template<class Type >
Type& Tuple4Tpl< Type >::operator[] ( unsigned  i)
inline

Direct coordinate access.

Definition at line 770 of file CVGeom.h.

References Tuple4Tpl< Type >::u.

◆ operator[]() [2/2]

template<class Type >
const Type& Tuple4Tpl< Type >::operator[] ( unsigned  i) const
inline

Direct coordinate access (const)

Definition at line 772 of file CVGeom.h.

References Tuple4Tpl< Type >::u.

◆ rows()

template<class Type >
std::size_t Tuple4Tpl< Type >::rows ( ) const
inline

Definition at line 658 of file CVGeom.h.

References Tuple4Tpl< Type >::dimensions().

Member Data Documentation

◆ 

union { ... }

◆ u

template<class Type >
Type Tuple4Tpl< Type >::u[4]

◆ w

◆ x

◆ y

◆ z


The documentation for this class was generated from the following file: