Commit 021c94b9 authored by schultezub's avatar schultezub
Browse files

* added AbstractTransferFunction::getTexture()

 * added DataHandle::getTimestamp()
 * added ImageDataRenderTarget::getColor/DepthTexture()

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@244 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent d623e384
...@@ -89,5 +89,16 @@ namespace TUMVis { ...@@ -89,5 +89,16 @@ namespace TUMVis {
return _intensityDomain; return _intensityDomain;
} }
const tgt::Texture* AbstractTransferFunction::getTexture() {
// TODO: lock here or in createTexture?
{
tbb::mutex::scoped_lock lock(_localMutex);
if (_texture == 0 || _dirty) {
createTexture();
}
}
return _texture;
}
} }
\ No newline at end of file
...@@ -106,6 +106,13 @@ namespace TUMVis { ...@@ -106,6 +106,13 @@ namespace TUMVis {
*/ */
const tgt::vec2& getIntensityDomain() const; const tgt::vec2& getIntensityDomain() const;
/**
* Gets the OpenGL lookup texture storing the TF.
* \note Calling thread must have a valid OpenGL context.
* \return _texture
*/
const tgt::Texture* getTexture();
/// Signal emitted when transfer function has changed. /// Signal emitted when transfer function has changed.
sigslot::signal0<> s_changed; sigslot::signal0<> s_changed;
......
...@@ -105,6 +105,14 @@ namespace TUMVis { ...@@ -105,6 +105,14 @@ namespace TUMVis {
return data; return data;
} }
/**
* Gets the DataHandle.
* \return dh
*/
const DataHandle* getDataHandle() const {
return dh;
}
private: private:
/// Not copy-constructable /// Not copy-constructable
ScopedTypedData(const ScopedTypedData& rhs); ScopedTypedData(const ScopedTypedData& rhs);
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
namespace TUMVis { namespace TUMVis {
DataHandle::DataHandle(AbstractData* data) DataHandle::DataHandle(AbstractData* data)
: _data(data) : _data(data)
, _timestamp(clock())
{ {
init(); init();
} }
...@@ -80,8 +81,12 @@ namespace TUMVis { ...@@ -80,8 +81,12 @@ namespace TUMVis {
return; return;
if (! _data->isShareable()) if (! _data->isShareable())
_data = _data->clone(); _data = _data->clone(); // TODO: update timestamp?
_data->addReference(); _data->addReference();
} }
clock_t DataHandle::getTimestamp() const {
return _timestamp;
}
} }
\ No newline at end of file
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#ifndef datahandle_h__ #ifndef datahandle_h__
#define datahandle_h__ #define datahandle_h__
#include <ctime>
namespace TUMVis { namespace TUMVis {
class AbstractData; class AbstractData;
...@@ -88,6 +90,12 @@ namespace TUMVis { ...@@ -88,6 +90,12 @@ namespace TUMVis {
*/ */
AbstractData* getData(); AbstractData* getData();
/**
* Gets the timestamp when this data has been created.
* \return _timestamp
*/
clock_t getTimestamp() const;
private: private:
/** /**
...@@ -95,7 +103,8 @@ namespace TUMVis { ...@@ -95,7 +103,8 @@ namespace TUMVis {
*/ */
void init(); void init();
AbstractData* _data; ///< managed data AbstractData* _data; ///< managed data
clock_t _timestamp; ///< Timestamp when this data has been created
}; };
} }
......
...@@ -189,4 +189,12 @@ namespace TUMVis { ...@@ -189,4 +189,12 @@ namespace TUMVis {
return 0; return 0;
} }
const tgt::Texture* ImageDataRenderTarget::getColorTexture() const {
return _colorTexture;
}
const tgt::Texture* ImageDataRenderTarget::getDepthTexture() const {
return _depthTexture;
}
} }
\ No newline at end of file
...@@ -78,6 +78,18 @@ namespace TUMVis { ...@@ -78,6 +78,18 @@ namespace TUMVis {
virtual ImageDataRenderTarget* getSubImage(const tgt::svec3& llf, const tgt::svec3& urb) const; virtual ImageDataRenderTarget* getSubImage(const tgt::svec3& llf, const tgt::svec3& urb) const;
/**
* Gets the color texture of this render target
* \return _colorTexture
*/
const tgt::Texture* getColorTexture() const;
/**
* Gets the depth texture of this render target
* \return _depthTexture
*/
const tgt::Texture* getDepthTexture() const;
/** /**
* Activates the render target (binds the FBO and sets the viewport). * Activates the render target (binds the FBO and sets the viewport).
*/ */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment