Class used for texture preprocessing. More...
#include <TerrainViz/nodes/SoTVizTexturePreprocessor.h>
Classes | |
class | TexTree |
class | TVIZFileInfo |
Public Member Functions | |
SoTVizTexturePreprocessor () | |
virtual | ~SoTVizTexturePreprocessor () |
SbBool | process () |
void | setMaximumDepth (int maxDepth) |
int | getQuadTreeDepth () const |
SbBool | addFile (const SbString &filePath) |
SbBool | addFile (const SbString &filePath, const SbVec2d &origin, const SbVec2d &orientation, const SbVec2d &step, TVIZUnits units) |
SbBool | addOverlayFile (const SbString &filePath, const SbVec2d &origin, const SbVec2d &orientation, const SbVec2d &step, TVIZUnits units) |
SbBool | writeToXML (const SbString &fileName) |
Static Public Member Functions | |
static void | setMaxTextureSize (int size) |
static int | getMaxTextureSize () |
This class allows preprocessing of multiple texture files.
Please see SoTVizPreprocessor for datum and ellipsoid definitions and compatibility.
Input can be raster files with geo-referencing (GeoTiff and Tiff-Tfw supported), or classic raster files (see SoRasterImageRW for the list of supported formats) with separate geo-referencing information in a geodetic coordinate system.
"Geodetic" is the horizontal and vertical position. The positions are commonly UTM x/y/z or latitude, longitude, elevation triplets.
The output is a balanced (all tree levels available) or unbalanced quadtree of textures, used by the SoTVizRender class.
Each output texture is characterized by its level and position in the tree. Each texture is saved as a PNG file (no transparency managed).
The writeToXML method exports the quadtree description to be read by SoTVizRender.
SoTVizTexturePreprocessor::SoTVizTexturePreprocessor | ( | ) |
Constructor.
virtual SoTVizTexturePreprocessor::~SoTVizTexturePreprocessor | ( | ) | [virtual] |
Destructor.
SbBool SoTVizTexturePreprocessor::addFile | ( | const SbString & | filePath, | |
const SbVec2d & | origin, | |||
const SbVec2d & | orientation, | |||
const SbVec2d & | step, | |||
TVIZUnits | units | |||
) |
Adds a raster file to the preprocessor.
Coordinates are given in the geodetic system. The origin is the lower left corner. orientation is the width vector of the bitmap in the geodetic system.
Adds a georeferenced file to the preprocessor.
SbBool SoTVizTexturePreprocessor::addOverlayFile | ( | const SbString & | filePath, | |
const SbVec2d & | origin, | |||
const SbVec2d & | orientation, | |||
const SbVec2d & | step, | |||
TVIZUnits | units | |||
) |
Adds an overlay raster file (transparent raster) to the preprocessor.
Coordinates are given in the geodetic system. The origin is the lower left corner. orientation is the width vector of the bitmap in the geodetic system.
static int SoTVizTexturePreprocessor::getMaxTextureSize | ( | ) | [static] |
Returns the maximum size in pixels of the textures to be generated.
int SoTVizTexturePreprocessor::getQuadTreeDepth | ( | ) | const |
Returns the texture quadtree depth.
SbBool SoTVizTexturePreprocessor::process | ( | ) | [virtual] |
Processes the file list and generates a list of PNG files.
Implements SoTVizPreprocessor.
void SoTVizTexturePreprocessor::setMaximumDepth | ( | int | maxDepth | ) |
Sets the maximum tree depth not to exceed.
static void SoTVizTexturePreprocessor::setMaxTextureSize | ( | int | size | ) | [static] |
Sets the maximum size in pixels of the textures to be generated.
If not called, the maximum texture size will match the OpenGL driver capabilities. Otherwise, the value will be rounded down to the largest power of two that is less than the specified value, even if this value exceeds the hardware capabilities.
Writes resulting elevation and textures description in a TerrainViz XML file.
Note this is a file name, not a path. The path used is the one given by setDestDirectory. Both preprocessors (textures and data) must reference the same file.
Implements SoTVizPreprocessor.