Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UniformGrid Class Reference

#include <KNN_Grid.h>

Inheritance diagram for UniformGrid:
Collaboration diagram for UniformGrid:

Public Types

typedef unsigned int index_t
 
typedef float coord_t
 
typedef NVec< 3, index_tIndex
 
typedef NVec< 3, coord_tVec
 
typedef unsigned int index_t
 
typedef float coord_t
 
typedef NVec< 3, index_tIndex
 
typedef NVec< 3, coord_tVec
 

Public Member Functions

 UniformGrid (index_t w, index_t h, index_t d)
 
void set_extent (const Point3D &m, const Point3D &M)
 
void get_cellsize (Point3D &c)
 
UniformGrid::Index compute_index (const Point3D &v)
 
 UniformGrid (index_t w, index_t h, index_t d)
 
void set_extent (const Point3D &m, const Point3D &M)
 
void get_cellsize (Point3D &c)
 
UniformGrid::Index compute_index (const Point3D &v)
 

Public Attributes

Index size
 
Point3D bb_min
 
Point3D bb_max
 
Point3D cellsize
 

Detailed Description

Definition at line 26 of file Rocon/include/KNN_Grid.h.

Member Typedef Documentation

typedef float coord_t

Definition at line 30 of file Rocon/include/KNN_Grid.h.

typedef float coord_t

Definition at line 30 of file Rocprop/include/KNN_Grid.h.

typedef NVec<3,index_t> Index

Definition at line 31 of file Rocprop/include/KNN_Grid.h.

typedef NVec<3,index_t> Index

Definition at line 31 of file Rocon/include/KNN_Grid.h.

typedef unsigned int index_t

Definition at line 29 of file Rocprop/include/KNN_Grid.h.

typedef unsigned int index_t

Definition at line 29 of file Rocon/include/KNN_Grid.h.

typedef NVec<3,coord_t> Vec

Definition at line 32 of file Rocprop/include/KNN_Grid.h.

typedef NVec<3,coord_t> Vec

Definition at line 32 of file Rocon/include/KNN_Grid.h.

Constructor & Destructor Documentation

UniformGrid ( index_t  w,
index_t  h,
index_t  d 
)
inline

Definition at line 37 of file Rocon/include/KNN_Grid.h.

37 { size = Index(w,h,d); }
const NT & d
NVec< 3, index_t > Index
UniformGrid ( index_t  w,
index_t  h,
index_t  d 
)
inline

Definition at line 37 of file Rocprop/include/KNN_Grid.h.

37 { size = Index(w,h,d); }
const NT & d
NVec< 3, index_t > Index

Member Function Documentation

UniformGrid::Index compute_index ( const Point3D v)
inline

Definition at line 51 of file Rocon/include/KNN_Grid.h.

References i, k, KNNDIM, and x.

52  {
54  for(int k=0; k<KNNDIM; k++)
55  {
56  int x = (int)floor(((v[k] - bb_min[k]) / cellsize[k]));
57  if (x <0)
58  i[k] = 0;
59  else
60  i[k] = x;
61  if( i[k] >= size[k])
62  {
63  i[k] = size[k]-1;
64  }
65  }
66  return i;
67  }
j indices k indices k
Definition: Indexing.h:6
const int KNNDIM
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
UniformGrid::Index compute_index ( const Point3D v)
inline

Definition at line 51 of file Rocprop/include/KNN_Grid.h.

References i, k, KNNDIM, and x.

52  {
54  for(int k=0; k<KNNDIM; k++)
55  {
56  int x = (int)floor(((v[k] - bb_min[k]) / cellsize[k]));
57  if (x <0)
58  i[k] = 0;
59  else
60  i[k] = x;
61  if( i[k] >= size[k])
62  {
63  i[k] = size[k]-1;
64  }
65  }
66  return i;
67  }
j indices k indices k
Definition: Indexing.h:6
const int KNNDIM
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
void get_cellsize ( Point3D c)
inline

Definition at line 49 of file Rocprop/include/KNN_Grid.h.

49 {c = cellsize;};
void get_cellsize ( Point3D c)
inline

Definition at line 49 of file Rocon/include/KNN_Grid.h.

49 {c = cellsize;};
void set_extent ( const Point3D m,
const Point3D M 
)
inline

Definition at line 39 of file Rocprop/include/KNN_Grid.h.

References k, and KNNDIM.

40  {
41  bb_min = m; bb_max = M;
42  cellsize = M - m;
43  for(int k=0; k<KNNDIM; k++)
44  {
45  cellsize[k] /= (float)(size[k]);
46  }
47  }
j indices k indices k
Definition: Indexing.h:6
const int KNNDIM
void set_extent ( const Point3D m,
const Point3D M 
)
inline

Definition at line 39 of file Rocon/include/KNN_Grid.h.

References k, and KNNDIM.

Referenced by KNN_Grid< Tri >::clear(), and KNN_Grid< Tri >::KNN_Grid().

40  {
41  bb_min = m; bb_max = M;
42  cellsize = M - m;
43  for(int k=0; k<KNNDIM; k++)
44  {
45  cellsize[k] /= (float)(size[k]);
46  }
47  }
j indices k indices k
Definition: Indexing.h:6
const int KNNDIM

Here is the caller graph for this function:

Member Data Documentation

Point3D bb_max

Definition at line 35 of file Rocon/include/KNN_Grid.h.

Point3D bb_min

Definition at line 35 of file Rocon/include/KNN_Grid.h.

Point3D cellsize

Definition at line 35 of file Rocon/include/KNN_Grid.h.

Index size

Definition at line 34 of file Rocon/include/KNN_Grid.h.


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