rl_BasicRay Class Reference

#include <rl_BasicRay.h>

List of all members.

Public Member Functions

virtual ~rl_BasicRay ()
 A virtual do-nothing destructor.
 rl_BasicRay ()
 rl_BasicRay (dvm3_Vector const &pos, dvm3_Vector const &dir, double energy, long int id)
 rl_BasicRay (rl_BasicRay const &other)
void set_id (long int id)
long int id () const
double & energy ()
double energy () const
double & position (int i)
double position (int i) const
dvm3_Vector & position ()
dvm3_Vector const & position () const
double & direction (int i)
double direction (int i) const
dvm3_Vector & direction ()
dvm3_Vector const & direction () const
double reflect_direction_vector (dvm3_Vector const &normal)
void project (double s)
virtual void translate_rotate (dvm3_Vector const &trans, dvm3_RotMat const &rotmat)
virtual void derotate_detranslate (dvm3_Vector const &trans, dvm3_RotMat const &rotmat)
std::ostream & print_on (std::ostream &os, char const prefix[]="", char const postfix[]="") const

Protected Member Functions

void init (dvm3_Vector const &pos, dvm3_Vector const &dir, double energy, long int id)

Protected Attributes

dvm3_Vector pos_
 ray position
dvm3_Vector dir_
 ray direction vector (direction cosines)
double energy_
 ray energy
long int id_
 ray id number

Friends

std::ostream & operator<< (std::ostream &os, rl_BasicRay const &)


Detailed Description

A basic ray: encapsulates position and direction vectors, energy, and ray id.

Definition at line 47 of file rl_BasicRay.h.


Constructor & Destructor Documentation

rl_BasicRay::~rl_BasicRay (  )  [virtual]

A virtual do-nothing destructor.

Definition at line 41 of file rl_BasicRay.cc.

rl_BasicRay::rl_BasicRay (  )  [inline]

Default constructor; constructs a ray in an INVALID state. Use init to initialize the fields.

Definition at line 274 of file rl_BasicRay.h.

rl_BasicRay::rl_BasicRay ( dvm3_Vector const &  pos,
dvm3_Vector const &  dir,
double  energy,
long int  id 
) [inline]

Constructor. Construct an rl_BasicRay from ray initial position and direction vector, energy, and id number.

Parameters:
pos ray initial position.
dir ray initial direction unit vector.
energy ray energy, in keV.
id ray id.

Definition at line 279 of file rl_BasicRay.h.

rl_BasicRay::rl_BasicRay ( rl_BasicRay const &  other  )  [inline]

Copy constructor

Parameters:
other ray to be copied.

Definition at line 286 of file rl_BasicRay.h.


Member Function Documentation

void rl_BasicRay::init ( dvm3_Vector const &  pos,
dvm3_Vector const &  dir,
double  energy,
long int  id 
) [inline, protected]

Initialize rl_BasicRay with ray initial position and direction vector, energy, and id number

Parameters:
pos ray position vector
dir ray direction vector
energy ray energy
id ray id number

Definition at line 292 of file rl_BasicRay.h.

References dir_, energy_, id_, and pos_.

void rl_BasicRay::set_id ( long int  id  )  [inline]

Reset ray id

Parameters:
id new id value.

Definition at line 310 of file rl_BasicRay.h.

References id_.

long int rl_BasicRay::id (  )  const [inline]

Read-only access to current ray id

Returns:
ray id number

Definition at line 306 of file rl_BasicRay.h.

References id_.

double & rl_BasicRay::energy (  )  [inline]

Read/write access to current ray energy

Returns:
a reference to the ray energy

Definition at line 315 of file rl_BasicRay.h.

References energy_.

double rl_BasicRay::energy (  )  const [inline]

Read-only access to current ray position

Returns:
the ray energy

Definition at line 320 of file rl_BasicRay.h.

References energy_.

double & rl_BasicRay::position ( int  i  )  [inline]

Read/write access to component i of current ray position

Parameters:
i index.
Returns:
a reference to the i component of the position vector.

Definition at line 325 of file rl_BasicRay.h.

References pos_.

double rl_BasicRay::position ( int  i  )  const [inline]

Read-only access to component i of current ray position

Parameters:
i index.
Returns:
the i component of the position vector.

Definition at line 330 of file rl_BasicRay.h.

References pos_.

dvm3_Vector & rl_BasicRay::position (  )  [inline]

