PDBox Class Reference

#include <pDomain.h>

Inheritance diagram for PDBox:

Inheritance graph
[legend]
Collaboration diagram for PDBox:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 PDBox (const pVec &e0, const pVec &e1)
 ~PDBox ()
bool Within (const pVec &pos) const
pVec Generate () const
pDomaincopy () const

Public Attributes

pVec p0
pVec p1
pVec dif


Detailed Description

Definition at line 229 of file pDomain.h.


Constructor & Destructor Documentation

PDBox::PDBox ( const pVec e0,
const pVec e1 
) [inline]

Definition at line 236 of file pDomain.h.

References dif, p0, p1, pVec::x(), pVec::y(), and pVec::z().

Referenced by copy().

00237     {
00238         p0 = e0;
00239         p1 = e1;
00240         if(e1.x() < e0.x()) { p0.x() = e1.x(); p1.x() = e1.x(); }
00241         if(e1.y() < e0.y()) { p0.y() = e1.y(); p1.y() = e1.y(); }
00242         if(e1.z() < e0.z()) { p0.z() = e1.z(); p1.z() = e1.z(); }
00243 
00244         dif = p1 - p0;
00245     }

Here is the call graph for this function:

Here is the caller graph for this function:

PDBox::~PDBox (  )  [inline]

Definition at line 247 of file pDomain.h.

00248     {
00249     }


Member Function Documentation

bool PDBox::Within ( const pVec pos  )  const [inline, virtual]

Implements pDomain.

Definition at line 251 of file pDomain.h.

References p0, p1, pVec::x(), pVec::y(), and pVec::z().

00252     {
00253         return !((pos.x() < p0.x()) || (pos.x() > p1.x()) ||
00254                  (pos.y() < p0.y()) || (pos.y() > p1.y()) ||
00255                  (pos.z() < p0.z()) || (pos.z() > p1.z()));
00256     }

Here is the call graph for this function:

pVec PDBox::Generate (  )  const [inline, virtual]

Implements pDomain.

Definition at line 258 of file pDomain.h.

References dif, p0, and pRandVec().

00259     {
00260         // Scale and translate [0,1] random to fit box
00261         return p0 + CompMult(pRandVec(), dif);
00262     }

Here is the call graph for this function:

pDomain* PDBox::copy (  )  const [inline, virtual]

Implements pDomain.

Definition at line 264 of file pDomain.h.

References PDBox().

00265     {
00266         PDBox *P = new PDBox(*this);
00267         return P;
00268     }

Here is the call graph for this function:


Member Data Documentation

pVec PDBox::p0

Definition at line 233 of file pDomain.h.

Referenced by Generate(), PDBox(), and Within().

pVec PDBox::p1

Definition at line 233 of file pDomain.h.

Referenced by PDBox(), and Within().

pVec PDBox::dif

Definition at line 233 of file pDomain.h.

Referenced by Generate(), and PDBox().


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:51:38 2008 for Armagetron Advanced by  doxygen 1.5.4