The rl struct for handling each ray. More...
Public Member Functions | |
RayRecord () | |
default constructor - sets all members to zero | |
RayRecord (const Point &origin, const Vector &dir, RayType type, const void *data=NULL, size_t nbytes=0) | |
sets all location members to zero, and all other members as requested | |
RayRecord (const RayRecord &r) | |
copies the given RayRecord | |
~RayRecord () | |
deletes dynamically allocated memory if it has been allocated | |
RayRecord & | operator= (const RayRecord &) |
copies the given RayRecord | |
void | changeData (const void *, size_t) |
Public Attributes | |
Point | origin |
the origin of the ray | |
Vector | distance |
the directed distance: see details | |
RayType | type |
the ray's type | |
void * | data |
pointer to ray data | |
size_t | nbytes |
size of ray data | |
uint | depth |
depth of the ray: the head ray is at depth 0 | |
uint | parent |
the index of the ray's parent: the head ray has parent -1 | |
uint | child |
the index of the ray's first child: if it does not have one, -1 | |
uint | next |
the index of the next ray: -1 if absent | |
uint | prev |
the index of the previous ray: -1 if absent |
The rl struct for handling each ray.
rl::RayLogger uses RayRecord to store the data for each ray and how to navigate from one ray to the next.
default constructor - sets all members to zero
rl::RayRecord::RayRecord | ( | const Point & | origin, |
const Vector & | dir, | ||
RayType | type, | ||
const void * | data = NULL , |
||
size_t | nbytes = 0 |
||
) |
sets all location members to zero, and all other members as requested
References changeData(), and data.
rl::RayRecord::RayRecord | ( | const RayRecord & | r | ) |
copies the given RayRecord
References changeData(), data, and nbytes.
deletes dynamically allocated memory if it has been allocated
References data.
void rl::RayRecord::changeData | ( | const void * | data_, |
size_t | nbytes_ | ||
) |
Referenced by operator=(), and RayRecord().
uint rl::RayRecord::child |
the index of the ray's first child: if it does not have one, -1
Referenced by rl::RayLogger::addRay(), rl::RayLogger::endForest(), rl::RayLogger::GetRayRecord(), rl::operator<<(), operator=(), and rl::RayLogger::readRay().
void* rl::RayRecord::data |
pointer to ray data
Referenced by changeData(), rl::RayLogger::endForest(), rl::operator<<(), operator=(), RayRecord(), rl::RayLogger::readRay(), and ~RayRecord().
uint rl::RayRecord::depth |
depth of the ray: the head ray is at depth 0
Referenced by rl::RayLogger::addRay(), rl::RayLogger::GetRayRecord(), rl::operator<<(), operator=(), and rl::RayLogger::readRay().
Vector rl::RayRecord::distance |
the directed distance: see details
If the length of the ray is non-infinite, this stores direction times distance. Otherwise, the x and y coordinates are components of the normalized ray and the z coordinate is infinity * sign(normalized z). This makes the disk representation of the ray record smaller while retaining directional data on infinite-length rays.
Referenced by rl::RayLogger::endForest(), rl::operator<<(), operator=(), and rl::RayLogger::readRay().
size_t rl::RayRecord::nbytes |
size of ray data
Referenced by changeData(), rl::RayLogger::endForest(), rl::operator<<(), operator=(), RayRecord(), and rl::RayLogger::readRay().
uint rl::RayRecord::next |
the index of the next ray: -1 if absent
Referenced by rl::RayLogger::addRay(), rl::RayLogger::GetRayRecord(), rl::operator<<(), operator=(), and rl::RayLogger::readRay().
Point rl::RayRecord::origin |
the origin of the ray
Referenced by rl::operator<<(), operator=(), and rl::RayLogger::readRay().
the index of the ray's parent: the head ray has parent -1
Referenced by rl::RayLogger::addRay(), rl::RayLogger::GetRayRecord(), rl::operator<<(), operator=(), and rl::RayLogger::readRay().
uint rl::RayRecord::prev |
the index of the previous ray: -1 if absent
Referenced by rl::RayLogger::addRay(), rl::RayLogger::GetRayRecord(), rl::operator<<(), operator=(), and rl::RayLogger::readRay().
the ray's type
Referenced by rl::RayLogger::endForest(), rl::operator<<(), operator=(), and rl::RayLogger::readRay().