Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
Render geometric classes.

Classes related to computer graphics and rendering process. More...

Classes

class  Bial::Vector3D
 The Vector3D class is a Geometric representation of a vector direction in 3D space. More...
 
class  Bial::Point3D
 The Point3D class is a Geometric representation of a point in 3D space.
A point is a zero­dimensional location in 3D space. More...
 
class  Bial::Normal
 The Normal class is the geometric representation of a Normal in 3D space.
A surface normal (or just normal) is a vector that is perpendicular to a surface at a particular position.
It can be defined as the cross product of any two nonparallel vectors that are tangent to the surface at a point.
The implementations of Normal3D and Vector3D are very similar. Like vectors, normals are represented by three floats x, y, and z;
they can be added and subtracted to compute new normals; and they can be scaled and normalized.
However, a normal cannot be added to a point, and one cannot take the cross product of two normals. More...
 
class  Bial::Ray
 The Ray class is a mathematic representation of a light ray.
A ray is a semi­infinite line specified by its origin and direction. More...
 
class  Bial::BBox
 The BBox class is a Bounding Box with 8 vertices, and can be represented by 2 points (6coordinates). More...
 
class  Bial::Transform3D
 The Transform3D class holds affine matrices and is used to apply geometric transformations over cartesian coordinates.
The affine transformation multiplies the coordinates vector to the affine matrix. More...
 
class  Bial::DifferentialGeometry
 The DifferentialGeometry class is a parametric representation of the Shape geometry. More...
 
class  Bial::FastTransform
 

Functions

double Bial::Lerp (double t, double v1, double v2)
 Simple linear interpolation. More...
 
Vector3D Bial::operator* (double s, const Vector3D &vec)
 
Point3D Bial::operator* (double s, const Point3D &p)
 
Normal Bial::operator* (double s, const Normal &norm)
 
double Bial::Dot (const Vector3D &v1, const Vector3D &v2)
 
double Bial::Dot (const Normal &n1, const Normal &n2)
 
double Bial::Dot (const Normal &n1, const Vector3D &v2)
 
double Bial::Dot (const Vector3D &v1, const Normal &n2)
 
double Bial::AbsDot (const Vector3D &v1, const Vector3D &v2)
 
double Bial::AbsDot (const Normal &n1, const Normal &n2)
 
double Bial::AbsDot (const Normal &n1, const Vector3D &v2)
 
double Bial::AbsDot (const Vector3D &v1, const Normal &n2)
 
Vector3D Bial::Cross (const Vector3D &v1, const Vector3D &v2)
 
void Bial::CoordinateSystem (const Vector3D &v1, Vector3D *v2, Vector3D *v3)
 
double Bial::Distance (const Point3D &p1, const Point3D &p2)
 
double Bial::DistanceSquared (const Point3D &p1, const Point3D &p2)
 
Normal Bial::FaceForward (const Normal &n, const Vector3D &v)
 
template<class O >
O & Bial::operator<< (O &os, const Vector3D &vec)
 
template<class O >
O & Bial::operator<< (O &os, const Point3D &pt)
 
template<class O >
O & Bial::operator<< (O &os, const Normal &norm)
 
template<class O >
O & Bial::operator<< (O &os, const Ray &ray)
 
template<class O >
O & Bial::operator<< (O &os, const BBox &box)
 
template<class O >
O & Bial::operator<< (O &os, const Transform3D &tr)
 

Detailed Description

Classes related to computer graphics and rendering process.


Class Documentation

class Bial::Vector3D

The Vector3D class is a Geometric representation of a vector direction in 3D space.

Date
2015/Aug/21

Definition at line 44 of file Geometrics.hpp.

Collaboration diagram for Bial::Vector3D:
Collaboration graph

Public Member Functions

 Vector3D ()
 
 Vector3D (double xx, double yy, double zz)
 Vector3D constructor. More...
 
 Vector3D (const Normal &norm)
 Conversion from Normal to Vector3D. More...
 
bool HasNaNs () const
 HasNaNs returns if the any of the components is'nt a valid number. return none. More...
 
bool operator== (const Vector3D &vec) const
 Returns if the components match. More...
 
bool operator!= (const Vector3D &vec) const
 Returns if the components do not match. More...
 
Vector3D operator+ (const Vector3D &vec) const
 Add operation, the vector components are added. More...
 
Vector3Doperator+= (const Vector3D &vec)
 Add operation, the vector components are added. More...
 
Vector3D operator- (const Vector3D &vec) const
 Subtract operation, the vector components are subtracted. More...
 
Vector3Doperator-= (const Vector3D &vec)
 Subtract operation, the vector components are subtracted. More...
 
Vector3D operator* (double s) const
 Multiply operation, the vector components are multiplied to a scalar value. More...
 
Vector3Doperator*= (double s)
 Multiply operation, the vector components are multiplied to a scalar value. More...
 
Vector3D operator/ (double s) const
 Division operation, the vector components are divided by s. More...
 
Vector3Doperator/= (double s)
 Division operation, the vector components are divided by s. More...
 
Vector3D operator- () const
 Returns the vector inverse. More...
 
double operator[] (int i) const
 Gives the option to loop over the components of a vector. More...
 
double & operator[] (int i)
 Gives the option to loop over the components of a vector. More...
 
double LengthSquared () const
 Returns the length of a vector.
Given a vector $ \vec{v} = (x,y,z) $, this function returns $||\vec{v}|| = \sqrt{x*x+y*y+z*z} $. More...
 
double Length () const
 Returns the squared length of a vector.
Given a vector $ \vec{v} = (x,y,z) $, this function returns $ ||\vec{v}||^2 = {x*x+y*y+z*z} $. More...
 
Vector3D Normalized () const
 Returns the normalized vector.
Given a vector $ \vec{v} = (x,y,z) $, this function returns $ \frac{\vec{v}}{||\vec{v}||^2} $. return none. More...
 
Point3D toPoint () const
 Conversion from Vector3D to Point3D. More...
 

