MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
Point< DIM > Struct Template Reference

#include <pointbox.h>

Inheritance diagram for Point< DIM >:
[legend]

Public Member Functions

 Point (const Point &p)
 
Pointoperator= (const Point &p)
 
MBool operator== (const Point &p) const
 
 Point (MFloat x0=0.0, MFloat x1=0.0, MFloat x2=0.0, MInt id=-1)
 

Public Attributes

MFloat x [DIM] {}
 
MInt cellId
 

Detailed Description

template<MInt DIM>
struct Point< DIM >

Needed for building a K-D-tree Numercial Recipies in C: The Art of Scientific Computing Thrid Edition Authors:

Definition at line 20 of file pointbox.h.

Constructor & Destructor Documentation

◆ Point() [1/2]

template<MInt DIM>
Point< DIM >::Point ( const Point< DIM > &  p)
inline

Definition at line 23 of file pointbox.h.

23 {
24 for(MInt i = 0; i < DIM; i++)
25 x[i] = p.x[i];
26 cellId = p.cellId;
27 }
int32_t MInt
Definition: maiatypes.h:62
constexpr std::underlying_type< FcCell >::type p(const FcCell property)
Converts property name to underlying integer value.
MFloat x[DIM]
Definition: pointbox.h:21
MInt cellId
Definition: pointbox.h:22

◆ Point() [2/2]

template<MInt DIM>
Point< DIM >::Point ( MFloat  x0 = 0.0,
MFloat  x1 = 0.0,
MFloat  x2 = 0.0,
MInt  id = -1 
)
inlineexplicit

Definition at line 39 of file pointbox.h.

39 {
40 x[0] = x0;
41 cellId = id;
42 if(DIM > 1) x[1] = x1;
43 if(DIM > 2) x[2] = x2;
44 // if (DIM > 3) throw("Point not implemented for DIM > 3");
45 }
MInt id
Definition: maiatypes.h:71

Member Function Documentation

◆ operator=()

template<MInt DIM>
Point & Point< DIM >::operator= ( const Point< DIM > &  p)
inline

Definition at line 28 of file pointbox.h.

28 {
29 for(MInt i = 0; i < DIM; i++)
30 x[i] = p.x[i];
31 cellId = p.cellId;
32 return *this;
33 }

◆ operator==()

template<MInt DIM>
MBool Point< DIM >::operator== ( const Point< DIM > &  p) const
inline

Definition at line 34 of file pointbox.h.

34 {
35 for(MInt i = 0; i < DIM; i++)
36 if(x[i] != p.x[i]) return false;
37 return true;
38 }

Member Data Documentation

◆ cellId

template<MInt DIM>
MInt Point< DIM >::cellId

Definition at line 22 of file pointbox.h.

◆ x

template<MInt DIM>
MFloat Point< DIM >::x[DIM] {}

Definition at line 21 of file pointbox.h.


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