dtTerrain::LCCAnalyzer Class Reference

The LCC Analyzer calculates LCC data for use in the vegetation decorator. More...

#include <lccanalyzer.h>

List of all members.

Public Member Functions

 LCCAnalyzer ()
 Constructor.
virtual ~LCCAnalyzer ()
 Destructor.
dtCore::RefPtr< osg::Image > MakeBaseLCCColor (const HeightField &hf, int latitude, int longitude)
 Makes the base color texture map for the specified heightfield.
dtCore::RefPtr< osg::Image > MakeLCCMask (const osg::Image &src_image, unsigned char r, unsigned char g, unsigned char b)
 Creates a mask image based on this LCC type where a hit corresponds to a black pixel and white corresponds to a miss.
void LCCHistogram (const osg::Image &LCCbase, const osg::Image &image, const std::string &fileName, int binsize)
 Buggy "histogram" of an image by a particular LCC type.
dtCore::RefPtr< osg::Image > MakeCombinedImage (dtTerrain::LCCType &l, const HeightField &hf, const osg::Image &f_image, const osg::Image &s_image, const osg::Image &r_image)
 Create probability map of the likehihood for a particular LCC type.
dtCore::RefPtr< osg::Image > GenerateBaseFilterImage (LCCType &type, const std::string &tileCachePath)
bool CheckBaseLCCImages (const HeightField &hf, int latitude, int longitude, const std::string &tileCachePath)
void CheckSlopeAndElevationMaps (const HeightField &hf, const std::string &tileCachePath)
bool ProcessLCCData (const PagedTerrainTile &tile, LCCType &type)
void ComputeProbabilityMap (const HeightField &hf, LCCType &type, int latitude, int longitude, const std::string &tileCachePath)
void AddGeospecificImage (const std::string &fileName)
 Adds a geospecific image to the LCC analyzers list of geo images.
bool IsGeoSpecificLCCImageLoaded (const std::string &fileName)
 Checks the list of currently loaded images to see if the specified image has already been loaded and processed.
void LoadAllGeoSpecificImages ()
 Makes sure all the geospecific images that have been added to the analyzer are loaded and ready for use in the LCC data processing.
bool OutputDebugImages ()
 Gets whether or not inter-process images processed during LCC analysis are saved for review.
void SetOutputDebugImages (bool value)
 Sets whether or not inter-process images processed during LCC analysis are saved for review.
void SetMaxImageSize (unsigned int newSize)
 Sets the maximum size of the images constructed during LCC analysis.
unsigned int GetImageSize () const
 Gets the current maximum image size used during LCC analysis.
void Clear ()
 Clears all data cached in this analyzer.


Detailed Description

The LCC Analyzer calculates LCC data for use in the vegetation decorator.

Constructor & Destructor Documentation

dtTerrain::LCCAnalyzer::LCCAnalyzer (  ) 

Constructor.

dtTerrain::LCCAnalyzer::~LCCAnalyzer (  )  [virtual]

Destructor.


Member Function Documentation

dtCore::RefPtr< osg::Image > dtTerrain::LCCAnalyzer::MakeBaseLCCColor ( const HeightField hf,
int  latitude,
int  longitude 
)

Makes the base color texture map for the specified heightfield.

Parameters:
hf the heightfield to process
latitude the latitude of the terrain segment
longitude the longitude of the terrain segment
Returns:
the newly created image

dtCore::RefPtr< osg::Image > dtTerrain::LCCAnalyzer::MakeLCCMask ( const osg::Image &  src_image,
unsigned char  r,
unsigned char  g,
unsigned char  b 
)

Creates a mask image based on this LCC type where a hit corresponds to a black pixel and white corresponds to a miss.

Parameters:
src_image Image containing LCC coloration data.
r Red pixel color value with which to create the mask.
g Green pixel color value with which to create the mask.
b Blue pixel color value with which to create the mask.
Returns:
The mask image.

