Commit 7e13e80c authored by schultezub's avatar schultezub
Browse files

* added automatic update in DataContainerInspectorWidget

* fixed ImageDataRenderTarget:::getLocalMemoryFootprint()

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@322 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 5cc0e4b6
......@@ -86,15 +86,24 @@ namespace TUMVis {
QModelIndex idxName = index.sibling(index.row(), 0);
_selectedDataHandleName = idxName.data(Qt::DisplayRole).toString();
_selectedIndex = tgt::ivec2(index.row(), index.column());
}
else {
_selectedDataHandle = QtDataHandle(0);
_selectedDataHandleName = "";
_selectedIndex = tgt::ivec2(-1, -1);
}
updateInfoWidget();
}
void DataContainerInspectorWidget::onDCTWidgetDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) {
if (topLeft.row() <= _selectedIndex.x && topLeft.column() <= _selectedIndex.y && bottomRight.row() >= _selectedIndex.x && bottomRight.column() >= _selectedIndex.y) {
onDCTWidgetItemClicked(topLeft.sibling(_selectedIndex.x, _selectedIndex.y));
}
}
void DataContainerInspectorWidget::setupGUI() {
_mainLayout = new QHBoxLayout();
_mainLayout->setSpacing(4);
......@@ -120,8 +129,9 @@ namespace TUMVis {
_lblTimestamp = new QLabel("Timestamp: ", _infoWidget);
_infoWidgetLayout->addWidget(_lblTimestamp);
_canvas = CtxtMgr.createContext("DataContainerInspector", "", tgt::ivec2(128, 128), tgt::GLCanvas::RGBA, _infoWidget);
_infoWidgetLayout->addWidget(_canvas, 1);
// _canvas = CtxtMgr.createContext("DataContainerInspector", "", tgt::ivec2(128, 128), tgt::GLCanvas::RGBA, _infoWidget);
// _infoWidgetLayout->addWidget(_canvas, 1);
_infoWidgetLayout->addWidget(new QWidget(_infoWidget), 1);
_mainLayout->addWidget(_infoWidget, 1);
......@@ -129,6 +139,9 @@ namespace TUMVis {
connect(
_dctWidget, SIGNAL(clicked(const QModelIndex&)),
this, SLOT(onDCTWidgetItemClicked(const QModelIndex&)));
connect(
_dctWidget->getTreeModel(), SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
this, SLOT(onDCTWidgetDataChanged(const QModelIndex&, const QModelIndex&)));
connect(
this, SIGNAL(dataContainerChanged(const QString&, QtDataHandle)),
_dctWidget->getTreeModel(), SLOT(onDataContainerChanged(const QString&, QtDataHandle)));
......
......@@ -96,6 +96,13 @@ namespace TUMVis {
*/
void onDCTWidgetItemClicked(const QModelIndex& index);
/**
* Slot to be called by the DataContainerTreeWidget when the data has changed.
* \param topLeft
* \param bottomRight
*/
void onDCTWidgetDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
protected:
/**
* Setup the GUI stuff
......@@ -117,6 +124,7 @@ namespace TUMVis {
DataContainer* _dataContainer; ///< The DataContainer this widget is inspecting
QtDataHandle _selectedDataHandle; ///< The currently selected QtDataHandle
QString _selectedDataHandleName; ///< The name of the currently selected QtDataHandle
tgt::ivec2 _selectedIndex; ///< row/column of selected item
DataContainerTreeWidget* _dctWidget; ///< The TreeWidget showing the DataHandles in _dataContainer
tgt::QtThreadedCanvas* _canvas; ///< The OpenGL canvas for rendering the DataContainer's contents
......
......@@ -78,7 +78,6 @@ namespace TUMVis {
else
return QVariant();
case Qt::UserRole:
// const cast ist ugly, same as GUI programming...
return qVariantFromValue(_dataHandle);
default:
return QVariant();
......
......@@ -242,10 +242,12 @@ namespace TUMVis {
sum += sizeof(tgt::FramebufferObject);
sum += sizeof(tgt::Texture) * _colorTextures.size();
for (std::vector<tgt::Texture*>::const_iterator it = _colorTextures.begin(); it != _colorTextures.end(); ++it)
sum += (*it)->getBpp() * (*it)->getArraySize();
for (std::vector<tgt::Texture*>::const_iterator it = _colorTextures.begin(); it != _colorTextures.end(); ++it) {
if ((*it)->getPixelData() != 0)
sum += (*it)->getBpp() * (*it)->getArraySize();
}
if (_depthTexture != 0) {
if (_depthTexture != 0 && _depthTexture->getPixelData() != 0) {
sum += sizeof(tgt::Texture);
sum += _depthTexture->getBpp() * _depthTexture->getArraySize();
}
......
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