NL3D::CTileNoise Class Reference

#include <tile_bank.h>


Detailed Description

This class manage tile noise.
Author:
Cyril Corvazier

Nevrax France

Date:
2000

Definition at line 457 of file tile_bank.h.

Public Member Functions

 CTileNoise (const CTileNoise &src)
 CTileNoise ()
CTileNoiseoperator= (const CTileNoise &src)
void reset ()
void serial (NLMISC::IStream &f)
void setEmpty ()
 ~CTileNoise ()

Private Attributes

std::string _FileName
CTileNoiseMap_TileNoiseMap

Friends

class CTileBank


Constructor & Destructor Documentation

NL3D::CTileNoise::CTileNoise  ) 
 

Definition at line 1857 of file tile_bank.cpp.

References _TileNoiseMap.

01858 {
01859         // Not loaded
01860         _TileNoiseMap=NULL;
01861         _FileName="";
01862 }

NL3D::CTileNoise::CTileNoise const CTileNoise src  ) 
 

Definition at line 1864 of file tile_bank.cpp.

References _TileNoiseMap, and src.

01865 {
01866         // Default ctor
01867         _TileNoiseMap=NULL;
01868         _FileName="";
01869 
01870         // Copy
01871         *this=src;
01872 }

NL3D::CTileNoise::~CTileNoise  ) 
 

Definition at line 1874 of file tile_bank.cpp.

References _TileNoiseMap.

01875 {
01876         if (_TileNoiseMap)
01877         {
01878                 delete _TileNoiseMap;
01879                 _TileNoiseMap=NULL;
01880         }
01881 }


Member Function Documentation

CTileNoise & NL3D::CTileNoise::operator= const CTileNoise src  ) 
 

Definition at line 1883 of file tile_bank.cpp.

References _TileNoiseMap, and src.

01884 {
01885         // Copy the filename
01886         _FileName=src._FileName;
01887 
01888         // Tile noise map ?
01889         if (src._TileNoiseMap)
01890         {
01891                 if (_TileNoiseMap==NULL)
01892                 {
01893                         // Allocate it
01894                         _TileNoiseMap=new CTileNoiseMap;
01895                 }
01896 
01897                 // Copy the noise map
01898                 *_TileNoiseMap=*src._TileNoiseMap;
01899         }
01900         else
01901         {
01902                 // Erase the map
01903                 if (_TileNoiseMap)
01904                 {
01905                         delete _TileNoiseMap;
01906                         _TileNoiseMap=NULL;
01907                 }
01908         }
01909         return *this;
01910 }

void NL3D::CTileNoise::reset  ) 
 

Definition at line 1930 of file tile_bank.cpp.

References _TileNoiseMap.

Referenced by setEmpty().

01931 {
01932         // Erase the map
01933         if (_TileNoiseMap)
01934         {
01935                 delete _TileNoiseMap;
01936                 _TileNoiseMap=NULL;
01937         }
01938 
01939         // Erase filename
01940         _FileName="";
01941 }

void NL3D::CTileNoise::serial NLMISC::IStream f  ) 
 

Definition at line 1912 of file tile_bank.cpp.

References NLMISC::IStream::serial(), and NLMISC::IStream::serialVersion().

01913 {
01914         // Version
01915         f.serialVersion (0);
01916 
01917         // Serial the file name
01918         f.serial (_FileName);
01919 }

void NL3D::CTileNoise::setEmpty  ) 
 

Definition at line 1921 of file tile_bank.cpp.

References _TileNoiseMap, NL3D_TILE_NOISE_MAP_SIZE, NL3D::CTileNoiseMap::Pixels, and reset().

01922 {
01923         // Reset it
01924         reset();
01925         _FileName="EmptyDisplacementMap";
01926         _TileNoiseMap=new CTileNoiseMap();
01927         memset (_TileNoiseMap->Pixels, 0, NL3D_TILE_NOISE_MAP_SIZE*NL3D_TILE_NOISE_MAP_SIZE);
01928 }


Friends And Related Function Documentation

friend class CTileBank [friend]
 

Definition at line 459 of file tile_bank.h.


Field Documentation

std::string NL3D::CTileNoise::_FileName [private]
 

Definition at line 483 of file tile_bank.h.

Referenced by NL3D::CTileBank::getTileNoiseMap().

class CTileNoiseMap* NL3D::CTileNoise::_TileNoiseMap [private]
 

Definition at line 482 of file tile_bank.h.

Referenced by CTileNoise(), NL3D::CTileBank::getTileNoiseMap(), operator=(), reset(), setEmpty(), and ~CTileNoise().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 08:05:08 2004 for NeL by doxygen 1.3.6