Skip to content
Snippets Groups Projects

Load ini-file on data-load

Merged Magne.Stromsnes requested to merge read_and_use_grid_scaling into master
11 files
+ 540
10
Compare changes
  • Side-by-side
  • Inline
Files
11
@@ -48,6 +48,7 @@ void ObliqueSliceRenderWidget::initializeGL()
&tfn::TransferProperties::transferFunctionChanged,
[this]() { update(); });
connect(&m_textureStore->volume(), &Volume::dimensionsChanged, this, &ObliqueSliceRenderWidget::updateBoxScaling);
connect(&m_textureStore->volume(), &Volume::gridSpacingChanged, this, &ObliqueSliceRenderWidget::updateGridSpacing);
updateObliqueSlice();
}
@@ -64,6 +65,8 @@ void ObliqueSliceRenderWidget::paintGL()
m_cubePlaneIntersection.getModelRotationMatrix() * m_boxScalingMatrix;
m_sliceProgram.setUniformValue("modelViewMatrix", modelViewMatrix);
m_sliceProgram.setUniformValue("gridSpacingMatrix", m_gridSpacingMatrix);
glActiveTexture(GL_TEXTURE0);
m_sliceProgram.setUniformValue("volumeTexture", 0);
m_textureStore->volume().bind();
@@ -142,3 +145,10 @@ void ObliqueSliceRenderWidget::updateBoxScaling(QVector3D dims)
auto maxDim = std::max(dims.x(), std::max(dims.y(), dims.z()));
m_boxScalingMatrix.scale(2 * dims / (minDim + maxDim));
}
void ObliqueSliceRenderWidget::updateGridSpacing(QVector3D dims)
{
m_gridSpacingMatrix.setToIdentity();
auto maxDim = std::max(dims.x(), std::max(dims.y(), dims.z()));
m_gridSpacingMatrix.scale(dims / maxDim);
}
Loading