Commit ea21c6cd authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Some testing for fixing gcc -O2 / -ftree-vrp issue. Fixing some memory leaks

parent 0212878f
......@@ -224,6 +224,7 @@ namespace campvis {
SimpleJobProcessor::deinit();
OpenGLJobProcessor::deinit();
PipelineFactory::deinit();
tgt::QtContextManager::deinit();
tgt::deinit();
......
......@@ -87,6 +87,8 @@ namespace campvis {
}
LogHighlighter::~LogHighlighter() {
delete _filterRegExp;
delete _logLevelRegExp;
setFilterRegExp(0);
}
......
......@@ -45,31 +45,32 @@ namespace campvis {
}
LogViewerWidget::~LogViewerWidget() {
delete _logHighlighter;
delete _controls_layout;
}
void LogViewerWidget::setupGUI() {
setWindowTitle(tr("Log Viewer"));
_mainLayout = new QVBoxLayout();
setLayout(_mainLayout);
_mainLayout = new QVBoxLayout(this);
_controls_layout = new QHBoxLayout();
_mainLayout->addLayout(_controls_layout);
_filter_label = new QLabel(tr("&Filter:"));
_filter_label = new QLabel(tr("&Filter:"), this);
_controls_layout->addWidget(_filter_label);
_filter_line_edit = new QLineEdit();
_filter_line_edit = new QLineEdit(this);
_filter_line_edit->setPlaceholderText(tr("Start typing here to filter log messages"));
_filter_label->setBuddy(_filter_line_edit);
_controls_layout->addWidget(_filter_line_edit);
_controls_layout->addStretch();
_clear_button = new QPushButton(tr("&Clear"));
_clear_button = new QPushButton(tr("&Clear"), this);
_controls_layout->addWidget(_clear_button);
_logDisplay = new QTextEdit();
_logDisplay = new QTextEdit(this);
_logDisplay->setReadOnly(true);
_mainLayout->addWidget(_logDisplay);
......
......@@ -101,38 +101,38 @@ namespace campvis {
_btnPipelineFactory = new QPushButton("Add Pipeline", _containerWidget);
_cwLayout->addWidget(_btnPipelineFactory, 0, 1);
_pipelineWidget = new PipelineTreeWidget();
_pipelineWidget = new PipelineTreeWidget(this);
_containerWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
_cwLayout->addWidget(_pipelineWidget, 1, 0, 1, 2);
_containerWidget->setLayout(_cwLayout);
ui.pipelineTreeDock->setWidget(_containerWidget);
_pipelinePropertiesScrollArea = new QScrollArea();
_pipelinePropertiesScrollArea = new QScrollArea(this);
_pipelinePropertiesScrollArea->setWidgetResizable(true);
_pipelinePropertiesScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
_pipelinePropertiesScrollArea->setFrameStyle(QScrollArea::NoFrame);
_pipelinePropertiesWidget = new QWidget();
_pipelinePropertiesWidget = new QWidget(_pipelinePropertiesScrollArea);
_pipelinePropertiesWidget->installEventFilter(this);
_pipelinePropertiesScrollArea->setWidget(_pipelinePropertiesWidget);
ui.pipelinePropertiesDock->setWidget(_pipelinePropertiesScrollArea);
QVBoxLayout* rightLayout = new QVBoxLayout();
QVBoxLayout* rightLayout = new QVBoxLayout(_pipelinePropertiesWidget);
rightLayout->setSpacing(4);
_pipelinePropertiesWidget->setLayout(rightLayout);
_btnExecute = new QPushButton("Execute Selected Pipeline/Processor");
_btnExecute = new QPushButton("Execute Selected Pipeline/Processor", _pipelinePropertiesWidget);
rightLayout->addWidget(_btnExecute);
_btnShowDataContainerInspector = new QPushButton("Inspect DataContainer of Selected Pipeline");
_btnShowDataContainerInspector = new QPushButton("Inspect DataContainer of Selected Pipeline", _pipelinePropertiesWidget);
rightLayout->addWidget(_btnShowDataContainerInspector);
_propCollectionWidget = new PropertyCollectionWidget();
_propCollectionWidget = new PropertyCollectionWidget(this);
rightLayout->addWidget(_propCollectionWidget);
rightLayout->addStretch();
_logViewer = new LogViewerWidget();
_logViewer = new LogViewerWidget(this);
ui.logViewerDock->setWidget(_logViewer);
_dcInspectorWidget = new DataContainerInspectorWidget();
......
......@@ -59,11 +59,17 @@ namespace campvis {
}
void ImageMappingInformation::updateMatrices() {
tgt::mat4 t = tgt::mat4::createTranslation(_offset);
// tgt::mat4 s = tgt::mat4::createScale(_voxelSize * _size);
// _textureToWolrdTransformation = t * s;
_textureToWolrdTransformation = tgt::mat4::createTranslation(_offset) * tgt::mat4::createScale(_voxelSize * _size);
// std::cout << s << t << _textureToWolrdTransformation << "\n";
if (! _textureToWolrdTransformation.invert(_worldToTextureTransformation))
tgtAssert(false, "Could not invert texture-to-world matrix. That should not happen!");
_voxelToWorldTransformation = tgt::mat4::createTranslation(_offset) * tgt::mat4::createScale(_voxelSize);
tgt::mat4 s = tgt::mat4::createScale(_voxelSize);
_voxelToWorldTransformation = t * s;
// std::cout << s << t << _voxelToWorldTransformation << "\n";
if (! _voxelToWorldTransformation.invert(_worldToVoxelTransformation))
tgtAssert(false, "Could not invert voxel-to-world matrix. That should not happen!");
}
......
......@@ -40,6 +40,9 @@ namespace campvis {
TransFuncWindowingEventListener::TransFuncWindowingEventListener(TransferFunctionProperty* property)
: tgt::EventListener()
, _prop(property)
, _mousePressed(false)
, _mouseDownPosition(0, 0)
, _originalIntensityDomain(0.f, 1.f)
{
tgtAssert(_prop != 0, "Assigned property must not be 0.");
}
......
......@@ -41,7 +41,8 @@ namespace tgt {
}
void GlContextManager::releaseCurrentContext() {
glFinish();
if (_currentContext != 0)
glFinish();
setCurrent(0);
}
......
......@@ -2,7 +2,7 @@
* *
* tgt - Tiny Graphics Toolbox *
* *
* Copyright (C) 2006-2011 Visualization and Computer Graphics Group, *
* Copyright (C) 2005-2013 Visualization and Computer Graphics Group, *
* Department of Computer Science, University of Muenster, Germany. *
* <http://viscg.uni-muenster.de> *
* *
......@@ -504,12 +504,12 @@ struct Matrix4 {
return result;
}
/// Return the main diagonal of the upper left 3x3-submatrix
/// Returns a vector representing the scaling applied to unit vectors by this matrix.
Vector3<T> getScalingPart() const {
Vector3<T> result(T(0));
result.elem[0] = t00;
result.elem[1] = t11;
result.elem[2] = t22;
result.elem[0] = length(Vector3<T>(t00, t10, t20));
result.elem[1] = length(Vector3<T>(t01, t11, t21));
result.elem[2] = length(Vector3<T>(t02, t12, t22));
return result;
}
/*
......@@ -690,6 +690,10 @@ typedef Matrix2f mat2;
typedef Matrix3f mat3;
typedef Matrix4f mat4;
typedef Matrix2f dmat2;
typedef Matrix3f dmat3;
typedef Matrix4f dmat4;
#ifdef DLL_TEMPLATE_INST
template struct TGT_API Matrix2<float>;
template struct TGT_API Matrix3<float>;
......
......@@ -48,6 +48,11 @@ namespace campvis {
return *_singleton;
}
void PipelineFactory::deinit() {
delete _singleton;
}
std::vector<std::string> PipelineFactory::getRegisteredPipelines() const {
tbb::spin_mutex::scoped_lock lock(_mutex);
......
......@@ -59,6 +59,8 @@ namespace campvis {
* \return *_singleton
*/
static PipelineFactory& getRef();
static void deinit();
std::vector<std::string> getRegisteredPipelines() const;
......
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