Static Public Member Functions

template<class D >
static Vector3D fromVector (const Vector< D > vec)
 Conversion from Bial::Vector to Vector3D. More...
 

Public Attributes

double x
 
double y
 Vector direction in y. More...
 
double z
 Vector direction in z. More...
 

Constructor & Destructor Documentation

Bial::Vector3D::Vector3D ( )
Bial::Vector3D::Vector3D ( double  xx,
double  yy,
double  zz 
)
explicit

Vector3D constructor.

Date
2015/Aug/21
Parameters
xxVector direction in x.
yyVector direction in y.
zzVector direction in z.
Warning
Throws if has NaN parameter.
Bial::Vector3D::Vector3D ( const Normal norm)
explicit

Conversion from Normal to Vector3D.

Date
2015/Aug/21
Parameters
norminput normal.

Member Function Documentation

template<class D >
Vector3D Bial::Vector3D::fromVector ( const Vector< D >  vec)
inlinestatic

Conversion from Bial::Vector to Vector3D.

Date
2015/Aug/21
Parameters
Inputvector.
Returns
Result vector.

Definition at line 976 of file Geometrics.hpp.

bool Bial::Vector3D::HasNaNs ( ) const

HasNaNs returns if the any of the components is'nt a valid number. return none.

Date
2015/Aug/21
double Bial::Vector3D::Length ( ) const

Returns the squared length of a vector.
Given a vector $ \vec{v} = (x,y,z) $, this function returns $ ||\vec{v}||^2 = {x*x+y*y+z*z} $.

Date
2015/Aug/21
Returns
The squared length of a vector.
double Bial::Vector3D::LengthSquared ( ) const

Returns the length of a vector.
Given a vector $ \vec{v} = (x,y,z) $, this function returns $||\vec{v}|| = \sqrt{x*x+y*y+z*z} $.

Date
2015/Aug/21
Returns
The length of a vector.
Vector3D Bial::Vector3D::Normalized ( ) const

Returns the normalized vector.
Given a vector $ \vec{v} = (x,y,z) $, this function returns $ \frac{\vec{v}}{||\vec{v}||^2} $. return none.

Date
2015/Aug/21
bool Bial::Vector3D::operator!= ( const Vector3D vec) const

Returns if the components do not match.

Date
2015/Aug/21
Parameters
vecInput vector to be compared. return none.
Vector3D Bial::Vector3D::operator* ( double  s) const

Multiply operation, the vector components are multiplied to a scalar value.

Date
2015/Aug/21
Parameters
sA scalar value to be multiplied.
Returns
Result vector.
Vector3D& Bial::Vector3D::operator*= ( double  s)

Multiply operation, the vector components are multiplied to a scalar value.

Date
2015/Aug/21
Parameters
sA scalar value to be multiplied.
Returns
Reference to 'this' vector.
Vector3D Bial::Vector3D::operator+ ( const Vector3D vec) const

Add operation, the vector components are added.

Date
2015/Aug/21
Parameters
vecInput vector to be compared.
Warning
Throws if has NaNs.
Returns
Result vector.
Vector3D& Bial::Vector3D::operator+= ( const Vector3D vec)

Add operation, the vector components are added.

Date
2015/Aug/21
Parameters
vecInput vector
Returns
Reference to 'this' vector.
Vector3D Bial::Vector3D::operator- ( const Vector3D vec) const

Subtract operation, the vector components are subtracted.

Date
2015/Aug/21
Parameters
vecInput vector
Returns
Result vector.
Vector3D Bial::Vector3D::operator- ( ) const

Returns the vector inverse.

Date
2015/Aug/21
Returns
Result vector.
Vector3D& Bial::Vector3D::operator-= ( const Vector3D vec)

Subtract operation, the vector components are subtracted.

Date
2015/Aug/21
Parameters
vecInput vector
Returns
Reference to 'this' vector.
Vector3D Bial::Vector3D::operator/ ( double  s) const

Division operation, the vector components are divided by s.

Date
2015/Aug/21
Parameters
sA scalar denominator.
Returns
Result vector.
Vector3D& Bial::Vector3D::operator/= ( double  s)

Division operation, the vector components are divided by s.

Date
2015/Aug/21
Parameters
sA scalar denominator.
Returns
Reference to 'this' vector.
bool Bial::Vector3D::operator== ( const Vector3D vec) const

Returns if the components match.

Date
2015/Aug/21
Parameters
vecInput vector return none.
double Bial::Vector3D::operator[] ( int  i) const

Gives the option to loop over the components of a vector.

Date
2015/Aug/21
Parameters
iis the component index ( 0 for x, 1 for y, and 2 for z )
Returns
Vector component value at index i.
Warning
Throws if i < 0 or i > 2
double& Bial::Vector3D::operator[] ( int  i)

Gives the option to loop over the components of a vector.

Date
2015/Aug/21
Parameters
iis the component index ( 0 for x, 1 for y, and 2 for z )
Returns
Vector component value at index i.
Warning
Throws if i < 0 or i > 2
Point3D Bial::Vector3D::toPoint ( ) const

Conversion from Vector3D to Point3D.

Date
2015/Aug/21
Returns
Result point.

Member Data Documentation

double Bial::Vector3D::x

Definition at line 49 of file Geometrics.hpp.

double Bial::Vector3D::y

Vector direction in y.

Definition at line 51 of file Geometrics.hpp.

double Bial::Vector3D::z

Vector direction in z.

Definition at line 53 of file Geometrics.hpp.

class Bial::Point3D

The Point3D class is a Geometric representation of a point in 3D space.
A point is a zero­dimensional location in 3D space.

Date
2015/Aug/21

Definition at line 218 of file Geometrics.hpp.

Collaboration diagram for Bial::Point3D:
Collaboration graph

Public Member Functions

 Point3D ()
 
 Point3D (double xx, double yy, double zz)
 Point3D constructor. More...
 
bool HasNaNs () const
 HasNaNs returns if the any of the components is'nt a valid number. return none. More...
 
