Commit 86ba4751 authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED over zealous noexcept

parent 62c92931
......@@ -44,7 +44,7 @@
using namespace camitk;
// --------------- Constructor -------------------
DicomComponent::DicomComponent(DicomSerie* dicomSerie) noexcept : ImageComponent("") {
DicomComponent::DicomComponent(DicomSerie* dicomSerie) throw(camitk::AbortException) : ImageComponent("") {
// associated the component's dicom series
serie = dicomSerie;
......
......@@ -52,7 +52,7 @@ QStringList DicomComponentExtension::getFileExtensions() const {
}
// --------------- Open -------------------
Component* DicomComponentExtension::open(const QString& path) noexcept {
Component* DicomComponentExtension::open(const QString& path) throw(camitk::AbortException) {
serieParsed = DicomParser::parseDirectory(path);
......
......@@ -45,7 +45,7 @@ using namespace camitk;
#include <Log.h>
// -------------------- constructor --------------------
ItkImageComponent::ItkImageComponent(const QString& fileName) noexcept
ItkImageComponent::ItkImageComponent(const QString& fileName) throw(camitk::AbortException)
: ImageComponent(fileName) {
createComponent(fileName);
}
......
......@@ -47,7 +47,7 @@ using namespace camitk;
#include <QDockWidget>
// -------------------- default constructor --------------------
MMLComponent::MMLComponent(const QString& fileName) noexcept : Component(fileName, QFileInfo(fileName).baseName()) {
MMLComponent::MMLComponent(const QString& fileName) throw(camitk::AbortException) : Component(fileName, QFileInfo(fileName).baseName()) {
QString file = fileName;
QFileInfo fi = QFileInfo(fileName);
......
......@@ -71,14 +71,13 @@
using namespace camitk;
//-------------------- Constructor -------------------
PMLComponent::PMLComponent(const QString& file) noexcept(false) : MeshComponent(file) {
PMLComponent::PMLComponent(const QString& file) throw(camitk::AbortException) : MeshComponent(file) {
// Open the .pml file using library-pml
try {
Application::showStatusBarMessage("Loading " + QFileInfo(file).fileName() + "...");
physicalModel = new PhysicalModel(file.toStdString().c_str());
}
catch
(PMLAbortException& e) {
catch (PMLAbortException& e) {
throw AbortException("The PML XML document cannot be opened: " + std::string(e.what()));
}
......
......@@ -55,7 +55,7 @@ PhysicalModel::PhysicalModel() {
init();
}
PhysicalModel::PhysicalModel ( const char* fileName, PtrToSetProgressFunction pspf ) noexcept(false) {
PhysicalModel::PhysicalModel ( const char* fileName, PtrToSetProgressFunction pspf ) throw(PMLAbortException) {
init();
setProgressFunction = pspf;
......@@ -329,7 +329,7 @@ void PhysicalModel::xmlPrint ( std::ostream& o, bool opt ) {
}
// --------------- xmlRead ---------------
void PhysicalModel::xmlRead ( const char* filename ) noexcept(false) {
void PhysicalModel::xmlRead ( const char* filename ) throw(PMLAbortException) {
// clear all the current data
clear();
......
......@@ -47,7 +47,7 @@ using namespace camitk;
#include "ActionTransition.h"
// ---------------------- constructor ----------------------------
ActionStateMachine::ActionStateMachine(int& argc, char** argv, QString inputFileName, QString outputDirectory) noexcept :
ActionStateMachine::ActionStateMachine(int& argc, char** argv, QString inputFileName, QString outputDirectory) throw(camitk::AbortException) :
Application("camitk-actionstatemachine", argc, argv) {
setProperty("Log to File", true);
......@@ -176,7 +176,7 @@ void ActionStateMachine::initMainWindow() {
}
// ---------------------- checkSCXMLFile ----------------------------
void ActionStateMachine::checkSCXMLFile(QString filename) noexcept {
void ActionStateMachine::checkSCXMLFile(QString filename) throw(camitk::AbortException) {
QString msg;
QDomDocument doc;
......@@ -210,7 +210,7 @@ void ActionStateMachine::checkSCXMLFile(QString filename) noexcept {
}
// ---------------------- parseSCXMLTree ----------------------------
QString ActionStateMachine::parseSCXMLTree() noexcept {
QString ActionStateMachine::parseSCXMLTree() throw(camitk::AbortException) {
// Get the name of the application
QString applicationName = "";
QDomElement docElem = scxmlDoc.documentElement();
......@@ -261,7 +261,7 @@ void ActionStateMachine::finished() {
}
// ---------------------- createAllActionStates ----------------------------
void ActionStateMachine::createAllActionStates(QDomNodeList nodeList) noexcept {
void ActionStateMachine::createAllActionStates(QDomNodeList nodeList) throw(camitk::AbortException) {
int nbStates = nodeList.size();
if (nbStates < 1) {
QString msg = tr("No state and no camitk-action!");
......@@ -348,7 +348,7 @@ void ActionStateMachine::createAllActionStates(QDomNodeList nodeList) noexcept {
}
// ---------------------- createTransitions ----------------------------
void ActionStateMachine::createTransitions(QDomNodeList nodeList) noexcept {
void ActionStateMachine::createTransitions(QDomNodeList nodeList) throw(camitk::AbortException) {
int nbStates = nodeList.size();
for (int stateNumber = 0; stateNumber < nbStates; stateNumber++) {
// For each state ...
......@@ -448,7 +448,7 @@ QVector<Action::ApplyStatus> ActionStateMachine::stringToStatus(QString listOfSt
}
// ---------------------- setCamiTKAction ----------------------------
void ActionStateMachine::setCamiTKAction(ActionState* actionState, QDomElement actionElement) noexcept {
void ActionStateMachine::setCamiTKAction(ActionState* actionState, QDomElement actionElement) throw(camitk::AbortException) {
QString msg;
if ((actionState == nullptr) || (actionElement.isNull())) {
msg = tr("No Action or no state...");
......@@ -535,7 +535,7 @@ void ActionStateMachine::setCamiTKAction(ActionState* actionState, QDomElement a
}
// ---------------------- setCamiTKSaveAction ----------------------------
void ActionStateMachine::setCamiTKSaveAction(SaveActionState* actionState, QDomElement actionElement) noexcept {
void ActionStateMachine::setCamiTKSaveAction(SaveActionState* actionState, QDomElement actionElement) throw(camitk::AbortException) {
QString msg;
if ((actionState == nullptr) || (actionElement.isNull())) {
......
......@@ -36,7 +36,7 @@
using namespace camitk;
// --------------- Constructor -------------------
StlComponent::StlComponent(const QString& file) noexcept: MeshComponent(file) {
StlComponent::StlComponent(const QString& file) throw(camitk::AbortException) : MeshComponent(file) {
// use the file name without extension as component name
setName(QFileInfo(file).baseName());
......
......@@ -38,7 +38,7 @@
using namespace camitk;
// -------------------- default constructor --------------------
VRMLComponent::VRMLComponent(const QString& file) noexcept : Component(file, QFileInfo(file).baseName()) {
VRMLComponent::VRMLComponent(const QString& file) throw(camitk::AbortException) : Component(file, QFileInfo(file).baseName()) {
// create a VTK importer to read the VRML file
vtkSmartPointer<vtkVRMLImporter> importer = vtkSmartPointer<vtkVRMLImporter>::New();
......
......@@ -32,7 +32,7 @@
using namespace camitk;
// -------------------- constructor --------------------
RawImageComponent::RawImageComponent(const QString& fileName) noexcept
RawImageComponent::RawImageComponent(const QString& fileName) throw(camitk::AbortException)
: ImageComponent(fileName) {
if (!fileName.isNull()) {
// restore the normal cursor
......
......@@ -48,13 +48,13 @@
using namespace camitk;
// -------------------- constructor --------------------
VtkImageComponent::VtkImageComponent(const QString& fileName) noexcept
VtkImageComponent::VtkImageComponent(const QString& fileName) throw(camitk::AbortException)
: ImageComponent(fileName) {
createComponent(fileName);
}
// -------------------- createComponent --------------------
void VtkImageComponent::createComponent(const QString& filename) noexcept {
void VtkImageComponent::createComponent(const QString& filename) throw(camitk::AbortException) {
if (!filename.isNull()) {
try {
// create the ImageComponent (it will register it self in the list of Components)
......
......@@ -49,7 +49,7 @@ Component::Component(const QString& file, const QString& n, Representation s) :
}
Component::Component(Component* parentComponent, const QString& n, Representation s) noexcept(false) : myParentNode(parentComponent), myService(s), myName(n) {
Component::Component(Component* parentComponent, const QString& n, Representation s) throw(AbortException) : myParentNode(parentComponent), myService(s), myName(n) {
if (myParentNode == nullptr) {
throw AbortException(tr("Inconsistency: cannot instanciate a sub component with a null parent, please use the parent component pointer as the first parameter of the constructor or use the top-level Component constructor.").toStdString());
}
......
......@@ -70,13 +70,13 @@
namespace camitk {
// -------------------- constructors --------------------
ImageComponent::ImageComponent(const QString& file) noexcept(false)
ImageComponent::ImageComponent(const QString& file) throw ( AbortException )
: Component(file, "Image Volume") {
init();
}
ImageComponent::ImageComponent(vtkSmartPointer<vtkImageData> anImageData, const QString& name, bool copy, ImageOrientationHelper::PossibleImageOrientations initialOrientation)
noexcept(false) : Component("", name) {
throw ( AbortException ) : Component("", name) {
init();
setImageData(anImageData, copy, initialOrientation);
setName(name);
......
......@@ -66,7 +66,7 @@
namespace camitk {
// -------------------- constructor --------------------
MeshComponent::MeshComponent(const QString& file) noexcept(false) : Component(file, "Mesh", Component::GEOMETRY) {
MeshComponent::MeshComponent(const QString& file) throw ( AbortException ) : Component(file, "Mesh", Component::GEOMETRY) {
init();
}
......
......@@ -29,7 +29,7 @@
using namespace camitk;
// -------------------- default constructor --------------------
AbortComponent::AbortComponent(const QString& file) noexcept : Component(file, QFileInfo(file).baseName()) {
AbortComponent::AbortComponent(const QString& file) throw(camitk::AbortException) : Component(file, QFileInfo(file).baseName()) {
// just do what it is supposed to do
throw AbortException(tr("Abort file %1 error").arg(file).toStdString());
}
......@@ -31,7 +31,7 @@
using namespace camitk;
// --------------- Constructor -------------------
PickMe::PickMe ( const QString& file ) noexcept : VtkMeshComponent ( file ) {
PickMe::PickMe ( const QString& file ) throw(camitk::AbortException) : VtkMeshComponent ( file ) {
// initially all the point data have a value of 0.0 (everything is blue)
// when the user pick a cell or a point in 3D, the point data are modified
// using the point index (for point picking) or average of cell's point index
......
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