Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

toxic::IObject Class Reference

#include <iobject.h>

Inheritance diagram for toxic::IObject:

toxic::Basis toxic::Collection toxic::IBoundedObject toxic::Plane toxic::DummyObject toxic::IAreaLight toxic::Octree toxic::Cube toxic::Mesh toxic::Ring toxic::Sphere toxic::Square List of all members.

Public Types

enum  IntersectionMask {
  INTERSECT_NO_RAYS = 0, INTERSECT_VISIBILITY_RAYS = 1, INTERSECT_PRIMARY_RAYS = 2, INTERSECT_REFLECTED_RAYS = 4,
  INTERSECT_SHADOW_RAYS = 8, INTERSECT_PHOTON_RAYS = 16, INTERSECT_PRIMARY_FG_RAYS = 32, INTERSECT_SECONDARY_FG_RAYS = 64,
  INTERSECT_AUTOFOCUS_RAYS = 128, INTERSECT_ALL_RAYS
}

Public Member Functions

 IObject (const sheep::Matrix4 &m, const ISurfaceShader *surface_shader=0, IntersectionMask intersection_mask=INTERSECT_ALL_RAYS)
virtual ~IObject ()
virtual void Finalize (const Context &context)
virtual int GetObjectCount () const
void SetSurfaceShader (const ISurfaceShader *surface_shader)
const ISurfaceShaderGetSurfaceShader () const
virtual bool Intersect (const Context &context, const Ray &ray, Hit *hit=0) const=0
virtual void Annotate (const Context &context, const ICamera *camera, Framebuffer *framebuffer) const

Public Attributes

int m_mailbox_ray_id
 Id of the last ray tested against this object.


Protected Attributes

const ISurfaceShaderm_surface_shader
IntersectionMask m_intersection_mask

Member Enumeration Documentation

enum toxic::IObject::IntersectionMask
 

Enumeration values:
INTERSECT_NO_RAYS 
INTERSECT_VISIBILITY_RAYS 
INTERSECT_PRIMARY_RAYS 
INTERSECT_REFLECTED_RAYS 
INTERSECT_SHADOW_RAYS 
INTERSECT_PHOTON_RAYS 
INTERSECT_PRIMARY_FG_RAYS 
INTERSECT_SECONDARY_FG_RAYS 
INTERSECT_AUTOFOCUS_RAYS 
INTERSECT_ALL_RAYS  Handy shortcut.

Definition at line 42 of file iobject.h.


Constructor & Destructor Documentation

IObject::IObject const sheep::Matrix4 m,
const ISurfaceShader surface_shader = 0,
IntersectionMask  intersection_mask = INTERSECT_ALL_RAYS
 

m is the object space to world space transformation matrix. The 'surface_shader' pointer may be null because some objects (like the Collection and Octree objects) don't need a shader.

Definition at line 29 of file iobject.cpp.

References USE_MAILBOXES.

virtual toxic::IObject::~IObject  )  [inline, virtual]
 

Definition at line 79 of file iobject.h.


Member Function Documentation

virtual void toxic::IObject::Annotate const Context context,
const ICamera camera,
Framebuffer framebuffer
const [inline, virtual]
 

Reimplemented in toxic::Collection, toxic::Mesh, and toxic::Octree.

Definition at line 103 of file iobject.h.

Referenced by toxic::Renderer::Annotate().

virtual void toxic::IObject::Finalize const Context context  )  [inline, virtual]
 

This method must be called only once, after the object is completely configured, and before it is used for the first time.

Reimplemented in toxic::Collection, toxic::IAreaLight, toxic::Mesh, and toxic::Octree.

Definition at line 83 of file iobject.h.

Referenced by toxic::Octree::Finalize(), and toxic::Collection::Finalize().

virtual int toxic::IObject::GetObjectCount  )  const [inline, virtual]
 

This method returns the number of objects contained into this object. For primitives, it returns 1. For composite objects (like the Collection object), it returns the number of child objects.

Reimplemented in toxic::Collection, and toxic::Octree.

Definition at line 88 of file iobject.h.

Referenced by toxic::Octree::Finalize(), toxic::Collection::Finalize(), and main().

const ISurfaceShader * IObject::GetSurfaceShader  )  const [inline]
 

Definition at line 142 of file iobject.h.

Referenced by toxic::Sphere::ComputeIrradiance(), toxic::IAreaLight::ComputeIrradiance(), toxic::Renderer::final_gathering(), toxic::IAreaLight::GeneratePhotonRay(), toxic::SceneBuilder::object_builder(), toxic::Renderer::trace(), toxic::GlobalPhotonTracer::trace_photon(), and toxic::CausticsPhotonTracer::trace_photon().

virtual bool toxic::IObject::Intersect const Context context,
const Ray ray,
Hit hit = 0
const [pure virtual]
 

This method returns true if the ray intersect the object, or false otherwise. If 'hit' is not null, intersection data are reported through the 'hit' parameter (only if an intersection has been found; if no intersection has been found, the 'hit' parameter is left unchanged). The ray is expressed in world space.

Implemented in toxic::Collection, toxic::Cube, toxic::DummyObject, toxic::Mesh, toxic::Octree, toxic::Plane, toxic::Ring, toxic::Sphere, and toxic::Square.

Referenced by toxic::Octree::Intersect(), toxic::Collection::Intersect(), and toxic::Octree::octree_full_visitor::Trace().

void IObject::SetSurfaceShader const ISurfaceShader surface_shader  )  [inline]
 

Definition at line 137 of file iobject.h.


Member Data Documentation

IntersectionMask toxic::IObject::m_intersection_mask [protected]
 

Definition at line 111 of file iobject.h.

int toxic::IObject::m_mailbox_ray_id [mutable]
 

Id of the last ray tested against this object.

Todo:
Allocate one ray id per rendering thread.

Definition at line 67 of file iobject.h.

Referenced by toxic::Octree::octree_full_visitor::Trace().

const ISurfaceShader* toxic::IObject::m_surface_shader [protected]
 

Definition at line 110 of file iobject.h.


The documentation for this class was generated from the following files:
Generated on Tue May 11 01:31:57 2004 for toxic by doxygen 1.3.6