PackingBrick< T > Class Template Reference
This class is used for the purpose of packing several bricks of (maybe downsampled) volume data into one volume. More...
#include <brick.h>
Public Member Functions | |
| PackingBrick (tgt::ivec3 pos, tgt::ivec3 dimensions, std::list< Brick * > &list) | |
| PackingBrick< T > * | setSourceVolume (T *v, tgt::ivec3 dims) |
| Sets the sourceVolume for this brick. | |
| T * | getSourceVolume () |
| Returns the source volume. | |
| void | setTargetVolume (VolumeAtomic< T > *v) |
| Sets the target volume. | |
| VolumeAtomic< T > * | getTargetVolume () |
| Returns the target volume. | |
| std::list< Brick * >::iterator | getListPosition () |
| Returns this bricks position in the list. | |
| void | write () |
| Writes the volume data from the source volume to the target volume. | |
| void | updateTexture (const VolumeTexture *texture) |
| Updates the target volume's texture with this bricks current source volume data. | |
Protected Member Functions | |
| PackingBrick< T > * | split (tgt::ivec3 newBrickDimensions, T *volumeData, tgt::ivec3 volumeDims) |
| Splits this Brick into smaller ones and inserts them into the list at this bricks position. | |
Protected Attributes | |
| T * | sourceVolume_ |
| VolumeAtomic< T > * | targetVolume_ |
| std::list< Brick * > & | list_ |
Detailed Description
template<class T>
class voreen::PackingBrick< T >
This class is used for the purpose of packing several bricks of (maybe downsampled) volume data into one volume.
That volume is subdivided into several PackingBricks, which are inserted into a list.
Definition at line 114 of file brick.h.
Constructor & Destructor Documentation
| PackingBrick | ( | tgt::ivec3 | pos, | |
| tgt::ivec3 | dimensions, | |||
| std::list< Brick * > & | list | |||
| ) | [inline] |
- Parameters:
-
pos The position of this brick in the volume that is to be filled with data dimensions The dimensions of this brick list The list holding all PackingBricks that are created. PackingBricks might subdivide themselves into several smaller ones, and these smaller ones are then also inserted into the list.
Member Function Documentation
| PackingBrick< T > * setSourceVolume | ( | T * | v, | |
| tgt::ivec3 | dims | |||
| ) | [inline] |
Sets the sourceVolume for this brick.
If the volume doesn't fit, 0 is returned. If the volume fits perfectly, this brick removes itself from the queue. If the volume does fit, but is smaller, this brick subdivides itself into several smaller ones, until the volume fits perfectly. The source volume holds the data that is to be inserted into the volume subdivided by the PackingBricks. In order to save memory, the source volume is only specified by data and dimensions, and not by a VolumeAtomic object.
| void setTargetVolume | ( | VolumeAtomic< T > * | v | ) | [inline] |
| PackingBrick< T > * split | ( | tgt::ivec3 | newBrickDimensions, | |
| T * | volumeData, | |||
| tgt::ivec3 | volumeDims | |||
| ) | [inline, protected] |
Splits this Brick into smaller ones and inserts them into the list at this bricks position.
Used when only a small part of this brick is filled with VolumeData. The given volume is then inserted into one of the splitted bricks. That brick is returned.
- Parameters:
-
newBrickDimensions The new dimensions the newly created PackingBricks will have once this PackingBrick subdivides itself. volumeData The volume data to be inserted into this PackingBrick volumeDims The dimensions of the volume data to be inserted into this PackingBrick.
| void write | ( | ) | [inline] |
Writes the volume data from the source volume to the target volume.
This should only be done once. Once all PackingBricks have written their source volume's data into the target volume (which is the same for all PackingBricks), the target volume creates its opengl texture. To update that texture, updateTexture(..) is used.