Commit bb5d23dd authored by Declara Denis's avatar Declara Denis Committed by Christian Schulte zu Berge
Browse files

Adapted GeometryDataFactory to return unique pointers

parent edac8e97
......@@ -135,7 +135,7 @@ namespace campvis {
_localDataContainer.clear();
_textures.clear();
ShdrMgr.dispose(_paintShader);
delete _quad;
_quad = nullptr;
GLCtxtMgr.removeContext(this);
}
......@@ -262,8 +262,6 @@ namespace campvis {
}
void DataContainerInspectorCanvas::createQuad() {
delete _quad;
_quad = 0;
_quad = GeometryDataFactory::createQuad(cgt::vec3(0.f), cgt::vec3(1.f), cgt::vec3(0.f, 1.f, 0.f), cgt::vec3(1.f, 0.f, 0.f));
}
......
......@@ -44,6 +44,8 @@
#include "modules/base/processors/trackballcameraprovider.h"
#include "modules/vis/processors/geometryrenderer.h"
#include <memory>
namespace cgt {
class Shader;
......@@ -213,7 +215,7 @@ namespace campvis {
tbb::mutex _localMutex; ///< Mutex protecting the local members
cgt::Shader* _paintShader; ///< GLSL shader for rendering the textures
FaceGeometry* _quad; ///< Quad used for rendering
std::shared_ptr<FaceGeometry> _quad; ///< Quad used for rendering
cgt::ivec2 _numTiles; ///< number of tiles on texture overview
cgt::ivec2 _quadSize; ///< size in pixels for each tile in overview
......
......@@ -30,7 +30,7 @@
namespace campvis {
FaceGeometry* GeometryDataFactory::createQuad(const cgt::vec3& llf, const cgt::vec3& urb, const cgt::vec3& texLlf, const cgt::vec3& texUrb) {
std::unique_ptr<FaceGeometry> GeometryDataFactory::createQuad(const cgt::vec3& llf, const cgt::vec3& urb, const cgt::vec3& texLlf, const cgt::vec3& texUrb) {
std::vector<cgt::vec3> vertices, texCorods;
vertices.push_back(cgt::vec3(llf.x, llf.y, llf.z));
......@@ -43,10 +43,10 @@ namespace campvis {
texCorods.push_back(cgt::vec3(texUrb.x, texUrb.y, texLlf.z));
texCorods.push_back(cgt::vec3(texLlf.x, texUrb.y, texLlf.z));
return new FaceGeometry(vertices, texCorods);
return std::unique_ptr<FaceGeometry>(new FaceGeometry(vertices, texCorods));
}
MultiIndexedGeometry* GeometryDataFactory::createGrid(const cgt::vec3& llf, const cgt::vec3& urb, const cgt::vec3& texLlf, const cgt::vec3& texUrb, int xSegments, int ySegments) {
std::unique_ptr<MultiIndexedGeometry> GeometryDataFactory::createGrid(const cgt::vec3& llf, const cgt::vec3& urb, const cgt::vec3& texLlf, const cgt::vec3& texUrb, int xSegments, int ySegments) {
cgtAssert(xSegments > 0 && ySegments > 1, "Grid must have at least one segment in each direction");
int numVertices = (xSegments + 1) * (ySegments + 1);
......@@ -72,7 +72,7 @@ namespace campvis {
}
}
MultiIndexedGeometry* result = new MultiIndexedGeometry(vertices, textureCoordinates, std::vector<cgt::vec4>(), normals);
auto result = new MultiIndexedGeometry(vertices, textureCoordinates, std::vector<cgt::vec4>(), normals);
// For each horizontal stripe, construct the indeces for triangle strips
int verticesPerStrip = (xSegments + 1) * 2;
......@@ -86,11 +86,11 @@ namespace campvis {
result->addPrimitive(indices);
}
return result;
return std::unique_ptr<MultiIndexedGeometry>(result);
}
MeshGeometry* GeometryDataFactory::createCube(const cgt::Bounds& bounds, const cgt::Bounds& texBounds) {
std::unique_ptr<MeshGeometry> GeometryDataFactory::createCube(const cgt::Bounds& bounds, const cgt::Bounds& texBounds) {
const cgt::vec3& llf = bounds.getLLF();
const cgt::vec3& urb = bounds.getURB();
const cgt::vec3& tLlf = texBounds.getLLF();
......@@ -178,10 +178,10 @@ namespace campvis {
vertices.clear();
texCoords.clear();
return new MeshGeometry(faces);
return std::unique_ptr<MeshGeometry>(new MeshGeometry(faces));
}
MultiIndexedGeometry* GeometryDataFactory::createTeapot() {
std::unique_ptr<MultiIndexedGeometry> GeometryDataFactory::createTeapot() {
std::vector<cgt::vec3> vertices, normals;
vertices.reserve(Teapot::num_teapot_vertices);
normals.reserve(Teapot::num_teapot_vertices);
......@@ -201,10 +201,10 @@ namespace campvis {
currentOffset += count + 1;
}
return toReturn;
return std::unique_ptr<MultiIndexedGeometry>(toReturn);
}
MultiIndexedGeometry* GeometryDataFactory::createSphere(uint16_t numStacks /*= 6*/, uint16_t numSlices /*= 12*/, const cgt::vec3& exponents /*= cgt::vec3(1.f)*/) {
std::unique_ptr<MultiIndexedGeometry> GeometryDataFactory::createSphere(uint16_t numStacks /*= 6*/, uint16_t numSlices /*= 12*/, const cgt::vec3& exponents /*= cgt::vec3(1.f)*/) {
cgtAssert(numStacks > 1 && numSlices > 2, "Sphere must have minimum 2 stacks and 3 slices!");
std::vector<cgt::vec3> vertices;
std::vector<cgt::vec3> textureCoordinates;
......@@ -285,10 +285,10 @@ namespace campvis {
toReturn->addPrimitive(indices);
}
return toReturn;
return std::unique_ptr<MultiIndexedGeometry>(toReturn);
}
MultiIndexedGeometry* GeometryDataFactory::createArrow(uint16_t numSlices, float tipLen, float cylRadius, float tipRadius) {
std::unique_ptr<MultiIndexedGeometry> GeometryDataFactory::createArrow(uint16_t numSlices, float tipLen, float cylRadius, float tipRadius) {
cgtAssert(numSlices > 2, "Arrow shaft must have minimum 3 slices!");
cgtAssert(tipRadius > cylRadius, "Tip radius must exceed cyclinder radius (for correct normals)!");
cgtAssert(tipLen > 0, "Tip length must be between 0 and 1!");
......@@ -395,7 +395,7 @@ namespace campvis {
toReturn->addPrimitive(indices);
}
return toReturn;
return std::unique_ptr<MultiIndexedGeometry>(toReturn);
}
}
\ No newline at end of file
......@@ -34,6 +34,7 @@
#include "core/datastructures/multiindexedgeometry.h"
#include <vector>
#include <memory>
namespace campvis {
......@@ -49,7 +50,7 @@ namespace campvis {
* \param texUrb Texture coordinates of the upper right vertex
* \return A FaceGeometry building a quad with the given bounds and texture coordinates.
*/
static FaceGeometry* createQuad(const cgt::vec3& llf, const cgt::vec3& urb, const cgt::vec3& texLlf, const cgt::vec3& texUrb);
static std::unique_ptr<FaceGeometry> createQuad(const cgt::vec3& llf, const cgt::vec3& urb, const cgt::vec3& texLlf, const cgt::vec3& texUrb);
/**
* Creates a MultiIndexedGeometry building an axis-aligned rectangular gird in the YX plane
......@@ -64,8 +65,7 @@ namespace campvis {
* \param ySegments Number of segments along y direction
* \return A MultiIndexedGeometry building a grid with the given bounds and texture coordinates.
*/
static MultiIndexedGeometry* createGrid(const cgt::vec3& llf, const cgt::vec3& urb, const cgt::vec3& texLlf, const cgt::vec3& texUrb,
int xSegments = 4, int ySegments = 4);
static std::unique_ptr<MultiIndexedGeometry> createGrid(const cgt::vec3& llf, const cgt::vec3& urb, const cgt::vec3& texLlf, const cgt::vec3& texUrb, int xSegments = 4, int ySegments = 4);
/**
* Creates a MeshGeometry building a cube with the given bounds and texture coordinates.
......@@ -74,13 +74,13 @@ namespace campvis {
* \param texBounds texture coordinates at the cube bounds
* \return A MeshGeometry building a cube with the given bounds and texture coordinates.
*/
static MeshGeometry* createCube(const cgt::Bounds& bounds, const cgt::Bounds& texBounds);
static std::unique_ptr<MeshGeometry> createCube(const cgt::Bounds& bounds, const cgt::Bounds& texBounds);
/**
* Creates an MultiIndexedGeometry storing the famous Utah teapot.
* \return MultiIndexedGeometry storing the famous Utah teapot.
*/
static MultiIndexedGeometry* createTeapot();
static std::unique_ptr<MultiIndexedGeometry> createTeapot();
/**
* Creates an MultiIndexedGeometry storing a unit sphere around the origin.
......@@ -89,7 +89,7 @@ namespace campvis {
* \param exponents Exponent for each dimension to define a supersphere (defines the roundness)
* \return MultiIndexedGeometry storing a unit sphere around the origin.
*/
static MultiIndexedGeometry* createSphere(uint16_t numStacks = 6, uint16_t numSlices = 12, const cgt::vec3& exponents = cgt::vec3(1.f));
static std::unique_ptr<MultiIndexedGeometry> createSphere(uint16_t numStacks = 6, uint16_t numSlices = 12, const cgt::vec3& exponents = cgt::vec3(1.f));
/**
......@@ -100,7 +100,7 @@ namespace campvis {
* \param tipRadius Radius of the bottom of the arrow tip
* \return MultiIndexedGeometry storing a unit arrow in Z direction starting from the origin.
*/
static MultiIndexedGeometry* createArrow(uint16_t numSlices = 12, float tipLen = 0.35, float cylRadius = 0.05, float tipRadius = 0.15);
static std::unique_ptr<MultiIndexedGeometry> createArrow(uint16_t numSlices = 12, float tipLen = 0.35, float cylRadius = 0.05, float tipRadius = 0.15);
};
}
......
......@@ -38,8 +38,6 @@ namespace campvis {
}
QuadRenderer::~QuadRenderer() {
delete _quad11;
delete _quad01;
}
void QuadRenderer::renderQuad11(GLenum mode) {
......
......@@ -30,6 +30,8 @@
#include "core/coreapi.h"
#include <memory>
namespace campvis {
class FaceGeometry;
......@@ -71,8 +73,8 @@ namespace campvis {
/// Private Constructor, must be called from valid OpenGL context.
QuadRenderer();
FaceGeometry* _quad11; ///< The FaceGeometry that renders the [-1, 1] quad.
FaceGeometry* _quad01; ///< The FaceGeometry that renders the [0, 1] quad.
std::unique_ptr<FaceGeometry> _quad11; ///< The FaceGeometry that renders the [-1, 1] quad.
std::unique_ptr<FaceGeometry> _quad01; ///< The FaceGeometry that renders the [0, 1] quad.
};
#define QuadRdr cgt::Singleton<campvis::QuadRenderer>::getRef()
......
......@@ -45,7 +45,7 @@ namespace campvis {
, p_halfAngle("HalfAngle", "Fan Half Angle", 45.0f, 1.0f, 90.0f)
, p_innerRadius("InnerRadius", "Fan Inner Radius", 0.2f, 0.0f, 0.99f)
, _shader(0)
, _grid(0)
, _grid(nullptr)
{
addProperty(p_inputImage);
addProperty(p_renderTargetID);
......@@ -67,9 +67,8 @@ namespace campvis {
void UsFanRenderer::deinit() {
ShdrMgr.dispose(_shader);
_shader = 0;
delete _grid;
_grid = 0;
_shader = nullptr;
_grid = nullptr;
VisualizationProcessor::deinit();
}
......@@ -77,55 +76,59 @@ namespace campvis {
void UsFanRenderer::updateResult(DataContainer& data) {
ImageRepresentationGL::ScopedRepresentation texture(data, p_inputImage.getValue());
// Check that the needed resources have been initialized. Error should never happen.
if (_shader == 0 || _grid == 0) {
LDEBUG("Shader or Grid are not initialized.");
return;
}
float halfAngle = cgt::deg2rad(p_halfAngle.getValue());
float innerRadius = p_innerRadius.getValue();
// Only display the fan if there exists a valid input texture
if (texture != nullptr) {
float halfAngle = cgt::deg2rad(p_halfAngle.getValue());
float innerRadius = p_innerRadius.getValue();
// calculate bounding box of the US fan
cgt::vec3 bbCenter = cgt::vec3(0, cos(halfAngle)*innerRadius/2.0f + 0.5, 0.0f);
float bbHeight = 1.0f - cos(halfAngle)*innerRadius;
float bbWidth = sin(halfAngle) * 2.0f;
// calculate bounding box of the US fan
cgt::vec3 bbCenter = cgt::vec3(0, cos(halfAngle)*innerRadius/2.0f + 0.5, 0.0f);
float bbHeight = 1.0f - cos(halfAngle)*innerRadius;
float bbWidth = sin(halfAngle) * 2.0f;
cgt::vec2 viewportSize = cgt::vec2(getEffectiveViewportSize());
cgt::vec2 viewportSize = cgt::vec2(getEffectiveViewportSize());
// Flip y axis and add a little border
cgt::mat4 viewportMatrix = cgt::mat4::createScale(cgt::vec3(1, -1, 1) * 0.95f);
// Flip y axis and add a little border
cgt::mat4 viewportMatrix = cgt::mat4::createScale(cgt::vec3(1, -1, 1) * 0.95f);
// Adjust the size of the fan to the size of the viewport
if (viewportSize.y / bbHeight * bbWidth > viewportSize.x) {
viewportMatrix *= cgt::mat4::createScale(cgt::vec3(1.0f, viewportSize.x / viewportSize.y, 1.0f) * (1.0f / bbWidth * 2.0f));
} else {
viewportMatrix *= cgt::mat4::createScale(cgt::vec3(viewportSize.y / viewportSize.x, 1.0f, 1.0f) * (1.0f / bbHeight * 2.0f));
}
// Adjust the size of the fan to the size of the viewport
if (viewportSize.y / bbHeight * bbWidth > viewportSize.x) {
viewportMatrix *= cgt::mat4::createScale(cgt::vec3(1.0f, viewportSize.x / viewportSize.y, 1.0f) * (1.0f / bbWidth * 2.0f));
} else {
viewportMatrix *= cgt::mat4::createScale(cgt::vec3(viewportSize.y / viewportSize.x, 1.0f, 1.0f) * (1.0f / bbHeight * 2.0f));
}
// Move the fan center
viewportMatrix *= cgt::mat4::createTranslation(-bbCenter);
// Move the fan center
viewportMatrix *= cgt::mat4::createTranslation(-bbCenter);
_shader->activate();
cgt::TextureUnit textureUnit;
textureUnit.activate();
if (texture != nullptr)
texture->bind(_shader, textureUnit, "_texture", "_textureParams");
_shader->activate();
cgt::TextureUnit textureUnit;
textureUnit.activate();
if (texture != nullptr)
texture->bind(_shader, textureUnit, "_texture", "_textureParams");
_shader->setUniform("_projectionMatrix", viewportMatrix);
_shader->setUniform("halfAngle", halfAngle);
_shader->setUniform("innerRadius", innerRadius);
_shader->setUniform("isMonochromatic", (texture == nullptr || texture->getParent()->getNumChannels()) == 1);
_shader->setUniform("_projectionMatrix", viewportMatrix);
_shader->setUniform("halfAngle", halfAngle);
_shader->setUniform("innerRadius", innerRadius);
_shader->setUniform("isMonochromatic", (texture == nullptr || texture->getParent()->getNumChannels()) == 1);
FramebufferActivationGuard fag(this);
createAndAttachColorTexture();
FramebufferActivationGuard fag(this);
createAndAttachColorTexture();
glClearColor(0.1, 0.1, 0.1, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
_grid->render(GL_TRIANGLE_STRIP);
_shader->deactivate();
glClearColor(0.1, 0.1, 0.1, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
_grid->render(GL_TRIANGLE_STRIP);
_shader->deactivate();
LGL_ERROR;
LGL_ERROR;
data.addData(p_renderTargetID.getValue(), new RenderData(_fbo));
data.addData(p_renderTargetID.getValue(), new RenderData(_fbo));
}
}
}
......@@ -26,6 +26,7 @@
#define USFANRENDERER_H__
#include <string>
#include <memory>
#include "core/pipeline/visualizationprocessor.h"
#include "core/pipeline/abstractprocessordecorator.h"
......@@ -77,7 +78,7 @@ namespace campvis {
virtual void updateResult(DataContainer& dataContainer);
cgt::Shader* _shader;
MultiIndexedGeometry *_grid;
std::unique_ptr<MultiIndexedGeometry> _grid;
private:
static const std::string loggerCat_;
......
......@@ -216,7 +216,7 @@ namespace campvis {
_sliceExtractor.deinit();
VisualizationProcessor::deinit();
ShdrMgr.dispose(_shader);
delete _quad;
_quad = nullptr; // Object is automatically deleted
}
void MicroscopyImageSegmentation::updateResult(DataContainer& data) {
......
......@@ -44,6 +44,8 @@
#include <vector>
#include "modules/processorfactory.h"
#include <memory>
#include "core/datastructures/facegeometry.h"
namespace cgt {
class Shader;
......@@ -177,7 +179,7 @@ namespace campvis {
void updateProperties(DataContainer& dc);
cgt::Shader* _shader; ///< Shader for slice rendering
FaceGeometry* _quad;
std::unique_ptr<FaceGeometry> _quad;
TrackballCameraProvider _tcp;
VolumeRenderer _vr;
......
......@@ -62,8 +62,8 @@ namespace campvis {
, p_lightId("LightId", "Input Light Source", "lightsource", DataNameProperty::READ)
, p_sliceOrientation("SliceOrientation", "Slice Orientation", sliceOrientationOptions, 3)
, p_sliceNumber("SliceNumber", "Slice Number", 0, 0, 0)
, _ellipsoidGeometry(0)
, _cubeGeometry(0)
, _ellipsoidGeometry(nullptr)
, _cubeGeometry(nullptr)
{
addProperty(p_inputEigenvalues, INVALID_RESULT | INVALID_PROPERTIES);
addProperty(p_inputEigenvectors, INVALID_RESULT | INVALID_PROPERTIES);
......@@ -95,10 +95,8 @@ namespace campvis {
void TensorGlyphRenderer::deinit() {
ShdrMgr.dispose(_shader);
delete _ellipsoidGeometry;
_ellipsoidGeometry = 0;
delete _cubeGeometry;
_cubeGeometry = 0;
_ellipsoidGeometry = nullptr;
_cubeGeometry = nullptr;
VisualizationProcessor::deinit();
......
......@@ -26,6 +26,7 @@
#define TENSORGLYPHRENDERER_H__
#include <string>
#include <memory>
#include "core/pipeline/visualizationprocessor.h"
#include "core/pipeline/abstractprocessordecorator.h"
......@@ -122,8 +123,8 @@ namespace campvis {
void renderTensorGlyph(const GenericImageRepresentationLocal<float, 3>* evals, const GenericImageRepresentationLocal<float, 9>* evecs, const cgt::vec3& position);
cgt::Shader* _shader; ///< Shader for glyph rendering
GeometryData* _ellipsoidGeometry; ///< Geometry for ellipsoid rendering
GeometryData* _cubeGeometry; ///< Geometry for cuboid rendering
std::shared_ptr<GeometryData> _ellipsoidGeometry; ///< Geometry for ellipsoid rendering
std::shared_ptr<GeometryData> _cubeGeometry; ///< Geometry for cuboid rendering
static const std::string loggerCat_;
};
......
......@@ -62,7 +62,7 @@ namespace campvis {
, p_lightId("LightId", "Input Light Source", "lightsource", DataNameProperty::READ)
, p_sliceOrientation("SliceOrientation", "Slice Orientation", sliceOrientationOptions, 4)
, p_sliceNumber("SliceNumber", "Slice Number", 0, 0, 0)
, _arrowGeometry(0)
, _arrowGeometry(nullptr)
{
addProperty(p_inputVectors, INVALID_RESULT | INVALID_PROPERTIES);
addProperty(p_camera);
......@@ -96,14 +96,13 @@ namespace campvis {
void VectorFieldRenderer::deinit() {
ShdrMgr.dispose(_shader);
delete _arrowGeometry;
_arrowGeometry = 0;
_arrowGeometry = nullptr;
VisualizationProcessor::deinit();
}
void VectorFieldRenderer::updateResult(DataContainer& dataContainer) {
if (_arrowGeometry == 0 ) {
if (_arrowGeometry == nullptr ) {
LERROR("Error initializing arrow geometry.");
return;
}
......
......@@ -26,6 +26,7 @@
#define VECTORFIELDRENDERER_H__
#include <string>
#include <memory>
#include "core/pipeline/visualizationprocessor.h"
#include "core/pipeline/abstractprocessordecorator.h"
......@@ -125,7 +126,7 @@ namespace campvis {
*/
void renderVectorArrow(const GenericImageRepresentationLocal<float, 3>* vectors, const cgt::vec3& position, float scale);
GeometryData* _arrowGeometry; ///< Geometry for arrow rendering
std::shared_ptr<GeometryData> _arrowGeometry; ///< Geometry for arrow rendering
cgt::Shader* _shader; ///< Shader for arrow rendering
static const std::string loggerCat_;
......
......@@ -77,13 +77,13 @@ namespace campvis {
_geometryReader.s_validated.connect(this, &GeometryRendererDemo::onProcessorValidated);
// create Teapot
MultiIndexedGeometry* teapot = GeometryDataFactory::createTeapot();
auto teapot = GeometryDataFactory::createTeapot();
teapot->applyTransformationToVertices(cgt::mat4::createTranslation(cgt::vec3(5.f, 10.f, 5.f)) * cgt::mat4::createScale(cgt::vec3(16.f)));
getDataContainer().addData("teapot", teapot);
getDataContainer().addData("teapot", teapot.release());
// create cube
MeshGeometry* cube = GeometryDataFactory::createCube(cgt::Bounds(cgt::vec3(7.f), cgt::vec3(9.f)), cgt::Bounds(cgt::vec3(0.f), cgt::vec3(1.f)));
getDataContainer().addData("cube", cube);
auto cube = GeometryDataFactory::createCube(cgt::Bounds(cgt::vec3(7.f), cgt::vec3(9.f)), cgt::Bounds(cgt::vec3(0.f), cgt::vec3(1.f)));
getDataContainer().addData("cube", cube.release());
// setup pipeline
_geometryReader.p_url.setValue(ShdrMgr.completePath("/modules/vis/sampledata/left_ventricle_mesh.vtk"));
......
......@@ -71,8 +71,8 @@ namespace campvis {
cgt::vec3 texURB(static_cast<float>(p_clipX.getValue().y), static_cast<float>(p_clipY.getValue().y), static_cast<float>(p_clipZ.getValue().y));
texURB /= numSlices;
MeshGeometry* cube = GeometryDataFactory::createCube(volumeExtent, cgt::Bounds(texLLF, texURB));
data.addData(p_geometryID.getValue(), cube);
std::unique_ptr<MeshGeometry> cube = GeometryDataFactory::createCube(volumeExtent, cgt::Bounds(texLLF, texURB));
data.addData(p_geometryID.getValue(), cube.release());
}
else {
LERROR("Input image must have dimensionality of 3.");
......
......@@ -89,13 +89,12 @@ namespace campvis {
// The closing face is the slice proxy geometry.
// This is probably not the fastest, but an elegant solution, which also supports arbitrary slice orientations. :)
cgt::Bounds volumeExtent = img->getParent()->getWorldBounds();
MeshGeometry* cube = GeometryDataFactory::createCube(volumeExtent, cgt::Bounds(cgt::vec3(0.f), cgt::vec3(1.f)));
std::shared_ptr<MeshGeometry> cube = GeometryDataFactory::createCube(volumeExtent, cgt::Bounds(cgt::vec3(0.f), cgt::vec3(1.f)));
cgt::vec3 normal(0.f, 0.f, 1.f);
float p = img->getParent()->getMappingInformation().getOffset().z + (p_sliceNumber.getValue() * img->getParent()->getMappingInformation().getVoxelSize().z);
MeshGeometry clipped = cube->clipAgainstPlane(p, normal, true);
const FaceGeometry& slice = clipped.getFaces().back(); // the last face is the closing face
delete cube;
glEnable(GL_DEPTH_TEST);
_shader->activate();
......
......@@ -150,7 +150,7 @@ namespace campvis {
_sliceRenderer->deinit();
VisualizationProcessor::deinit();
ShdrMgr.dispose(_shader);
delete _quad;
_quad = nullptr;
}
void VolumeExplorer::updateResult(DataContainer& data) {
......
......@@ -40,6 +40,8 @@
#include "modules/vis/processors/sliceextractor.h"
#include "modules/processorfactory.h"
#include <memory>
namespace cgt {
class Shader;
}
......@@ -154,7 +156,7 @@ namespace campvis {
void updateProperties(DataContainer& dc);
cgt::Shader* _shader; ///< Shader for slice rendering
FaceGeometry* _quad;
std::unique_ptr<FaceGeometry> _quad;
TrackballCameraProvider _tcp;
VolumeRenderer _raycaster;
......
......@@ -33,6 +33,8 @@
#include "core/datastructures/facegeometry.h"
#include "modules/modulesapi.h"
#include <memory>
namespace cgt {
class FramebufferObject;
class Shader;
......@@ -104,7 +106,7 @@ namespace campvis {
cgt::Texture* _xorBitmaskTexture; ///< Texture holding the 128x128 possible combinations of uvec4 bitmasks
cgt::Texture* _hierarchyTexture; ///< The OpenGL texture storing the voxel hierarchy
FaceGeometry* _quad;
std::shared_ptr<FaceGeometry> _quad;
static std::string loggerCat_;
......
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