|
Path Tracer
|
Abstract class for a three-dimentional object. More...
#include <Object3D.h>
Public Member Functions | |
| Object3D () | |
| Default constructor. More... | |
| Object3D (Material *material) | |
| Main constructor. More... | |
| Object3D (const Object3D &obj) | |
| Copy constructor. More... | |
| ~Object3D () | |
| Destructor. More... | |
| Material * | getMaterial () const |
| Getter for the Material. More... | |
| double | getArea () const |
| Getter for this object's area. More... | |
| void | setMaterial (Material *material) |
| Setter for the Material. More... | |
| virtual void | computeArea ()=0 |
| Computes this object area. More... | |
| virtual Object3D * | deepCopy () const =0 |
| Makes a deep copy of this object. More... | |
| virtual double | smallestPositiveIntersection (const Ray &ray) const =0 |
| Computes the smallest positive intersection between the ray and this object. More... | |
| virtual DoubleUnitVec3D | getNormal (const DoubleVec3D &point) const =0 |
| Computes the normal at a point on the object. More... | |
| virtual DoubleVec3D | getRandomPoint () const =0 |
| Computes a random point on the object. More... | |
| virtual std::ostream & | getDescription (std::ostream &stream) const =0 |
| Returns this object's description. More... | |
| virtual DoubleVec3D | getCenter () const =0 |
| Returns this object's center. More... | |
| virtual DoubleVec3D | getMinCoord () const =0 |
| Returns the minimum coordinate of a cuboid containing this object. More... | |
| virtual DoubleVec3D | getMaxCoord () const =0 |
| Returns the maximum coordinate of a cuboid containing this object. More... | |
| virtual std::string | getType () const =0 |
| Returns this object type. More... | |
| virtual json | getLocationJson () const =0 |
| Converts this objects's location to json. More... | |
| virtual void | setLocationJson (const json &j)=0 |
| Sets this object's location according to json. More... | |
| Object3D & | operator= (const Object3D &otherObject) |
| Assignment operator. More... | |
Protected Attributes | |
| double | area |
| Stores the area of this object. More... | |
Abstract class for a three-dimentional object.
| Object3D::Object3D | ( | ) |
Default constructor.
The default material is a diffuse one.
| Object3D::Object3D | ( | Material * | material | ) |
Main constructor.
| material | The material of this object. |
| Object3D::Object3D | ( | const Object3D & | obj | ) |
Copy constructor.
Calls Object3D::operator=().
| obj | The object that will be copied. |
| Object3D::~Object3D | ( | ) |
Destructor.
|
pure virtual |
|
pure virtual |
| double Object3D::getArea | ( | ) | const |
Getter for this object's area.
|
pure virtual |
|
pure virtual |
Returns this object's description.
| stream | The current stream. |
|
pure virtual |
| Material * Object3D::getMaterial | ( | ) | const |
Getter for the Material.
|
pure virtual |
Returns the maximum coordinate of a cuboid containing this object.
|
pure virtual |
Returns the minimum coordinate of a cuboid containing this object.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Assignment operator.
Makes a deepcopy of the material before copying it.
| otherObject | The object to which this will be equal. |
|
pure virtual |
| void Object3D::setMaterial | ( | Material * | material | ) |
Setter for the Material.
| material | The new material of this object. |
|
pure virtual |
Computes the smallest positive intersection between the ray and this object.
| ray | The ray with wich we want to compute the intersection. |
|
protected |
Stores the area of this object.
It is computed every time the object coordinates are modified.