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 e8e5d8f1 authored by schultezub's avatar schultezub
Browse files

added DataContainer::getHandlesCopy() and ImageDataGL::getTexture()

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@265 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 05559564
......@@ -104,4 +104,17 @@ namespace TUMVis {
return toReturn;
}
std::map<std::string, const DataHandle*> DataContainer::getHandlesCopy() const {
std::map<std::string, const DataHandle*> toReturn;
std::map<std::string, const DataHandle*>::const_iterator hint = toReturn.begin();
// copy map while also deep copying the DataHandles
tbb::spin_mutex::scoped_lock lock(_localMutex);
for (std::map<std::string, const DataHandle*>::const_iterator it = _handles.begin(); it != _handles.end(); ++it) {
hint = toReturn.insert(hint, std::make_pair(it->first, new DataHandle(*(it->second))));
}
return toReturn;
}
}
\ No newline at end of file
......@@ -189,6 +189,14 @@ namespace TUMVis {
*/
std::vector< std::pair< std::string, const DataHandle*> > getDataHandlesCopy() const;
/**
* Returns a copy of the current map of DataHandles.
* \note Use with caution, this method is to be considered as slow, as it includes several
* copies and locks the whole DataContainer during execution.
* \return A copy of the current handles map. The caller has to take ownership of the passed pointers!
*/
std::map<std::string, const DataHandle*> getHandlesCopy() const;
/**
* Signal emitted when data has been added to this DataContainer (this includes also data being replaced).
* First parameter is the name of the added data, second parameter contains a DataHandle to the new data.
......
......@@ -128,4 +128,8 @@ namespace TUMVis {
shader->setIgnoreUniformLocationError(tmp);
}
const tgt::Texture* ImageDataGL::getTexture() const {
return _texture;
}
}
\ No newline at end of file
......@@ -104,6 +104,11 @@ namespace TUMVis {
const tgt::TextureUnit& texUnit,
const std::string& texUniform = "_texture") const;
/**
* Gets the OpenGL texture.
* \return _texture
*/
const tgt::Texture* getTexture() const;
protected:
......
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