Commit bf8536ed authored by cfouard's avatar cfouard
Browse files

Small changes to fix some warnings (just to see CDash as green as possible)

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@406 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 022367e8
......@@ -179,19 +179,19 @@ vtkSmartPointer<vtkPointSet> ImageReconstructionAction::getMarchingCubesReconstr
int * previousDimensions = originalImageData->GetDimensions();
double x_magnification, y_magnification, z_magnification;
double x_magnification = 0.0;
double y_magnification = 0.0;
double z_magnification = 0.0;
x_magnification = subSampledDimX / (double) previousDimensions[0];
y_magnification = subSampledDimY / (double) previousDimensions[1];
if (originalImageData->GetDataDimension() == 3)
z_magnification = subSampledDimZ / (double) previousDimensions[2];
resampleFilter->SetAxisMagnificationFactor(0, x_magnification);
resampleFilter->SetAxisMagnificationFactor(1, y_magnification);
if (originalImageData->GetDataDimension() == 3)
if (originalImageData->GetDataDimension() == 3) {
z_magnification = subSampledDimZ / (double) previousDimensions[2];
resampleFilter->SetAxisMagnificationFactor(2, z_magnification);
}
resampleFilter->SetInput(originalImageData);
resampleFilter->AddObserver(vtkCommand::ProgressEvent, progressCallback);
......
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
****************************************************************************/
// include from STD
#include <set>
// includes from Qt
#include <QMap>
#include <QDir>
#include <QPair>
#include <QString>
#include <QFileInfo>
#include <QTextStream>
#include <Parameters.hxx>
#include <Action.hxx>
#ifndef ACTIONGENERATOR_H
#define ACTIONGENERATOR_H
using namespace coreschema;
class ActionGenerator {
public :
static bool generateActionFiles(QString xmlFileName, QString devDirectoryName, QString * elementClassName = NULL);
protected:
ActionGenerator(QString xmlFilename, QString devDirectoryName);
virtual void setXmlFileName(QString xmlFileName) throw (QString);
virtual void setDevDirectoryName(QString devDirectoryName) throw (QString);
virtual void createElement() throw (QString);
virtual void generateActionFiles() throw (QString);
virtual void writeHFile() throw (QString);
virtual void writeCFile() throw (QString);
virtual void writeImplementationFile() throw (QString);
/** XML DOM Element create by CodeSynthesis
* This action contains all of the informations of the xml file
*/
std::auto_ptr<Action> theAction;
/// Where to find the XML description of the Action
QFileInfo xmlFileName;
/// Where to store the produced files
QDir devDirectoryName;
/// Name of the created Action class
/// redundant information already contained in theAction, for practicle purpose.
QString className;
/// Does the action have parameters stored as properties ?
bool hasParameters;
/** List containing all parameters of the action stored as properties of theAction
* For practical reasons, this map contains for each parameter:
* - key: the name of the parameter
* - value: a QPair of element:
* - first: the type of the parameter
* - second: the default value of the parameter
* (if non exists in the XML file, a default one is given)
*/
QMap<QString, QPair<QString, QString> > parameters;
/// Set of additional files to include
std::set<QString> additionalIncludes;
private:
bool isItkFilter;
// bool hasImplementationFile;
};
#endif
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
****************************************************************************/
#ifndef ACTIONGENERATOR_H
#define ACTIONGENERATOR_H
#if defined(_WIN32) && !defined(__MINGW32__) // MSVC only
#pragma warning( disable : 4290 )
#endif // MSVC only
// include from STD
#include <set>
// includes from Qt
#include <QMap>
#include <QDir>
#include <QPair>
#include <QString>
#include <QFileInfo>
#include <QTextStream>
#include <Parameters.hxx>
#include <Action.hxx>
using namespace coreschema;
class ActionGenerator {
public :
static bool generateActionFiles(QString xmlFileName, QString devDirectoryName, QString * elementClassName = NULL);
protected:
ActionGenerator(QString xmlFilename, QString devDirectoryName);
virtual void setXmlFileName(QString xmlFileName) throw (QString);
virtual void setDevDirectoryName(QString devDirectoryName) throw (QString);
virtual void createElement() throw (QString);
virtual void generateActionFiles() throw (QString);
virtual void writeHFile() throw (QString);
virtual void writeCFile() throw (QString);
virtual void writeImplementationFile() throw (QString);
/** XML DOM Element create by CodeSynthesis
* This action contains all of the informations of the xml file
*/
std::auto_ptr<Action> theAction;
/// Where to find the XML description of the Action
QFileInfo xmlFileName;
/// Where to store the produced files
QDir devDirectoryName;
/// Name of the created Action class
/// redundant information already contained in theAction, for practicle purpose.
QString className;
/// Does the action have parameters stored as properties ?
bool hasParameters;
/** List containing all parameters of the action stored as properties of theAction
* For practical reasons, this map contains for each parameter:
* - key: the name of the parameter
* - value: a QPair of element:
* - first: the type of the parameter
* - second: the default value of the parameter
* (if non exists in the XML file, a default one is given)
*/
QMap<QString, QPair<QString, QString> > parameters;
/// Set of additional files to include
std::set<QString> additionalIncludes;
private:
bool isItkFilter;
// bool hasImplementationFile;
};
#endif
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
****************************************************************************/
#include "ComponentGenerator.h"
......@@ -269,7 +269,6 @@ void ComponentGenerator::writeCFile() throw (QString) {
text.replace(QRegExp("@PARENTCLASSNAME@"), parentClassName);
if (text.contains(QRegExp("@ADDITIONAL_INCLUDES@"))) {
int nbIncludes = additionalIncludes.size();
std::set<QString>::const_iterator it;
for (it = additionalIncludes.begin(); it != additionalIncludes.end(); it++) {
out << QString("#include <") << (*it) << ">" << endl;
......
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
****************************************************************************/
#ifndef COMPONENTGENERATOR_H
#define COMPONENTGENERATOR_H
#include <set>
// includes from Qt
#include <QMap>
#include <QDir>
#include <QPair>
#include <QString>
#include <QFileInfo>
#include <QTextStream>
#include <Component.hxx>
using namespace coreschema;
class ComponentGenerator {
public :
enum RepresentationType {
IMAGE,
MESH,
NONE
};
static bool generateComponentFiles(QString xmlFileName, QString devDirectoryName, QString * elementClassName = NULL);
protected:
ComponentGenerator(QString xmlFilename, QString devDirectoryName);
virtual void setXmlFileName(QString xmlFileName) throw (QString);
virtual void setDevDirectoryName(QString devDirectoryName) throw (QString);
virtual void createElement() throw (QString);
virtual void generateComponentFiles() throw (QString);
virtual void writeHFile() throw (QString);
virtual void writeCFile() throw (QString);
/** XML DOM Element create by CodeSynthesis
* This component contains all of the informations of the xml file
*/
std::auto_ptr<Component> theComponent;
/// Where to find the XML description of the Action
QFileInfo xmlFileName;
/// Where to store the produced files
QDir devDirectoryName;
/// Name of the created Component class
/// redundant information already contained in theAction, for practicle purpose.
QString className;
/// Does the component have properties ?
bool hasParameters;
/** List containing all properties of the component
* For practical reasons, this map contains for each parameter:
* - key: the name of the parameter
* - value: a QPair of element:
* - first: the type of the parameter
* - second: the default value of the parameter
* (if non exists in the XML file, a default one is given)
*/
QMap<QString, QPair<QString, QString> > parameters;
/// Set of additional files to include
std::set<QString> additionalIncludes;
RepresentationType representation;
};
#endif
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
****************************************************************************/
#ifndef COMPONENTGENERATOR_H
#define COMPONENTGENERATOR_H
#if defined(_WIN32) && !defined(__MINGW32__) // MSVC only
#pragma warning( disable : 4290 )
#endif // MSVC only
#include <set>
// includes from Qt
#include <QMap>
#include <QDir>
#include <QPair>
#include <QString>
#include <QFileInfo>
#include <QTextStream>
#include <Component.hxx>
using namespace coreschema;
class ComponentGenerator {
public :
enum RepresentationType {
IMAGE,
MESH,
NONE
};
static bool generateComponentFiles(QString xmlFileName, QString devDirectoryName, QString * elementClassName = NULL);
protected:
ComponentGenerator(QString xmlFilename, QString devDirectoryName);
virtual void setXmlFileName(QString xmlFileName) throw (QString);
virtual void setDevDirectoryName(QString devDirectoryName) throw (QString);
virtual void createElement() throw (QString);
virtual void generateComponentFiles() throw (QString);
virtual void writeHFile() throw (QString);
virtual void writeCFile() throw (QString);
/** XML DOM Element create by CodeSynthesis
* This component contains all of the informations of the xml file
*/
std::auto_ptr<Component> theComponent;
/// Where to find the XML description of the Action
QFileInfo xmlFileName;
/// Where to store the produced files
QDir devDirectoryName;
/// Name of the created Component class
/// redundant information already contained in theAction, for practicle purpose.
QString className;
/// Does the component have properties ?
bool hasParameters;
/** List containing all properties of the component
* For practical reasons, this map contains for each parameter:
* - key: the name of the parameter
* - value: a QPair of element:
* - first: the type of the parameter
* - second: the default value of the parameter
* (if non exists in the XML file, a default one is given)
*/
QMap<QString, QPair<QString, QString> > parameters;
/// Set of additional files to include
std::set<QString> additionalIncludes;
RepresentationType representation;
};
#endif
......@@ -44,11 +44,11 @@ void DevWindow::okClicked() {
xmlFile = ui.xmlFileLineEdit->text();
if (devDirectory == "") {
int ret = QMessageBox::warning(this, tr("Before going further..."), tr("Please set the development directory\n"));
QMessageBox::warning(this, tr("Before going further..."), tr("Please set the development directory\n"));
return;
}
if (xmlFile == "") {
int ret = QMessageBox::warning(this, tr("Before going further..."), tr("Please set the xml extension file name\n"));
QMessageBox::warning(this, tr("Before going further..."), tr("Please set the xml extension file name\n"));
return;
}
......
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
****************************************************************************/
#ifndef EXTENSIONGENERATOR_H
#define EXTENSIONGENERATOR_H
#if defined(_WIN32) && !defined(__MINGW32__) // MSVC only
#pragma warning( disable : 4290 )
#endif // MSVC only
// includes from Qt
#include <QString>
......@@ -31,9 +38,6 @@
// Includes from coreschema
#include <Extension.hxx>
#ifndef EXTENSIONGENERATOR_H
#define EXTENSIONGENERATOR_H
using namespace coreschema;
......
......@@ -56,7 +56,7 @@ void NewbieWindow::actionButtonClicked() {
QString enteredDir = ui.devDirectoryLineEdit->text();
QFileInfo devDir(enteredDir);
if ((enteredDir == "") || (!devDir.isDir())) {
int ret = QMessageBox::warning(this, tr("Before going further..."), tr("Please select a valid development directory\n"));
QMessageBox::warning(this, tr("Before going further..."), tr("Please select a valid development directory\n"));
return;
}
ExtensionWindow * win = new ExtensionWindow(this, ui.devDirectoryLineEdit->text(), Action);
......@@ -73,7 +73,7 @@ void NewbieWindow::componentButtonClicked() {
QString enteredDir = ui.devDirectoryLineEdit->text();
QFileInfo devDir(enteredDir);
if ((enteredDir == "") || (!devDir.isDir())) {
int ret = QMessageBox::warning(this, tr("Before going further..."), tr("Please select a valid development directory\n"));
QMessageBox::warning(this, tr("Before going further..."), tr("Please select a valid development directory\n"));
return;
}
// QMessageBox::warning(this, "Newbie Window", "Component Button Clicked");
......
......@@ -22,15 +22,19 @@
*
* $CAMITK_LICENCE_END$
****************************************************************************/
#ifndef REPORTWINDOW_H
#define REPORTWINDOW_H
#if defined(_WIN32) && !defined(__MINGW32__) // MSVC only
#pragma warning( disable : 4290 )
#endif // MSVC only
#include <QString>
#include <QStringList>
// Include GUI automatically generated from the file
// MedicalViewer.ui (to be modified via QtDesigner).
#include "ui_ReportWindow.h"
#ifndef REPORTWINDOW_H
#define REPORTWINDOW_H
class ReportWindow : public QMainWindow {
Q_OBJECT
......
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*