Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 57cc871f authored by Fouard's avatar Fouard
Browse files

Initial version of the new log... not finished

parent 52e89205
......@@ -47,6 +47,7 @@
#include "ShowAllViewers.h"
#include "ShowArbitraryViewer.h"
#include "ChangeLanguage.h"
#include "LoggerSettings.h"
// --------------- constructor -------------------
ApplicationActionExtension::ApplicationActionExtension() : ActionExtension() {}
......@@ -76,4 +77,5 @@ void ApplicationActionExtension::init() {
registerNewAction(ShowAllViewers);
// disabled as long as this viewer is not working
// registerNewAction(ShowArbitraryViewer);
}
\ No newline at end of file
registerNewAction(LoggerSettings);
}
......@@ -30,7 +30,8 @@
// -- Core stuff
#include "Application.h"
#include "Log.h"
// Deprecated. Use Application.h to handle logger instead.
//#include "Log.h"
// -- QT stuff
#include <QGraphicsTextItem>
......@@ -388,7 +389,7 @@ void ImageLutWidget::fillHistogramTable(DATATYPE* data, unsigned int dataDim, DA
}
else {
QString msg = "Division by zero";
CAMITK_ERROR("ImageLutWidget", "fillHistogramTable", msg.toStdString());
CAMITK_ERROR("ImageLutWidget::fillHistogramTable: " + msg);
}
}
......
......@@ -49,7 +49,8 @@
// CamiTK
#include <InteractiveViewer.h>
#include <Core.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Application.h>
#include <InteractiveViewer.h>
#include <RendererWidget.h>
......@@ -256,7 +257,7 @@ QWidget* ReorientImage::getWidget() {
Action::ApplyStatus ReorientImage::apply() {
if (!dialog) {
CAMITK_ERROR("ReorientImage", "process", "Calling apply() without having initializing its QWidget => this is prohibited at the moment, aborting ...");
CAMITK_ERROR("ReorientImage::process: Calling apply() without having initializing its QWidget => this is prohibited at the moment, aborting ...");
return ABORTED;
}
......@@ -484,7 +485,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("ReorientImage::buildGeometries: 3D Model VTK files not found");
}
}
......
......@@ -53,7 +53,8 @@
#include <MeshComponent.h>
#include <InteractiveViewer.h>
#include <RendererWidget.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
using namespace camitk;
......@@ -110,7 +111,7 @@ QWidget* VolumeRenderingAction::getWidget() {
// --------------- apply -------------------
Action::ApplyStatus VolumeRenderingAction::apply() {
CAMITK_INFO("VolumeRenderingAction", "apply", "apply volume rendering");
CAMITK_INFO("VolumeRenderingAction::apply: apply volume rendering");
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
process(input);
......
......@@ -35,7 +35,8 @@
#include <QtXml/QDomElement>
#include <QtXml/QDomNodeList>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
using namespace camitk;
......@@ -274,14 +275,14 @@ void VolumeRenderingWidget::load(QString filename) {
QFile file(filename);
if (!file.open(QIODevice::ReadOnly)) {
msg = tr("File not found: the file ") + filename + tr(" was not found");
CAMITK_ERROR("VolumeRenderingWidget", "load", msg.toStdString());
CAMITK_ERROR("VolumeRenderingWidget::load: " + msg);
msg = tr("Error: cannot fine file ") + filename + tr(" sorry...\n");
return;
}
if (!doc.setContent(&file)) {
msg = tr("File ") + filename + tr(" have no valid root (not a valid XML file format).\n");
file.close();
CAMITK_ERROR("VolumeRenderingWidget", "load", msg.toStdString());
CAMITK_ERROR("VolumeRenderingWidget::load: " + msg);
return;
}
......@@ -289,7 +290,7 @@ void VolumeRenderingWidget::load(QString filename) {
if (rootName != QString("vrColorMap")) {
file.close();
msg = tr("File ") + filename + tr(" is not in the right xml file format.\n");
CAMITK_ERROR("VolumeRenderingWidget", "load", msg.toStdString());
CAMITK_ERROR("VolumeRenderingWidget::load: " + msg);
return;
}
......@@ -459,7 +460,7 @@ void VolumeRenderingWidget::save() {
}
else {
msg = tr("File not found: the file ") + filename + tr(" was not found");
CAMITK_ERROR("VolumeRenderingWidget", "save", msg.toStdString());
CAMITK_ERROR("VolumeRenderingWidget::save: " + msg);
msg = tr("Error: cannot fine file ") + filename + tr(" sorry...\n");
return;
}
......
......@@ -27,7 +27,8 @@
#include <MeshComponent.h>
#include <Application.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
using namespace camitk;
#include <vtkUnstructuredGrid.h>
......@@ -61,7 +62,7 @@ Action::ApplyStatus CenterMesh::apply() {
for (unsigned int i = 0; i < (unsigned) getTargets().size(); i++) {
targetMesh = dynamic_cast<MeshComponent*>(getTargets().at(i));
CAMITK_INFO("CenterMesh", "apply", "Centering " << targetMesh->getName().toStdString());
CAMITK_INFO("CenterMesh::apply: Centering " + targetMesh->getName());
//-- compute barycenter
double barycenter[3] = {0.0, 0.0, 0.0};
......@@ -95,7 +96,7 @@ Action::ApplyStatus CenterMesh::apply() {
targetMesh->setModified();
}
else {
CAMITK_INFO("CenterMesh", "apply transformation", "Error: filter output is of type: " << filter->GetOutputDataObject(0)->GetClassName());
CAMITK_INFO("CenterMesh::apply transformation: Error: filter output is of type: " + QString(filter->GetOutputDataObject(0)->GetClassName()))
return ERROR;
}
......
......@@ -2,7 +2,8 @@
#include "ComputeNormals.h"
#include <Application.h>
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Property.h>
// Vtk includes
......@@ -39,8 +40,7 @@ Action::ApplyStatus ComputeNormals::apply() {
MeshComponent* mesh = dynamic_cast<MeshComponent*> ( getTargets().first() );
if ( !mesh ) {
CAMITK_DEBUG ( "ComputeNormals", "apply", "mesh " +
getTargets().first()->getName().toStdString() + " is not a MeshComponent" )
CAMITK_TRACE("ComputeNormals::apply: mesh " + getTargets().first()->getName() + " is not a MeshComponent")
return ABORTED;
}
......@@ -48,13 +48,11 @@ Action::ApplyStatus ComputeNormals::apply() {
pData->AddObserver ( vtkCommand::ProgressEvent, progressCallback );
if ( !pData ) {
CAMITK_DEBUG ( "ComputeNormals", "apply", "the mesh point set of " +
getTargets().first()->getName().toStdString() + " is not a polydata" )
CAMITK_TRACE("ComputeNormals::apply: the mesh point set of " + getTargets().first()->getName() + " is not a polydata")
return ABORTED;
}
CAMITK_INFO ( "ComputeNormals", "apply", "Compute normals for mesh " +
getTargets().first()->getName().toStdString() )
CAMITK_INFO("ComputeNormals::apply: Compute normals for mesh " + getTargets().first()->getName())
// compute normals
vtkSmartPointer<vtkPolyDataNormals> polyNormals = vtkSmartPointer<vtkPolyDataNormals>::New();
......
......@@ -26,7 +26,8 @@
#include "ExtractSelection.h"
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Application.h>
#include <vtkExtractSelection.h>
......@@ -59,12 +60,11 @@ Action::ApplyStatus ExtractSelection::apply() {
MeshComponent* targetMesh = dynamic_cast<MeshComponent*>(getTargets().last());
if ( !targetMesh ) {
CAMITK_DEBUG ( "ExtractSelection", "apply", "mesh " +
getTargets().first()->getName().toStdString() + " is not a MeshComponent" )
CAMITK_TRACE("ExtractSelection::apply: mesh " + getTargets().first()->getName() + " is not a MeshComponent")
return ABORTED;
}
CAMITK_INFO("ExtractSelection", "apply", "Extract selection of " << getTargets().last()->getName().toStdString());
CAMITK_INFO("ExtractSelection::apply: Extract selection of " + getTargets().last()->getName());
vtkSmartPointer<vtkExtractSelection> extractSelection = vtkSmartPointer<vtkExtractSelection>::New();
......
......@@ -25,7 +25,8 @@
#include "MeshPicking.h"
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Application.h>
#include <InteractiveViewer.h>
using namespace camitk;
......@@ -139,7 +140,7 @@ Action::ApplyStatus MeshPicking::apply() {
informationLabel->setText(message);
}
CAMITK_INFO("MeshPicking", "apply", "Done...");
CAMITK_INFO("MeshPicking::apply\n Done...");
// NOTE this CAMITK_INFO is here just to show how to use CamiTK log facilities
// restore the normal cursor
......
......@@ -24,7 +24,8 @@
****************************************************************************/
#include "MeshQuality.h"
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Application.h>
#include <InteractiveViewer.h>
using namespace camitk;
......
......@@ -26,7 +26,8 @@
#include "RigidTransform.h"
#include <Component.h>
#include <InteractiveViewer.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Application.h>
using namespace camitk;
......@@ -202,7 +203,7 @@ Action::ApplyStatus RigidTransform::apply() {
comp->setModified();
}
else {
CAMITK_INFO("RigidTransform", "applyTransform", "Error: filter output is of type: " << filterList[i]->GetOutputDataObject(0)->GetClassName());
CAMITK_INFO("RigidTransform::applyTransform: Error: filter output is of type: " + QString(filterList[i]->GetOutputDataObject(0)->GetClassName()));
return ABORTED;
}
// next filter
......
......@@ -24,7 +24,8 @@
****************************************************************************/
#include "GridTopology.h"
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Application.h>
#include <MainWindow.h>
using namespace camitk;
......@@ -261,4 +262,4 @@ void GridTopology::buildNetwork ( vtkSmartPointer<vtkUnstructuredGrid> grid ) {
}
grid->SetCells ( VTK_LINE, elements );
}
\ No newline at end of file
}
......@@ -25,7 +25,8 @@
// CamiTK includes
#include "SphereTopology.h"
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Application.h>
#include <MainWindow.h>
#include <Property.h>
......
......@@ -26,7 +26,8 @@
#include "AppendMeshes.h"
#include <Application.h>
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Property.h>
// Vtk includes
......@@ -62,7 +63,7 @@ camitk::Action::ApplyStatus AppendMeshes::apply() {
// at least 2 targets must be selected
if ( getTargets().size() < 2 ) {
CAMITK_DEBUG ( "AppendMeshes", "apply", "at least 2 mesh components must be selected" )
CAMITK_TRACE ( "AppendMeshes::apply: at least 2 mesh components must be selected" )
return ABORTED;
}
......@@ -73,13 +74,13 @@ camitk::Action::ApplyStatus AppendMeshes::apply() {
for ( int i = 0; i < getTargets().size(); i++ ) {
meshComp = dynamic_cast<MeshComponent*> ( getTargets().at ( i ) );
if ( !meshComp ) {
CAMITK_DEBUG ( "AppendMeshes", "apply", getTargets().at ( i )->getName().toStdString() + " is not a MeshComponent" );
CAMITK_TRACE ( "AppendMeshes::apply" + getTargets().at ( i )->getName() + " is not a MeshComponent" );
return ABORTED;
}
appendFilter->AddInputData ( meshComp->getPointSet() );
}
CAMITK_INFO ( "AppendMeshes", "apply", "append meshes" );
CAMITK_INFO ( "AppendMeshes::apply: append meshes" );
appendFilter->AddObserver ( vtkCommand::ProgressEvent, progressCallback );
appendFilter->Modified();
......
......@@ -27,7 +27,8 @@
#include <Application.h>
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <VtkMeshUtil.h>
using namespace camitk;
......@@ -58,7 +59,7 @@ CleanPolyData::CleanPolyData(ActionExtension* extension) : Action(extension) {
// --------------- apply -------------------
Action::ApplyStatus CleanPolyData::apply() {
CAMITK_INFO("CleanPolyData", "apply", "Merge duplicate points " << getTargets().last()->getName().toStdString());
CAMITK_INFO("CleanPolyData::apply: Merge duplicate points " + getTargets().last()->getName());
// set waiting cursor and status bar
QApplication::setOverrideCursor ( QCursor ( Qt::WaitCursor ) );
......
......@@ -2,7 +2,8 @@
#include "ComputeCurvatures.h"
#include <Application.h>
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Property.h>
// Vtk includes
......@@ -40,21 +41,18 @@ Action::ApplyStatus ComputeCurvatures::apply() {
MeshComponent* mesh = dynamic_cast<MeshComponent*> ( getTargets().first() );
if (!mesh) {
CAMITK_DEBUG ( "ComputeCurvatures", "apply", "mesh " +
getTargets().first()->getName().toStdString() + " is not a MeshComponent" )
CAMITK_TRACE("ComputeCurvatures::apply: mesh " + getTargets().first()->getName() + " is not a MeshComponent")
return ABORTED;
}
vtkPolyData* pData = vtkPolyData::SafeDownCast(mesh->getPointSet());
if (!pData) {
CAMITK_DEBUG ( "ComputeCurvatures", "apply", "the mesh point set of " +
getTargets().first()->getName().toStdString() + " is not a polydata" )
CAMITK_TRACE("ComputeCurvatures::apply: the mesh point set of " + getTargets().first()->getName() + " is not a polydata")
return ABORTED;
}
CAMITK_INFO ( "ComputeCurvatures", "apply", "Compute curvatures for mesh " +
getTargets().first()->getName().toStdString() )
CAMITK_INFO("ComputeCurvatures::apply: Compute curvatures for mesh " + getTargets().first()->getName())
// set up curvatures
vtkSmartPointer<vtkCurvatures> curv = vtkSmartPointer<vtkCurvatures>::New();
......
......@@ -24,7 +24,8 @@
****************************************************************************/
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Application.h>
#include <vtkUnstructuredGrid.h>
......@@ -47,7 +48,7 @@ ExtractEdges::ExtractEdges(ActionExtension* extension) : Action(extension) {
Action::ApplyStatus ExtractEdges::apply() {
CAMITK_INFO("ExtractEdges", "apply", "Extracting edges " << getTargets().last()->getName().toStdString());
CAMITK_INFO("ExtractEdges::apply: Extracting edges " + getTargets().last()->getName());
// set waiting cursor and status bar
QApplication::setOverrideCursor ( QCursor ( Qt::WaitCursor ) );
......
......@@ -24,7 +24,8 @@
****************************************************************************/
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Application.h>
using namespace camitk;
......@@ -46,7 +47,7 @@ ExtractSurface::ExtractSurface(ActionExtension* extension) : Action(extension) {
// --------------- apply -------------------
Action::ApplyStatus ExtractSurface::apply() {
CAMITK_INFO("ExtractSurface", "apply", "Extracting Surface " << getTargets().last()->getName().toStdString());
CAMITK_INFO("ExtractSurface::apply: Extracting Surface " + getTargets().last()->getName());
// set waiting cursor and status bar
QApplication::setOverrideCursor ( QCursor ( Qt::WaitCursor ) );
......
......@@ -26,7 +26,8 @@
#include "FillWithPoints.h"
#include <Application.h>
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Property.h>
// Vtk includes
......
......@@ -26,7 +26,8 @@
#include "ICPRegistration.h"
#include <Application.h>
#include <MeshComponent.h>
#include <Log.h>
// Deprecated. Use Appllication logger management instead
//#include <Log.h>
#include <Property.h>
// Vtk includes
......@@ -72,7 +73,7 @@ camitk::Action::ApplyStatus ICPRegistration::apply() {
// at least 2 targets must be selected
if ( getTargets().size() < 2 ) {
CAMITK_DEBUG ( "ICPRegistration", "apply", "at least 2 mesh components must be selected" )
CAMITK_INFO("ICPRegistration::apply: at least 2 mesh components must be selected")
return ABORTED;
}
......@@ -82,16 +83,12 @@ camitk::Action::ApplyStatus ICPRegistration::apply() {
// check if targets are MeshComponents
if ( ( targetMesh == NULL ) || ( sourceMesh == NULL ) ) {
CAMITK_DEBUG ( "ICPRegistration", "apply", "mesh " +
getTargets().first()->getName().toStdString() + " and/or " +
getTargets().last()->getName().toStdString() + " is not a MeshComponent" )
CAMITK_INFO("ICPRegistration::apply: mesh " + getTargets().first()->getName() + " and/or " + getTargets().last()->getName() + " is not a MeshComponent" )
return ABORTED;
}
CAMITK_INFO ( "ICPRegistration", "apply", "ICP Registration from mesh " +
getTargets().first()->getName().toStdString() + " to mesh " +
getTargets().last()->getName().toStdString() )
CAMITK_INFO("ICPRegistration::apply: ICP Registration from mesh " + getTargets().first()->getName() + " to mesh " + getTargets().last()->getName())
// set up ICP
vtkSmartPointer<vtkIterativeClosestPointTransform> icp = vtkSmartPointer<vtkIterativeClosestPointTransform>::New();
......
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