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

moved rendering code from EEPGenerator to QuadRenderer

some GUI improvements

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@219 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 5fb271e8
......@@ -62,4 +62,8 @@ namespace TUMVis {
}
}
QSize MainWindow::sizeHint() const {
return QSize(800, 450);
}
}
\ No newline at end of file
......@@ -37,6 +37,8 @@ namespace TUMVis {
*/
void onPipelinesChanged();
QSize sizeHint() const;
signals:
/// Qt signal for updating the PipelineWidget.
void updatePipelineWidget(const std::vector<AbstractPipeline*>&);
......
......@@ -214,6 +214,7 @@ namespace TUMVis {
void PipelineTreeWidget::update(const std::vector<AbstractPipeline*>& pipelines) {
_treeModel->setData(pipelines);
expandAll();
}
void PipelineTreeWidget::setupWidget() {
......
......@@ -31,4 +31,75 @@ namespace tgt {
glDepthFunc(GL_LESS);
}
void QuadRenderer::renderCube(const tgt::Bounds& bounds, const tgt::Bounds& texBounds) {
const tgt::vec3& llf = bounds.getLLF();
const tgt::vec3& urb = bounds.getURB();
const tgt::vec3& tLlf = texBounds.getLLF();
const tgt::vec3& tUrb = texBounds.getURB();
// TODO: get fuckin' rid of intermediate mode, it simply sucks...
glColor3f(1.f, 0.f, 1.f);
glBegin(GL_QUADS);
// front
glTexCoord3f(tLlf.x, tUrb.y, tLlf.z);
glVertex3f(llf.x, urb.y, llf.z);
glTexCoord3f(tUrb.x, tUrb.y, tLlf.z);
glVertex3f(urb.x, urb.y, llf.z);
glTexCoord3f(tUrb.x, tLlf.y, tLlf.z);
glVertex3f(urb.x, llf.y, llf.z);
glTexCoord3f(tLlf.x, tLlf.y, tLlf.z);
glVertex3f(llf.x, llf.y, llf.z);
// right
glTexCoord3f(tUrb.x, tUrb.y, tLlf.z);
glVertex3f(urb.x, urb.y, llf.z);
glTexCoord3f(tUrb.x, tUrb.y, tUrb.z);
glVertex3f(urb.x, urb.y, urb.z);
glTexCoord3f(tUrb.x, tLlf.y, tUrb.z);
glVertex3f(urb.x, llf.y, urb.z);
glTexCoord3f(tUrb.x, tLlf.y, tLlf.z);
glVertex3f(urb.x, llf.y, llf.z);
// top
glTexCoord3f(tLlf.x, tUrb.y, tUrb.z);
glVertex3f(llf.x, urb.y, urb.z);
glTexCoord3f(tUrb.x, tUrb.y, tUrb.z);
glVertex3f(urb.x, urb.y, urb.z);
glTexCoord3f(tUrb.x, tUrb.y, tLlf.z);
glVertex3f(urb.x, urb.y, llf.z);
glTexCoord3f(tLlf.x, tUrb.y, tLlf.z);
glVertex3f(llf.x, urb.y, llf.z);
// left
glTexCoord3f(tLlf.x, tUrb.y, tUrb.z);
glVertex3f(llf.x, urb.y, urb.z);
glTexCoord3f(tLlf.x, tUrb.y, tLlf.z);
glVertex3f(llf.x, urb.y, llf.z);
glTexCoord3f(tLlf.x, tLlf.y, tLlf.z);
glVertex3f(llf.x, llf.y, llf.z);
glTexCoord3f(tLlf.x, tLlf.y, tUrb.z);
glVertex3f(llf.x, llf.y, urb.z);
// bottom
glTexCoord3f(tLlf.x, tLlf.y, tLlf.z);
glVertex3f(llf.x, llf.y, llf.z);
glTexCoord3f(tUrb.x, tLlf.y, tLlf.z);
glVertex3f(urb.x, llf.y, llf.z);
glTexCoord3f(tUrb.x, tLlf.y, tUrb.z);
glVertex3f(urb.x, llf.y, urb.z);
glTexCoord3f(tLlf.x, tLlf.y, tUrb.z);
glVertex3f(llf.x, llf.y, urb.z);
// back
glTexCoord3f(tUrb.x, tUrb.y, tUrb.z);
glVertex3f(urb.x, urb.y, urb.z);
glTexCoord3f(tLlf.x, tUrb.y, tUrb.z);
glVertex3f(llf.x, urb.y, urb.z);
glTexCoord3f(tLlf.x, tLlf.y, tUrb.z);
glVertex3f(llf.x, llf.y, urb.z);
glTexCoord3f(tUrb.x, tLlf.y, tUrb.z);
glVertex3f(urb.x, llf.y, urb.z);
glEnd();
}
}
\ No newline at end of file
#ifndef QUADRENDERER_H__
#define QUADRENDERER_H__
#include "tgt/bounds.h"
#include "tgt/exception.h"
#include "tgt/singleton.h"
#include "tgt/tgt_gl.h"
......@@ -14,6 +15,8 @@ namespace tgt {
static void renderQuad();
static void renderCube(const tgt::Bounds& bounds, const tgt::Bounds& texBounds);
private:
......
......@@ -52,7 +52,7 @@ namespace TUMVis {
if (img != 0) {
if (img->getDimensionality() == 3) {
// TODO: implement some kind of proxy geometry...
// TODO: implement some kind of cool proxy geometry supporting clipping (camera in volume)...
tgt::Bounds volumeExtent = img->getWorldBounds();
tgt::Bounds textureBounds(tgt::vec3(0.f), tgt::vec3(1.f));
......@@ -74,11 +74,11 @@ namespace TUMVis {
ImageDataRenderTarget* entrypoints = new ImageDataRenderTarget(tgt::svec3(_renderTargetSize.getValue(), 1));
entrypoints->activate();
glDepthFunc(GL_GREATER);
glClearDepth(0.0f);
glDepthFunc(GL_LESS);
glClearDepth(1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glCullFace(GL_FRONT);
renderProxyGeometry(volumeExtent, textureBounds);
glCullFace(GL_BACK);
tgt::QuadRenderer::renderCube(volumeExtent, textureBounds);
entrypoints->deactivate();
......@@ -86,17 +86,15 @@ namespace TUMVis {
ImageDataRenderTarget* exitpoints = new ImageDataRenderTarget(tgt::svec3(_renderTargetSize.getValue(), 1));
exitpoints->activate();
glDepthFunc(GL_LESS);
glClearDepth(1.0f);
glDepthFunc(GL_GREATER);
glClearDepth(0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glCullFace(GL_BACK);
renderProxyGeometry(volumeExtent, textureBounds);
glCullFace(GL_FRONT);
tgt::QuadRenderer::renderCube(volumeExtent, textureBounds);
exitpoints->deactivate();
_shader->deactivate();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
......@@ -117,75 +115,4 @@ namespace TUMVis {
_invalidationLevel.setValid();
}
void EEPGenerator::renderProxyGeometry(const tgt::Bounds& bounds, const tgt::Bounds& texBounds) {
const tgt::vec3& llf = bounds.getLLF();
const tgt::vec3& urb = bounds.getURB();
const tgt::vec3& tLlf = texBounds.getLLF();
const tgt::vec3& tUrb = texBounds.getURB();
// TODO: get fuckin' rid of intermediate mode, it simply sucks...
glColor3f(1.f, 0.f, 1.f);
glBegin(GL_QUADS);
// front
glTexCoord3f(tLlf.x, tLlf.y, tLlf.z);
glVertex3f(llf.x, llf.y, llf.z);
glTexCoord3f(tUrb.x, tLlf.y, tLlf.z);
glVertex3f(urb.x, llf.y, llf.z);
glTexCoord3f(tUrb.x, tUrb.y, tLlf.z);
glVertex3f(urb.x, urb.y, llf.z);
glTexCoord3f(tLlf.x, tUrb.y, tLlf.z);
glVertex3f(llf.x, urb.y, llf.z);
// right
glTexCoord3f(tUrb.x, tLlf.y, tLlf.z);
glVertex3f(urb.x, llf.y, llf.z);
glTexCoord3f(tUrb.x, tLlf.y, tUrb.z);
glVertex3f(urb.x, llf.y, urb.z);
glTexCoord3f(tUrb.x, tUrb.y, tUrb.z);
glVertex3f(urb.x, urb.y, urb.z);
glTexCoord3f(tUrb.x, tUrb.y, tLlf.z);
glVertex3f(urb.x, urb.y, llf.z);
// top
glTexCoord3f(tLlf.x, tUrb.y, tLlf.z);
glVertex3f(llf.x, urb.y, llf.z);
glTexCoord3f(tUrb.x, tUrb.y, tLlf.z);
glVertex3f(urb.x, urb.y, llf.z);
glTexCoord3f(tUrb.x, tUrb.y, tUrb.z);
glVertex3f(urb.x, urb.y, urb.z);
glTexCoord3f(tLlf.x, tUrb.y, tUrb.z);
glVertex3f(llf.x, urb.y, urb.z);
// left
glTexCoord3f(tLlf.x, tLlf.y, tUrb.z);
glVertex3f(llf.x, llf.y, urb.z);
glTexCoord3f(tLlf.x, tLlf.y, tLlf.z);
glVertex3f(llf.x, llf.y, llf.z);
glTexCoord3f(tLlf.x, tUrb.y, tLlf.z);
glVertex3f(llf.x, urb.y, llf.z);
glTexCoord3f(tLlf.x, tUrb.y, tUrb.z);
glVertex3f(llf.x, urb.y, urb.z);
// bottom
glTexCoord3f(tLlf.x, tLlf.y, tUrb.z);
glVertex3f(llf.x, llf.y, urb.z);
glTexCoord3f(tUrb.x, tLlf.y, tUrb.z);
glVertex3f(urb.x, llf.y, urb.z);
glTexCoord3f(tUrb.x, tLlf.y, tLlf.z);
glVertex3f(urb.x, llf.y, llf.z);
glTexCoord3f(tLlf.x, tLlf.y, tLlf.z);
glVertex3f(llf.x, llf.y, llf.z);
// back
glTexCoord3f(tUrb.x, tLlf.y, tUrb.z);
glVertex3f(urb.x, llf.y, urb.z);
glTexCoord3f(tLlf.x, tLlf.y, tUrb.z);
glVertex3f(llf.x, llf.y, urb.z);
glTexCoord3f(tLlf.x, tUrb.y, tUrb.z);
glVertex3f(llf.x, urb.y, urb.z);
glTexCoord3f(tUrb.x, tUrb.y, tUrb.z);
glVertex3f(urb.x, urb.y, urb.z);
glEnd();
}
}
......@@ -50,7 +50,6 @@ namespace TUMVis {
CameraProperty _camera;
protected:
void renderProxyGeometry(const tgt::Bounds& bounds, const tgt::Bounds& texBounds);
tgt::Shader* _shader; ///< Shader for EEP generation
......
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