1 #ifndef CXERROROBSERVER_H
2 #define CXERROROBSERVER_H
4 #include "cxResourceExport.h"
6 #include "boost/shared_ptr.hpp"
7 #include <vtkCommand.h>
8 #include <vtkSmartPointer.h>
9 #include <vtkAlgorithm.h>
34 static boost::shared_ptr<QMutex> mMutex;
54 virtual void Execute(vtkObject* caller,
unsigned long,
void* text)
56 mMessage = QString(
reinterpret_cast<char*
> (text));
60 static bool checkedRead(vtkSmartPointer<vtkAlgorithm> reader, QString filename)
62 vtkSmartPointer<ErrorObserver> errorObserver = vtkSmartPointer<ErrorObserver>::New();
63 reader->AddObserver(
"ErrorEvent", errorObserver);
71 if (!errorObserver->mMessage.isEmpty())
73 reportError(
"Load of data [" + filename +
"] failed with message:\n"
74 + errorObserver->mMessage);
83 #endif // CXERROROBSERVER_H