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

Fixed various cppcheck issues and compiler warnings

parent ef127d10
...@@ -157,15 +157,15 @@ namespace campvis { ...@@ -157,15 +157,15 @@ namespace campvis {
if (const AbstractData* data = _dataHandle.getData()) { if (const AbstractData* data = _dataHandle.getData()) {
if (const RenderData* tester = dynamic_cast<const RenderData*>(data)) { if (const RenderData* tester = dynamic_cast<const RenderData*>(data)) {
for (size_t i = 0; i < tester->getNumColorTextures(); ++i) { for (size_t i = 0; i < tester->getNumColorTextures(); ++i) {
DataHandleTreeItem* dhti = new DataHandleTreeItem(QtDataHandle(tester->getColorDataHandle(i)), _name + "::ColorTexture" + StringUtils::toString(i), this); new DataHandleTreeItem(QtDataHandle(tester->getColorDataHandle(i)), _name + "::ColorTexture" + StringUtils::toString(i), this);
} }
if (tester->hasDepthTexture()) { if (tester->hasDepthTexture()) {
DataHandleTreeItem* dhti = new DataHandleTreeItem(QtDataHandle(tester->getDepthDataHandle()), _name + "::DepthTexture", this); new DataHandleTreeItem(QtDataHandle(tester->getDepthDataHandle()), _name + "::DepthTexture", this);
} }
} }
else if (const ImageSeries* tester = dynamic_cast<const ImageSeries*>(data)) { else if (const ImageSeries* tester = dynamic_cast<const ImageSeries*>(data)) {
for (size_t i = 0; i < tester->getNumImages(); ++i) { for (size_t i = 0; i < tester->getNumImages(); ++i) {
DataHandleTreeItem* dhti = new DataHandleTreeItem(QtDataHandle(tester->getImage(i)), _name + "::Image" + StringUtils::toString(i), this); new DataHandleTreeItem(QtDataHandle(tester->getImage(i)), _name + "::Image" + StringUtils::toString(i), this);
} }
} }
......
...@@ -138,7 +138,7 @@ namespace campvis { ...@@ -138,7 +138,7 @@ namespace campvis {
_logDisplay->clear(); _logDisplay->clear();
_logHighlighter->setFilterRegExp(_filterRegExp); _logHighlighter->setFilterRegExp(_filterRegExp);
for (std::deque<LogEntry>::iterator it = _logMessages.begin(); it != _logMessages.end(); it++) { for (std::deque<LogEntry>::iterator it = _logMessages.begin(); it != _logMessages.end(); ++it) {
displayMessage(*it); displayMessage(*it);
} }
} }
......
...@@ -303,7 +303,7 @@ namespace campvis { ...@@ -303,7 +303,7 @@ namespace campvis {
PipelineTreeItem* pipeti = new PipelineTreeItem(*pipe, it->second); PipelineTreeItem* pipeti = new PipelineTreeItem(*pipe, it->second);
for (std::vector<AbstractProcessor*>::const_iterator proc = (*pipe)->getProcessors().begin(); proc != (*pipe)->getProcessors().end(); ++proc) { for (std::vector<AbstractProcessor*>::const_iterator proc = (*pipe)->getProcessors().begin(); proc != (*pipe)->getProcessors().end(); ++proc) {
ProcessorTreeItem* procti = new ProcessorTreeItem(*proc, pipeti); new ProcessorTreeItem(*proc, pipeti);
} }
} }
else { else {
......
...@@ -58,6 +58,7 @@ namespace campvis { ...@@ -58,6 +58,7 @@ namespace campvis {
} }
_property->s_changed.connect(this, &AbstractPropertyWidget::onPropertyChanged); _property->s_changed.connect(this, &AbstractPropertyWidget::onPropertyChanged);
// cppcheck-suppress pureVirtualCall
connect(this, SIGNAL(s_propertyChanged(const AbstractProperty*)), this, SLOT(updateWidgetFromProperty())); connect(this, SIGNAL(s_propertyChanged(const AbstractProperty*)), this, SLOT(updateWidgetFromProperty()));
} }
......
...@@ -95,7 +95,6 @@ namespace campvis { ...@@ -95,7 +95,6 @@ namespace campvis {
void Geometry1DTransferFunctionEditor::paint() { void Geometry1DTransferFunctionEditor::paint() {
Geometry1DTransferFunction* gtf = static_cast<Geometry1DTransferFunction*>(_transferFunction); Geometry1DTransferFunction* gtf = static_cast<Geometry1DTransferFunction*>(_transferFunction);
const std::vector<TFGeometry1D*>& geometries = gtf->getGeometries(); const std::vector<TFGeometry1D*>& geometries = gtf->getGeometries();
const tgt::vec2& intensityDomain = gtf->getIntensityDomain();
// TODO: get rid of intermediate mode? // TODO: get rid of intermediate mode?
glPushAttrib(GL_ALL_ATTRIB_BITS); glPushAttrib(GL_ALL_ATTRIB_BITS);
...@@ -120,18 +119,16 @@ namespace campvis { ...@@ -120,18 +119,16 @@ namespace campvis {
maxFilling = log(maxFilling); maxFilling = log(maxFilling);
float xl = static_cast<float>(0.f) / static_cast<float>(numBuckets); float xl = static_cast<float>(0.f) / static_cast<float>(numBuckets);
float xr = 0.f;
float yl = (_logScale float yl = (_logScale
? log(static_cast<float>(ih->getNumElements(0))) / maxFilling ? log(static_cast<float>(ih->getNumElements(0))) / maxFilling
: static_cast<float>(ih->getNumElements(0)) / maxFilling); : static_cast<float>(ih->getNumElements(0)) / maxFilling);
float yr = 0.f;
glBegin(GL_QUADS); glBegin(GL_QUADS);
glColor4f(1.f, .75f, 0.f, .5f); glColor4f(1.f, .75f, 0.f, .5f);
for (size_t i = 1; i < numBuckets; ++i) { for (size_t i = 1; i < numBuckets; ++i) {
xr = static_cast<float>(i) / static_cast<float>(numBuckets); float xr = static_cast<float>(i) / static_cast<float>(numBuckets);
yr = (_logScale float yr = (_logScale
? std::max(0.f, static_cast<float>(log(static_cast<float>(ih->getNumElements(i)))) / maxFilling) ? std::max(0.f, static_cast<float>(log(static_cast<float>(ih->getNumElements(i)))) / maxFilling)
: static_cast<float>(ih->getNumElements(i)) / maxFilling); : static_cast<float>(ih->getNumElements(i)) / maxFilling);
...@@ -139,9 +136,6 @@ namespace campvis { ...@@ -139,9 +136,6 @@ namespace campvis {
glVertex2f(xl, yl); glVertex2f(xl, yl);
glVertex2f(xr, yr); glVertex2f(xr, yr);
glVertex2f(xr, 0.f); glVertex2f(xr, 0.f);
xl = xr;
yl = yr;
} }
glEnd(); glEnd();
} }
...@@ -248,7 +242,7 @@ namespace campvis { ...@@ -248,7 +242,7 @@ namespace campvis {
QLabel* lblOpacityBottom = new QLabel(tr("0%"), this); QLabel* lblOpacityBottom = new QLabel(tr("0%"), this);
_layout->addWidget(lblOpacityBottom, 3, 0, 1, 1, Qt::AlignRight); _layout->addWidget(lblOpacityBottom, 3, 0, 1, 1, Qt::AlignRight);
_canvas = new tgt::QtThreadedCanvas("", tgt::ivec2(256, 128), tgt::GLCanvas::RGBA_BUFFER, false); _canvas = new tgt::QtThreadedCanvas("", tgt::ivec2(256, 128), tgt::GLCanvas::RGBA_BUFFER, 0, false);
tgt::GlContextManager::getRef().registerContextAndInitGlew(_canvas); tgt::GlContextManager::getRef().registerContextAndInitGlew(_canvas);
GLJobProc.registerContext(_canvas); GLJobProc.registerContext(_canvas);
......
...@@ -91,7 +91,6 @@ namespace campvis { ...@@ -91,7 +91,6 @@ namespace campvis {
void Geometry2DTransferFunctionEditor::paint() { void Geometry2DTransferFunctionEditor::paint() {
Geometry2DTransferFunction* gtf = static_cast<Geometry2DTransferFunction*>(_transferFunction); Geometry2DTransferFunction* gtf = static_cast<Geometry2DTransferFunction*>(_transferFunction);
const std::vector<TFGeometry2D*>& geometries = gtf->getGeometries(); const std::vector<TFGeometry2D*>& geometries = gtf->getGeometries();
const tgt::vec2& intensityDomain = gtf->getIntensityDomain();
// TODO: get rid of intermediate mode? // TODO: get rid of intermediate mode?
glPushAttrib(GL_ALL_ATTRIB_BITS); glPushAttrib(GL_ALL_ATTRIB_BITS);
...@@ -122,15 +121,13 @@ namespace campvis { ...@@ -122,15 +121,13 @@ namespace campvis {
float maxFilling = static_cast<float>(ih->getMaxFilling()); float maxFilling = static_cast<float>(ih->getMaxFilling());
float xl = static_cast<float>(0.f) / static_cast<float>(numBuckets); float xl = static_cast<float>(0.f) / static_cast<float>(numBuckets);
float xr = 0.f;
float yl = static_cast<float>(ih->getNumElements(0)) / maxFilling; float yl = static_cast<float>(ih->getNumElements(0)) / maxFilling;
float yr = 0.f;
glBegin(GL_QUADS); glBegin(GL_QUADS);
glColor4f(1.f, .75f, 0.f, .5f); glColor4f(1.f, .75f, 0.f, .5f);
for (size_t i = 1; i < numBuckets; ++i) { for (size_t i = 1; i < numBuckets; ++i) {
xr = static_cast<float>(i) / static_cast<float>(numBuckets); float xr = static_cast<float>(i) / static_cast<float>(numBuckets);
yr = static_cast<float>(ih->getNumElements(i)) / maxFilling; float yr = static_cast<float>(ih->getNumElements(i)) / maxFilling;
glVertex2f(xl, 0.f); glVertex2f(xl, 0.f);
glVertex2f(xl, yl); glVertex2f(xl, yl);
...@@ -229,7 +226,7 @@ namespace campvis { ...@@ -229,7 +226,7 @@ namespace campvis {
QLabel* lblOpacityBottom = new QLabel(tr("0%"), this); QLabel* lblOpacityBottom = new QLabel(tr("0%"), this);
_layout->addWidget(lblOpacityBottom, 3, 0, 1, 1, Qt::AlignRight); _layout->addWidget(lblOpacityBottom, 3, 0, 1, 1, Qt::AlignRight);
_canvas = new tgt::QtThreadedCanvas("", tgt::ivec2(256, 128), tgt::GLCanvas::RGBA_BUFFER, false); _canvas = new tgt::QtThreadedCanvas("", tgt::ivec2(256, 128), tgt::GLCanvas::RGBA_BUFFER, 0, false);
tgt::GlContextManager::getRef().registerContextAndInitGlew(_canvas); tgt::GlContextManager::getRef().registerContextAndInitGlew(_canvas);
GLJobProc.registerContext(_canvas); GLJobProc.registerContext(_canvas);
......
...@@ -65,8 +65,8 @@ namespace campvis { ...@@ -65,8 +65,8 @@ namespace campvis {
SimpleTransferFunction* stf = static_cast<SimpleTransferFunction*>(_transferFunction); SimpleTransferFunction* stf = static_cast<SimpleTransferFunction*>(_transferFunction);
_cpwColorLeft->blockSignals(true); _cpwColorLeft->blockSignals(true);
_cpwColorRight->blockSignals(true); _cpwColorRight->blockSignals(true);
_cpwColorLeft->setColor(QtColorTools::toQColor(static_cast<SimpleTransferFunction*>(_transferFunction)->getLeftColor())); _cpwColorLeft->setColor(QtColorTools::toQColor(stf->getLeftColor()));
_cpwColorRight->setColor(QtColorTools::toQColor(static_cast<SimpleTransferFunction*>(_transferFunction)->getRightColor())); _cpwColorRight->setColor(QtColorTools::toQColor(stf->getRightColor()));
_cpwColorLeft->blockSignals(false); _cpwColorLeft->blockSignals(false);
_cpwColorRight->blockSignals(false); _cpwColorRight->blockSignals(false);
} }
......
...@@ -50,13 +50,13 @@ namespace campvis { ...@@ -50,13 +50,13 @@ namespace campvis {
for (size_t i = 0; i < TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS; ++i) { for (size_t i = 0; i < TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS; ++i) {
if (attachments[i] != 0) { if (attachments[i] != 0) {
ImageData* img = new ImageData(2, attachments[i]->getDimensions(), attachments[i]->getNumChannels()); ImageData* img = new ImageData(2, attachments[i]->getDimensions(), attachments[i]->getNumChannels());
ImageRepresentationGL* rep = ImageRepresentationGL::create(img, attachments[i]); ImageRepresentationGL::create(img, attachments[i]);
_colorTextures.push_back(DataHandle(img)); _colorTextures.push_back(DataHandle(img));
} }
} }
if (attachments[TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS] != 0) { if (attachments[TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS] != 0) {
ImageData* img = new ImageData(2, attachments[TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS]->getDimensions(), attachments[TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS]->getNumChannels()); ImageData* img = new ImageData(2, attachments[TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS]->getDimensions(), attachments[TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS]->getNumChannels());
ImageRepresentationGL* rep = ImageRepresentationGL::create(img, attachments[TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS]); ImageRepresentationGL::create(img, attachments[TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS]);
_depthTexture = DataHandle(img); _depthTexture = DataHandle(img);
} }
} }
......
...@@ -146,8 +146,10 @@ namespace campvis { ...@@ -146,8 +146,10 @@ namespace campvis {
void TrackballNavigationEventListener::removeLqModeProcessor(VisualizationProcessor* vp) { void TrackballNavigationEventListener::removeLqModeProcessor(VisualizationProcessor* vp) {
for (std::vector<VisualizationProcessor*>::iterator it = _lqModeProcessors.begin(); it != _lqModeProcessors.end(); ++it) { for (std::vector<VisualizationProcessor*>::iterator it = _lqModeProcessors.begin(); it != _lqModeProcessors.end(); ++it) {
if (*it == vp) if (*it == vp) {
_lqModeProcessors.erase(it); _lqModeProcessors.erase(it);
return;
}
} }
} }
......
...@@ -568,7 +568,7 @@ std::vector<std::string> TarFileFactory::getFilenames() { ...@@ -568,7 +568,7 @@ std::vector<std::string> TarFileFactory::getFilenames() {
std::vector<std::string> files; std::vector<std::string> files;
std::map<std::string, ArchivedFile>::iterator theIterator; std::map<std::string, ArchivedFile>::iterator theIterator;
for (theIterator = files_.begin(); theIterator != files_.end(); theIterator++) for (theIterator = files_.begin(); theIterator != files_.end(); ++theIterator)
files.push_back((*theIterator).first); files.push_back((*theIterator).first);
return files; return files;
...@@ -627,7 +627,7 @@ bool FileSystem::exists(const std::string& filename) { ...@@ -627,7 +627,7 @@ bool FileSystem::exists(const std::string& filename) {
void FileSystem::addFactory(FileFactory* ff) { void FileSystem::addFactory(FileFactory* ff) {
std::vector<std::string> files = ff->getFilenames(); std::vector<std::string> files = ff->getFilenames();
std::vector<std::string>::iterator theIterator; std::vector<std::string>::iterator theIterator;
for (theIterator = files.begin(); theIterator != files.end(); theIterator++) for (theIterator = files.begin(); theIterator != files.end(); ++theIterator)
virtualFS_[*theIterator] = ff; virtualFS_[*theIterator] = ff;
factories_.push_back(ff); factories_.push_back(ff);
...@@ -1156,7 +1156,6 @@ std::vector<std::string> FileSystem::listFiles(const std::string& directory, con ...@@ -1156,7 +1156,6 @@ std::vector<std::string> FileSystem::listFiles(const std::string& directory, con
WIN32_FIND_DATA findFileData = {0}; WIN32_FIND_DATA findFileData = {0};
HANDLE hFind = 0; HANDLE hFind = 0;
std::stack<std::string> stackDirs;
std::string dir(converted + "\\*"); std::string dir(converted + "\\*");
hFind = FindFirstFile(dir.c_str(), &findFileData); hFind = FindFirstFile(dir.c_str(), &findFileData);
......
...@@ -113,81 +113,6 @@ bool GLCanvas::getAutoFlush() { ...@@ -113,81 +113,6 @@ bool GLCanvas::getAutoFlush() {
return autoFlush_; return autoFlush_;
} }
bool GLCanvas::takeScreenshot(std::string fname) {
//taken from gamedev.net forum:
FILE *pFile; // The file pointer.
unsigned char uselessChar; // used for useless char.
short int uselessInt; // used for useless int.
unsigned char imageType; // Type of image we are saving.
int index; // used with the for loop.
unsigned char bits; // Bit depth.
long Size; // Size of the picture.
int colorMode;
unsigned char tempColors;
short int width = getWidth();
short int height = getHeight();
// Open file for output.
pFile = fopen(fname.c_str(), "wb");
// Check if the file opened or not.
if (!pFile) {
fclose(pFile);
return false;
}
unsigned char *image = new unsigned char[getWidth()*getHeight()*3];
//read image from gl:
glReadPixels( 0, 0, getWidth(), getHeight(), GL_RGB, GL_UNSIGNED_BYTE, image );
// Set the image type, the color mode, and the bit depth.
imageType = 2; colorMode = 3; bits = 24;
// Set these two to 0.
uselessChar = 0; uselessInt = 0;
// Write useless data.
size_t written = 0;
written += fwrite(&uselessChar, sizeof(unsigned char), 1, pFile);
written += fwrite(&uselessChar, sizeof(unsigned char), 1, pFile);
// Now image type.
written += fwrite(&imageType, sizeof(unsigned char), 1, pFile);
// Write useless data.
written += fwrite(&uselessInt, sizeof(short int), 1, pFile);
written += fwrite(&uselessInt, sizeof(short int), 1, pFile);
written += fwrite(&uselessChar, sizeof(unsigned char), 1, pFile);
written += fwrite(&uselessInt, sizeof(short int), 1, pFile);
written += fwrite(&uselessInt, sizeof(short int), 1, pFile);
// Write the size that you want.
written += fwrite(&width, sizeof(short int), 1, pFile);
written += fwrite(&height, sizeof(short int), 1, pFile);
written += fwrite(&bits, sizeof(unsigned char), 1, pFile);
// Write useless data.
written += fwrite(&uselessChar, sizeof(unsigned char), 1, pFile);
// Get image size.
Size = width * height * colorMode;
// Now switch image from RGB to BGR.
for (index = 0; index < Size; index += colorMode){
tempColors = image[index];
image[index] = image[index + 2];
image[index + 2] = tempColors;
}
// Finally write the image.
written += fwrite(image, sizeof(unsigned char), Size, pFile);
// close the file.
fclose(pFile);
delete[] image;
return (written > 0);
}
const ivec4& GLCanvas::getRgbaSize() const { const ivec4& GLCanvas::getRgbaSize() const {
return rgbaSize_; return rgbaSize_;
} }
......
...@@ -150,10 +150,6 @@ public: ...@@ -150,10 +150,6 @@ public:
/// wheater canvas automatically calls glFlush or swap /// wheater canvas automatically calls glFlush or swap
bool getAutoFlush(); bool getAutoFlush();
///Take a screenshot and save it as TGA file.
///@param fname Target filename
bool takeScreenshot(std::string fname);
/// Getter /// Getter
const ivec4& getRgbaSize() const; const ivec4& getRgbaSize() const;
......
...@@ -52,9 +52,9 @@ void GUIApplication::removeCanvas(GLCanvas* canvas) { ...@@ -52,9 +52,9 @@ void GUIApplication::removeCanvas(GLCanvas* canvas) {
} }
void GUIApplication::initCanvases() { void GUIApplication::initCanvases() {
std::list<GLCanvas*>::iterator iter; for (std::list<GLCanvas*>::iterator iter = canvases_.begin(); iter != canvases_.end(); ++iter) {
for ( iter = canvases_.begin(); iter != canvases_.end(); iter++ ) { if (! (*iter)->isInitialized())
if (!(*iter)->isInitialized()) (*iter)->init(); (*iter)->init();
} }
} }
......
...@@ -297,7 +297,7 @@ LogManager::LogManager(const std::string& logDir) ...@@ -297,7 +297,7 @@ LogManager::LogManager(const std::string& logDir)
LogManager::~LogManager() { LogManager::~LogManager() {
vector<Log*>::iterator it; vector<Log*>::iterator it;
for (it = logs_.begin(); it != logs_.end(); it++) for (it = logs_.begin(); it != logs_.end(); ++it)
delete (*it); delete (*it);
delete consoleLog_; delete consoleLog_;
...@@ -311,7 +311,7 @@ void LogManager::log(const std::string &cat, LogLevel level, const std::string & ...@@ -311,7 +311,7 @@ void LogManager::log(const std::string &cat, LogLevel level, const std::string &
const std::string &extendedInfo) const std::string &extendedInfo)
{ {
vector<Log*>::iterator it; vector<Log*>::iterator it;
for (it = logs_.begin(); it != logs_.end(); it++) { for (it = logs_.begin(); it != logs_.end(); ++it) {
if (*it != 0) if (*it != 0)
(*it)->log(cat, level, msg, extendedInfo); (*it)->log(cat, level, msg, extendedInfo);
} }
......
...@@ -121,10 +121,9 @@ int NaturalCubicSpline::lookup(float x) const { ...@@ -121,10 +121,9 @@ int NaturalCubicSpline::lookup(float x) const {
else { else {
int i1 = 0; int i1 = 0;
int i2 = size - 2; int i2 = size - 2;
int i3 = 0;
while (i2 - i1 > 1) { while (i2 - i1 > 1) {
i3 = i1 + ((i2 - i1) >> 1); int i3 = i1 + ((i2 - i1) >> 1);
if (points_[i3].x > x) if (points_[i3].x > x)
i2 = i3; i2 = i3;
else else
......
...@@ -56,7 +56,8 @@ namespace campvis { ...@@ -56,7 +56,8 @@ namespace campvis {
, p_url("url", "Image URL", "") , p_url("url", "Image URL", "")
, p_targetImageID("targetImageName", "Target Image ID", "DevilImageReader.output", DataNameProperty::WRITE) , p_targetImageID("targetImageName", "Target Image ID", "DevilImageReader.output", DataNameProperty::WRITE)
, p_importType("ImportType", "Import Type", importOptions, 3) , p_importType("ImportType", "Import Type", importOptions, 3)
, _devilTextureReader(0) , _shader(nullptr)
, _devilTextureReader(nullptr)
{ {
addProperty(&p_url); addProperty(&p_url);
addProperty(&p_targetImageID); addProperty(&p_targetImageID);
......
...@@ -46,7 +46,7 @@ namespace campvis { ...@@ -46,7 +46,7 @@ namespace campvis {
void AbstractImageReader::setTargetImageId(DataNameProperty& targetImageId) { void AbstractImageReader::setTargetImageId(DataNameProperty& targetImageId) {
this->p_targetImageID.setValue(targetImageId.getValue()); this->p_targetImageID.setValue(targetImageId.getValue());
std::set<AbstractProperty*> sharedProperties = targetImageId.getSharedProperties(); std::set<AbstractProperty*> sharedProperties = targetImageId.getSharedProperties();
for(std::set<AbstractProperty*>::iterator it = sharedProperties.begin(); it != sharedProperties.end(); it++) { for(std::set<AbstractProperty*>::iterator it = sharedProperties.begin(); it != sharedProperties.end(); ++it) {
this->p_targetImageID.addSharedProperty(*it); this->p_targetImageID.addSharedProperty(*it);
} }
} }
...@@ -60,7 +60,7 @@ namespace campvis { ...@@ -60,7 +60,7 @@ namespace campvis {
} }
bool AbstractImageReader::acceptsExtension(const std::string& extension) { bool AbstractImageReader::acceptsExtension(const std::string& extension) {
for(std::vector<std::string>::iterator it = this->_ext.begin(); it != this->_ext.end(); it++) { for(std::vector<std::string>::iterator it = this->_ext.begin(); it != this->_ext.end(); ++it) {
if(*it == extension) { if(*it == extension) {
return true; return true;
} }
......
...@@ -78,8 +78,6 @@ namespace campvis { ...@@ -78,8 +78,6 @@ namespace campvis {
protected: protected:
std::vector<std::string> _ext; std::vector<std::string> _ext;
static const std::string loggerCat_;
private: private:
......
...@@ -66,7 +66,6 @@ namespace campvis { ...@@ -66,7 +66,6 @@ namespace campvis {
size_t dimensionality = 3; size_t dimensionality = 3;
tgt::svec3 size; tgt::svec3 size;
WeaklyTypedPointer::BaseType pt; WeaklyTypedPointer::BaseType pt;
size_t numChannels = 1;
tgt::vec3 voxelSize(1.f); tgt::vec3 voxelSize(1.f);
tgt::vec3 imageOffset(0.f); tgt::vec3 imageOffset(0.f);
...@@ -138,6 +137,8 @@ namespace campvis { ...@@ -138,6 +137,8 @@ namespace campvis {
file.close(); \ file.close(); \
} \ } \
rep = GenericImageRepresentationLocal<C_TYPE, 1>::create(image, dataArray); \ rep = GenericImageRepresentationLocal<C_TYPE, 1>::create(image, dataArray); \
if (rep == 0) \
delete [] dataArray; \
} }
DISPATCH_PARSING(WeaklyTypedPointer::UINT8 , uint8_t, uint16_t) DISPATCH_PARSING(WeaklyTypedPointer::UINT8 , uint8_t, uint16_t)
......
...@@ -67,7 +67,7 @@ namespace campvis { ...@@ -67,7 +67,7 @@ namespace campvis {
} }
void GenericImageReader::deinit() { void GenericImageReader::deinit() {
for(std::map<AbstractImageReader*, MetaProperty*>::iterator it = this->_readers.begin(); it != this->_readers.end(); it++) { for(std::map<AbstractImageReader*, MetaProperty*>::iterator it = this->_readers.begin(); it != this->_readers.end(); ++it) {
if (nullptr != it->first) delete it->first; if (nullptr != it->first) delete it->first;
if (nullptr != it->second) delete it->second; if (nullptr != it->second) delete it->second;
} }
...@@ -128,7 +128,7 @@ namespace campvis { ...@@ -128,7 +128,7 @@ namespace campvis {
if(it != this->_readers.end()) {