Commit 7560e4d8 authored by Emmanuel Promayon's avatar Emmanuel Promayon

UPDATED removed C++11 deprecated throw(...)

parent ad3713c9
......@@ -44,7 +44,7 @@
using namespace camitk;
// --------------- Constructor -------------------
DicomComponent::DicomComponent(DicomSerie* dicomSerie) throw(camitk::AbortException) : ImageComponent("") {
DicomComponent::DicomComponent(DicomSerie* dicomSerie) : ImageComponent("") {
// associated the component's dicom series
serie = dicomSerie;
......
......@@ -49,9 +49,10 @@ class DicomComponent : public camitk::ImageComponent {
public:
/**
* Create a new Component that handles DICOM images
* @param pointor to the associated DicomSerie
* This method may throw an AbortException if a problem occurs.
* @param dSerie to the associated DicomSerie
**/
DicomComponent(DicomSerie*) throw(camitk::AbortException);
DicomComponent(DicomSerie* dSerie);
/**
* @brief Get the DicomSerie associated to this component.
......
......@@ -52,7 +52,7 @@ QStringList DicomComponentExtension::getFileExtensions() const {
}
// --------------- Open -------------------
Component* DicomComponentExtension::open(const QString& path) throw(camitk::AbortException) {
Component* DicomComponentExtension::open(const QString& path) {
serieParsed = DicomParser::parseDirectory(path);
......
......@@ -75,8 +75,9 @@ public:
virtual QStringList getFileExtensions() const;
/** Open a single .dcm image or a directory containing files to be read
* This method may throw an AbortException if a problem occurs.
*/
virtual camitk::Component* open(const QString&) throw (camitk::AbortException);
virtual camitk::Component* open(const QString&);
/** Save a given Component (does not have to be top-level)
* into one of the currently managed format.
......
......@@ -50,7 +50,7 @@ public:
/**Default Constructor*/
DicomDialog(QList<DicomDialogEntry*>);
/**Destructor*/
~DicomDialog() override;
~DicomDialog() override = default;
/// Get the list of DicomDialogEntry selected for opening
QList<DicomDialogEntry*> getSelectedDicomDialogEntries();
......
......@@ -45,7 +45,7 @@ using namespace camitk;
#include <Log.h>
// -------------------- constructor --------------------
ItkImageComponent::ItkImageComponent(const QString& fileName) throw(camitk::AbortException)
ItkImageComponent::ItkImageComponent(const QString& fileName)
: ImageComponent(fileName) {
createComponent(fileName);
}
......
......@@ -40,8 +40,10 @@
class ItkImageComponent : public camitk::ImageComponent {
Q_OBJECT
public:
/// default constructor: give it the name of the file containing the data
ItkImageComponent(const QString&) throw (camitk::AbortException);
/** default constructor: give it the name of the file containing the data.
* This method may throw an AbortException if a problem occurs.
*/
ItkImageComponent(const QString&);
/// needed for deleting
virtual ~ItkImageComponent() = default;
......
......@@ -66,7 +66,7 @@ QStringList ItkImageComponentExtension::getFileExtensions() const {
}
// --------------- open -------------------
Component* ItkImageComponentExtension::open(const QString& fileName) throw (AbortException) {
Component* ItkImageComponentExtension::open(const QString& fileName) {
ItkImageComponent* res = nullptr;
try {
res = new ItkImageComponent(fileName);
......
......@@ -54,8 +54,10 @@ public:
/// get the list of managed extensions (each file with an extension in the list can be loaded by this Extension
virtual QStringList getFileExtensions() const;
/// get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
virtual camitk::Component* open(const QString&) throw(camitk::AbortException);
/** get a new instance from data stored in a file.
* This method may throw an AbortException if a problem occurs.
*/
virtual camitk::Component* open(const QString&);
/** save a given Component (does not have to be top-level) into one of the currently managed format.
*
......
......@@ -47,7 +47,7 @@ using namespace camitk;
#include <QDockWidget>
// -------------------- default constructor --------------------
MMLComponent::MMLComponent(const QString& fileName) throw(camitk::AbortException) : Component(fileName, QFileInfo(fileName).baseName()) {
MMLComponent::MMLComponent(const QString& fileName) : Component(fileName, QFileInfo(fileName).baseName()) {
QString file = fileName;
QFileInfo fi = QFileInfo(fileName);
......
......@@ -50,8 +50,10 @@ class MMLCOMPONENT_API MMLComponent : public camitk::Component {
public:
/// Default constructor: give it the name of the file containing the data (.mml file)
MMLComponent(const QString&) throw(camitk::AbortException);
/** Default constructor: give it the name of the file containing the data (.mml file)
* This method may throw an AbortException if a problem occurs.
*/
MMLComponent(const QString&);
/// destructor
virtual ~MMLComponent();
......@@ -115,4 +117,4 @@ private:
};
#endif
\ No newline at end of file
#endif
......@@ -47,20 +47,20 @@ QStringList MMLComponentExtension::getFileExtensions() const {
}
// --------------- open -------------------
camitk::Component* MMLComponentExtension::open( const QString& fileName ) throw( AbortException ) {
return new MMLComponent( fileName );
camitk::Component* MMLComponentExtension::open(const QString& fileName) {
return new MMLComponent(fileName);
}
// -------------------- save --------------------
bool MMLComponentExtension::save( Component* component ) const {
MMLComponent* mmlComp = dynamic_cast<MMLComponent*>( component );
bool MMLComponentExtension::save(Component* component) const {
MMLComponent* mmlComp = dynamic_cast<MMLComponent*>(component);
bool saveStatus = true;
if ( mmlComp ) {
if (mmlComp) {
mmlComp->saveMML();
mmlComp->setModified( false );
mmlComp->setModified(false);
}
else {
saveStatus = ComponentExtension::save( component );
saveStatus = ComponentExtension::save(component);
}
return saveStatus;
}
......@@ -57,8 +57,10 @@ public:
/// get the list of managed extensions (each file with an extension in the list can be loaded by this Extension
virtual QStringList getFileExtensions() const;
/// get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
virtual camitk::Component* open(const QString&) throw (camitk::AbortException);
/** get a new instance from data stored in a file (this is the most important method to redefine in your subclass).
* This method may throw an AbortException if a problem occurs.
*/
virtual camitk::Component* open(const QString&);
/// save (only work with mml component)
virtual bool save(camitk::Component* component) const;
......
......@@ -35,6 +35,7 @@
bool colorsRegistered = MMLMonitorDisplayFactory::getInstance()->registerClass<Colors>("Colors", Monitor::SCALARSET);
// ---------------------- constructor ----------------------------
Colors::Colors(Monitor* monitor, MMLComponent* manager): MMLMonitorDisplay(monitor, manager) {
}
......
......@@ -36,7 +36,7 @@ public:
/// constructor
Colors(Monitor* monitor, MMLComponent* manager);
/// destructor
~Colors() override;
~Colors() override = default;
/// update display
void update() override;
......
......@@ -71,7 +71,7 @@
using namespace camitk;
//-------------------- Constructor -------------------
PMLComponent::PMLComponent(const QString& file) throw(camitk::AbortException) : MeshComponent(file) {
PMLComponent::PMLComponent(const QString& file) : MeshComponent(file) {
// Open the .pml file using library-pml
try {
Application::showStatusBarMessage("Loading " + QFileInfo(file).fileName() + "...");
......
......@@ -100,9 +100,12 @@ class PML_COMPONENT_API PMLComponent : public camitk::MeshComponent {
Q_OBJECT
public:
/// Construct the PML component directly from the .pml xml file.
/// @param filename: The input .pml xml file to build the physical model from.
PMLComponent(const QString& file) throw(camitk::AbortException);
/** Construct the PML component directly from the .pml xml file.
* This method may throw an AbortException if a problem occurs.
*
* @param filename: The input .pml xml file to build the physical model from.
*/
PMLComponent(const QString& file);
/** Create the PML component directly from the PhysicalModel (also have to give the original pml filename)
* @param p the physicalModel (already instantiated and build)
......
......@@ -59,7 +59,7 @@ QStringList PMLComponentExtension::getFileExtensions() const {
}
// --------------- open -------------------
camitk::Component* PMLComponentExtension::open(const QString& fileName) throw(AbortException) {
camitk::Component* PMLComponentExtension::open(const QString& fileName) {
Application::showStatusBarMessage("Loading " + fileName + "...");
......
......@@ -57,8 +57,10 @@ public:
/// get the list of managed extensions (each file with an extension in the list can be loaded by this Extension
virtual QStringList getFileExtensions() const;
/// get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
virtual camitk::Component* open(const QString&) throw (camitk::AbortException);
/** get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
* This method may throw an AbortException if a problem occurs.
*/
virtual camitk::Component* open(const QString&);
/// save from or to PML
virtual bool save(camitk::Component* component) const;
......
This diff is collapsed.
......@@ -92,13 +92,17 @@ public:
/** Default constructor : this one just initialize everything.
* Structures and atoms are empty.
*/
PhysicalModel();
PhysicalModel() noexcept;
/**
* Instanciate a physical model object using a XML native format file
* This method may throw a PMLAbortException if a problem occurs.
*
* @param fileName the name of the xml file to use
* @param pspf is a pointer to the method that will be called by the setProgress(...) method (default = NULL)
*/
PhysicalModel(const char* fileName, PtrToSetProgressFunction pspf = nullptr) throw(PMLAbortException);
PhysicalModel(const char* fileName, PtrToSetProgressFunction pspf = nullptr);
/// destructor
virtual ~PhysicalModel();
/// Current PML library version
......@@ -276,9 +280,10 @@ public:
private:
/** use the XML Parser/Reader to read an XML file conform to physicalmodel.dtd
* @param n the name of the XML file
*/
void xmlRead(const char* n) throw(PMLAbortException);
* This method may throw a PMLAbortException if a problem occurs.
* @param n the name of the XML file
*/
void xmlRead(const char* n);
/** read the xml tree and call other parse methods to build the physicalModel. */
bool parseTree(std::unique_ptr<physicalModel::PhysicalModel> root, std::string defaultName);
......
......@@ -47,7 +47,7 @@ using namespace camitk;
#include "ActionTransition.h"
// ---------------------- constructor ----------------------------
ActionStateMachine::ActionStateMachine(int& argc, char** argv, QString inputFileName, QString outputDirectory) throw(camitk::AbortException) :
ActionStateMachine::ActionStateMachine(int& argc, char** argv, QString inputFileName, QString outputDirectory) :
Application("camitk-actionstatemachine", argc, argv) {
setProperty("Log to File", true);
......@@ -171,7 +171,7 @@ void ActionStateMachine::initMainWindow() {
}
// ---------------------- checkSCXMLFile ----------------------------
void ActionStateMachine::checkSCXMLFile(QString filename) throw(camitk::AbortException) {
void ActionStateMachine::checkSCXMLFile(QString filename) {
QString msg;
QDomDocument doc;
......@@ -205,7 +205,7 @@ void ActionStateMachine::checkSCXMLFile(QString filename) throw(camitk::AbortExc
}
// ---------------------- parseSCXMLTree ----------------------------
QString ActionStateMachine::parseSCXMLTree() throw(camitk::AbortException) {
QString ActionStateMachine::parseSCXMLTree() {
// Get the name of the application
QString applicationName = "";
QDomElement docElem = scxmlDoc.documentElement();
......@@ -256,7 +256,7 @@ void ActionStateMachine::finished() {
}
// ---------------------- createAllActionStates ----------------------------
void ActionStateMachine::createAllActionStates(QDomNodeList nodeList) throw(camitk::AbortException) {
void ActionStateMachine::createAllActionStates(QDomNodeList nodeList) {
int nbStates = nodeList.size();
if (nbStates < 1) {
QString msg = tr("No state and no camitk-action!");
......@@ -343,7 +343,7 @@ void ActionStateMachine::createAllActionStates(QDomNodeList nodeList) throw(cami
}
// ---------------------- createTransitions ----------------------------
void ActionStateMachine::createTransitions(QDomNodeList nodeList) throw(camitk::AbortException) {
void ActionStateMachine::createTransitions(QDomNodeList nodeList) {
int nbStates = nodeList.size();
for (int stateNumber = 0; stateNumber < nbStates; stateNumber++) {
// For each state ...
......@@ -443,7 +443,7 @@ QVector<Action::ApplyStatus> ActionStateMachine::stringToStatus(QString listOfSt
}
// ---------------------- setCamiTKAction ----------------------------
void ActionStateMachine::setCamiTKAction(ActionState* actionState, QDomElement actionElement) throw(camitk::AbortException) {
void ActionStateMachine::setCamiTKAction(ActionState* actionState, QDomElement actionElement) {
QString msg;
if ((actionState == nullptr) || (actionElement.isNull())) {
msg = tr("No Action or no state...");
......@@ -530,7 +530,7 @@ void ActionStateMachine::setCamiTKAction(ActionState* actionState, QDomElement a
}
// ---------------------- setCamiTKSaveAction ----------------------------
void ActionStateMachine::setCamiTKSaveAction(SaveActionState* actionState, QDomElement actionElement) throw(camitk::AbortException) {
void ActionStateMachine::setCamiTKSaveAction(SaveActionState* actionState, QDomElement actionElement) {
QString msg;
if ((actionState == nullptr) || (actionElement.isNull())) {
......
......@@ -59,8 +59,10 @@ class ActionStateMachine : public camitk::Application {
Q_OBJECT
public:
/// construtor
ActionStateMachine(int& argc, char** argv, QString inputFileName = "", QString outputDirectory = "") throw(camitk::AbortException);
/** construtor.
* This method may throw an AbortException if a problem occurs.
*/
ActionStateMachine(int& argc, char** argv, QString inputFileName = "", QString outputDirectory = "");
/// destructor
virtual ~ActionStateMachine() = default;
......@@ -80,11 +82,15 @@ protected:
/// initialized main window
void initMainWindow();
/// check that the file is a SCXML file (simple checking, no XML Schema validation yet)
void checkSCXMLFile(QString filename) throw(camitk::AbortException);
/** check that the file is a SCXML file (simple checking, no XML Schema validation yet)
* This method may throw an AbortException if a problem occurs.
*/
void checkSCXMLFile(QString filename);
/// parse the XML file (using Qt DOM API)
QString parseSCXMLTree() throw(camitk::AbortException);
/** parse the XML file (using Qt DOM API)
* This method may throw an AbortException if a problem occurs.
*/
QString parseSCXMLTree();
///@name Attributes
///@{
......@@ -125,13 +131,17 @@ private:
/// @name Tool methods used, see parseSCXMLTree()
/// @{
void createAllActionStates(QDomNodeList nodeList) throw(camitk::AbortException);
/// This method may throw an AbortException if a problem occurs.
void createAllActionStates(QDomNodeList nodeList);
void createTransitions(QDomNodeList nodeList) throw(camitk::AbortException);
/// This method may throw an AbortException if a problem occurs.
void createTransitions(QDomNodeList nodeList);
void setCamiTKAction(ActionState* actionState, QDomElement actionElement) throw(camitk::AbortException);
/// This method may throw an AbortException if a problem occurs.
void setCamiTKAction(ActionState* actionState, QDomElement actionElement);
void setCamiTKSaveAction(SaveActionState* actionState, QDomElement actionElement) throw(camitk::AbortException);
/// This method may throw an AbortException if a problem occurs.
void setCamiTKSaveAction(SaveActionState* actionState, QDomElement actionElement);
QVector<camitk::Action::ApplyStatus> stringToStatus(QString listOfStatus);
///@}
......
......@@ -48,7 +48,7 @@
using namespace camitk;
// -------------------- default constructor --------------------
MshComponent::MshComponent(const QString& file) throw (AbortException) : MeshComponent(file) {
MshComponent::MshComponent(const QString& file) : MeshComponent(file) {
// use the file name without extension as component name
setName(QFileInfo(file).baseName());
......
......@@ -46,8 +46,8 @@ class MSH_COMPONENT_API MshComponent : public camitk::MeshComponent {
public:
/// default constructor
MshComponent(const QString& file) throw(camitk::AbortException);
/// This method may throw an AbortException if a problem occurs.
MshComponent(const QString& file);
private :
......
......@@ -55,7 +55,7 @@ QStringList MshExtension::getFileExtensions() const {
}
// --------------- open -------------------
Component* MshExtension::open(const QString& fileName) throw (AbortException) {
Component* MshExtension::open(const QString& fileName) {
return new MshComponent(fileName);
}
......
......@@ -57,8 +57,9 @@ public:
/// get the list of managed extensions (each file with an extension in the list can be loaded by this Extension
virtual QStringList getFileExtensions() const;
/// get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
virtual camitk::Component* open(const QString&) throw(camitk::AbortException);
/// get a new instance from data stored in a file
/// This method may throw an AbortException if a problem occurs.
virtual camitk::Component* open(const QString&);
/**
* @brief save a MshComponent
......
......@@ -32,7 +32,7 @@
using namespace camitk;
// -------------------- default constructor --------------------
ObjComponent::ObjComponent(const QString& file) throw(AbortException) : MeshComponent(file) {
ObjComponent::ObjComponent(const QString& file) : MeshComponent(file) {
// use the file name without extension as component name
setName(QFileInfo(file).baseName());
......
......@@ -40,9 +40,8 @@ class ObjComponent : public camitk::MeshComponent {
public:
/// default constructor
ObjComponent(const QString& file) throw(camitk::AbortException);
/// This method may throw an AbortException if a problem occurs.
ObjComponent(const QString& file);
private:
......
......@@ -53,7 +53,7 @@ QStringList ObjExtension::getFileExtensions() const {
}
// --------------- open -------------------
camitk::Component* ObjExtension::open(const QString& fileName) throw (camitk::AbortException) {
camitk::Component* ObjExtension::open(const QString& fileName) {
return new ObjComponent(fileName);
}
......
......@@ -53,8 +53,10 @@ public:
/// get the list of managed extensions (each file with an extension in the list can be loaded by this extension)
virtual QStringList getFileExtensions() const;
/// get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
virtual camitk::Component* open(const QString&) throw (camitk::AbortException);
/** get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
* This method may throw an AbortException if a problem occurs.
*/
virtual camitk::Component* open(const QString&);
/// save a component as a OBJ file.
virtual bool save ( camitk::Component* component ) const;
......
......@@ -44,7 +44,7 @@
using namespace camitk;
// -------------------- default constructor --------------------
OffComponent::OffComponent(const QString& file) throw(AbortException) : MeshComponent(file) {
OffComponent::OffComponent(const QString& file) : MeshComponent(file) {
// use the file name without extension as component name
setName(QFileInfo(file).baseName());
......
......@@ -40,11 +40,9 @@ class OffComponent : public camitk::MeshComponent {
public:
/// default constructor
OffComponent(const QString& file) throw(camitk::AbortException);
/// This method may throw an AbortException if a problem occurs.
OffComponent(const QString& file);
private:
......
......@@ -55,7 +55,7 @@ QStringList OffExtension::getFileExtensions() const {
}
// --------------- open -------------------
camitk::Component* OffExtension::open(const QString& fileName) throw (camitk::AbortException) {
camitk::Component* OffExtension::open(const QString& fileName) {
return new OffComponent(fileName);
}
......
......@@ -53,8 +53,10 @@ public:
/// get the list of managed extensions (each file with an extension in the list can be loaded by this Extension
virtual QStringList getFileExtensions() const;
/// get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
virtual camitk::Component* open(const QString&) throw (camitk::AbortException);
/** get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
* This method may throw an AbortException if a problem occurs.
*/
virtual camitk::Component* open(const QString&);
/**
* @brief save a OffComponent
......
......@@ -36,7 +36,7 @@
using namespace camitk;
// --------------- Constructor -------------------
StlComponent::StlComponent(const QString& file) throw(camitk::AbortException) : MeshComponent(file) {
StlComponent::StlComponent(const QString& file) : MeshComponent(file) {
// use the file name without extension as component name
setName(QFileInfo(file).baseName());
......
......@@ -44,7 +44,9 @@ class StlComponent : public camitk::MeshComponent {
public:
/// Default Constructor
StlComponent(const QString& file) throw(camitk::AbortException);
/// This method may throw an AbortException if a problem occurs.
StlComponent(const QString& file);
/// Default Destructor
virtual ~StlComponent() = default;
......
......@@ -50,7 +50,7 @@ QStringList StlExtension::getFileExtensions() const {
}
// --------------- open -------------------
Component* StlExtension::open(const QString& fileName) throw (AbortException) {
Component* StlExtension::open(const QString& fileName) {
return new StlComponent(fileName);
}
......
......@@ -50,14 +50,13 @@ public:
virtual QString getDescription() const;
/** Get the list of managed extensions
* (each file with an extension in the list can be loaded by this extension)
*/
virtual QStringList getFileExtensions() const;
/** Get a new instance from data stored in a file
* (this is the most important method to redefine in your subclass)
/** Get a new instance from data stored in a file.
* This method may throw an AbortException if a problem occurs.
*/
camitk::Component* open(const QString&) throw (camitk::AbortException);
camitk::Component* open(const QString&);
/** Save a given Component (does not have to be top-level)
* into one of the currently managed format.
......
......@@ -38,7 +38,7 @@
using namespace camitk;
// -------------------- default constructor --------------------
VRMLComponent::VRMLComponent(const QString& file) throw(camitk::AbortException) : Component(file, QFileInfo(file).baseName()) {
VRMLComponent::VRMLComponent(const QString& file) : Component(file, QFileInfo(file).baseName()) {
// create a VTK importer to read the VRML file
vtkSmartPointer<vtkVRMLImporter> importer = vtkSmartPointer<vtkVRMLImporter>::New();
......
......@@ -49,7 +49,8 @@ class VRMLComponent : public camitk::Component {
public:
/// default constructor
VRMLComponent(const QString& file) throw(camitk::AbortException);
/// This method may throw an AbortException if a problem occurs.
VRMLComponent(const QString& file);
/// do nothing to init the representation, as all representation are done in the sub-component
virtual void initRepresentation() {};
......
......@@ -53,7 +53,7 @@ QStringList VRMLComponentExtension::getFileExtensions() const {
}
// --------------- open -------------------
Component* VRMLComponentExtension::open(const QString& fileName) throw (AbortException) {
Component* VRMLComponentExtension::open(const QString& fileName) {
return new VRMLComponent(fileName);
}
......
......@@ -59,11 +59,13 @@ public:
/// get the plugin description (can be html)
virtual QString getDescription() const;
/// get the list of managed extensions (each file with an extension in the list can be loaded by this Extension
/// get the list of managed extensions
virtual QStringList getFileExtensions() const;
/// get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
virtual camitk::Component* open(const QString&) throw (camitk::AbortException);
/** get a new instance from data stored in a file
* This method may throw an AbortException if a problem occurs.
*/
virtual camitk::Component* open(const QString&);
/** save the given MeshComponent to VRML (does not have to be top-level).
*
......
......@@ -32,7 +32,7 @@
using namespace camitk;
// -------------------- constructor --------------------
RawImageComponent::RawImageComponent(const QString& fileName) throw(camitk::AbortException)
RawImageComponent::RawImageComponent(const QString& fileName)
: ImageComponent(fileName) {
if (!fileName.isNull()) {
// restore the normal cursor
......
......@@ -48,8 +48,10 @@
class RawImageComponent : public camitk::ImageComponent {
Q_OBJECT
public:
/// default constructor: give it the name of the file containing the data
RawImageComponent(const QString&) throw (camitk::AbortException);
/** default constructor: give it the name of the file containing the data
* This method may throw an AbortException if a problem occurs.
*/
RawImageComponent(const QString&);
/// Destructor
~RawImageComponent();
......
......@@ -48,13 +48,13 @@
using namespace camitk;
// -------------------- constructor --------------------
VtkImageComponent::VtkImageComponent(const QString& fileName) throw(camitk::AbortException)
VtkImageComponent::VtkImageComponent(const QString& fileName)
: ImageComponent(fileName) {
createComponent(fileName);
}
// -------------------- createComponent --------------------