Ignore:
Timestamp:
02/19/07 02:51:22 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h

    r2070 r2124  
    7272  void Reduce(int axis, int right, float value);  
    7373   
     74  bool Intersects(const Vector3 &lStart, const Vector3 &lEnd) const; 
    7475 
    7576  // the size of the box along all the axes 
     
    9394  void Include(const int &axis, const float &newBound); 
    9495 
    95  
    96   int 
    97   Side(const Plane3 &plane) const; 
     96  int Side(const Plane3 &plane) const; 
    9897 
    9998  // Overlap returns 1 if the two axis-aligned boxes overlap .. even weakly 
     
    121120  bool Includes(const AxisAlignedBox3 &b) const; 
    122121 
     122  /** Returns true if this point is inside box. 
     123  */ 
    123124  virtual int IsInside(const Vector3 &v) const; 
    124125   
     126  /** Returns true if start and endpoint of the ray is inside box. 
     127  */ 
    125128  virtual int IsInside(const VssRay &v) const; 
    126129 
     
    203206  // Returns the intersection of two axis-aligned boxes. 
    204207  friend inline AxisAlignedBox3 Intersect(const AxisAlignedBox3 &x, 
    205                                 const AxisAlignedBox3 &y); 
     208                                                                                  const AxisAlignedBox3 &y); 
    206209 
    207210  // Given 4x4 matrix, transform the current box to new one. 
    208211  friend inline AxisAlignedBox3 Transform(const AxisAlignedBox3 &box, 
    209                                           const Matrix4x4 &tform); 
     212                                                                                  const Matrix4x4 &tform); 
    210213 
    211214   
    212215  // returns true when two boxes are completely equal 
    213   friend inline int operator== (const AxisAlignedBox3 &A, const AxisAlignedBox3 &B); 
     216  friend inline int operator== (const AxisAlignedBox3 &A,  
     217                                                                const AxisAlignedBox3 &B); 
    214218   
    215219  virtual float SurfaceArea() const; 
    216   virtual float GetVolume() const { 
    217     return (mMax.x - mMin.x) * (mMax.y - mMin.y) * (mMax.z - mMin.z); 
     220  virtual float GetVolume() const  
     221  { 
     222          return (mMax.x - mMin.x) * (mMax.y - mMin.y) * (mMax.z - mMin.z); 
    218223  } 
    219224 
    220225  // Six faces are distuinguished by their name. 
    221   enum EFaces { ID_Back = 0, ID_Left = 1, ID_Bottom = 2, ID_Front = 3, 
    222                 ID_Right = 4, ID_Top = 5}; 
    223    
    224   int 
    225   ComputeMinMaxT(const Vector3 &origin, 
    226                                  const Vector3 &direction, 
    227                                  float *tmin, 
    228                                  float *tmax) const; 
     226  enum EFaces {ID_Back = 0,  
     227                           ID_Left = 1,  
     228                           ID_Bottom = 2,  
     229                           ID_Front = 3, 
     230                           ID_Right = 4,  
     231                           ID_Top = 5}; 
     232   
     233  int  ComputeMinMaxT(const Vector3 &origin, 
     234                                          const Vector3 &direction, 
     235                                          float *tmin, 
     236                                          float *tmax) const; 
    229237         
    230238  // Compute tmin and tmax for a ray, whenever required .. need not pierce box 
     
    243251  // computes the signed distances for case: tmin < tmax and tmax > 0 
    244252  int GetMinMaxT(const Ray &ray, float *tmin, float *tmax, 
    245                 EFaces &entryFace, EFaces &exitFace) const; 
     253                                EFaces &entryFace, EFaces &exitFace) const; 
    246254   
    247255  // Writes a brief description of the object, indenting by the given 
Note: See TracChangeset for help on using the changeset viewer.