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

a Bunch of refactoring:

 * renamed GeometryTransferFunctionXYZ to Geometry1DTransferFunctionXYZ
 * renamed TFGeometry to TFGeometry1D

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@323 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 7e13e80c
......@@ -31,7 +31,7 @@ SET(TUMVIS_APPLICATION_TO_BE_MOCCED
gui/properties/boolpropertywidget.h
gui/properties/intpropertywidget.h
gui/properties/floatpropertywidget.h
gui/properties/geometrytransferfunctioneditor.h
gui/properties/geometry1dtransferfunctioneditor.h
gui/properties/propertycollectionwidget.h
gui/properties/simpletransferfunctioneditor.h
gui/properties/stringpropertywidget.h
......
......@@ -157,6 +157,8 @@ namespace TUMVis {
else {
_lblTimestamp->setText("Timestamp: ");
_lblName->setText("Name: ");
_lblLocalMemoryFootprint->setText("Local Memory Footprint: ");
_lblVideoMemoryFootprint->setText("Video Memory Footprint: ");
}
}
......
......@@ -26,7 +26,7 @@
//
// ================================================================================================
#include "geometrytransferfunctioneditor.h"
#include "geometry1dtransferfunctioneditor.h"
#include "tgt/assert.h"
#include "tgt/shadermanager.h"
......@@ -36,8 +36,8 @@
#include "application/gui/qtcolortools.h"
#include "application/gui/properties/tfgeometrymanipulator.h"
#include "core/classification/geometrytransferfunction.h"
#include "core/classification/tfgeometry.h"
#include "core/classification/geometry1dtransferfunction.h"
#include "core/classification/tfgeometry1d.h"
#include "core/datastructures/imagedatalocal.h"
#include "core/properties/transferfunctionproperty.h"
#include "core/tools/opengljobprocessor.h"
......@@ -49,7 +49,7 @@
namespace TUMVis {
GeometryTransferFunctionEditor::GeometryTransferFunctionEditor(GeometryTransferFunction* tf, QWidget* parent /*= 0*/)
Geometry1DTransferFunctionEditor::Geometry1DTransferFunctionEditor(Geometry1DTransferFunction* tf, QWidget* parent /*= 0*/)
: AbstractTransferFunctionEditor(tf, parent)
, _layout(0)
, _canvas(0)
......@@ -59,12 +59,12 @@ namespace TUMVis {
{
_selectedGeometry = 0;
setupGUI();
tf->s_geometryCollectionChanged.connect(this, &GeometryTransferFunctionEditor::onGeometryCollectionChanged);
tf->s_geometryCollectionChanged.connect(this, &Geometry1DTransferFunctionEditor::onGeometryCollectionChanged);
updateManipulators();
setEventTypes(tgt::Event::MOUSEPRESSEVENT);
}
GeometryTransferFunctionEditor::~GeometryTransferFunctionEditor() {
Geometry1DTransferFunctionEditor::~Geometry1DTransferFunctionEditor() {
tbb::mutex::scoped_lock lock(_localMutex);
// clear and delete former stuff
......@@ -76,23 +76,23 @@ namespace TUMVis {
delete *it;
}
GeometryTransferFunction* gtf = static_cast<GeometryTransferFunction*>(_transferFunction);
Geometry1DTransferFunction* gtf = static_cast<Geometry1DTransferFunction*>(_transferFunction);
gtf->s_geometryCollectionChanged.disconnect(this);
// TODO: this needs to be done, but we can not ensure that GLJobProc is still existant during deconstruction...
//GLJobProc.deregisterContext(_canvas);
}
void GeometryTransferFunctionEditor::updateWidgetFromProperty() {
GeometryTransferFunction* gtf = static_cast<GeometryTransferFunction*>(_transferFunction);
void Geometry1DTransferFunctionEditor::updateWidgetFromProperty() {
Geometry1DTransferFunction* gtf = static_cast<Geometry1DTransferFunction*>(_transferFunction);
_lblIntensityLeft->setText(QString::number(gtf->getIntensityDomain().x));
_lblIntensityRight->setText(QString::number(gtf->getIntensityDomain().y));
invalidate();
}
void GeometryTransferFunctionEditor::paint() {
GeometryTransferFunction* gtf = static_cast<GeometryTransferFunction*>(_transferFunction);
void Geometry1DTransferFunctionEditor::paint() {
Geometry1DTransferFunction* gtf = static_cast<Geometry1DTransferFunction*>(_transferFunction);
gtf->lock();
const std::vector<TFGeometry*>& geometries = gtf->getGeometries();
const std::vector<TFGeometry1D*>& geometries = gtf->getGeometries();
const tgt::vec2& intensityDomain = gtf->getIntensityDomain();
// TODO: get rid of intermediate mode?
......@@ -109,7 +109,7 @@ namespace TUMVis {
LGL_ERROR;
// render TF geometries
for (std::vector<TFGeometry*>::const_iterator it = geometries.begin(); it != geometries.end(); ++it) {
for (std::vector<TFGeometry1D*>::const_iterator it = geometries.begin(); it != geometries.end(); ++it) {
(*it)->render();
}
......@@ -176,7 +176,7 @@ namespace TUMVis {
gtf->unlock();
}
void GeometryTransferFunctionEditor::sizeChanged(const tgt::ivec2& size) {
void Geometry1DTransferFunctionEditor::sizeChanged(const tgt::ivec2& size) {
tbb::mutex::scoped_lock lock(_localMutex);
for (std::vector<AbstractTFGeometryManipulator*>::iterator it = _manipulators.begin(); it != _manipulators.end(); ++it) {
(*it)->setViewportSize(size);
......@@ -184,12 +184,12 @@ namespace TUMVis {
invalidate();
}
void GeometryTransferFunctionEditor::mousePressEvent(tgt::MouseEvent* e) {
void Geometry1DTransferFunctionEditor::mousePressEvent(tgt::MouseEvent* e) {
if (_selectedGeometry != 0 && e->modifiers() & tgt::Event::CTRL) {
TFGeometry* g = _selectedGeometry->getGeometry();
std::vector<TFGeometry::KeyPoint>& kpts = g->getKeyPoints();
TFGeometry::KeyPoint kp(static_cast<float>(e->x()) / static_cast<float>(_canvas->width()), tgt::col4(255));
std::vector<TFGeometry::KeyPoint>::const_iterator lb = std::upper_bound(kpts.begin(), kpts.end(), kp);
TFGeometry1D* g = _selectedGeometry->getGeometry();
std::vector<TFGeometry1D::KeyPoint>& kpts = g->getKeyPoints();
TFGeometry1D::KeyPoint kp(static_cast<float>(e->x()) / static_cast<float>(_canvas->width()), tgt::col4(255));
std::vector<TFGeometry1D::KeyPoint>::const_iterator lb = std::upper_bound(kpts.begin(), kpts.end(), kp);
if (lb != kpts.end()) {
kp._color = lb->_color;
}
......@@ -209,12 +209,12 @@ namespace TUMVis {
}
}
void GeometryTransferFunctionEditor::invalidate() {
GLJobProc.enqueueJob(_canvas, new CallMemberFuncJob<GeometryTransferFunctionEditor>(this, &GeometryTransferFunctionEditor::paint), OpenGLJobProcessor::PaintJob);
void Geometry1DTransferFunctionEditor::invalidate() {
GLJobProc.enqueueJob(_canvas, new CallMemberFuncJob<Geometry1DTransferFunctionEditor>(this, &Geometry1DTransferFunctionEditor::paint), OpenGLJobProcessor::PaintJob);
}
void GeometryTransferFunctionEditor::setupGUI() {
GeometryTransferFunction* gtf = static_cast<GeometryTransferFunction*>(_transferFunction);
void Geometry1DTransferFunctionEditor::setupGUI() {
Geometry1DTransferFunction* gtf = static_cast<Geometry1DTransferFunction*>(_transferFunction);
_layout = new QGridLayout(this);
setLayout(_layout);
......@@ -253,7 +253,7 @@ namespace TUMVis {
_layout->setRowStretch(2, 1);
}
void GeometryTransferFunctionEditor::updateManipulators() {
void Geometry1DTransferFunctionEditor::updateManipulators() {
tbb::mutex::scoped_lock lock(_localMutex);
// clear and delete former stuff
......@@ -267,17 +267,17 @@ namespace TUMVis {
}
_manipulators.clear();
GeometryTransferFunction* gtf = static_cast<GeometryTransferFunction*>(_transferFunction);
const std::vector<TFGeometry*>& geometries = gtf->getGeometries();
for (std::vector<TFGeometry*>::const_iterator git = geometries.begin(); git != geometries.end(); ++git) {
Geometry1DTransferFunction* gtf = static_cast<Geometry1DTransferFunction*>(_transferFunction);
const std::vector<TFGeometry1D*>& geometries = gtf->getGeometries();
for (std::vector<TFGeometry1D*>::const_iterator git = geometries.begin(); git != geometries.end(); ++git) {
// Add manipulator for the whole geometry and register it as event handler:
WholeTFGeometryManipulator* wtf = new WholeTFGeometryManipulator(_canvas->getSize(), gtf, *git);
_manipulators.push_back(wtf);
_canvas->getEventHandler()->addListenerToFront(wtf);
wtf->s_selected.connect(this, &GeometryTransferFunctionEditor::onWholeTFGeometryManipulatorSelected);
wtf->s_selected.connect(this, &Geometry1DTransferFunctionEditor::onWholeTFGeometryManipulatorSelected);
// Add a manipulator for each KeyPoint and register it as event handler:
for (std::vector<TFGeometry::KeyPoint>::iterator kpit = (*git)->getKeyPoints().begin(); kpit != (*git)->getKeyPoints().end(); ++kpit) {
for (std::vector<TFGeometry1D::KeyPoint>::iterator kpit = (*git)->getKeyPoints().begin(); kpit != (*git)->getKeyPoints().end(); ++kpit) {
_manipulators.push_back(new KeyPointManipulator(_canvas->getSize(), gtf, *git, kpit));
_canvas->getEventHandler()->addListenerToFront(_manipulators.back());
}
......@@ -286,26 +286,26 @@ namespace TUMVis {
_canvas->getEventHandler()->addListenerToFront(this);
}
void GeometryTransferFunctionEditor::onGeometryCollectionChanged() {
void Geometry1DTransferFunctionEditor::onGeometryCollectionChanged() {
updateManipulators();
}
void GeometryTransferFunctionEditor::onWholeTFGeometryManipulatorSelected(WholeTFGeometryManipulator* wtf /* :) */) {
void Geometry1DTransferFunctionEditor::onWholeTFGeometryManipulatorSelected(WholeTFGeometryManipulator* wtf /* :) */) {
_selectedGeometry = wtf;
invalidate();
}
void GeometryTransferFunctionEditor::onBtnAddGeometryClicked() {
GeometryTransferFunction* gtf = static_cast<GeometryTransferFunction*>(_transferFunction);
gtf->addGeometry(TFGeometry::createQuad(tgt::vec2(.4f, .6f), tgt::col4(196), tgt::col4(196)));
void Geometry1DTransferFunctionEditor::onBtnAddGeometryClicked() {
Geometry1DTransferFunction* gtf = static_cast<Geometry1DTransferFunction*>(_transferFunction);
gtf->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.4f, .6f), tgt::col4(196), tgt::col4(196)));
}
void GeometryTransferFunctionEditor::onBtnRemoveGeometryClicked() {
void Geometry1DTransferFunctionEditor::onBtnRemoveGeometryClicked() {
if (_selectedGeometry != 0) {
// to get the signal-slots disconnected in the correct order and avoid double deletion,
// this is getting a little messy and cumbersome:
GeometryTransferFunction* gtf = static_cast<GeometryTransferFunction*>(_transferFunction);
TFGeometry* geometryToRemove = _selectedGeometry->getGeometry();
Geometry1DTransferFunction* gtf = static_cast<Geometry1DTransferFunction*>(_transferFunction);
TFGeometry1D* geometryToRemove = _selectedGeometry->getGeometry();
{
tbb::mutex::scoped_lock lock(_localMutex);
......
......@@ -26,13 +26,13 @@
//
// ================================================================================================
#ifndef GEOMETRYTRANSFERFUNCTIONEDITOR_H__
#define GEOMETRYTRANSFERFUNCTIONEDITOR_H__
#ifndef GEOMETRY1DTRANSFERFUNCTIONEDITOR_H__
#define GEOMETRY1DTRANSFERFUNCTIONEDITOR_H__
#include "tbb/include/tbb/mutex.h"
#include "tgt/painter.h"
#include "tgt/event/eventlistener.h"
#include "core/classification/tfgeometry.h"
#include "core/classification/tfgeometry1d.h"
#include "application/gui/properties/abstracttransferfunctioneditor.h"
class QGridLayout;
......@@ -46,14 +46,14 @@ namespace tgt {
namespace TUMVis {
class ColorPickerWidget;
class GeometryTransferFunction;
class Geometry1DTransferFunction;
class AbstractTFGeometryManipulator;
class WholeTFGeometryManipulator;
/**
* Editor widget for a GeometryTransferFunction.
* Editor widget for a Geometry1DTransferFunction.
*/
class GeometryTransferFunctionEditor : public AbstractTransferFunctionEditor, public tgt::EventListener, public tgt::Painter {
class Geometry1DTransferFunctionEditor : public AbstractTransferFunctionEditor, public tgt::EventListener, public tgt::Painter {
Q_OBJECT;
public:
......@@ -62,12 +62,12 @@ namespace TUMVis {
* \param tf The transfer function the editor shall handle.
* \param parent Parent Qt widget
*/
GeometryTransferFunctionEditor(GeometryTransferFunction* tf, QWidget* parent = 0);
Geometry1DTransferFunctionEditor(Geometry1DTransferFunction* tf, QWidget* parent = 0);
/**
* Destructor
*/
virtual ~GeometryTransferFunctionEditor();
virtual ~Geometry1DTransferFunctionEditor();
/**
......@@ -139,4 +139,4 @@ namespace TUMVis {
};
}
#endif // GEOMETRYTRANSFERFUNCTIONEDITOR_H__
#endif // GEOMETRY1DTRANSFERFUNCTIONEDITOR_H__
......@@ -33,8 +33,8 @@
#include "tgt/event/mouseevent.h"
#include "application/gui/qtcolortools.h"
#include "core/classification/geometrytransferfunction.h"
#include "core/classification/tfgeometry.h"
#include "core/classification/geometry1dtransferfunction.h"
#include "core/classification/tfgeometry1d.h"
#include "core/tools/algorithmicgeometry.h"
#include <QColorDialog>
......@@ -42,7 +42,7 @@
namespace TUMVis {
AbstractTFGeometryManipulator::AbstractTFGeometryManipulator(const tgt::ivec2& viewportSize, GeometryTransferFunction* tf)
AbstractTFGeometryManipulator::AbstractTFGeometryManipulator(const tgt::ivec2& viewportSize, Geometry1DTransferFunction* tf)
: _viewportSize(viewportSize)
, _tf(tf)
{
......@@ -65,7 +65,7 @@ namespace TUMVis {
// ================================================================================================
KeyPointManipulator::KeyPointManipulator(const tgt::ivec2& viewportSize, GeometryTransferFunction* tf, TFGeometry* geometry, const std::vector<TFGeometry::KeyPoint>::iterator& keyPoint)
KeyPointManipulator::KeyPointManipulator(const tgt::ivec2& viewportSize, Geometry1DTransferFunction* tf, TFGeometry1D* geometry, const std::vector<TFGeometry1D::KeyPoint>::iterator& keyPoint)
: AbstractTFGeometryManipulator(viewportSize, tf)
, _geometry(geometry)
, _keyPoint(keyPoint)
......@@ -139,7 +139,7 @@ namespace TUMVis {
// ================================================================================================
WholeTFGeometryManipulator::WholeTFGeometryManipulator(const tgt::ivec2& viewportSize, GeometryTransferFunction* tf, TFGeometry* geometry)
WholeTFGeometryManipulator::WholeTFGeometryManipulator(const tgt::ivec2& viewportSize, Geometry1DTransferFunction* tf, TFGeometry1D* geometry)
: AbstractTFGeometryManipulator(viewportSize, tf)
, _geometry(geometry)
, _mousePressed(false)
......@@ -157,7 +157,7 @@ namespace TUMVis {
}
TFGeometry* WholeTFGeometryManipulator::getGeometry() const {
TFGeometry1D* WholeTFGeometryManipulator::getGeometry() const {
return _geometry;
}
......@@ -207,7 +207,7 @@ namespace TUMVis {
if(newColor.isValid()) {
tgt::col4 tmp = QtColorTools::toTgtColor(newColor);
for (std::vector<TFGeometry::KeyPoint>::iterator it = _geometry->getKeyPoints().begin(); it != _geometry->getKeyPoints().end(); ++it) {
for (std::vector<TFGeometry1D::KeyPoint>::iterator it = _geometry->getKeyPoints().begin(); it != _geometry->getKeyPoints().end(); ++it) {
it->_color = tgt::col4(tmp.xyz(), it->_color.a);
}
_geometry->s_changed();
......@@ -244,13 +244,13 @@ namespace TUMVis {
void WholeTFGeometryManipulator::updateHelperPoints() {
_helperPoints.clear();
const std::vector<TFGeometry::KeyPoint>& keyPoints = _geometry->getKeyPoints();
const std::vector<TFGeometry1D::KeyPoint>& keyPoints = _geometry->getKeyPoints();
if (keyPoints.front()._color.w > 0) {
_helperPoints.push_back(tgt::vec2(keyPoints.front()._position, 0.f));
}
for (std::vector<TFGeometry::KeyPoint>::const_iterator it = keyPoints.begin(); it != keyPoints.end(); ++it) {
for (std::vector<TFGeometry1D::KeyPoint>::const_iterator it = keyPoints.begin(); it != keyPoints.end(); ++it) {
float y = static_cast<float>(it->_color.a) / 255.f;
_helperPoints.push_back(tgt::vec2(it->_position, y));
}
......
......@@ -32,25 +32,25 @@
#include "tgt/vector.h"
#include "tgt/matrix.h"
#include "tgt/event/eventlistener.h"
#include "core/classification/tfgeometry.h"
#include "core/classification/tfgeometry1d.h"
namespace TUMVis {
class GeometryTransferFunction;
class Geometry1DTransferFunction;
/**
* Abstract base class for TFGeometry manipulators.
* TFGeometry manipulators encapsulate a TF Geometry (or a part of it) and offer methods
* for manipulating the TFGeometry (which is handy e.g. for TF editors...). Therefore, it
* Abstract base class for TFGeometry1D manipulators.
* TFGeometry1D manipulators encapsulate a TF Geometry (or a part of it) and offer methods
* for manipulating the TFGeometry1D (which is handy e.g. for TF editors...). Therefore, it
* extends the tgt::EventListener class and should implement its methods as necessary.
*/
class AbstractTFGeometryManipulator : public tgt::EventListener {
public:
/**
* Creates a new AbstractTFGeometryManipulator for the given GeometryTransferFunction.
* Creates a new AbstractTFGeometryManipulator for the given Geometry1DTransferFunction.
* \param viewportSize Viewport size (extent of the OpenGL rendering canvas)
* \param tf Parent TF of the geometries to manipulate
*/
AbstractTFGeometryManipulator(const tgt::ivec2& viewportSize, GeometryTransferFunction* tf);
AbstractTFGeometryManipulator(const tgt::ivec2& viewportSize, Geometry1DTransferFunction* tf);
/**
* Pure virtual Destructor
......@@ -84,14 +84,14 @@ namespace TUMVis {
*/
tgt::vec2 viewportToTF(const tgt::ivec2& pos) const;
tgt::ivec2 _viewportSize; ///< Viewport size (extent of the OpenGL rendering canvas)
GeometryTransferFunction* _tf; ///< Parent TF of the geometries to manipulate (might be handy somewhere later...)
tgt::ivec2 _viewportSize; ///< Viewport size (extent of the OpenGL rendering canvas)
Geometry1DTransferFunction* _tf; ///< Parent TF of the geometries to manipulate (might be handy somewhere later...)
};
// ================================================================================================
/**
* Class for manipulating the KeyPoints of a TFGeometry.
* Class for manipulating the KeyPoints of a TFGeometry1D.
*/
class KeyPointManipulator : public AbstractTFGeometryManipulator {
public:
......@@ -102,7 +102,7 @@ namespace TUMVis {
* \param geometry Parent geometry of the KeyPoint to manipulate
* \param keyPoint Iterator to the KeyPoint to manipulate
*/
KeyPointManipulator(const tgt::ivec2& viewportSize, GeometryTransferFunction* tf, TFGeometry* geometry, const std::vector<TFGeometry::KeyPoint>::iterator& keyPoint);
KeyPointManipulator(const tgt::ivec2& viewportSize, Geometry1DTransferFunction* tf, TFGeometry1D* geometry, const std::vector<TFGeometry1D::KeyPoint>::iterator& keyPoint);
/// \see AbstractTFGeometryManipulator::render
void render();
......@@ -117,19 +117,19 @@ namespace TUMVis {
virtual void mouseDoubleClickEvent(tgt::MouseEvent* e);
protected:
static const int MANIPULATOR_SIZE; ///< Size of the manipulator
TFGeometry* _geometry; ///< Parent geometry of the KeyPoint to manipulate
std::vector<TFGeometry::KeyPoint>::iterator _keyPoint; ///< Iterator to the KeyPoint to manipulate
static const int MANIPULATOR_SIZE; ///< Size of the manipulator
TFGeometry1D* _geometry; ///< Parent geometry of the KeyPoint to manipulate
std::vector<TFGeometry1D::KeyPoint>::iterator _keyPoint; ///< Iterator to the KeyPoint to manipulate
// event handling stuff:
bool _mousePressed; ///< Flag whether the mouse button is currently pressed
//TFGeometry::KeyPoint _valueWhenPressed; ///< KeyPointValue when pressed
//TFGeometry1D::KeyPoint _valueWhenPressed; ///< KeyPointValue when pressed
};
// ================================================================================================
/**
* Class for manipulating the whole TFGeometry at once.
* Class for manipulating the whole TFGeometry1D at once.
*/
class WholeTFGeometryManipulator : public AbstractTFGeometryManipulator, public sigslot::has_slots<> {
public:
......@@ -139,7 +139,7 @@ namespace TUMVis {
* \param tf Parent TF of the geometries to manipulate
* \param geometry Parent geometry of the KeyPoint to manipulate
*/
WholeTFGeometryManipulator(const tgt::ivec2& viewportSize, GeometryTransferFunction* tf, TFGeometry* geometry);
WholeTFGeometryManipulator(const tgt::ivec2& viewportSize, Geometry1DTransferFunction* tf, TFGeometry1D* geometry);
/**
* Destructor
......@@ -150,7 +150,7 @@ namespace TUMVis {
* Returns the Parent geometry of the KeyPoint to manipulate.
* \return _geometry
*/
TFGeometry* getGeometry() const;
TFGeometry1D* getGeometry() const;
/**
* Returns the vector caching the 2D coordinates of the TF key points.
......@@ -191,13 +191,13 @@ namespace TUMVis {
*/
void updateHelperPoints();
TFGeometry* _geometry; ///< Parent geometry of the KeyPoint to manipulate
TFGeometry1D* _geometry; ///< Parent geometry of the KeyPoint to manipulate
std::vector<tgt::vec2> _helperPoints; ///< vector caching the 2D coordinates of the TF key points
// event handling stuff:
bool _mousePressed; ///< Flag whether the mouse button is currently pressed
tgt::vec2 _pressedPosition; ///< Position where mousedown occured, in TF coordinates
std::vector<TFGeometry::KeyPoint> _valuesWhenPressed; ///< KeyPoints when pressed
std::vector<TFGeometry1D::KeyPoint> _valuesWhenPressed; ///< KeyPoints when pressed
};
}
......
......@@ -29,11 +29,11 @@
#include "transferfunctioneditorfactory.h"
#include "application/gui/properties/abstracttransferfunctioneditor.h"
#include "application/gui/properties/geometrytransferfunctioneditor.h"
#include "application/gui/properties/geometry1dtransferfunctioneditor.h"
#include "application/gui/properties/simpletransferfunctioneditor.h"
#include "core/classification/abstracttransferfunction.h"
#include "core/classification/geometrytransferfunction.h"
#include "core/classification/geometry1dtransferfunction.h"
#include "core/classification/simpletransferfunction.h"
namespace TUMVis {
......@@ -45,8 +45,8 @@ namespace TUMVis {
return new SimpleTransferFunctionEditor(tester);
}
if (GeometryTransferFunction* tester = dynamic_cast<GeometryTransferFunction*>(tf)) {
return new GeometryTransferFunctionEditor(tester);
if (Geometry1DTransferFunction* tester = dynamic_cast<Geometry1DTransferFunction*>(tf)) {
return new Geometry1DTransferFunctionEditor(tester);
}
return 0;
......
......@@ -26,7 +26,7 @@
//
// ================================================================================================
#include "geometrytransferfunction.h"
#include "geometry1dtransferfunction.h"
#include "tgt/assert.h"
#include "tgt/logmanager.h"
......@@ -34,29 +34,29 @@
#include "tgt/texture.h"
#include "tgt/textureunit.h"
#include "core/classification/tfgeometry.h"
#include "core/classification/tfgeometry1d.h"
namespace TUMVis {
const std::string GeometryTransferFunction::loggerCat_ = "TUMVis.core.classification.GeometryTransferFunction";
const std::string Geometry1DTransferFunction::loggerCat_ = "TUMVis.core.classification.Geometry1DTransferFunction";
GeometryTransferFunction::GeometryTransferFunction(size_t size, const tgt::vec2& intensityDomain /*= tgt::vec2(0.f, 1.f)*/)
Geometry1DTransferFunction::Geometry1DTransferFunction(size_t size, const tgt::vec2& intensityDomain /*= tgt::vec2(0.f, 1.f)*/)
: AbstractTransferFunction(tgt::svec3(size, 1, 1), intensityDomain)
{
}
GeometryTransferFunction::~GeometryTransferFunction() {
for (std::vector<TFGeometry*>::iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
Geometry1DTransferFunction::~Geometry1DTransferFunction() {
for (std::vector<TFGeometry1D*>::iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
(*it)->s_changed.disconnect(this);
delete *it;
}
}
size_t GeometryTransferFunction::getDimensionality() const {
size_t Geometry1DTransferFunction::getDimensionality() const {
return 1;
}
void GeometryTransferFunction::createTexture() {
void Geometry1DTransferFunction::createTexture() {
delete _texture;
GLenum dataType = GL_UNSIGNED_BYTE;
......@@ -66,7 +66,7 @@ namespace TUMVis {
GLubyte* ptr = _texture->getPixelData();
memset(ptr, 0, _texture->getArraySize());
for (std::vector<TFGeometry*>::const_iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
for (std::vector<TFGeometry1D*>::const_iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
(*it)->rasterize(*_texture);
}
......@@ -74,25 +74,25 @@ namespace TUMVis {
_dirtyTexture = false;
}
const std::vector<TFGeometry*>& GeometryTransferFunction::getGeometries() const {
const std::vector<TFGeometry1D*>& Geometry1DTransferFunction::getGeometries() const {
return _geometries;
}
void GeometryTransferFunction::addGeometry(TFGeometry* geometry) {
void Geometry1DTransferFunction::addGeometry(TFGeometry1D* geometry) {
{
tbb::mutex::scoped_lock lock(_localMutex);
_geometries.push_back(geometry);
}
geometry->s_changed.connect(this, &GeometryTransferFunction::onGeometryChanged);
geometry->s_changed.connect(this, &Geometry1DTransferFunction::onGeometryChanged);
_dirtyTexture = true;
s_geometryCollectionChanged();
s_changed();
}
void GeometryTransferFunction::removeGeometry(TFGeometry* geometry) {
void Geometry1DTransferFunction::removeGeometry(TFGeometry1D* geometry) {
{
tbb::mutex::scoped_lock lock(_localMutex);
for (std::vector<TFGeometry*>::iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
for (std::vector<TFGeometry1D*>::iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
if (*it == geometry) {
_geometries.erase(it);
break;
......@@ -106,7 +106,7 @@ namespace TUMVis {
s_changed();
}
void GeometryTransferFunction::onGeometryChanged() {
void Geometry1DTransferFunction::onGeometryChanged() {
_dirtyTexture = true;
s_changed();
}
......
......@@ -26,8 +26,8 @@
//
// ================================================================================================
#ifndef GEOMETRYTRANSFERFUNCTION_H__
#define GEOMETRYTRANSFERFUNCTION_H__
#ifndef GEOMETRY1DTRANSFERFUNCTION_H__
#define GEOMETRY1DTRANSFERFUNCTION_H__
#include "core/classification/abstracttransferfunction.h"
......@@ -35,24 +35,24 @@