2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 104b5322 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Removed a bunch of obsolete TODOs and FIXMEs.

parent 4d773a4f
...@@ -125,7 +125,6 @@ namespace campvis { ...@@ -125,7 +125,6 @@ namespace campvis {
void CampVisPainter::init() { void CampVisPainter::init() {
try { try {
// TODO: Remove hardcoded paths, and use ShdrMgr.addPath() at some central location
_copyShader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", ""); _copyShader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", "");
_copyShader->setAttributeLocation(0, "in_Position"); _copyShader->setAttributeLocation(0, "in_Position");
_copyShader->setAttributeLocation(1, "in_TexCoords"); _copyShader->setAttributeLocation(1, "in_TexCoords");
......
...@@ -240,7 +240,7 @@ namespace campvis { ...@@ -240,7 +240,7 @@ namespace campvis {
_lblIntensityRight = new QLabel(QString::number(gtf->getIntensityDomain().y), this); _lblIntensityRight = new QLabel(QString::number(gtf->getIntensityDomain().y), this);
_layout->addWidget(_lblIntensityRight, 4, 3, 1, 1, Qt::AlignRight); _layout->addWidget(_lblIntensityRight, 4, 3, 1, 1, Qt::AlignRight);
QVBoxLayout* buttonLayout = new QVBoxLayout(); // TODO: check whether buttonLayout will be deleted by Qt's GC! QVBoxLayout* buttonLayout = new QVBoxLayout();
_layout->addLayout(buttonLayout, 1, 4, 1, 3, Qt::AlignTop); _layout->addLayout(buttonLayout, 1, 4, 1, 3, Qt::AlignTop);
_btnAddGeometry = new QPushButton(tr("Add Geometry"), this); _btnAddGeometry = new QPushButton(tr("Add Geometry"), this);
......
...@@ -57,8 +57,6 @@ namespace campvis { ...@@ -57,8 +57,6 @@ namespace campvis {
/** /**
* Abstract base class for data handled by a DataHandle and stored in a DataContainer. * Abstract base class for data handled by a DataHandle and stored in a DataContainer.
*
* \todo
*/ */
class CAMPVIS_CORE_API AbstractData { class CAMPVIS_CORE_API AbstractData {
friend class DataHandle; friend class DataHandle;
......
...@@ -49,8 +49,6 @@ namespace campvis { ...@@ -49,8 +49,6 @@ namespace campvis {
* also ensures (hopefully) that nobody can do messy things, such as changing the data while some other * also ensures (hopefully) that nobody can do messy things, such as changing the data while some other
* thread is reading it. Theoretically this should be possible, but a correct implementation would require * thread is reading it. Theoretically this should be possible, but a correct implementation would require
* some brain fuck. * some brain fuck.
*
* \todo Check thread-safety
*/ */
class CAMPVIS_CORE_API DataContainer { class CAMPVIS_CORE_API DataContainer {
public: public:
......
...@@ -28,11 +28,13 @@ ...@@ -28,11 +28,13 @@
#include "core/datastructures/abstractdata.h" #include "core/datastructures/abstractdata.h"
#include <string> #include <string>
#include <memory>
namespace campvis { namespace campvis {
/** /**
* Class that generically wraps around a pointer of the template type and takes ownership of it. * Class that generically wraps around a pointer of the template type and takes ownership of it.
* Ownership is handled through shared pointers, as the clone() method only returns a shallow copy.
* \tparam T Type of the pointer this AbstractData wraps around. * \tparam T Type of the pointer this AbstractData wraps around.
*/ */
template<typename T> template<typename T>
...@@ -40,7 +42,7 @@ namespace campvis { ...@@ -40,7 +42,7 @@ namespace campvis {
public: public:
/** /**
* Creates a new GenericPointerData and initializes its pointer with \a data. * Creates a new GenericPointerData and initializes its pointer with \a data.
* \param data The initial pointer for this data, may be 0, GenericPointerData takes ownerwhip. * \param data The initial pointer for this data, may be 0, GenericPointerData takes ownership.
*/ */
explicit GenericPointerData(T* data) explicit GenericPointerData(T* data)
: AbstractData() : AbstractData()
...@@ -48,10 +50,19 @@ namespace campvis { ...@@ -48,10 +50,19 @@ namespace campvis {
{}; {};
/** /**
* Destructor, deletes the pointer. * Creates a new GenericPointerData and initializes its pointer with \a data.
* \param data The initial pointer for this data, may be 0, GenericPointerData takes ownership.
*/
explicit GenericPointerData(std::shared_ptr<T> data)
: AbstractData()
, _data(data)
{};
/**
* Destructor
*/ */
virtual ~GenericPointerData() { virtual ~GenericPointerData() {
delete _data;
}; };
/** /**
...@@ -72,10 +83,10 @@ namespace campvis { ...@@ -72,10 +83,10 @@ namespace campvis {
/** /**
* Sets the data to \a data. * Sets the data to \a data.
* \param data The new pointer for this data, may be 0, GenericPointerData takes ownerwhip. * \param data The new pointer for this data, may be 0, GenericPointerData takes ownership.
*/ */
void setData(T* data) { void setData(T* data) {
_data = data; _data = std::shared_ptr<T>(data);
}; };
...@@ -83,8 +94,7 @@ namespace campvis { ...@@ -83,8 +94,7 @@ namespace campvis {
* Prototype - clone method, some people call this virtual constructor... * Prototype - clone method, some people call this virtual constructor...
* \return A SHALLOW copy of this object. * \return A SHALLOW copy of this object.
*/ */
virtual AbstractData* clone() const { virtual GenericPointerData<T>* clone() const {
// FIXME: This is only a shallow copy - not what you expect from clone!
return new GenericPointerData<T>(_data); return new GenericPointerData<T>(_data);
}; };
...@@ -105,7 +115,7 @@ namespace campvis { ...@@ -105,7 +115,7 @@ namespace campvis {
}; };
protected: protected:
T* _data; ///< Pointer to the data. std::shared_ptr<T> _data; ///< Shared pointer to the data.
}; };
} }
......
...@@ -33,8 +33,6 @@ namespace campvis { ...@@ -33,8 +33,6 @@ namespace campvis {
/** /**
* Subclass of ImageData offering access to image data stored in binary form on the local harddisk. * Subclass of ImageData offering access to image data stored in binary form on the local harddisk.
*
* \todo Number of channels
*/ */
class CAMPVIS_CORE_API ImageRepresentationDisk : public GenericAbstractImageRepresentation<ImageRepresentationDisk> { class CAMPVIS_CORE_API ImageRepresentationDisk : public GenericAbstractImageRepresentation<ImageRepresentationDisk> {
public: public:
......
...@@ -68,7 +68,6 @@ namespace campvis { ...@@ -68,7 +68,6 @@ namespace campvis {
} }
{ {
// TODO: there is probably a more elegant method...
tbb::spin_mutex::scoped_lock(mutex); tbb::spin_mutex::scoped_lock(mutex);
_normalizedIntensityRange.nibble(localMin); _normalizedIntensityRange.nibble(localMin);
_normalizedIntensityRange.nibble(localMax); _normalizedIntensityRange.nibble(localMax);
......
...@@ -37,8 +37,6 @@ namespace campvis { ...@@ -37,8 +37,6 @@ namespace campvis {
/** /**
* Abstract base class for storing image data in the local memory. * Abstract base class for storing image data in the local memory.
*
* \todo implement padding, add some kind of cool iterators
*/ */
class CAMPVIS_CORE_API ImageRepresentationLocal : public GenericAbstractImageRepresentation<ImageRepresentationLocal> { class CAMPVIS_CORE_API ImageRepresentationLocal : public GenericAbstractImageRepresentation<ImageRepresentationLocal> {
public: public:
......
...@@ -37,8 +37,6 @@ namespace campvis { ...@@ -37,8 +37,6 @@ namespace campvis {
/** /**
* Abstract base class for data handled by a DataHandle and stored in a DataContainer. * Abstract base class for data handled by a DataHandle and stored in a DataContainer.
*
* \todo
*/ */
class CAMPVIS_CORE_API LightSourceData : public AbstractData { class CAMPVIS_CORE_API LightSourceData : public AbstractData {
public: public:
......
...@@ -39,9 +39,6 @@ ...@@ -39,9 +39,6 @@
namespace campvis { namespace campvis {
/** /**
* Abstract base class for CAMPVis Property. * Abstract base class for CAMPVis Property.
*
* \todo Add PropertyWidgets, add clone()?
* Think about a reasonable locking mechanism and implement that
*/ */
class CAMPVIS_CORE_API AbstractProperty { class CAMPVIS_CORE_API AbstractProperty {
public: public:
......
...@@ -35,7 +35,6 @@ namespace campvis { ...@@ -35,7 +35,6 @@ namespace campvis {
* Generic class for value-based properties. * Generic class for value-based properties.
* *
* \tparam T Base type of the property's value. * \tparam T Base type of the property's value.
* \todo Add PropertyWidgets, review use of mutex
*/ */
template<typename T> template<typename T>
class GenericProperty : public AbstractProperty { class GenericProperty : public AbstractProperty {
...@@ -179,11 +178,9 @@ namespace campvis { ...@@ -179,11 +178,9 @@ namespace campvis {
template<typename T> template<typename T>
void campvis::GenericProperty<T>::setFrontValue(const T& value) { void campvis::GenericProperty<T>::setFrontValue(const T& value) {
_value = value; _value = value;
// TODO: think about the correct/reasonable order of observer notification
// thread-safety might play a role thereby...
for (std::set<AbstractProperty*>::iterator it = _sharedProperties.begin(); it != _sharedProperties.end(); ++it) { for (std::set<AbstractProperty*>::iterator it = _sharedProperties.begin(); it != _sharedProperties.end(); ++it) {
// We ensure all shared properties to be of type GenericProperty<T> in the addSharedProperty overload. // We ensure all shared properties to be of type GenericProperty<T> in the addSharedProperty overload.
// Hence, static_cast ist safe. // Hence, static_cast is safe.
GenericProperty<T>* child = static_cast< GenericProperty<T>* >(*it); GenericProperty<T>* child = static_cast< GenericProperty<T>* >(*it);
child->setValue(value); child->setValue(value);
} }
......
...@@ -39,8 +39,6 @@ namespace campvis { ...@@ -39,8 +39,6 @@ namespace campvis {
* Collection of various helper methods for strings. * Collection of various helper methods for strings.
* *
* \sa std::string * \sa std::string
*
* \todo Test, test, test!
*/ */
class CAMPVIS_CORE_API StringUtils { class CAMPVIS_CORE_API StringUtils {
public: public:
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
namespace tgt { namespace tgt {
/// \todo Bounds
/** /**
This class is an abstract superclass for spacecurves. \n This class is an abstract superclass for spacecurves. \n
It provides the virtual methods getPoint() and getDerivative(), which It provides the virtual methods getPoint() and getDerivative(), which
......
...@@ -107,7 +107,6 @@ namespace campvis { ...@@ -107,7 +107,6 @@ namespace campvis {
_quadView.p_outputImage.setValue("quadview.output"); _quadView.p_outputImage.setValue("quadview.output");
// TODO: replace this hardcoded domain by automatically determined from image min/max values
Geometry1DTransferFunction* tf = new Geometry1DTransferFunction(128, tgt::vec2(0.f, 1.f)); Geometry1DTransferFunction* tf = new Geometry1DTransferFunction(128, tgt::vec2(0.f, 1.f));
tf->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 255), tgt::col4(255, 255, 255, 255))); tf->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 255), tgt::col4(255, 255, 255, 255)));
_usFusion1.p_transferFunction.replaceTF(tf); _usFusion1.p_transferFunction.replaceTF(tf);
......
...@@ -109,7 +109,6 @@ namespace campvis { ...@@ -109,7 +109,6 @@ namespace campvis {
_usBlurFilter.p_sigma.setValue(2.f); _usBlurFilter.p_sigma.setValue(2.f);
// TODO: replace this hardcoded domain by automatically determined from image min/max values
Geometry1DTransferFunction* tf = new Geometry1DTransferFunction(128, tgt::vec2(0.f, 1.f)); Geometry1DTransferFunction* tf = new Geometry1DTransferFunction(128, tgt::vec2(0.f, 1.f));
tf->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 255), tgt::col4(255, 255, 255, 255))); tf->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 255), tgt::col4(255, 255, 255, 255)));
_usFusion.p_transferFunction.replaceTF(tf); _usFusion.p_transferFunction.replaceTF(tf);
......
...@@ -133,7 +133,6 @@ namespace campvis { ...@@ -133,7 +133,6 @@ namespace campvis {
if (tfp.hasKey("ElementByteOrderMSB")) if (tfp.hasKey("ElementByteOrderMSB"))
e = (tfp.getBool("ElementByteOrderMSB") ? EndianHelper::IS_BIG_ENDIAN : EndianHelper::IS_LITTLE_ENDIAN); e = (tfp.getBool("ElementByteOrderMSB") ? EndianHelper::IS_BIG_ENDIAN : EndianHelper::IS_LITTLE_ENDIAN);
// TODO: spacing, element size, etc.
if (tfp.hasKey("ElementSpacing")) { if (tfp.hasKey("ElementSpacing")) {
if (dimensionality == 3) if (dimensionality == 3)
voxelSize = tfp.getVec3("ElementSpacing"); voxelSize = tfp.getVec3("ElementSpacing");
......
...@@ -191,9 +191,6 @@ namespace campvis { ...@@ -191,9 +191,6 @@ namespace campvis {
/// \see AbstractImageRepresentation::getVideoMemoryFootprint() /// \see AbstractImageRepresentation::getVideoMemoryFootprint()
virtual size_t getVideoMemoryFootprint() const; virtual size_t getVideoMemoryFootprint() const;
/// \see AbstractImageRepresentation::getSubImage
virtual ThisType* getSubImage(ImageData* parent, const tgt::svec3& llf, const tgt::svec3& urb) const;
/** /**
* Returns a WeaklyTypedPointer to the image data. * Returns a WeaklyTypedPointer to the image data.
* \note The pointer is still owned by this ImageRepresentationLocal. If you want a copy, use clone(). * \note The pointer is still owned by this ImageRepresentationLocal. If you want a copy, use clone().
...@@ -267,13 +264,6 @@ namespace campvis { ...@@ -267,13 +264,6 @@ namespace campvis {
return 0; return 0;
} }
template<typename BASETYPE, size_t NUMCHANNELS, size_t DIMENSIONALITY>
GenericImageRepresentationItk<BASETYPE, NUMCHANNELS, DIMENSIONALITY>* campvis::GenericImageRepresentationItk<BASETYPE, NUMCHANNELS, DIMENSIONALITY>::getSubImage(ImageData* parent, const tgt::svec3& llf, const tgt::svec3& urb) const {
tgtAssert(tgt::hand(tgt::lessThan(llf, urb)), "Coordinates in LLF must be component-wise smaller than the ones in URB!");
// TODO: implement - there certainly exists an ITK filter for this...
return 0;
}
template<typename BASETYPE, size_t NUMCHANNELS, size_t DIMENSIONALITY> template<typename BASETYPE, size_t NUMCHANNELS, size_t DIMENSIONALITY>
WeaklyTypedPointer campvis::GenericImageRepresentationItk<BASETYPE, NUMCHANNELS, DIMENSIONALITY>::getWeaklyTypedPointer() const { WeaklyTypedPointer campvis::GenericImageRepresentationItk<BASETYPE, NUMCHANNELS, DIMENSIONALITY>::getWeaklyTypedPointer() const {
return WeaklyTypedPointer(TypeTraits<BASETYPE, NUMCHANNELS>::weaklyTypedPointerBaseType, NUMCHANNELS, _itkImage->GetBufferPointer()); return WeaklyTypedPointer(TypeTraits<BASETYPE, NUMCHANNELS>::weaklyTypedPointerBaseType, NUMCHANNELS, _itkImage->GetBufferPointer());
......
...@@ -57,7 +57,6 @@ namespace campvis { ...@@ -57,7 +57,6 @@ namespace campvis {
_sliceExtractor.p_xSliceNumber.setValue(0); _sliceExtractor.p_xSliceNumber.setValue(0);
// TODO: replace this hardcoded domain by automatically determined from image min/max values
Geometry1DTransferFunction* tf = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .08f)); Geometry1DTransferFunction* tf = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .08f));
tf->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 0), tgt::col4(255, 255, 255, 255))); tf->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 0), tgt::col4(255, 255, 255, 255)));
_sliceExtractor.p_transferFunction.replaceTF(tf); _sliceExtractor.p_transferFunction.replaceTF(tf);
......
...@@ -120,8 +120,6 @@ namespace campvis { ...@@ -120,8 +120,6 @@ namespace campvis {
-2*n.x*n.y , 1 - 2*n.y*n.y, -2*n.z*n.y , 0, -2*n.x*n.y , 1 - 2*n.y*n.y, -2*n.z*n.y , 0,
-2*n.x*n.z , -2*n.y*n.z , 1 - 2*n.z*n.z, 0, -2*n.x*n.z , -2*n.y*n.z , 1 - 2*n.z*n.z, 0,
2*n.x*k , 2*n.y*k , 2*n.z*k , 1)); 2*n.x*k , 2*n.y*k , 2*n.z*k , 1));
// TODO: double check, whether matrix transpose is necessary
} }
else { else {
LERROR("No suitable virtual mirror geometry found."); LERROR("No suitable virtual mirror geometry found.");
......
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