NuKDPt< D > Class Template Reference

Represents a point in D dimensional space. More...

#include <NuKDTree.h>

List of all members.

Public Member Functions

 NuKDPt ()
 Leaves fCoord uninitialized.
 NuKDPt (float c0,...)
float & operator[] (unsigned int d)
float operator[] (unsigned int d) const

Protected Attributes

float fCoord [D]

Detailed Description

template<unsigned int D>
class NuKDPt< D >

Represents a point in D dimensional space.

Must be initialized with floats/doubles, due to lack of typechecking

Definition at line 21 of file NuKDTree.h.


Constructor & Destructor Documentation

template<unsigned int D>
NuKDPt< D >::NuKDPt (  )  [inline]

Leaves fCoord uninitialized.

Definition at line 25 of file NuKDTree.h.

00025 {}

template<unsigned int D>
NuKDPt< D >::NuKDPt ( float  c0,
  ... 
) [inline]

Definition at line 26 of file NuKDTree.h.

References ap, and NuKDPt< D >::fCoord.

00027   {
00028     fCoord[0] = c0; // Need to do the first one by hand
00029     if(D > 1){
00030       va_list ap;
00031       va_start(ap, c0); // because va_start needs to see a required argument
00032       for(unsigned int d = 1; d < D; ++d){
00033         fCoord[d] = va_arg(ap, double);
00034       }
00035       va_end(ap);
00036     }
00037   }


Member Function Documentation

template<unsigned int D>
float NuKDPt< D >::operator[] ( unsigned int  d  )  const [inline]

Definition at line 39 of file NuKDTree.h.

References NuKDPt< D >::fCoord.

00039 {return fCoord[d];}

template<unsigned int D>
float& NuKDPt< D >::operator[] ( unsigned int  d  )  [inline]

Definition at line 38 of file NuKDTree.h.

References NuKDPt< D >::fCoord.

00038 {return fCoord[d];}


Member Data Documentation

template<unsigned int D>
float NuKDPt< D >::fCoord[D] [protected]

Definition at line 42 of file NuKDTree.h.

Referenced by NuKDPt< D >::NuKDPt(), and NuKDPt< D >::operator[]().


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

Generated on 13 Dec 2018 for loon by  doxygen 1.6.1