bool operator== (const Point3D &p) const
 Returns if the positions match. More...
 
bool operator!= (const Point3D &p) const
 Returns if the positions do not match. More...
 
Point3D operator+ (const Vector3D &vec) const
 Add operation, the point position is added to the vector components. More...
 
Point3Doperator+= (const Vector3D &vec)
 Add operation, the point position is added to the vector components. More...
 
Vector3D operator- (const Point3D &p) const
 Subtract operation, the point positions are subtracted, generating a Vector3D. More...
 
Vector3D operator- (const Vector3D &vec) const
 Subtract operation, the point position is subtracted to the vector components, generating a Vector3D. More...
 
Point3Doperator-= (const Vector3D &vec)
 Subtract operation, the point position is subtracted to the vector components. More...
 
Point3Doperator+= (const Point3D &p)
 Add operation, the points positions are added. More...
 
Point3D operator+ (const Point3D &p) const
 Add operation, the points positions are added. More...
 
Point3D operator* (double f) const
 Multiply operation, the point position components are multiplied to a scalar value. More...
 
Point3Doperator*= (double f)
 Multiply operation, the point position components are multiplied to a scalar value. More...
 
Point3D operator/ (double f) const
 Division operation, the point position components are divided by s. More...
 
Point3Doperator/= (double f)
 Division operation, the point position components are divided by s. More...
 
double operator[] (int i) const
 Gives the option to loop over the components of the point position. More...
 
double & operator[] (int i)
 Gives the option to loop over the components of the point position. More...
 
Vector3D toVector () const
 Conversion from Point3D to Vector3D. More...
 
bool operator< (const Point3D &p) const
 Simple function used in sorting algoritms. More...
 
bool operator> (const Point3D &p) const
 Simple function used in sorting algoritms. More...
 

Public Attributes

double x
 
double y
 Point position in y. More...
 
double z
 Point position in z. More...
 

Constructor & Destructor Documentation

Bial::Point3D::Point3D ( )
Bial::Point3D::Point3D ( double  xx,
double  yy,
double  zz 
)
explicit

Point3D constructor.

Date
2015/Aug/21
Parameters
xxPoint direction in x.
yyPoint direction in y.
zzPoint direction in z.
Warning
Throws if has NaNs.

Member Function Documentation

bool Bial::Point3D::HasNaNs ( ) const

HasNaNs returns if the any of the components is'nt a valid number. return none.

Date
2015/Aug/21
bool Bial::Point3D::operator!= ( const Point3D p) const

Returns if the positions do not match.

Date
2015/Aug/21
Parameters
pInput point to be compared. return none.
Point3D Bial::Point3D::operator* ( double  f) const

Multiply operation, the point position components are multiplied to a scalar value.

Date
2015/Aug/21
Parameters
fA scalar value to be multiplied.
Returns
Result point.
Point3D& Bial::Point3D::operator*= ( double  f)

Multiply operation, the point position components are multiplied to a scalar value.

Date
2015/Aug/21
Parameters
fA scalar value to be multiplied.
Returns
Reference to 'this' point.
Point3D Bial::Point3D::operator+ ( const Vector3D vec) const

Add operation, the point position is added to the vector components.

Date
2015/Aug/21
Parameters
vecInput vector.
Returns
Result point.
Point3D Bial::Point3D::operator+ ( const Point3D p) const

Add operation, the points positions are added.

Date
2015/Aug/21
Parameters
pInput point.
Returns
Result point.
Point3D& Bial::Point3D::operator+= ( const Vector3D vec)

Add operation, the point position is added to the vector components.

Date
2015/Aug/21
Parameters
vecInput vector.
Returns
Reference to 'this' point.
Point3D& Bial::Point3D::operator+= ( const Point3D p)

Add operation, the points positions are added.

Date
2015/Aug/21
Parameters
pInput point.
Returns
Reference to 'this' point.
Vector3D Bial::Point3D::operator- ( const Point3D p) const

Subtract operation, the point positions are subtracted, generating a Vector3D.

Date
2015/Aug/21
Parameters
pInput point.
Warning
Throws if has NaNs.
Returns
Result vector3D.
Vector3D Bial::Point3D::operator- ( const Vector3D vec) const

Subtract operation, the point position is subtracted to the vector components, generating a Vector3D.

Date
2015/Aug/21
Parameters
vecInput vector.
Warning
Throws if has NaNs.
Returns
Result point.
Point3D& Bial::Point3D::operator-= ( const Vector3D vec)

Subtract operation, the point position is subtracted to the vector components.

Date
2015/Aug/21
Parameters
vecInput vector.
Returns
Reference to 'this' point.
Point3D Bial::Point3D::operator/ ( double  f) const

Division operation, the point position components are divided by s.

Date
2015/Aug/21
Parameters
sA scalar denominator.
Returns
Result point.
Point3D& Bial::Point3D::operator/= ( double  f)

Division operation, the point position components are divided by s.

Date
2015/Aug/21
Parameters
sA scalar denominator.
Returns
Reference to 'this' point.
bool Bial::Point3D::operator< ( const Point3D p) const
inline

Simple function used in sorting algoritms.

Date
2015/Aug/21
Parameters
pInput point to be compared. return none.

Definition at line 374 of file Geometrics.hpp.

bool Bial::Point3D::operator== ( const Point3D p) const

Returns if the positions match.

Date
2015/Aug/21
Parameters
pInput point to be compared.
Warning
Throws if has NaNs. return none.
bool Bial::Point3D::operator> ( const Point3D p) const
inline

Simple function used in sorting algoritms.

Date
2015/Aug/21
Parameters
pInput point to be compared. return none.

Definition at line 385 of file Geometrics.hpp.

double Bial::Point3D::operator[] ( int  i) const

Gives the option to loop over the components of the point position.

Date
2015/Aug/21
Parameters
iis the component index ( 0 for x, 1 for y, and 2 for z )
Returns
Position component value at index i.
Warning
Throws if i < 0 or i > 2
double& Bial::Point3D::operator[] ( int  i)

Gives the option to loop over the components of the point position.

Date
2015/Aug/21
Parameters
iis the component index ( 0 for x, 1 for y, and 2 for z )
Returns
Position component value at index i.
Warning
Throws if i < 0 or i > 2
Vector3D Bial::Point3D::toVector ( ) const

Conversion from Point3D to Vector3D.

Date
2015/Aug/21
Returns
Result vector.
Warning
Throws if has NaNs.

Member Data Documentation

double Bial::Point3D::x

Definition at line 223 of file Geometrics.hpp.

double Bial::Point3D::y

Point position in y.

Definition at line 225 of file Geometrics.hpp.

double Bial::Point3D::z

Point position in z.

Definition at line 227 of file Geometrics.hpp.

class Bial::Normal

The Normal class is the geometric representation of a Normal in 3D space.
A surface normal (or just normal) is a vector that is perpendicular to a surface at a particular position.
It can be defined as the cross product of any two nonparallel vectors that are tangent to the surface at a point.
The implementations of Normal3D and Vector3D are very similar. Like vectors, normals are represented by three floats x, y, and z;
they can be added and subtracted to compute new normals; and they can be scaled and normalized.
However, a normal cannot be added to a point, and one cannot take the cross product of two normals.

Date
2015/Aug/21

Definition at line 403 of file Geometrics.hpp.

Collaboration diagram for Bial::Normal:
Collaboration graph

Public Member Functions

 Normal ()
 
 Normal (double xx, double yy, double zz)
 Normal constructor. More...
 
 Normal (const Vector3D &vec)
 Conversion from Vector3D to Normal. More...
 
bool HasNaNs () const
 HasNaNs returns if the any of the components is'nt a valid number. return none. More...
 
bool operator== (const Normal &norm) const
 Returns if the components match. More...
 
bool operator!= (const Normal &norm) const
 Returns if the components do not match. More...
 
Normal operator+ (const Normal &norm) const
 Add operation, the normal components are added. More...
 
Normaloperator+= (const Normal &norm)
 Add operation, the normal components are added. More...
 
Normal operator- (const Normal &norm) const
 Subtract operation, the normal components are subtracted. More...
 
Normaloperator-= (const Normal &norm)
 Subtract operation, the normal components are subtracted. More...
 
Normal operator* (double s) const
 Multiply operation, the normal components are multiplied to a scalar value. More...
 
Normaloperator*= (double s)
 Multiply operation, the normal components are multiplied to a scalar value. More...
 
Normal operator/ (double s) const
 Division operation, the normal components are divided by s. More...
 
Normaloperator/= (double s)
 Division operation, the normal components are divided by s. More...
 
Normal operator- () const
 Returns the normal inverse. More...
 
double operator[] (int i) const
 Gives the option to loop over the components of a normal. More...
 
double & operator[] (int i)
 Gives the option to loop over the components of a normal. More...
 
double LengthSquared () const
 Returns the length of a normal.
Given a normal $ \vec{v} = (x,y,z) $, this function returns $||\vec{v}|| = \sqrt{x*x+y*y+z*z} $. More...
 
double Length () const
 Returns the squared length of a normal.
Given a normal $ \vec{v} = (x,y,z) $, this function returns $ ||\vec{v}||^2 = {x*x+y*y+z*z} $. More...
 
Normal Normalized () const
 Returns the normalized normal.
Given a normal $ \vec{v} = (x,y,z) $, this function returns $ \frac{\vec{v}}{||\vec{v}||^2} $. return none. More...
 

Public Attributes

double x
 
double y
 Normal direction in y. More...
 
double z
 Normal direction in z. More...
 

Constructor & Destructor Documentation

Bial::Normal::Normal ( )
Bial::Normal::Normal ( double  xx,
double  yy,
double  zz 
)
explicit

Normal constructor.

Date
2015/Aug/21
Parameters
xxNormal direction in x.
yyNormal direction in y.
zzNormal direction in z.
Warning
Throws if has NaN parameter.
Bial::Normal::Normal ( const Vector3D vec)
explicit

Conversion from Vector3D to Normal.

Date
2015/Aug/21
Parameters
vecinput vector.

Member Function Documentation

bool Bial::Normal::HasNaNs ( ) const

HasNaNs returns if the any of the components is'nt a valid number. return none.

Date
2015/Aug/21
double Bial::Normal::Length ( ) const

Returns the squared length of a normal.
Given a normal $ \vec{v} = (x,y,z) $, this function returns $ ||\vec{v}||^2 = {x*x+y*y+z*z} $.

Date
2015/Aug/21
Returns
The squared length of a normal.
double Bial::Normal::LengthSquared ( ) const

Returns the length of a normal.
Given a normal $ \vec{v} = (x,y,z) $, this function returns $||\vec{v}|| = \sqrt{x*x+y*y+z*z} $.

Date
2015/Aug/21
Returns
The length of a normal.
Normal Bial::Normal::Normalized ( ) const

Returns the normalized normal.
Given a normal $ \vec{v} = (x,y,z) $, this function returns $ \frac{\vec{v}}{||\vec{v}||^2} $. return none.

Date
2015/Aug/21
bool Bial::Normal::operator!= ( const Normal norm) const

Returns if the components do not match.

Date
2015/Aug/21
Parameters
normInput normal to be compared. return none.
Normal Bial::Normal::operator* ( double  s) const

Multiply operation, the normal components are multiplied to a scalar value.

Date
2015/Aug/21
Parameters
sA scalar value to be multiplied.
Returns
Result normal.
Normal& Bial::Normal::operator*= ( double  s)

Multiply operation, the normal components are multiplied to a scalar value.

Date
2015/Aug/21
Parameters
sA scalar value to be multiplied.
Returns
Reference to 'this' normal.
Normal Bial::Normal::operator+ ( const Normal norm) const

Add operation, the normal components are added.

