ScEng::MarbleTexture Class Reference

A noise texture. More...

#include <marbletexture.h>

Inheritance diagram for ScEng::MarbleTexture:

ScEng::Texture ScEng::Material ScEng::Block List of all members.

Public Types

enum  DATAID { , id_color2, id_map1_on, id_map2_on }
 Enum DATAID. More...
enum  CHUNKS { NAME_CHUNKID = 0x00000005 }
 Enum Chunks. More...
enum  DEPENDENCIES { PLACE3DTEX_DEPENDENCY = 0, COLOR1TEX_DEPENDENCY = 1, COLOR2TEX_DEPENDENCY = 2, DATA_TABLE_DEPENDENCY = 3 }
 Enum DEPENDENCIES. More...

Public Member Functions

 MarbleTexture (bool create_dependencies)
 Constructor.
std::string GetClassName ()
 Returns the name for this class.
BlockType GetBlockType ()
 Virtual function.
void SetColor1 (GMT::Color color1, int t)
 Sets the Color 1.
void SetColor2 (GMT::Color color2, int t)
 Sets the Color 2.
void SetMap1On (bool map1, int t)
 Sets if this Marble uses the map1.
void SetMap2On (bool map2, int t)
 Sets if this Marble uses the map2.
GMT::Color GetColor1 (int t)
 Gets the Color 1.
GMT::Color GetColor2 (int t)
 Gets the Color 1.
bool GetMap1On (int t)
 Returns if this Marble uses the map1.
bool GetMap2On (int t)
 Returns if this Marble uses the map2.
int NumDependencies ()
 Returns the number of dependencies for this class.
void SetDependency (int i, Block *dependency)
 Sets a Dependency.
BlockGetDependency (int i)
 Returns a specific dependency.
std::string GetDependencyName (int i)
 Gets the name for the specified dependency.
unsigned int GetDependencyType (int i)
std::string GetName ()
 Returns the name for this texture.
void SetName (std::string new_name)
 Sets the name for this texture.
void SetNumSubTextures (int num)
 Sets the number of sub-textures.
int GetNumSubTextures ()
 Returns the number of sub-textures for this texture.
TextureGetSubTexture (int i)
 Returns the specified sub-texture.
void SetSubTexture (int i, Texture *texture)
 Sets the specified sub-texture.
void SetPlace3DTexture (Place3DTexture *place_3D_texture)
 Sets the Place3DTexture.
Place3DTextureGetPlace3DTexture ()
 Returns the Place3DTexture.
int GetNumDataTables ()
 Returns the number of DataTables used for this class.
DataTableGetDataTable (int id=0)
 Returns the DataTable for this class.
void SetDataTable (DataTable *d, int i=0)
 Sets the i_th data table.
void UpdateDataTable (int id=0)
 Updates the indexes for the DataTable.
BlockClone ()
 Creates a copy of this object and return it.
int Save (SceneSave *scene_save)
 Saves the info for this class.
int Load (SceneLoad *scene_load)
 Loads the info for this class.
void DeleteThis ()
 Deletes this class.
void ActionBegin (int time, int action)
void ActionEnd (int time, int action)
void Update (int time)
GMT::AColor EvaluateColor (DifferentialGeometry &dg)
 Returns the color of the texture in the position specified by the differential geometry instance.
GMT::Point3F EvaluateBump (DifferentialGeometry &dg)
 Returns the normal perturbation produced by the texture in the position specified by the differential geometry instance.

Public Attributes

std::string name
 The name of this texture.
Place3DTextureplace_tex
 The 3DPlace of the texture.
Texturecolor_1_tex
 One of the textures of the noise texture.
Texturecolor_2_tex
 One of the textures of the noise texture.
DataTabledt
 The DataTable to hold the info for this class.

Static Public Attributes

static BlockType block_type

Detailed Description

A noise texture.

Creates a perturbation using two colors or textures


Member Enumeration Documentation

enum ScEng::MarbleTexture::DATAID

Enum DATAID.

Enums the Ids for the differents Data used for the NoiseTexture

Enumerator:
id_color2  <The id for the Color 1 in the DataTable
id_map1_on  <The id for the Color 2 in the DataTable
id_map2_on  <The id for the use of map2 in the DataTable

enum ScEng::MarbleTexture::CHUNKS

Enum Chunks.

Enums the chunks used for this class

