Commit 9dffa840 authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

FIXED enforced CCC ABORTED status should be precede by a warning log entry

parent 31420ce7
......@@ -96,7 +96,7 @@ Action::ApplyStatus RegionGrowing::apply() {
// this call works only with a GUI (i.e. if theWidget exists)
if ((input == NULL) || (rgWidget == NULL)) {
CAMITK_WARNING("RegionGrowing cannot be called without a GUI (input data are required to be set manually.")
CAMITK_WARNING("Cannot be called without a GUI (input data are required to be set manually. Action Aborted.")
return ABORTED;
}
......
......@@ -78,7 +78,7 @@ Action::ApplyStatus GenerateModel::apply() {
// ask the user
originalFilename = QFileDialog::getSaveFileName( NULL, "Generate Model", "", "ModelingML (*.mml)" );
if ( originalFilename.isNull() ) {
CAMITK_WARNING("Generate Model: filename required.")
CAMITK_WARNING("Filename required. Action Aborted.")
return ABORTED;
}
}
......
......@@ -74,6 +74,6 @@ Action::ApplyStatus CloseAction::apply() {
}
// CCC Exception: just a trace message as the user voluntarily aborted the action
CAMITK_TRACE_IF((it == allTopLevel.constEnd()), "Close: action aborted by user")
CAMITK_TRACE_IF((it == allTopLevel.constEnd()), "Canceled by user. Action Aborted.")
return (it == allTopLevel.constEnd()) ? SUCCESS : ABORTED;
}
......@@ -74,7 +74,7 @@ Action::ApplyStatus CloseAllAction::apply() {
}
else {
// CCC Exception: just a trace message as the user voluntarily aborted the action
CAMITK_TRACE("CloseAllAction: action canceled by user")
CAMITK_TRACE("Canceled by user. Action Aborted.")
return ABORTED;
}
}
......
......@@ -99,7 +99,7 @@ Action::ApplyStatus OpenAction::apply() {
else {
Application::showStatusBarMessage(tr ("Open aborted."));
// CCC Exception: just a trace message as the user voluntarily aborted the action
CAMITK_TRACE("Open: a file is required. Action aborted.")
CAMITK_TRACE("A file is required. Action aborted.")
return ABORTED;
}
}
......
......@@ -122,7 +122,7 @@ Action::ApplyStatus OpenFile::apply() {
return SUCCESS;
}
else {
CAMITK_WARNING("Open File: a filename is required. Action aborted.")
CAMITK_WARNING("A filename is required. Action aborted.")
return ABORTED;
}
}
......
......@@ -200,7 +200,7 @@ Action::ApplyStatus SaveAsAction::apply() {
else {
Application::showStatusBarMessage( tr ( "Saving aborted" ), 2000 );
// CCC Exception: just a trace message as the user voluntarily aborted the action
CAMITK_TRACE("SaveAsAction: a filename is required. Action aborted.")
CAMITK_TRACE("A filename is required. Action aborted.")
return ABORTED;
}
......
......@@ -89,7 +89,7 @@ Action::ApplyStatus BoxVOI::apply() {
// this call works only with a GUI (i.e. if theWidget exists)
if ((input == nullptr) || (rgWidget == nullptr)) {
CAMITK_WARNING("BoxVOI: this action cannot be called without a GUI (input data are required to be set manually). Action Aborted.")
CAMITK_WARNING("This action cannot be called without a GUI (input data are required to be set manually). Action Aborted.")
return ABORTED;
}
......@@ -101,7 +101,7 @@ Action::ApplyStatus BoxVOI::apply() {
process(input);
}
else {
CAMITK_WARNING("BoxVOI: it is required to select 2 or 6 seeds to apply this action. Action Aborted.")
CAMITK_WARNING("2 or 6 seeds are required to apply this action. Action Aborted.")
return ABORTED;
}
return SUCCESS;
......@@ -120,7 +120,7 @@ Action::ApplyStatus BoxVOI::apply(QList<QVector3D>* seedPoints) {
process(input);
}
else {
CAMITK_WARNING("BoxVOI: 2 or 6 seeds are required to apply this action. Action Aborted.")
CAMITK_WARNING("2 or 6 seeds are required to apply this action. Action Aborted.")
return ABORTED;
}
......
......@@ -254,7 +254,7 @@ QWidget* ReorientImage::getWidget() {
Action::ApplyStatus ReorientImage::apply() {
if (!dialog) {
CAMITK_WARNING("ReorientImage: cannot apply the method before the QWidget initialization. Action aborted.");
CAMITK_WARNING("Cannot apply the method before the QWidget initialization. Action aborted.");
return ABORTED;
}
......@@ -266,7 +266,7 @@ Action::ApplyStatus ReorientImage::apply() {
// --------------- process -------------------
Action::ApplyStatus ReorientImage::process(ImageComponent* image) {
if (image == nullptr) {
CAMITK_WARNING("ReorientImage: an ImageComponent is required. Action Aborted.")
CAMITK_WARNING("An ImageComponent is required. Action Aborted.")
return ABORTED;
}
......@@ -483,7 +483,7 @@ void ReorientImage::buildGeometries() {
femaleModel->setColor(1.0, 0.75, 0.64);
}
else {
CAMITK_WARNING("ReorientImage::buildGeometries: 3D Model VTK files not found");
CAMITK_WARNING("Reorient Medical Image: 3D Model VTK files not found");
}
}
......
......@@ -70,7 +70,7 @@ Action::ApplyStatus ChangeColor::apply() {
return SUCCESS;
}
else {
CAMITK_WARNING("ChangeColor: invalid color. Action Aborted.")
CAMITK_WARNING("Invalid color. Action Aborted.")
return ABORTED;
}
}
......@@ -39,23 +39,23 @@ Action::ApplyStatus ComputeNormals::apply() {
MeshComponent* mesh = dynamic_cast<MeshComponent*>(getTargets().first());
if (mesh == nullptr) {
CAMITK_WARNING("Compute Normals: mesh " + getTargets().first()->getName() + " is not a MeshComponent. Action aborted.")
CAMITK_WARNING("Mesh " + getTargets().first()->getName() + " is not a MeshComponent. Action aborted.")
return ABORTED;
}
if (mesh->getPointSet() == nullptr) {
CAMITK_WARNING("Compute Normals: the mesh point set of " + getTargets().first()->getName() + " does not have a vtkPointSet. Action aborted.")
CAMITK_WARNING("The mesh point set of " + getTargets().first()->getName() + " does not have a vtkPointSet. Action aborted.")
return ABORTED;
}
vtkSmartPointer<vtkPolyData> pData = vtkPolyData::SafeDownCast(mesh->getPointSet());
if (pData == nullptr) {
CAMITK_WARNING("Compute Normals: the mesh point set of " + getTargets().first()->getName() + " is not a vtkPolyData. Action aborted.")
CAMITK_WARNING("The mesh point set of " + getTargets().first()->getName() + " is not a vtkPolyData. Action aborted.")
return ABORTED;
}
CAMITK_TRACE("Compute Normals: compute normals for mesh " + getTargets().first()->getName())
CAMITK_TRACE("Compute normals for mesh " + getTargets().first()->getName())
// compute normals
vtkSmartPointer<vtkPolyDataNormals> polyNormals = vtkSmartPointer<vtkPolyDataNormals>::New();
......@@ -64,7 +64,7 @@ Action::ApplyStatus ComputeNormals::apply() {
polyNormals->Update();
if (polyNormals->GetOutput()->GetPointData()->GetScalars("Normals") == nullptr) {
CAMITK_WARNING("Compute Normals: no normals can be computed for: "
CAMITK_WARNING("No normals can be computed for: "
+ getTargets().first()->getName() + " (probably no 3D surface in this mesh). Action aborted.")
return ABORTED;
}
......
......@@ -59,23 +59,21 @@ Action::ApplyStatus ExtractSelection::apply() {
MeshComponent* targetMesh = dynamic_cast<MeshComponent*>(getTargets().last());
if (targetMesh == nullptr) {
CAMITK_WARNING("ExtractSelection: mesh " + getTargets().first()->getName() + " is not a MeshComponent. Action aborted.")
CAMITK_WARNING("Mesh " + getTargets().first()->getName() + " is not a MeshComponent. Action aborted.")
return ABORTED;
}
CAMITK_TRACE("ExtractSelection: extract selection of " + getTargets().last()->getName());
CAMITK_TRACE("Extract selection of " + getTargets().last()->getName());
vtkSmartPointer<vtkExtractSelection> extractSelection = vtkSmartPointer<vtkExtractSelection>::New();
if (targetMesh->getPointSet() == nullptr) {
CAMITK_WARNING("ExtractSelection: mesh "
+ getTargets().first()->getName() + " does not have any vtkPointSet. Action aborted.")
CAMITK_WARNING("Mesh " + getTargets().first()->getName() + " does not have any vtkPointSet. Action aborted.")
return ABORTED;
}
if (targetMesh->getActiveSelection()->GetNumberOfNodes() == 0) {
CAMITK_WARNING("ExtractSelection: mesh " +
getTargets().first()->getName() + " does not have anything currently selected. Action aborted.")
CAMITK_WARNING("Mesh " + getTargets().first()->getName() + " does not have anything currently selected. Action aborted.")
return ABORTED;
}
......
......@@ -102,14 +102,14 @@ Action::ApplyStatus MeshToImageStencil::process(MeshComponent* comp) {
// get mesh as polydata
if (comp->getPointSet() == nullptr) {
CAMITK_WARNING(getName() + ": the mesh point set of " + comp->getName() + " does not have a vtkPointSet. Action aborted.")
CAMITK_WARNING("The mesh point set of " + comp->getName() + " does not have a vtkPointSet. Action aborted.")
return ABORTED;
}
vtkSmartPointer<vtkPolyData> pData = vtkPolyData::SafeDownCast(comp->getPointSet());
if (pData == nullptr) {
CAMITK_WARNING(getName() + ": the mesh point set of " + comp->getName() + " is not a vtkPolyData. Action aborted.")
CAMITK_WARNING("The mesh point set of " + comp->getName() + " is not a vtkPolyData. Action aborted.")
return ABORTED;
}
......
......@@ -202,7 +202,7 @@ Action::ApplyStatus RigidTransform::apply() {
comp->setModified();
}
else {
CAMITK_WARNING("Rigid Transform: filter output is of type: " + QString(filterList[i]->GetOutputDataObject(0)->GetClassName()) + ". Action aborted")
CAMITK_WARNING("Filter output is of type: " + QString(filterList[i]->GetOutputDataObject(0)->GetClassName()) + ". Action aborted")
return ABORTED;
}
// next filter
......
......@@ -62,7 +62,7 @@ camitk::Action::ApplyStatus AppendMeshes::apply() {
// at least 2 targets must be selected
if (getTargets().size() < 2) {
CAMITK_WARNING( "Append Meshes: at least 2 mesh components must be selected. Action aborted." )
CAMITK_WARNING("At least 2 mesh components must be selected. Action aborted.")
QApplication::restoreOverrideCursor();
return ABORTED;
}
......@@ -75,13 +75,13 @@ camitk::Action::ApplyStatus AppendMeshes::apply() {
meshComp = dynamic_cast<MeshComponent*>(getTargets().at(i));
if (meshComp == nullptr) {
QApplication::restoreOverrideCursor();
CAMITK_WARNING( "AppendMeshes: \"" + getTargets().at(i)->getName() + "\" is not a MeshComponent. Action aborted." );
CAMITK_WARNING("Component \"" + getTargets().at(i)->getName() + "\" is not a MeshComponent. Action aborted.")
return ABORTED;
}
appendFilter->AddInputData(meshComp->getPointSet());
}
CAMITK_TRACE( "AppendMeshes: append meshes" );
CAMITK_TRACE("Append meshes")
appendFilter->AddObserver(vtkCommand::ProgressEvent, progressCallback);
appendFilter->Modified();
......
......@@ -40,18 +40,18 @@ Action::ApplyStatus ComputeCurvatures::apply() {
MeshComponent* mesh = dynamic_cast<MeshComponent*>(getTargets().first());
if (mesh == nullptr) {
CAMITK_TRACE("Compute Curvatures: mesh " + getTargets().first()->getName() + " is not a MeshComponent. Action aborted.")
CAMITK_TRACE("Mesh " + getTargets().first()->getName() + " is not a MeshComponent. Action aborted.")
return ABORTED;
}
vtkPolyData* pData = vtkPolyData::SafeDownCast(mesh->getPointSet());
if (pData == nullptr) {
CAMITK_WARNING("Compute Curvatures: the mesh point set of " + getTargets().first()->getName() + " is not a vtkPolyData. Action aborted.")
CAMITK_WARNING("The mesh point set of " + getTargets().first()->getName() + " is not a vtkPolyData. Action aborted.")
return ABORTED;
}
CAMITK_TRACE("Compute Curvatures: compute curvatures for mesh " + getTargets().first()->getName())
CAMITK_TRACE("Compute curvatures for mesh " + getTargets().first()->getName())
// set up curvatures
vtkSmartPointer<vtkCurvatures> curv = vtkSmartPointer<vtkCurvatures>::New();
......@@ -69,7 +69,7 @@ Action::ApplyStatus ComputeCurvatures::apply() {
break;
case GAUSSIAN :
if (curv->GetOutput()->GetPointData()->GetScalars("Gauss_Curvature") == nullptr) {
CAMITK_ERROR("Compute Curvatures: no Gauss Curvature can be computed for: " +
CAMITK_ERROR("No Gauss Curvature can be computed for: " +
getTargets().first()->getName() + " (probably no 3D surface in this mesh).")
return ERROR;
}
......@@ -79,7 +79,7 @@ Action::ApplyStatus ComputeCurvatures::apply() {
mesh->addPointData("Mean Curvature", curv->GetOutput()->GetPointData()->GetScalars("Mean_Curvature"));
break;
default :
CAMITK_ERROR("Compute Curvatures: invalid Curvature type value.")
CAMITK_ERROR("Invalid Curvature type value.")
return ERROR;
break;
}
......
......@@ -120,7 +120,7 @@ Action::ApplyStatus ExportAsMDL::apply() {
returnStatus = process(input);
}
else {
CAMITK_WARNING("Export As MDL: target component \"" + comp->getName() + "\" is of type \"" + comp->getHierarchy().value(0) + "\", expecting MeshComponent. Action aborted.");
CAMITK_WARNING("Target component \"" + comp->getName() + "\" is of type \"" + comp->getHierarchy().value(0) + "\", expecting MeshComponent. Action aborted.");
returnStatus = ABORTED; // Bad input (should not be possible)
}
}
......@@ -140,7 +140,7 @@ Action::ApplyStatus ExportAsMDL::process(MeshComponent* comp) {
return SUCCESS;
}
else {
CAMITK_WARNING("Export As MDL: output file is missing, please provide one. Action aborted.");
CAMITK_WARNING("Output file is missing, please provide one. Action aborted.");
return ABORTED;
}
}
......
......@@ -72,7 +72,7 @@ camitk::Action::ApplyStatus ICPRegistration::apply() {
// at least 2 targets must be selected
if (getTargets().size() < 2) {
CAMITK_WARNING("ICP Registration: at least 2 mesh components must be selected. Action aborted.")
CAMITK_WARNING("At least 2 mesh components must be selected. Action aborted.")
return ABORTED;
}
......@@ -82,12 +82,12 @@ camitk::Action::ApplyStatus ICPRegistration::apply() {
// check if targets are MeshComponents
if ((targetMesh == nullptr) || (sourceMesh == nullptr)) {
CAMITK_WARNING("ICP Registration: mesh " + getTargets().first()->getName() + " and/or " + getTargets().last()->getName() + " is not a MeshComponent. Action aborted.")
CAMITK_WARNING("Mesh " + getTargets().first()->getName() + " and/or " + getTargets().last()->getName() + " is not a MeshComponent. Action aborted.")
return ABORTED;
}
CAMITK_TRACE("ICPRegistration::apply(): ICP Registration from mesh " + getTargets().first()->getName() + " to mesh " + getTargets().last()->getName())
CAMITK_TRACE("ICP Registration from mesh " + getTargets().first()->getName() + " to mesh " + getTargets().last()->getName())
// set up ICP
vtkSmartPointer<vtkIterativeClosestPointTransform> icp = vtkSmartPointer<vtkIterativeClosestPointTransform>::New();
......
......@@ -88,7 +88,7 @@ Action::ApplyStatus MergeMeshs::apply() {
// restore the normal cursor and progress bar
Application::resetProgressBar();
QApplication::restoreOverrideCursor();
CAMITK_WARNING("Merge Meshs: number of targets is insufficient (at least 2 meshs). Action aborted.");
CAMITK_WARNING("Number of targets is insufficient (at least 2 meshs required). Action aborted.");
return ABORTED;
}
......@@ -96,7 +96,7 @@ Action::ApplyStatus MergeMeshs::apply() {
// restore the normal cursor and progress bar
Application::resetProgressBar();
QApplication::restoreOverrideCursor();
CAMITK_WARNING("Merge Meshs: merge meshs works only with 2 meshs. Action aborted.");
CAMITK_WARNING("Merge meshs only works with 2 meshs. Action aborted.");
return ABORTED;
}
......
......@@ -343,7 +343,7 @@ Action::ApplyStatus MeshClipping::clipMesh(MeshComponent* mesh, vtkSmartPointer
break;
default:
//-- Not implemented
CAMITK_WARNING(tr("Mesh Clipping: aborted cannot clip mesh \"") + mesh->getName() + tr("\": it is not a vtkPolyData, a vtkUnstructuredGrid nor a vtkStructuredGrid. Action aborted."))
CAMITK_WARNING(tr("Cannot clip mesh \"") + mesh->getName() + tr("\": it is not a vtkPolyData, a vtkUnstructuredGrid nor a vtkStructuredGrid. Action aborted."))
return ABORTED;
break;
}
......
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