aboutsummaryrefslogtreecommitdiff
path: root/src/Bounds.hh
blob: df7b9f387e45bb29ffeed8a2e22c9b847b50e278 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef __BOUNDS_HH_
#define __BOUNDS_HH_

struct Bounds {
  double min[3],max[3];
  void setFromExtents(double *p1,double *p2);
  void setFromOriginDx(double *origin,double *dx,int *dims);
  int contains(double point[3]);
  // uses restricted assumption that box is entirely inside or 
  // entirely outside its parent
  inline int contains(Bounds &b){
    if(contains(b.min) && contains(b.max)) return 1;
    else return 0;
  }
};

#endif