Read/write access to current ray position

Returns:
a reference to the position vector dvm3_Vector.

Definition at line 335 of file rl_BasicRay.h.

References pos_.

dvm3_Vector const & rl_BasicRay::position (  )  const [inline]

Read-only access to current ray position

Returns:
a const reference to the position vector dvm3_Vector

Definition at line 340 of file rl_BasicRay.h.

References pos_.

double & rl_BasicRay::direction ( int  i  )  [inline]

Read/write access to component i of current ray direction

Parameters:
i index.

Definition at line 345 of file rl_BasicRay.h.

References dir_.

double rl_BasicRay::direction ( int  i  )  const [inline]

Read-only access to component i of current ray direction

Parameters:
i index.
Returns:
component i of the position vector.

Definition at line 350 of file rl_BasicRay.h.

References dir_.

dvm3_Vector & rl_BasicRay::direction (  )  [inline]

Read/write access to current ray direction vector

Returns:
reference to current ray direction vector dvm3_Vector

Definition at line 355 of file rl_BasicRay.h.

References dir_.

dvm3_Vector const & rl_BasicRay::direction (  )  const [inline]

Read-only access to current ray direction vector

Returns:
const reference to current ray direction vector dvm3_Vector

Definition at line 360 of file rl_BasicRay.h.

References dir_.

double rl_BasicRay::reflect_direction_vector ( dvm3_Vector const &  normal  ) 

Reflect this ray's direction vector about a (surface) normal

Parameters:
normal - surface normal unit vector to be used in reflecting this rl_BasicRay.
Returns:
sine of the graze angle between the ray and the surface

Definition at line 52 of file rl_BasicRay.cc.

References dir_.

void rl_BasicRay::project ( double  s  )  [inline]

Project a distance s along this ray

Parameters:
s distance to project the ray.

Definition at line 369 of file rl_BasicRay.h.

References dir_, and pos_.

void rl_BasicRay::translate_rotate ( dvm3_Vector const &  trans,
dvm3_RotMat const &  rotmat 
) [inline, virtual]

VIRTUAL: Translate to the BCS origin; rotate from STD to BCS coordinates

Parameters:
trans translation vector.
rotmat rotation matrix to be applied. rotmat specifies a rotation from std to bcs.

Definition at line 379 of file rl_BasicRay.h.

References dir_, pos_, rl_RayMath::rotate(), and rl_RayMath::translate_rotate().

void rl_BasicRay::derotate_detranslate ( dvm3_Vector const &  trans,
dvm3_RotMat const &  rotmat 
) [inline, virtual]

VIRTUAL: Derotate back to STD coordinates; detranslate back to STD origin

Parameters:
trans translation vector.
rotmat rotation matrix to be applied. rotmat specifies a rotation from std to bcs; the inverse of rotmat is applied to the ray.

Definition at line 391 of file rl_BasicRay.h.

References rl_RayMath::derotate(), rl_RayMath::derotate_detranslate(), dir_, and pos_.

std::ostream& rl_BasicRay::print_on ( std::ostream &  os,
char const  prefix[] = "",
char const  postfix[] = "" 
) const

Print the ray properties to an output stream.

Parameters:
os output stream.
prefix an optional prefix string.
postfix an optional postfix string.
Returns:
output stream


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
rl_BasicRay const &   
) [friend]

Print the ray properties to an output stream.

Parameters:
os output stream.
Returns:
output stream


Member Data Documentation

dvm3_Vector rl_BasicRay::pos_ [protected]

ray position

Definition at line 52 of file rl_BasicRay.h.

Referenced by derotate_detranslate(), init(), position(), project(), and translate_rotate().

dvm3_Vector rl_BasicRay::dir_ [protected]

ray direction vector (direction cosines)

Definition at line 54 of file rl_BasicRay.h.

Referenced by derotate_detranslate(), direction(), init(), project(), reflect_direction_vector(), and translate_rotate().

double rl_BasicRay::energy_ [protected]

ray energy

Definition at line 56 of file rl_BasicRay.h.

Referenced by energy(), and init().

long int rl_BasicRay::id_ [protected]

ray id number

Definition at line 58 of file rl_BasicRay.h.

Referenced by id(), init(), and set_id().


The documentation for this class was generated from the following files:
Generated on Fri Jun 27 15:52:40 2008 for rl_basicray by  doxygen 1.5.1