Date
2015/Aug/21
Parameters
normInput normal to be compared.
Warning
Throws if has NaNs.
Returns
Result normal.
Normal& Bial::Normal::operator+= ( const Normal norm)

Add operation, the normal components are added.

Date
2015/Aug/21
Parameters
normInput normal
Returns
Reference to 'this' normal.
Normal Bial::Normal::operator- ( const Normal norm) const

Subtract operation, the normal components are subtracted.

Date
2015/Aug/21
Parameters
normInput normal
Returns
Result normal.
Normal Bial::Normal::operator- ( ) const

Returns the normal inverse.

Date
2015/Aug/21
Returns
Result normal.
Normal& Bial::Normal::operator-= ( const Normal norm)

Subtract operation, the normal components are subtracted.

Date
2015/Aug/21
Parameters
normInput normal
Returns
Reference to 'this' normal.
Normal Bial::Normal::operator/ ( double  s) const

Division operation, the normal components are divided by s.

Date
2015/Aug/21
Parameters
sA scalar denominator.
Returns
Result normal.
Normal& Bial::Normal::operator/= ( double  s)

Division operation, the normal components are divided by s.

Date
2015/Aug/21
Parameters
sA scalar denominator.
Returns
Reference to 'this' normal.
bool Bial::Normal::operator== ( const Normal norm) const

Returns if the components match.

Date
2015/Aug/21
Parameters
normInput normal return none.
double Bial::Normal::operator[] ( int  i) const

Gives the option to loop over the components of a normal.

Date
2015/Aug/21
Parameters
iis the component index ( 0 for x, 1 for y, and 2 for z )
Returns
Normal component value at index i.
Warning
Throws if i < 0 or i > 2
double& Bial::Normal::operator[] ( int  i)

Gives the option to loop over the components of a normal.

Date
2015/Aug/21
Parameters
iis the component index ( 0 for x, 1 for y, and 2 for z )
Returns
Normal component value at index i.
Warning
Throws if i < 0 or i > 2

Member Data Documentation

double Bial::Normal::x

Definition at line 408 of file Geometrics.hpp.

double Bial::Normal::y

Normal direction in y.

Definition at line 410 of file Geometrics.hpp.

double Bial::Normal::z

Normal direction in z.

Definition at line 412 of file Geometrics.hpp.

class Bial::Ray

The Ray class is a mathematic representation of a light ray.
A ray is a semi­infinite line specified by its origin and direction.

Date
2015/Aug/21

Definition at line 563 of file Geometrics.hpp.

Collaboration diagram for Bial::Ray:
Collaboration graph

Public Member Functions

 Ray ()
 
 Ray (const Point3D &origin, const Vector3D &direction, double start=0.f, double end=INFINITY, double t=0.f, int d=0)
 Ray constructor. More...
 
 Ray (const Point3D &origin, const Vector3D &direction, const Ray &parent, double start=0.f, double end=INFINITY)
 Ray constructor with "parent" ray.
For convenience we also provide another ray constructor that takes a “parent” ray; the idea is that when additional rays are being spawned from an intersection, it’s useful to be able to copy the time value and set the depth value for the new ray based on the corresponding values from the previous ray. More...
 
Point3D operator() (double t) const
 Operator that makes the ray be used as a parametric function and returns a Point3D at position t along the ray.
Given a Ray with origin $ O $ and direction $ \vec{d} $, this function returns $ P = O + *\vec{d} * t $. More...
 

Public Attributes

Point3D o
 
Vector3D d
 Ray direction vector. More...
 
double mint
 Minimum value for parameter t. More...
 
double maxt
 Maximum value for parameter t. More...
 
double time
 Ray time counter used in animated objects simulation. More...
 
int depth
 The ray depth member tracks how many times light has bounced along the current path. More...
 

Constructor & Destructor Documentation

Bial::Ray::Ray ( )
Bial::Ray::Ray ( const Point3D origin,
const Vector3D direction,
double  start = 0.f,
double  end = INFINITY,
double  t = 0.f,
int  d = 0 
)

Ray constructor.

Parameters
originRay origin point.
directionRay direction vector.
startMinimum value for parameter t.
endMaximum value for parameter t.
tRay time counter used in animated objects simulation.
dThe ray depth member tracks how many times light has bounced along the current path.
Bial::Ray::Ray ( const Point3D origin,
const Vector3D direction,
const Ray parent,
double  start = 0.f,
double  end = INFINITY 
)

Ray constructor with "parent" ray.
For convenience we also provide another ray constructor that takes a “parent” ray; the idea is that when additional rays are being spawned from an intersection, it’s useful to be able to copy the time value and set the depth value for the new ray based on the corresponding values from the previous ray.

Parameters
originRay origin point.
directionRay direction vector.
parentA parent Ray.
startMinimum value for parameter t.
endMaximum value for parameter t.

Member Function Documentation

Point3D Bial::Ray::operator() ( double  t) const

Operator that makes the ray be used as a parametric function and returns a Point3D at position t along the ray.
Given a Ray with origin $ O $ and direction $ \vec{d} $, this function returns $ P = O + *\vec{d} * t $.

Parameters
tInput parameter $ t $.
Returns
The resulting point $ P $.

Member Data Documentation

Vector3D Bial::Ray::d

Ray direction vector.

Definition at line 573 of file Geometrics.hpp.

int Bial::Ray::depth

The ray depth member tracks how many times light has bounced along the current path.

Definition at line 589 of file Geometrics.hpp.

double Bial::Ray::maxt
mutable

Maximum value for parameter t.

Definition at line 581 of file Geometrics.hpp.

double Bial::Ray::mint
mutable

Minimum value for parameter t.

Definition at line 577 of file Geometrics.hpp.

Point3D Bial::Ray::o

Definition at line 569 of file Geometrics.hpp.

double Bial::Ray::time

Ray time counter used in animated objects simulation.

Definition at line 585 of file Geometrics.hpp.

class Bial::BBox

The BBox class is a Bounding Box with 8 vertices, and can be represented by 2 points (6coordinates).

Date
2015/Aug/21

Definition at line 640 of file Geometrics.hpp.

Collaboration diagram for Bial::BBox:
Collaboration graph

Public Member Functions

 BBox ()
 
 BBox (const Point3D &p)
 
 BBox (const Point3D &p1, const Point3D &p2)
 
bool operator== (const BBox &other) const
 
bool operator!= (const BBox &other) const
 
BBox Normalized () const
 
bool Overlaps (const BBox &b) const
 
bool Inside (const Point3D &pt) const
 
void Expand (double delta)
 
double SurfaceArea () const
 
double Volume () const
 
int MaximumExtent () const
 
const Point3Doperator[] (int i) const
 
Point3Doperator[] (int i)
 
Point3D at (size_t vtx)
 
Point3D Lerp (double tx, double ty, double tz) const
 
Vector3D Offset (const Point3D &p) const
 
void BoundingSphere (Point3D *c, double *rad) const
 

Public Attributes

Point3D pMin
 
Point3D pMax
 

Friends

BBox Union (const BBox &b, const Point3D &p)
 
BBox Union (const BBox &b, const BBox &b2)
 

Constructor & Destructor Documentation

Bial::BBox::BBox ( )
Bial::BBox::BBox ( const Point3D p)
Bial::BBox::BBox ( const Point3D p1,
const Point3D p2 
)

Member Function Documentation

Point3D Bial::BBox::at ( size_t  vtx)
void Bial::BBox::BoundingSphere ( Point3D c,
double *  rad 
) const
void Bial::BBox::Expand ( double  delta)
bool Bial::BBox::Inside ( const Point3D pt) const
Point3D Bial::BBox::Lerp ( double  tx,
double  ty,
double  tz 
) const
int Bial::BBox::MaximumExtent ( ) const
BBox Bial::BBox::Normalized ( ) const
inline

Definition at line 656 of file Geometrics.hpp.

Vector3D Bial::BBox::Offset ( const Point3D p) const
bool Bial::BBox::operator!= ( const BBox other) const
bool Bial::BBox::operator== ( const BBox other) const
const Point3D& Bial::BBox::operator[] ( int  i) const
Point3D& Bial::BBox::operator[] ( int  i)
bool Bial::BBox::Overlaps ( const BBox b) const
double Bial::BBox::SurfaceArea ( ) const
double Bial::BBox::Volume ( ) const

Friends And Related Function Documentation

BBox Union ( const BBox b,
const Point3D p 
)
friend
BBox Union ( const BBox b,
const BBox b2 
)
friend

Member Data Documentation

Point3D Bial::BBox::pMax

Definition at line 643 of file Geometrics.hpp.

Point3D Bial::BBox::pMin

Definition at line 643 of file Geometrics.hpp.

class Bial::Transform3D

The Transform3D class holds affine matrices and is used to apply geometric transformations over cartesian coordinates.
The affine transformation multiplies the coordinates vector to the affine matrix.

Date
2015/Aug/21

Definition at line 696 of file Geometrics.hpp.

Collaboration diagram for Bial::Transform3D:
Collaboration graph

Public Types

enum  : int { X = 0, Y, Z }
 

Public Member Functions

 Transform3D ()
 
 Transform3D (const Matrix< double > &mat)
 
 Transform3D (const Matrix< double > &mat, const Matrix< double > &inv)
 
Matrix< double > getAffineMatrix () const
 
void setAffineMatrix (const Matrix< double > &mat)
 
Matrix< double > getInverseMatrix () const
 
void setInverseMatrix (const Matrix< double > &value)
 
void reset ()
 
Transform3D copy ()
 
Transform3D Inverse ()
 
bool operator== (const Transform3D &other)
 
bool operator!= (const Transform3D &other)
 
Transform3D operator* (const Transform3D &other) const
 
Point3D operator() (const Point3D &pt) const
 
void operator() (const Point3D &pt, Point3D *res) const
 
Vector3D operator() (const Vector3D &vec) const
 
void operator() (const Vector3D &vec, Vector3D *res) const
 
Normal operator() (const Normal &norm) const
 
void operator() (const Normal &norm, Normal *res) const
 
Ray operator() (const Ray &ray) const
 
void operator() (const Ray &ray, Ray *res) const
 
BBox operator() (const BBox &b) const
 
void operator() (const BBox &b, BBox *res) const
 
Point3D operator() (double x, double y, double z) const
 
Transform3DTranslate (double dx, double dy, double dz=0.f)
 
Transform3DScale (double sx, double sy, double sz=1.f)
 
Transform3DScale (double factor)
 
bool HasScale () const
 
Transform3DRotate (double degrees, int dms)
 
Transform3DRotateRadians (double rad, int dms)
 
Transform3DRotate (double degrees, const Vector3D &axis)
 
Transform3DRotateRadians (double rad, const Vector3D &axis)
 
Transform3DShear (double s_xy, double s_yx, double s_xz, double s_yz, double s_zx, double s_zy)
 
Transform3DLookAt (const Point3D &pos, const Point3D &look, const Vector3D &up)
 
bool SwapsHandedness () const
 

Member Enumeration Documentation

anonymous enum : int
Enumerator

Definition at line 699 of file Geometrics.hpp.

Constructor & Destructor Documentation

Bial::Transform3D::Transform3D ( )
Bial::Transform3D::Transform3D ( const Matrix< double > &  mat)
Bial::Transform3D::Transform3D ( const Matrix< double > &  mat,
const Matrix< double > &  inv 
)

Member Function Documentation

