1 #ifndef rl_BasicRay_h_INCLUDED 2 #define rl_BasicRay_h_INCLUDED 31 #include <dvm3/dvm3.h> 32 #include <rl_basicray/rl_RayMath.h> 33 #include <Exception/Exception.h> 69 void init( dvm3_Vector
const& pos, dvm3_Vector
const& dir,
70 double energy,
long int id );
94 rl_BasicRay( dvm3_Vector
const& pos, dvm3_Vector
const& dir,
95 double energy,
long int id );
109 void set_id(
long int id );
162 dvm3_Vector
const&
position()
const;
220 dvm3_RotMat
const& rotmat );
232 dvm3_RotMat
const& rotmat );
243 std::ostream&
print_on( std::ostream& os,
char const prefix[] =
"",
244 char const postfix[] =
"" )
const;
280 double energy,
long int id )
281 : pos_(pos), dir_(dir), energy_(energy), id_(id)
287 : pos_(other.pos_), dir_(other.dir_), energy_(other.energy_), id_(other.id_)
292 init( dvm3_Vector
const& pos, dvm3_Vector
const& dir,
293 double energy,
long int id )
380 dvm3_RotMat
const& rotmat )
392 dvm3_RotMat
const& rotmat )
friend std::ostream & operator<<(std::ostream &os, rl_BasicRay const &)
Print the ray properties to an output stream.
std::ostream & print_on(std::ostream &os, char const prefix[]="", char const postfix[]="") const
Print the ray properties to an output stream.
virtual void derotate_detranslate(dvm3_Vector const &trans, dvm3_RotMat const &rotmat)
VIRTUAL: Derotate back to STD coordinates; detranslate back to STD origin.
dvm3_Vector & position()
Read/write access to current ray position.
dvm3_Vector dir_
ray direction vector (direction cosines)
dvm3_Vector & direction()
Read/write access to current ray direction vector.
static void derotate_detranslate(dvm3_Vector const &trans, dvm3_RotMat const &rotmat, dvm3_Vector &vector)
Rotate from BCS to STD coordinates, then translate back to original position.
dvm3_Vector pos_
ray position
static void translate_rotate(dvm3_Vector const &trans, dvm3_RotMat const &rotmat, dvm3_Vector &vector)
Translate to BCS origin, then rotate from STD to BCS coordinates.
long int id_
ray id number
static void derotate(dvm3_RotMat const &rotmat, dvm3_Vector &vector)
De-rotate vector from BCS coordinates back to STD coordinates.
A basic ray: encapsulates position and direction vectors, energy, and ray id.
rl_BasicRay()
Default constructor; constructs a ray in an INVALID state.
void init(dvm3_Vector const &pos, dvm3_Vector const &dir, double energy, long int id)
Initialize rl_BasicRay with ray initial position and direction vector, energy, and id number.
void project(double s)
Project a distance s along this ray.
double reflect_direction_vector(dvm3_Vector const &normal)
Reflect this ray's direction vector about a (surface) normal.
long int id() const
Read-only access to current ray id.
virtual ~rl_BasicRay()
A virtual do-nothing destructor.
static void rotate(dvm3_RotMat const &rotmat, dvm3_Vector &vector)
Rotate vector from STD coordinates to BCS coordinates.
virtual void translate_rotate(dvm3_Vector const &trans, dvm3_RotMat const &rotmat)
VIRTUAL: Translate to the BCS origin; rotate from STD to BCS coordinates.
double & energy()
Read/write access to current ray energy.
void set_id(long int id)
Reset ray id.