FractalMount Class Reference

#include <FractalMount.h>

Inheritance diagram for FractalMount:

Scene GRAObject List of all members.

Public Member Functions

 FractalMount (const SDS &proto, unsigned factor, unsigned mn=21, double xc=-0.4, double yc=-0.4, double w=0.8)
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_crystal_materials (unsigned &)
AutoPtr< Material > ** _create_mount_materials (unsigned &)
void _create_spheres (const Vector4 &, AutoPtr< Material > **, unsigned)
void _grow_mountain (double, int, int, int, double, double, double, double, AutoPtr< Material > **, unsigned)

Protected Attributes

unsigned _factor
double _roughness
unsigned _mountainNo
double _xCorner
double _yCorner
double _width
SceneGraphObject::OID _lastOID
Group _sceneGraph
bool _haveLight

Detailed Description

Testing scene: Fractal mountain, using Carpenter's method with a different extension to square grids. A pyramid of 4 glass spheres is added in front of the mountain. One light source.

Definition at line 20 of file FractalMount.h.


Constructor & Destructor Documentation

FractalMount const SDS &  proto,
unsigned  factor,
unsigned  mn = 21,
double  xc = -0.4,
double  yc = -0.4,
double  w = 0.8
 

Number of triangular polygons = 2 * 4^(factor)

    factor     # triangles        # spheres
       0               1               4
       1               8               4
       2              32               4
       3             128               4
       4             512               4
       5            2048               4
       6            8192               4
       7           32768               4
       8          131072               4
       9          524288               4
      10         2097152               4
 

Parameters:
proto prototype of the main spatial data structure
factor recursion factor, see table above
mn number of mountains (relief ruggedness)
xc X corner of generating plane
yc Y corner of generating plane
w width of (squared) generating plane

Definition at line 230 of file FractalMount.cc.

References FractalMount::_create_crystal_materials(), FractalMount::_create_lights(), FractalMount::_create_mount_materials(), FractalMount::_create_spheres(), FractalMount::_factor, FractalMount::_grow_mountain(), FractalMount::_mountainNo, FractalMount::_roughness, FractalMount::_width, FractalMount::_xCorner, FractalMount::_yCorner, 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.

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

Definition at line 14 of file FractalMount.cc.

Referenced by FractalMount::FractalMount().

void _create_lights void   )  [protected]
 

Definition at line 8 of file FractalMount.cc.

References Scene::appendLight().

Referenced by FractalMount::FractalMount().

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

Definition at line 47 of file FractalMount.cc.

References FractalMount::_roughness.

Referenced by FractalMount::FractalMount().

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

Definition at line 65 of file FractalMount.cc.

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

Referenced by FractalMount::FractalMount().

void _grow_mountain double  ,
int  ,
int  ,
int  ,
double  ,
double  ,
double  ,
double  ,
AutoPtr< Material > **  ,
unsigned 
[protected]
 

Definition at line 119 of file FractalMount.cc.

References FractalMount::_width, FractalMount::_xCorner, and FractalMount::_yCorner.

Referenced by FractalMount::FractalMount().

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

unsigned _factor [protected]
 

Definition at line 22 of file FractalMount.h.

Referenced by FractalMount::FractalMount().

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().

unsigned _mountainNo [protected]
 

Definition at line 24 of file FractalMount.h.

Referenced by FractalMount::FractalMount().

double _roughness [protected]
 

Definition at line 23 of file FractalMount.h.

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

Group _sceneGraph [protected, inherited]
 

Definition at line 21 of file Scene.h.

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

double _width [protected]
 

Definition at line 27 of file FractalMount.h.

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

double _xCorner [protected]
 

Definition at line 25 of file FractalMount.h.

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

double _yCorner [protected]
 

Definition at line 26 of file FractalMount.h.

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


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