Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at https://doku.lrz.de/display/PUBLIC/GitLab and make sure that your projects conform to the requirements.

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 {
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 {
*/
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.
sigslot::signal0<> s_changed;
......
......@@ -105,6 +105,14 @@ namespace TUMVis {
return data;
}
/**
* Gets the DataHandle.
* \return dh
*/
const DataHandle* getDataHandle() const {
return dh;
}
private:
/// Not copy-constructable
ScopedTypedData(const ScopedTypedData& rhs);
......
......@@ -34,6 +34,7 @@
namespace TUMVis {
DataHandle::DataHandle(AbstractData* data)
: _data(data)
, _timestamp(clock())
{
init();
}
......@@ -80,8 +81,12 @@ namespace TUMVis {
return;
if (! _data->isShareable())
_data = _data->clone();
_data = _data->clone(); // TODO: update timestamp?
_data->addReference();
}
clock_t DataHandle::getTimestamp() const {
return _timestamp;
}
}
\ No newline at end of file
......@@ -29,6 +29,8 @@
#ifndef datahandle_h__
#define datahandle_h__
#include <ctime>
namespace TUMVis {
class AbstractData;
......@@ -88,6 +90,12 @@ namespace TUMVis {
*/
AbstractData* getData();
/**
* Gets the timestamp when this data has been created.
* \return _timestamp
*/
clock_t getTimestamp() const;
private:
/**
......@@ -95,7 +103,8 @@ namespace TUMVis {
*/
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 {
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 {
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).
*/
......
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