HerdSoftware  0.4.0
Public Member Functions | Private Attributes | List of all members
Herd::PhysPoint Class Reference

A class describing a physical point in the 3D space. More...

#include <dataobjects/PhysPoint.h>

Inheritance diagram for Herd::PhysPoint:
Herd::Vec3D Herd::CooArray< float > Herd::ArrayForwarder< float, 3 >

Public Member Functions

 PhysPoint ()
 Default constructor. More...
 
 PhysPoint (float xCoo, float yCoo, float zCoo, float resX=0., float resY=0., float resZ=0.)
 Constructor. More...
 
 PhysPoint (const Vec3D &coo, std::array< float, 3 > res={0., 0., 0.})
 Array constructor. More...
 
virtual ~PhysPoint ()=default
 Virtual destructor
More...
 
float ResX () const
 Returns the resolution of the X coordinate of the point. More...
 
void SetResX (float resX)
 Sets the value of the X resolution. More...
 
float ResY () const
 Returns the resolution of the Y coordinate of the point. More...
 
void SetResY (float resY)
 Sets the value of the Y resolution. More...
 
float ResZ () const
 Returns the resolution of the Z coordinate of the point. More...
 
void SetResZ (float resZ)
 Sets the value of the Z resolution. More...
 
CooArray< float > ResAsArray () const
 Returns the point resolution as array. More...
 
void SetResFromArray (const std::array< float, 3 > res)
 Sets the resolution from array. More...
 
- Public Member Functions inherited from Herd::Vec3D
constexpr Vec3D ()
 Default constructor. More...
 
constexpr Vec3D (float x, float y, float z)
 Constructor. More...
 
constexpr Vec3D (std::array< float, 3 > arr)
 Constructor. More...
 
constexpr Vec3D (RefFrame::Direction direction)
 Constructs a 3D vector from a given direction. More...
 
void Dump () const
 Dumps the vector components. More...
 
float Mag () const
 Compute the vector magnitude. More...
 
Vec3D UnitVector () const
 Return this vector, but normalized to unit length. More...
 
constexpr Vec3D CrossProduct (const Vec3D &rhs) const
 Compute the cross product of two vectors. More...
 
float PolarAngle () const
 Compute the polar angle. More...
 
float AzimuthAngle () const
 Compute the azimuth angle. More...
 
Vec3Doperator+= (Vec3D const &right)
 Add a vector to this one. More...
 
Vec3Doperator+= (Vec3D &&right)
 
Vec3D operator- (Vec3D const &right) const
 Subtract two vectors. More...
 
Vec3Doperator-= (Vec3D const &right)
 Subtract a vector from this one. More...
 
Vec3Doperator-= (Vec3D &&right)
 
template<typename T , typename std::enable_if< std::is_arithmetic< T >::value >::type * = nullptr>
Vec3Doperator*= (T const &right)
 Multiply a vector by a number. More...
 
template<typename T , typename std::enable_if< std::is_arithmetic< T >::value >::type * = nullptr>
Vec3Doperator*= (T &&right)
 
template<typename T , typename std::enable_if< std::is_arithmetic< T >::value >::type * = nullptr>
Vec3Doperator/= (T const &right)
 Divide a vector by a number. More...
 
template<typename T , typename std::enable_if< std::is_arithmetic< T >::value >::type * = nullptr>
Vec3Doperator/= (T &&right)
 
bool operator== (const Vec3D &right) const
 Comparison operator. More...
 
- Public Member Functions inherited from Herd::CooArray< float >
constexpr CooArray ()=default
 Default constructor. More...
 
constexpr CooArray (const CooArray< float > &c)
 Copy constructor. More...
 
constexpr CooArray (U &&v1, V &&v2, Z &&v3)
 Initializer list constructor. More...
 
constexpr CooArray (const std::array< float, 3 > &values)
 Array constructors. More...
 
constexpr CooArray (std::array< float, 3 > &&values)
 
constexpr CooArray< float > & operator= (const CooArray< float > &lhs)
 Assignment operator. More...
 
constexpr float & operator[] (const RefFrame::Coo &coo)
 Accesses an element without validity check on the element index. More...
 
constexpr const float & operator[] (const RefFrame::Coo &coo) const
 Accesses an element without validity check on the element index. More...
 
constexpr float & at (const RefFrame::Coo &coo)
 Accesses an element with validity check on the element index. More...
 
constexpr const float & at (const RefFrame::Coo &coo) const
 Accesses an element with validity check on the element index. More...
 
- Public Member Functions inherited from Herd::ArrayForwarder< float, 3 >
constexpr ArrayForwarder ()=default
 
constexpr ArrayForwarder (std::array< _Tp, _Nm > arr)
 
void fill (const value_type &__u)
 
void swap (ArrayForwarder &__other) noexcept(noexcept(std::swap(std::declval< _Tp & >(), std::declval< _Tp & >())))
 
_GLIBCXX17_CONSTEXPR iterator begin () noexcept
 
_GLIBCXX17_CONSTEXPR const_iterator begin () const noexcept
 
_GLIBCXX17_CONSTEXPR iterator end () noexcept
 
_GLIBCXX17_CONSTEXPR const_iterator end () const noexcept
 
_GLIBCXX17_CONSTEXPR reverse_iterator rbegin () noexcept
 
_GLIBCXX17_CONSTEXPR const_reverse_iterator rbegin () const noexcept
 
_GLIBCXX17_CONSTEXPR reverse_iterator rend () noexcept
 
_GLIBCXX17_CONSTEXPR const_reverse_iterator rend () const noexcept
 
_GLIBCXX17_CONSTEXPR const_iterator cbegin () const noexcept
 
_GLIBCXX17_CONSTEXPR const_iterator cend () const noexcept
 
_GLIBCXX17_CONSTEXPR const_reverse_iterator crbegin () const noexcept
 
_GLIBCXX17_CONSTEXPR const_reverse_iterator crend () const noexcept
 
constexpr size_type size () const noexcept
 
constexpr size_type max_size () const noexcept
 
constexpr bool empty () const noexcept
 
_GLIBCXX17_CONSTEXPR reference operator[] (size_type __n) noexcept
 
constexpr const_reference operator[] (size_type __n) const noexcept
 
_GLIBCXX17_CONSTEXPR reference at (size_type __n)
 
constexpr const_reference at (size_type __n) const
 
_GLIBCXX17_CONSTEXPR reference front () noexcept
 
constexpr const_reference front () const noexcept
 
_GLIBCXX17_CONSTEXPR reference back () noexcept
 
constexpr const_reference back () const noexcept
 
_GLIBCXX17_CONSTEXPR pointer data () noexcept
 
_GLIBCXX17_CONSTEXPR const_pointer data () const noexcept
 

Private Attributes

CooArray< float > _res
 

Additional Inherited Members

- Public Types inherited from Herd::CooArray< float >
using BaseType = ArrayForwarder< float, 3 >
 
- Public Types inherited from Herd::ArrayForwarder< float, 3 >
typedef _Tp value_type
 
typedef value_typepointer
 
typedef value_typereference
 
typedef value_typeiterator
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
- Public Attributes inherited from Herd::ArrayForwarder< float, 3 >
const typedef value_typeconst_pointer
 
const typedef value_typeconst_reference
 
const typedef value_typeconst_iterator
 

Detailed Description

A class describing a physical point in the 3D space.

The PhysPoint class provides the coordinates and the resolution of a point in 3D space.

Constructor & Destructor Documentation

◆ PhysPoint() [1/3]

Herd::PhysPoint::PhysPoint ( )
inline

Default constructor.

Creates a physical point with undefined coordinates and resolution.

◆ PhysPoint() [2/3]

Herd::PhysPoint::PhysPoint ( float  xCoo,
float  yCoo,
float  zCoo,
float  resX = 0.,
float  resY = 0.,
float  resZ = 0. 
)
inline

Constructor.

Constructs a 3D point from its coordinates.

Parameters
xCooX coordinate.
yCooY coordinate.
zCooZ coordinate.
resXResolution on X coordinate.
resYResolution on Y coordinate.
resZResolution on Z coordinate.

◆ PhysPoint() [3/3]

Herd::PhysPoint::PhysPoint ( const Vec3D coo,
std::array< float, 3 >  res = {0., 0., 0.} 
)
inline

Array constructor.

Constructs a 3D point from its coordinates.

Parameters
coocoordinates.
resResolution on coordinates.

◆ ~PhysPoint()

virtual Herd::PhysPoint::~PhysPoint ( )
virtualdefault

Virtual destructor

Member Function Documentation

◆ ResAsArray()

CooArray<float> Herd::PhysPoint::ResAsArray ( ) const
inline

Returns the point resolution as array.

Returns
The resulting array.

◆ ResX()

float Herd::PhysPoint::ResX ( ) const
inline

Returns the resolution of the X coordinate of the point.

Returns
The X resolution (cm).

◆ ResY()

float Herd::PhysPoint::ResY ( ) const
inline

Returns the resolution of the Y coordinate of the point.

Returns
The Y resolution (cm).

◆ ResZ()

float Herd::PhysPoint::ResZ ( ) const
inline

Returns the resolution of the Z coordinate of the point.

Returns
The Z resolution (cm).

◆ SetResFromArray()

void Herd::PhysPoint::SetResFromArray ( const std::array< float, 3 >  res)
inline

Sets the resolution from array.

Parameters
resAn array with the resolution values along the three directions.

◆ SetResX()

void Herd::PhysPoint::SetResX ( float  resX)
inline

Sets the value of the X resolution.

Parameters
resXThe new X resolution (cm).

◆ SetResY()

void Herd::PhysPoint::SetResY ( float  resY)
inline

Sets the value of the Y resolution.

Parameters
resYThe new Y resolution (cm)

◆ SetResZ()

void Herd::PhysPoint::SetResZ ( float  resZ)
inline

Sets the value of the Z resolution.

Parameters
resZThe new Z resolution (cm).

Member Data Documentation

◆ _res

CooArray<float> Herd::PhysPoint::_res
private

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