Commit bdb90ce7 authored by grunau's avatar grunau
Browse files

Merge latest trunk changes to gui-redux


git-svn-id: https://camplinux.in.tum.de/svn/campvis/branches/gui-redux@512 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parents 3345ba3c eec5a8cd
......@@ -101,6 +101,7 @@ namespace campvis {
tgt::GLContextScopedLock lock(_localContext->getContext());
tgt::initGL(featureset);
ShdrMgr.setGlobalHeader("#version 330\n");
LGL_ERROR;
// ensure matching OpenGL specs
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
in vec3 ex_TexCoord;
out vec4 out_Color;
......
......@@ -133,8 +133,8 @@ namespace campvis {
_fbo->activate();
_fbo->detachAll();
_fbo->deactivate();
LGL_ERROR;
delete _fbo;
_fbo = 0;
}
AbstractTransferFunction::deinit();
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
out vec4 out_Color;
#include "tools/texture2d.frag"
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
in vec3 in_Position; ///< incoming vertex position
in vec3 in_TexCoord; ///< incoming texture coordinate
in vec4 in_Color; ///< incoming color
......
......@@ -63,7 +63,9 @@ namespace campvis {
virtual ~VisualizationProcessor();
protected:
//protected:
IVec2Property _renderTargetSize; ///< Viewport size of target canvas
};
......
......@@ -245,6 +245,14 @@ namespace campvis {
void campvis::NumericProperty<T>::setMinValue(const T& value) {
_minValue = value;
this->setValue(validateValue(this->_value));
for (std::set<AbstractProperty*>::iterator it = _sharedProperties.begin(); it != _sharedProperties.end(); ++it) {
// We ensure all shared properties to be of type NumericProperty<T> in the addSharedProperty overload.
// Hence, static_cast ist safe.
NumericProperty<T>* child = static_cast< NumericProperty<T>* >(*it);
child->setMinValue(value);
}
s_minMaxChanged(this);
}
......@@ -252,6 +260,14 @@ namespace campvis {
void campvis::NumericProperty<T>::setMaxValue(const T& value) {
_maxValue = value;
this->setValue(validateValue(this->_value));
for (std::set<AbstractProperty*>::iterator it = _sharedProperties.begin(); it != _sharedProperties.end(); ++it) {
// We ensure all shared properties to be of type NumericProperty<T> in the addSharedProperty overload.
// Hence, static_cast ist safe.
NumericProperty<T>* child = static_cast< NumericProperty<T>* >(*it);
child->setMaxValue(value);
}
s_minMaxChanged(this);
}
......
......@@ -62,8 +62,10 @@ namespace campvis {
tgtAssert(tf != 0, "Transfer function must not be 0.");
s_BeforeTFReplace(_transferFunction);
if (_transferFunction != 0)
if (_transferFunction != 0) {
_transferFunction->s_changed.disconnect(this);
_transferFunction->deinit();
}
delete _transferFunction;
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
in vec3 ex_TexCoord;
out vec4 out_Color;
......
......@@ -49,6 +49,7 @@
#include <usinterface/include/trackedusfileio.h>
#include <usinterface/include/trackedusframe.h>
#include <usinterface/include/trackedussweep.h>
#include <usinterface/include/sweepvisitor/sweepsmoothinggaussian.h>
namespace {
......@@ -160,9 +161,9 @@ namespace campvis {
FaceGeometry slice(corners, texCoords);
MeshGeometry bb = MeshGeometry::createCube(_bounds, tgt::Bounds(tgt::vec3(-1.f), tgt::vec3(-1.f)));
const unsigned char* tmp = (p_showConfidenceMap.getValue() ? _currentSweep->getConfidenceMap(frameNr) : _currentSweep->getTrackedUSFrame(frameNr)->getQuartsampledBuffer().Pointer());
size_t width = (p_showConfidenceMap.getValue() ? _currentSweep->Width() / 4 : _currentSweep->Width()/4);
size_t height = (p_showConfidenceMap.getValue() ? _currentSweep->Height() / 4 : _currentSweep->Height()/4);
const unsigned char* tmp = (p_showConfidenceMap.getValue() ? _currentSweep->getConfidenceMap(frameNr) : _currentSweep->getTrackedUSFrame(frameNr)->getImageBuffer());
size_t width = (p_showConfidenceMap.getValue() ? _currentSweep->Width() / 4 : _currentSweep->Width());
size_t height = (p_showConfidenceMap.getValue() ? _currentSweep->Height() / 4 : _currentSweep->Height());
if (tmp != 0) {
std::pair<ImageData*, ImageRepresentationRenderTarget*> rt = ImageRepresentationRenderTarget::createWithImageData(_renderTargetSize.getValue());
......@@ -204,10 +205,10 @@ namespace campvis {
_shader->setAttributeLocation(1, "in_TexCoord");
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
bb.render();
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
bb.render(GL_LINE_LOOP);
slice.render();
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
slice.render(GL_POLYGON);
rt.second->deactivate();
_shader->setIgnoreUniformLocationError(false);
......@@ -283,7 +284,8 @@ namespace campvis {
void TrackedUsSweepFrameRenderer3D::onSmoothButtonClicked() {
if (_currentSweep != 0) {
_currentSweep->SmoothCorners(AverageTopCornersAccessFunc(), GaussianSmoothingFunc<AverageTopCornersAccessFunc, 16>());
SweepSmoothingGaussian smoother(_currentSweep, 16);
smoother.applyToAll();
updateBoundingBox();
invalidate(AbstractProcessor::INVALID_RESULT);
}
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
out vec4 out_Color;
#include "tools/texture2d.frag"
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
out vec4 out_Color; ///< outgoing fragment color
#include "tools/raycasting.frag"
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
in vec3 ex_TexCoord; ///< incoming texture coordinate
out vec4 out_Color; ///< outgoing fragment color
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
in vec3 ex_TexCoord; ///< incoming texture coordinate
out vec4 out_Color; ///< outgoing fragment color
......
......@@ -26,8 +26,6 @@
* commercial licensing please contact the authors. *
* *
**********************************************************************/
#version 330
in vec3 ex_TexCoord;
out vec4 out_Color;
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
in vec3 ex_TexCoord;
out vec4 out_Color;
......
......@@ -26,8 +26,6 @@
* commercial licensing please contact the authors. *
* *
**********************************************************************/
#version 330
in vec3 ex_TexCoord;
out vec4 out_Color;
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
layout(location = 0) out vec4 out_Color; ///< outgoing fragment color
layout(location = 1) out vec4 out_FHP; ///< outgoing fragment first hitpoint
layout(location = 2) out vec4 out_FHN; ///< outgoing fragment first hit normal
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
in vec3 ex_TexCoord;
out vec4 out_Color;
......
......@@ -27,8 +27,6 @@
//
// ================================================================================================
#version 330
in vec3 ex_TexCoord;
out vec4 out_Color;
......
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