void dtTerrain::LCCAnalyzer::LCCHistogram ( const osg::Image &  LCCbase,
const osg::Image &  image,
const std::string &  fileName,
int  binsize 
)

Buggy "histogram" of an image by a particular LCC type.

Parameters:
LCCbase the black/white LCC image of picked points of a particular LCC type
image the slopemap, heightmap, or relative elevation
fileName the filename to save the histogram data
binsize the sampling size of the image (i.e. the delta height or slope).

dtCore::RefPtr< osg::Image > dtTerrain::LCCAnalyzer::MakeCombinedImage ( dtTerrain::LCCType l,
const HeightField hf,
const osg::Image &  f_image,
const osg::Image &  s_image,
const osg::Image &  r_image 
)

Create probability map of the likehihood for a particular LCC type.

Parameters:
l The LCC type to calculate probabilities for.
hf The heightfield.
f_image The masked LCC image containing placement statistics.
s_image the slopemap image
r_image the relative elevation image
Returns:
the newly created image

dtCore::RefPtr< osg::Image > dtTerrain::LCCAnalyzer::GenerateBaseFilterImage ( LCCType type,
const std::string &  tileCachePath 
)

bool dtTerrain::LCCAnalyzer::CheckBaseLCCImages ( const HeightField hf,
int  latitude,
int  longitude,
const std::string &  tileCachePath 
)

void dtTerrain::LCCAnalyzer::CheckSlopeAndElevationMaps ( const HeightField hf,
const std::string &  tileCachePath 
)

bool dtTerrain::LCCAnalyzer::ProcessLCCData ( const PagedTerrainTile tile,
LCCType type 
)

void dtTerrain::LCCAnalyzer::ComputeProbabilityMap ( const HeightField hf,
LCCType type,
int  latitude,
int  longitude,
const std::string &  tileCachePath 
)

void dtTerrain::LCCAnalyzer::AddGeospecificImage ( const std::string &  fileName  )  [inline]

Adds a geospecific image to the LCC analyzers list of geo images.

There must be at least one valid LCC geospecific image in this list, else an exception will be thrown while processing LCC types.

Parameters:
filename The name of the geospecific resource.

bool dtTerrain::LCCAnalyzer::IsGeoSpecificLCCImageLoaded ( const std::string &  fileName  ) 

Checks the list of currently loaded images to see if the specified image has already been loaded and processed.

Parameters:
fileName The filename of the image.
Returns:
True if already loaded, false otherwise.

void dtTerrain::LCCAnalyzer::LoadAllGeoSpecificImages (  ) 

Makes sure all the geospecific images that have been added to the analyzer are loaded and ready for use in the LCC data processing.

Note:
If an image has already been loaded previously, it will not be reloaded.

bool dtTerrain::LCCAnalyzer::OutputDebugImages (  )  [inline]

Gets whether or not inter-process images processed during LCC analysis are saved for review.

Returns:
True if images are saved, false otherwise.

void dtTerrain::LCCAnalyzer::SetOutputDebugImages ( bool  value  )  [inline]

Sets whether or not inter-process images processed during LCC analysis are saved for review.

Parameters:
value True if images should be saved, false otherwise.

void dtTerrain::LCCAnalyzer::SetMaxImageSize ( unsigned int  newSize  )  [inline]

Sets the maximum size of the images constructed during LCC analysis.

Parameters:
newSize The size in pixels of the image.
Note:
The default is 1024. Increasing this value will result in more accurate vegetation computations; however, will dramatically increase the time taken to generate the necessary data.

unsigned int dtTerrain::LCCAnalyzer::GetImageSize (  )  const [inline]

Gets the current maximum image size used during LCC analysis.

Returns:
The current image size.

void dtTerrain::LCCAnalyzer::Clear (  )  [inline]

Clears all data cached in this analyzer.

This should be called before processing a different tile or region.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008