Enumerator:
NAME_CHUNKID  Name chunk

enum ScEng::MarbleTexture::DEPENDENCIES

Enum DEPENDENCIES.

Enums the possible dependencies for this class

Enumerator:
PLACE3DTEX_DEPENDENCY  Place3DTexture dependency
COLOR1TEX_DEPENDENCY  Color1 Texture dependency
COLOR2TEX_DEPENDENCY  Color2 Texture dependency
DATA_TABLE_DEPENDENCY  DataTable dependency


Member Function Documentation

std::string ScEng::MarbleTexture::GetClassName (  )  [virtual]

Returns the name for this class.

Returns:
Returns "MarbleTexture"

Implements ScEng::Block.

int ScEng::MarbleTexture::NumDependencies (  )  [virtual]

Returns the number of dependencies for this class.

Returns:
Returns 3

Implements ScEng::Block.

void ScEng::MarbleTexture::SetDependency ( int  i,
Block dependency 
) [virtual]

Sets a Dependency.

Implements ScEng::Block.

Block * ScEng::MarbleTexture::GetDependency ( int  i  )  [virtual]

Returns a specific dependency.

Returns:
If the id is equal to PLACE3DTEX_DEPENDENCY returns the Place3DTexture

If the id is equal to COLOR1TEX_DEPENDENCY returns the color_1_tex

If the id is equal to COLOR2TEX_DEPENDENCY returns the color_2_tex

Implements ScEng::Block.

unsigned int ScEng::MarbleTexture::GetDependencyType ( int  i  )  [virtual]

Returns the type of the i-th dependency of this block.

Returns:
The type of the dependency. This is the type defined in BlockType::type.
See also:
BlockType

Reimplemented from ScEng::Block.

int ScEng::MarbleTexture::GetNumSubTextures (  )  [virtual]

Returns the number of sub-textures for this texture.

Returns:
Returns 2

Implements ScEng::Material.

Texture * ScEng::MarbleTexture::GetSubTexture ( int  i  )  [virtual]

Returns the specified sub-texture.

Returns:
If i equal to 1 returns the color_1_tex

If i equal to 2 returns the color_1_tex

If i is not 1 or 2 returns NULL

Implements ScEng::Material.

void ScEng::MarbleTexture::SetSubTexture ( int  i,
Texture texture 
) [virtual]

Sets the specified sub-texture.

Implements ScEng::Material.

void ScEng::MarbleTexture::SetPlace3DTexture ( Place3DTexture place_3D_texture  ) 

Sets the Place3DTexture.

Sets the Place3DTexture using MakeDependencyByID

Parameters:
place_3D_texture the Place3DTexture to be set
See also:
Block::MakeDependencyByID

int ScEng::MarbleTexture::GetNumDataTables (  )  [virtual]

Returns the number of DataTables used for this class.

Returns:
Returns 1

Reimplemented from ScEng::Block.

Block * ScEng::MarbleTexture::Clone (  )  [virtual]

Creates a copy of this object and return it.

The caller of this function is responsible to add this block to the DAG or to delete it.

Implements ScEng::Block.

void ScEng::MarbleTexture::ActionBegin ( int  time,
int  action 
) [virtual]

Informs the block that an action will begin

Parameters:
time the time at which the action begins. more details about the action, for example, it can be a RENDER_ACTION, or a SAVE_ACTION.

Reimplemented from ScEng::Block.

void ScEng::MarbleTexture::ActionEnd ( int  time,
int  action 
) [inline, virtual]

Informs the block that an action will end.

Parameters:
time the time at which the action ends. more details about the action, for example, it can be a RENDER_ACTION, or a SAVE_ACTION.

Reimplemented from ScEng::Block.

void ScEng::MarbleTexture::Update ( int  time  )  [inline, virtual]

Informs the block that it needs to update its data. For example, texture and material blocks usually move all their animated parameters from the data_table to int or float variables. This is specially useful when rendering, so there is no need to interpolate a data_value every time.

Parameters:
time the time at which the block needs to update its data.

Reimplemented from ScEng::Block.


Member Data Documentation

BlockType ScEng::MarbleTexture::block_type [static]

The type of this block BlockType NoiseTexture::block_type( BlockType::TEXTURE, 0x00500000, 0x00000020 );


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 10:49:22 2007 for SceneEngine by  doxygen 1.5.1-p1