SpatialVector: Added component access member functions

wx(), wy(), wz(), lx(), ly() and lz()
This commit is contained in:
Henry Weller
2016-03-17 22:12:48 +00:00
parent 4cc909f1ed
commit f528f844db
4 changed files with 138 additions and 29 deletions

View File

@ -67,6 +67,10 @@ class SpatialVector
public:
//- Component labeling enumeration
enum components { WX, WY, WZ, LX, LY, LZ };
// Constructors
//- Construct null
@ -81,19 +85,19 @@ public:
//- Construct from the angular and linear vector components
inline SpatialVector
(
const Vector<Cmpt>& angular,
const Vector<Cmpt>& linear
const Vector<Cmpt>& w,
const Vector<Cmpt>& l
);
//- Construct given 6 components
inline SpatialVector
(
const Cmpt& v0,
const Cmpt& v1,
const Cmpt& v2,
const Cmpt& v3,
const Cmpt& v4,
const Cmpt& v5
const Cmpt& wx,
const Cmpt& wy,
const Cmpt& wz,
const Cmpt& lx,
const Cmpt& ly,
const Cmpt& lz
);
//- Construct from Istream
@ -102,11 +106,32 @@ public:
// Member Functions
//- Return the angular part of the spatial vector as a vector
inline Vector<Cmpt> angular() const;
// Component access
//- Return the linear part of the spatial vector as a vector
inline Vector<Cmpt> linear() const;
inline const Cmpt& wx() const;
inline const Cmpt& wy() const;
inline const Cmpt& wz() const;
inline const Cmpt& lx() const;
inline const Cmpt& ly() const;
inline const Cmpt& lz() const;
inline Cmpt& wx();
inline Cmpt& wy();
inline Cmpt& wz();
inline Cmpt& lx();
inline Cmpt& ly();
inline Cmpt& lz();
// Sub-vector access.
//- Return the angular part of the spatial vector as a vector
inline Vector<Cmpt> w() const;
//- Return the linear part of the spatial vector as a vector
inline Vector<Cmpt> l() const;
// Member Operators