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

* fixed DataContainerInspectorWidget::onDataContainerDataAdded signal

 * fixed AbstractTransferFunction lazy histogram creation

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@312 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent d2d0e883
......@@ -67,7 +67,8 @@ namespace TUMVis {
}
void DataContainerInspectorWidget::onDataContainerDataAdded(const std::string& key, const DataHandle* dh) {
emit dataContainerChanged(QString::fromStdString(key), dh);
// copy DataHandle because signal will be handled by a different thread an indefinite amount of time later:
emit dataContainerChanged(QString::fromStdString(key), new DataHandle(*dh));
}
QSize DataContainerInspectorWidget::sizeHint() const {
......
......@@ -209,13 +209,13 @@ namespace TUMVis {
std::map<QString, DataHandleTreeItem*>::const_iterator it = _itemMap.lower_bound(key);
if (it == _itemMap.end() || it->first != key) {
DataHandleTreeItem* dhti = new DataHandleTreeItem(new DataHandle(*dh), key.toStdString(), _rootItem);
DataHandleTreeItem* dhti = new DataHandleTreeItem(dh, key.toStdString(), _rootItem);
_itemMap.insert(std::make_pair(key, dhti));
//emit reset();//dataChanged(createIndex(dhti->getRow(), 0, dhti), createIndex(dhti->getRow(), columnCount(), dhti));
emit dataChanged(createIndex(dhti->getRow(), 0, dhti), createIndex(dhti->getRow(), columnCount(), dhti));
}
else {
it->second->setDataHandle(dh);
//emit reset();//dataChanged(createIndex(it->second->getRow(), 0, it->second), createIndex(it->second->getRow(), columnCount(), it->second));
emit dataChanged(createIndex(it->second->getRow(), 0, it->second), createIndex(it->second->getRow(), columnCount(), it->second));
}
}
......
......@@ -157,6 +157,8 @@ namespace TUMVis {
tbb::parallel_for(tbb::blocked_range<size_t>(0, idl->getNumElements()), IntensityHistogramGenerator(idl, _intensityHistogram));
}
}
_dirtyHistogram = false;
}
const AbstractTransferFunction::IntensityHistogramType* AbstractTransferFunction::getIntensityHistogram() const {
......
......@@ -160,7 +160,7 @@ namespace TUMVis {
const DataHandle* _imageHandle; ///< DataHandle to the image for this transfer function. May be 0.
mutable IntensityHistogramType* _intensityHistogram; ///< Intensity histogram of the intensity in _imageHandle for the current _intensityDomain
tbb::atomic<bool> _dirtyHistogram; ///< Flag whether the intensity histogram has to be updated.
mutable tbb::atomic<bool> _dirtyHistogram; ///< Flag whether the intensity histogram has to be updated.
mutable tbb::mutex _localMutex; ///< mutex protecting the local members
......
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