Transform3D Bial::Transform3D::copy ( )
Matrix< double > Bial::Transform3D::getAffineMatrix ( ) const
Matrix< double > Bial::Transform3D::getInverseMatrix ( ) const
bool Bial::Transform3D::HasScale ( ) const
Transform3D Bial::Transform3D::Inverse ( )
Transform3D& Bial::Transform3D::LookAt ( const Point3D pos,
const Point3D look,
const Vector3D up 
)
bool Bial::Transform3D::operator!= ( const Transform3D other)
Point3D Bial::Transform3D::operator() ( const Point3D pt) const
void Bial::Transform3D::operator() ( const Point3D pt,
Point3D res 
) const
Vector3D Bial::Transform3D::operator() ( const Vector3D vec) const
void Bial::Transform3D::operator() ( const Vector3D vec,
Vector3D res 
) const
Normal Bial::Transform3D::operator() ( const Normal norm) const
void Bial::Transform3D::operator() ( const Normal norm,
Normal res 
) const
Ray Bial::Transform3D::operator() ( const Ray ray) const
void Bial::Transform3D::operator() ( const Ray ray,
Ray res 
) const
BBox Bial::Transform3D::operator() ( const BBox b) const
void Bial::Transform3D::operator() ( const BBox b,
BBox res 
) const
Point3D Bial::Transform3D::operator() ( double  x,
double  y,
double  z 
) const
Transform3D Bial::Transform3D::operator* ( const Transform3D other) const
bool Bial::Transform3D::operator== ( const Transform3D other)
void Bial::Transform3D::reset ( )
Transform3D& Bial::Transform3D::Rotate ( double  degrees,
int  dms 
)
Transform3D& Bial::Transform3D::Rotate ( double  degrees,
const Vector3D axis 
)
Transform3D& Bial::Transform3D::RotateRadians ( double  rad,
int  dms 
)
Transform3D& Bial::Transform3D::RotateRadians ( double  rad,
const Vector3D axis 
)
Transform3D& Bial::Transform3D::Scale ( double  sx,
double  sy,
double  sz = 1.f 
)
Transform3D& Bial::Transform3D::Scale ( double  factor)
void Bial::Transform3D::setAffineMatrix ( const Matrix< double > &  mat)
void Bial::Transform3D::setInverseMatrix ( const Matrix< double > &  value)
Transform3D& Bial::Transform3D::Shear ( double  s_xy,
double  s_yx,
double  s_xz,
double  s_yz,
double  s_zx,
double  s_zy 
)
bool Bial::Transform3D::SwapsHandedness ( ) const
Transform3D& Bial::Transform3D::Translate ( double  dx,
double  dy,
double  dz = 0.f 
)
class Bial::DifferentialGeometry

The DifferentialGeometry class is a parametric representation of the Shape geometry.

Date
2015/Aug/21

Definition at line 778 of file Geometrics.hpp.

Collaboration diagram for Bial::DifferentialGeometry:
Collaboration graph

Public Member Functions

 DifferentialGeometry ()
 DifferentialGeometry empty constructor. More...
 
 DifferentialGeometry (const Point3D &p, const Vector3D &dpdu, const Vector3D &dpdv, const Normal &dndu, const Normal &dndv, float u, float v, const Shape *sh)
 DifferentialGeometry constructor. More...
 

Public Attributes

Point3D p
 p is the point of interest. More...
 
Normal nn
 nn is the normalized version of the surface normal. It's obtained from the cross product between dpdu and dpdv. More...
 
Vector3D dpdu
 dpdu is the partial derivative of the surface position in u. More...
 
Vector3D dpdv
 dpdv is the partial derivative of the surface position in v. More...
 
Normal dndu
 dndu is the partial derivative of the surface normal in u. The vectors dndu amd dndv record the differential change in surface normal along the surface. More...
 
Normal dndv
 dndv is the partial derivative of the surface normal in u. The vectors dndu amd dndv record the differential change in surface normal along the surface. More...
 
float u
 u is a parametric coordinate. More...
 
float v
 v is a parametric coordinate. More...
 
const Shapeshape
 shape is a reference to the Shape that the differential geometry lies on. More...
 

Constructor & Destructor Documentation

Bial::DifferentialGeometry::DifferentialGeometry ( )

DifferentialGeometry empty constructor.

Bial::DifferentialGeometry::DifferentialGeometry ( const Point3D p,
const Vector3D dpdu,
const Vector3D dpdv,
const Normal dndu,
const Normal dndv,
float  u,
float  v,
const Shape sh 
)

DifferentialGeometry constructor.

Parameters
pis the point of interest.
dpduis the partial derivative of the surface position in u.
dpdvis the partial derivative of the surface position in v.
dnduis the partial derivative of the surface normal in u.
dndvis the partial derivative of the surface normal in v.
uis a parametric coordinate.
vis a parametric coordinate.
shis a reference to the Shape that the differential geometry lies on.

Member Data Documentation

Normal Bial::DifferentialGeometry::dndu

dndu is the partial derivative of the surface normal in u. The vectors dndu amd dndv record the differential change in surface normal along the surface.

Definition at line 801 of file Geometrics.hpp.

Normal Bial::DifferentialGeometry::dndv

dndv is the partial derivative of the surface normal in u. The vectors dndu amd dndv record the differential change in surface normal along the surface.

Definition at line 806 of file Geometrics.hpp.

Vector3D Bial::DifferentialGeometry::dpdu

dpdu is the partial derivative of the surface position in u.

Definition at line 792 of file Geometrics.hpp.

Vector3D Bial::DifferentialGeometry::dpdv

dpdv is the partial derivative of the surface position in v.

Definition at line 796 of file Geometrics.hpp.

Normal Bial::DifferentialGeometry::nn

nn is the normalized version of the surface normal. It's obtained from the cross product between dpdu and dpdv.

Definition at line 788 of file Geometrics.hpp.

Point3D Bial::DifferentialGeometry::p

p is the point of interest.

Definition at line 783 of file Geometrics.hpp.

const Shape* Bial::DifferentialGeometry::shape

shape is a reference to the Shape that the differential geometry lies on.

Definition at line 818 of file Geometrics.hpp.

float Bial::DifferentialGeometry::u

u is a parametric coordinate.

Definition at line 810 of file Geometrics.hpp.

float Bial::DifferentialGeometry::v

v is a parametric coordinate.

Definition at line 814 of file Geometrics.hpp.

class Bial::FastTransform

Definition at line 844 of file Geometrics.hpp.

Collaboration diagram for Bial::FastTransform:
Collaboration graph

Public Types

enum  : int { X = 0, Y, Z }
 

Public Member Functions

 FastTransform ()
 
 FastTransform (const Matrix< int > &mat)
 
 FastTransform (const Matrix< int > &mat, const Matrix< int > &inv)
 
Matrix< int > getAffineMatrix () const
 
void setAffineMatrix (const Matrix< int > &mat)
 
Matrix< int > getInverseMatrix () const
 
void setInverseMatrix (const Matrix< int > &value)
 
void reset ()
 
FastTransform Inverse ()
 
FastTransform copy ()
 
bool operator== (const FastTransform &other)
 
bool operator!= (const FastTransform &other)
 
FastTransform operator* (const FastTransform &other) const
 
Point3D operator() (double x, double y, double z) const
 
void operator() (int x, int y, int z, int *xx, int *yy, int *zz) const
 
Point3D operator() (const Point3D &pt) const
 
void operator() (const Point3D &pt, Point3D *res) const
 
FastTransformTranslate (int dx, int dy, int dz=0.f)
 
FastTransformScale (int sx, int sy, int sz=1.f)
 
FastTransformScale (int factor)
 
FastTransformRotate (double degrees, int dms)
 
FastTransformRotateRadians (double rad, int dms)
 
FastTransformShear (int s_xy, int s_yx, int s_xz, int s_yz, int s_zx, int s_zy)
 

Member Enumeration Documentation

anonymous enum : int
Enumerator

Definition at line 847 of file Geometrics.hpp.

Constructor & Destructor Documentation

Bial::FastTransform::FastTransform ( )
Bial::FastTransform::FastTransform ( const Matrix< int > &  mat)
Bial::FastTransform::FastTransform ( const Matrix< int > &  mat,
const Matrix< int > &  inv 
)

Member Function Documentation

FastTransform Bial::FastTransform::copy ( )
Matrix< int > Bial::FastTransform::getAffineMatrix ( ) const
Matrix< int > Bial::FastTransform::getInverseMatrix ( ) const
FastTransform Bial::FastTransform::Inverse ( )
bool Bial::FastTransform::operator!= ( const FastTransform other)
Point3D Bial::FastTransform::operator() ( double  x,
double  y,
double  z 
) const
void Bial::FastTransform::operator() ( int  x,
int  y,
int  z,
int *  xx,
int *  yy,
int *  zz 
) const
Point3D Bial::FastTransform::operator() ( const Point3D pt) const
void Bial::FastTransform::operator() ( const Point3D pt,
Point3D res 
) const
FastTransform Bial::FastTransform::operator* ( const FastTransform other) const
bool Bial::FastTransform::operator== ( const FastTransform other)
void Bial::FastTransform::reset ( )
FastTransform& Bial::FastTransform::Rotate ( double  degrees,
int  dms 
)
FastTransform& Bial::FastTransform::RotateRadians ( double  rad,
int  dms 
)
FastTransform& Bial::FastTransform::Scale ( int  sx,
int  sy,
int  sz = 1.f 
)
FastTransform& Bial::FastTransform::Scale ( int  factor)
void Bial::FastTransform::setAffineMatrix ( const Matrix< int > &  mat)
void Bial::FastTransform::setInverseMatrix ( const Matrix< int > &  value)
FastTransform& Bial::FastTransform::Shear ( int  s_xy,
int  s_yx,
int  s_xz,
int  s_yz,
int  s_zx,
int  s_zy 
)
FastTransform& Bial::FastTransform::Translate ( int  dx,
int  dy,
int  dz = 0.f 
)

Function Documentation

double Bial::AbsDot ( const Vector3D v1,
const Vector3D v2 
)
double Bial::AbsDot ( const Normal n1,
const Normal n2 
)
double Bial::AbsDot ( const Normal n1,
const Vector3D v2 
)
double Bial::AbsDot ( const Vector3D v1,
const Normal n2 
)
void Bial::CoordinateSystem ( const Vector3D v1,
Vector3D v2,
Vector3D v3 
)
Vector3D Bial::Cross ( const Vector3D v1,
const Vector3D v2 
)
double Bial::Distance ( const Point3D p1,
const Point3D p2 
)
double Bial::DistanceSquared ( const Point3D p1,
const Point3D p2 
)
double Bial::Dot ( const Vector3D v1,
const Vector3D v2 
)
double Bial::Dot ( const Normal n1,
const Normal n2 
)
double Bial::Dot ( const Normal n1,
const Vector3D v2 
)
double Bial::Dot ( const Vector3D v1,
const Normal n2 
)
Normal Bial::FaceForward ( const Normal n,
const Vector3D v 
)
double Bial::Lerp ( double  t,
double  v1,
double  v2 
)

Simple linear interpolation.

Date
2015/Aug/21
Parameters
tFactor
v1value 1
v2value 2 return none.
Vector3D Bial::operator* ( double  s,
const Vector3D vec 
)
Point3D Bial::operator* ( double  s,
const Point3D p 
)
Normal Bial::operator* ( double  s,
const Normal norm 
)
template<class O >
O& Bial::operator<< ( O &  os,
const Vector3D vec 
)

Definition at line 938 of file Geometrics.hpp.

template<class O >
O& Bial::operator<< ( O &  os,
const Point3D pt 
)

Definition at line 943 of file Geometrics.hpp.

template<class O >
O& Bial::operator<< ( O &  os,
const Normal norm 
)

Definition at line 948 of file Geometrics.hpp.

template<class O >
O& Bial::operator<< ( O &  os,
const Ray ray 
)

Definition at line 953 of file Geometrics.hpp.

template<class O >
O& Bial::operator<< ( O &  os,
const BBox box 
)

Definition at line 958 of file Geometrics.hpp.

template<class O >
O& Bial::operator<< ( O &  os,
const Transform3D tr 
)

Definition at line 963 of file Geometrics.hpp.