Ray Tracer
2020
|
Class for Point Vectors. More...
#include <Point.h>
Public Member Functions | |
Point () | |
Point default constructor. More... | |
Point (double x, double y, double z) | |
Point X-Y-Z constructor. More... | |
Point (const Point &point) | |
Point copy constructor. More... | |
Point (const Vector &vector) | |
Point from Vector constructor. More... | |
Point (const Matrix &matrix) | |
Point from Matrix constructor. More... | |
Public Member Functions inherited from Vector | |
Vector (size_t size=1) | |
Vector constructor. More... | |
Vector (const Vector &vec) | |
Vector copy constructor. More... | |
Vector (const Matrix &mat) | |
Vector from Matrix constructor. More... | |
virtual | ~Vector () |
Vector destructor. More... | |
Vector & | operator= (const Vector &vec) |
Vector assignment operator. More... | |
double & | operator() (size_t ix) |
Vector element access. More... | |
const double & | operator() (size_t ix) const |
Vector element access (const version). More... | |
Vector | operator- () const |
Unary minus. More... | |
Vector & | operator+= (const Vector &vec) |
Vector addition-assignment operator. More... | |
Vector & | operator-= (const Vector &vec) |
Vector subtraction-assignment operator. More... | |
Vector & | operator*= (double s) |
Vector-scalar multiplication-assignment operator. More... | |
Vector & | operator/= (double s) |
Vector-scalar multiplication-assignment operator. More... | |
double | dot (const Vector &vec) const |
Vector dot product. More... | |
Vector | cross (const Vector &vec) const |
Vector cross product. More... | |
double | norm () const |
Vector norm. More... | |
double | squaredNorm () const |
SquaredVector norm. More... | |
Public Member Functions inherited from Matrix | |
Matrix (size_t size=1) | |
Square Matrix constructor. More... | |
Matrix (size_t rows, size_t cols) | |
General Matrix constructor. More... | |
Matrix (const Matrix &mat) | |
Matrix copy constructor. More... | |
virtual | ~Matrix () |
Matrix destructor. More... | |
Matrix & | operator= (const Matrix &mat) |
Matrix assignment operator. More... | |
double & | operator() (size_t row, size_t col) |
Matrix element access. More... | |
const double & | operator() (size_t row, size_t col) const |
Matrix element access (const version). More... | |
size_t | numRows () const |
Number of rows in a Matrix. More... | |
size_t | numCols () const |
Number of columns in a Matrix. More... | |
size_t | numElements () const |
Number of elements in a Matrix. More... | |
Matrix | operator- () const |
Unary minus. More... | |
Matrix & | operator+= (const Matrix &mat) |
Matrix addition-assignment operator. More... | |
Matrix & | operator-= (const Matrix &mat) |
Matrix subtraction-assignment operator. More... | |
Matrix & | operator*= (double s) |
Matrix-scalar multiplication-assignment operator. More... | |
Matrix & | operator/= (double s) |
Matrix-scalar multiplication-assignment operator. More... | |
Matrix | transpose () const |
Matrix transpose. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Matrix | |
static Matrix | identity (size_t rows, size_t cols) |
Factory method for Identity Matrices. More... | |
static Matrix | zero (size_t rows, size_t cols) |
Factory method for Zero Matrices. More... | |
Protected Attributes inherited from Matrix | |
size_t | rows_ |
Number of rows in the Matrix. More... | |
size_t | cols_ |
Number of columns in the Matrix. More... | |
std::vector< double > | data_ |
Storage for Matrix data elements. More... | |
Related Functions inherited from Vector | |
Vector | operator+ (const Vector &lhs, const Vector &rhs) |
Vector addition operator. More... | |
Vector | operator- (const Vector &lhs, const Vector &rhs) |
Vector subtraction operator. More... | |
Vector | operator* (double s, const Vector &vec) |
scalar-Vector multiplication operator. More... | |
Vector | operator* (const Vector &vec, double s) |
scalar-Vector multiplication operator. More... | |
Vector | operator/ (const Vector &vec, double s) |
Vector-scalar division operator. More... | |
Related Functions inherited from Matrix | |
Matrix | operator+ (const Matrix &lhs, const Matrix &rhs) |
Matrix addition operator. More... | |
Matrix | operator- (const Matrix &lhs, const Matrix &rhs) |
Matrix subtraction operator. More... | |
Matrix | operator* (double s, const Matrix &mat) |
scalar-Matrix multiplication operator. More... | |
Matrix | operator* (const Matrix &mat, double s) |
Matrix-scalar multiplication operator. More... | |
Matrix | operator/ (const Matrix &mat, double s) |
Matrix-scalar division operator. More... | |
std::ostream & | operator<< (std::ostream &outputStream, const Matrix &mat) |
Stream insertion operator. More... | |
std::istream & | operator>> (std::istream &inputStream, Matrix &mat) |
Stream extraction operator. More... | |
Class for Point Vectors.
A Point can be seen as either a 3-Vector or a homogeneous 4-Vector. In this implementation a Point is a 3-Vector, and the Transform class deals with the homogeneous form. Point is essentially a thin wrapper around Vector, which ensures that the Vector has 3 elements.
Having separate types for Point, Direction, and Normal, means that it is possible to distinguish them when passing them to Transform.apply() etc.
Point::Point | ( | ) |
Point default constructor.
Point::Point | ( | double | x, |
double | y, | ||
double | z | ||
) |
Point::Point | ( | const Point & | point | ) |
Point::Point | ( | const Vector & | vector | ) |
Point::Point | ( | const Matrix & | matrix | ) |