INFO804 Introduction à l'informatique graphique
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rt::GraphicalObject Struct Referenceabstract

#include <GraphicalObject.h>

Inheritance diagram for rt::GraphicalObject:
rt::Sphere

Public Member Functions

 GraphicalObject ()
 Default constructor. Nothing to do.
 
virtual ~GraphicalObject ()
 Virtual destructor since object contains virtual methods.
 
virtual void init (Viewer &)=0
 
virtual void draw (Viewer &)=0
 
virtual Vector3 getNormal (Point3 p)=0
 
virtual Material getMaterial (Point3 p)=0
 
virtual Real rayIntersection (const Ray &ray, Point3 &p)=0
 

Detailed Description

This is an interface specifying methods that any graphical object should have. It is also drawable to be seen in QGLViewer window. Concrete exemples of a GraphicalObject include spheres.

Definition at line 22 of file GraphicalObject.h.

Constructor & Destructor Documentation

◆ GraphicalObject()

rt::GraphicalObject::GraphicalObject ( )
inline

Default constructor. Nothing to do.

Definition at line 25 of file GraphicalObject.h.

25{}

◆ ~GraphicalObject()

virtual rt::GraphicalObject::~GraphicalObject ( )
inlinevirtual

Virtual destructor since object contains virtual methods.

Definition at line 28 of file GraphicalObject.h.

28{}

Member Function Documentation

◆ draw()

virtual void rt::GraphicalObject::draw ( Viewer )
pure virtual

This method is called by Scene::draw() at each frame to redisplay objects in the OpenGL window.

Implemented in rt::Sphere.

◆ getMaterial()

virtual Material rt::GraphicalObject::getMaterial ( Point3  p)
pure virtual
Returns
the material associated to this part of the object

Implemented in rt::Sphere.

◆ getNormal()

virtual Vector3 rt::GraphicalObject::getNormal ( Point3  p)
pure virtual
Returns
the normal vector at point p on the object (p should be on or close to the sphere).

Implemented in rt::Sphere.

◆ init()

virtual void rt::GraphicalObject::init ( Viewer )
pure virtual

This method is called by Scene::init() at the beginning of the display in the OpenGL window. May be useful for some precomputations.

Implemented in rt::Sphere.

◆ rayIntersection()

virtual Real rt::GraphicalObject::rayIntersection ( const Ray ray,
Point3 p 
)
pure virtual
Parameters
[in]raythe incoming ray
[out]returnsthe point of intersection with the object (if any), or the closest point to it.
Returns
either a real < 0.0 if there is an intersection, or a kind of distance to the closest point of intersection.

Implemented in rt::Sphere.


The documentation for this struct was generated from the following file: