SphereFlake Class Reference

#include <SphereFlake.h>

Inheritance diagram for SphereFlake:

Scene GRAObject List of all members.

Public Member Functions

 SphereFlake (const SDS &proto, unsigned factor, float radius=1.0)
SceneGraphObject::OID appendModel (Parser &parser, const Matrix4 *m=NULL)
SceneGraphObject::OID appendObject (SceneGraphObject *primitive)
SceneGraphObject::OID appendLight (LightSource *light)
void build (void)
bool haveLight (void) const
Group * root (void)
virtual void __debug (void)

Protected Member Functions

void _create_lights (void)
AutoPtr< Material > ** _create_materials (unsigned &)
void _create_object_set (Vector3[9])
void _create_spheres (unsigned, const Vector4 &, const Vector4 &, Vector3[9], AutoPtr< Material > **, unsigned)

Protected Attributes

SceneGraphObject::OID _lastOID
Group _sceneGraph
bool _haveLight

Detailed Description

Testing scene: set of shiny spheres, with each sphere blooming sets of 9 more spheres with 1/3rd radius. A square floor polygon is added. Three light sources.

Definition at line 18 of file SphereFlake.h.


Constructor & Destructor Documentation

SphereFlake const SDS &  proto,
unsigned  factor,
float  radius = 1.0
 

Number of spheres = 9^factor + number_of__spheres(factor-1)

     factor     # spheres         # squares 
       0               1               1
       1              10               1
       2              91               1
       3             820               1
       4            7381               1
       5           66430               1
       6          597871               1
       7         5380840               1
 

Parameters:
proto prototype of the main spatial data structure
factor recursion factor, see the table above
radius radius of the biggest sphere

Definition at line 140 of file SphereFlake.cc.

References SphereFlake::_create_lights(), SphereFlake::_create_materials(), SphereFlake::_create_object_set(), SphereFlake::_create_spheres(), Scene::_lastOID, Scene::appendObject(), and Scene::build().


Member Function Documentation

void __debug void   )  [virtual, inherited]
 

Used only for debugging.

Definition at line 63 of file Scene.cc.

References Scene::_sceneGraph.

void _create_lights void   )  [protected]
 

Definition at line 9 of file SphereFlake.cc.

References Scene::appendLight().

Referenced by SphereFlake::SphereFlake().

AutoPtr< Material > ** _create_materials unsigned &   )  [protected]
 

Definition at line 19 of file SphereFlake.cc.

Referenced by SphereFlake::SphereFlake().

void _create_object_set Vector3  [9]  )  [protected]
 

Definition at line 48 of file SphereFlake.cc.

Referenced by SphereFlake::SphereFlake().

void _create_spheres unsigned  ,
const Vector4 &  ,
const Vector4 &  ,
Vector3  [9],
AutoPtr< Material > **  ,
unsigned 
[protected]
 

Definition at line 77 of file SphereFlake.cc.

References Scene::_lastOID, and Scene::appendObject().

Referenced by SphereFlake::SphereFlake().

SceneGraphObject::OID appendLight LightSource *  light  )  [inherited]
 

Appends a light source to the scene.

Parameters:
light appended light source

Definition at line 53 of file Scene.cc.

References Scene::_haveLight, Scene::_lastOID, and Scene::_sceneGraph.

Referenced by CornellBox::_build_lights(), SphereFlake::_create_lights(), and FractalMount::_create_lights().

SceneGraphObject::OID appendModel Parser &  parser,
const Matrix4 *  m = NULL
[inherited]
 

Appends model to the scene.

Parameters:
parser parser of the model
m transfoprmation matrix of the model

Definition at line 7 of file Scene.cc.

References Scene::_lastOID, and Scene::_sceneGraph.

SceneGraphObject::OID appendObject SceneGraphObject *  primitive  )  [inherited]
 

Appends single object to the scene.

Parameters:
primitive appended object

Definition at line 32 of file Scene.cc.

References Scene::_lastOID, and Scene::_sceneGraph.

Referenced by CornellBox::_build_sphere_flake(), CornellBox::_build_walls(), SphereFlake::_create_spheres(), FractalMount::_create_spheres(), CornellBox::addCrystalicSphere(), CornellBox::addMirrorSphere(), and SphereFlake::SphereFlake().

void build void   )  [inline, inherited]
 

Prepares the scene for manipulation. There is no guarantee that the scene is realy created until the build() method is called. After the build() call the scene is created. Nevertheless, you _can_ still append additional primitives and/or models.

Definition at line 65 of file Scene.h.

Referenced by FractalMount::FractalMount(), and SphereFlake::SphereFlake().

bool haveLight void   )  const [inline, inherited]
 

Returns:
true if the scene has light, false otherwise

Definition at line 70 of file Scene.h.

Group* root void   )  [inline, inherited]
 

Returns:
root of the scene graph

Definition at line 75 of file Scene.h.

Referenced by RayTracing::_cast_ray(), PhotonMapShader::_create_maps_per_shape(), PhotonMapShader::_create_scene_maps(), PhotonMapShader::_emit_caustic_photon(), PhotonMapShader::_emit_global_photon(), LocalReflection::_light_visible(), RTRender::_render(), GLRender::_render(), GLPhotonMapRender::_render(), GLIrradCacheRender::_render(), GLBVRender::_render(), GLEnergyRender::_render_energy(), PhotonMapShader::distributeEnergy(), RayTracing::illuminatePoint(), PhotonTracing::illuminatePoint(), Render::renderScene(), RadShader::setScene(), Radiosity::setScene(), PhotonMapping::setScene(), and LocalReflection::setScene().


Member Data Documentation

bool _haveLight [protected, inherited]
 

Definition at line 22 of file Scene.h.

Referenced by Scene::appendLight().

SceneGraphObject::OID _lastOID [protected, inherited]
 

Definition at line 20 of file Scene.h.

Referenced by CornellBox::_build_lights(), CornellBox::_build_sphere_flake(), CornellBox::_build_walls(), SphereFlake::_create_spheres(), FractalMount::_create_spheres(), CornellBox::addCrystalicSphere(), CornellBox::addMirrorSphere(), Scene::appendLight(), Scene::appendModel(), Scene::appendObject(), and SphereFlake::SphereFlake().

Group _sceneGraph [protected, inherited]
 

Definition at line 21 of file Scene.h.

Referenced by Scene::__debug(), Scene::appendLight(), Scene::appendModel(), and Scene::appendObject().


The documentation for this class was generated from the following files:
Generated on Tue Nov 21 15:11:43 2006 for gra by  doxygen 1.4.6