33 #ifndef CXDATAREADERWRITER_H_
34 #define CXDATAREADERWRITER_H_
36 #include "cxResourceExport.h"
47 #include "boost/scoped_ptr.hpp"
77 static boost::shared_ptr<QMutex> mMutex;
90 virtual bool canLoad(
const QString& type,
const QString& filename) = 0;
91 virtual DataPtr load(
const QString& uid,
const QString& filename) = 0;
94 virtual QString canLoadDataType()
const =0;
95 virtual bool readInto(
DataPtr data, QString path) = 0;
109 virtual bool canLoad(
const QString& type,
const QString& filename)
111 QString fileType = QFileInfo(filename).suffix();
112 return (fileType.compare(
"mhd", Qt::CaseInsensitive) == 0 || fileType.compare(
"mha", Qt::CaseInsensitive) == 0);
115 virtual bool readInto(
DataPtr data, QString path);
116 bool readInto(
ImagePtr image, QString filename);
117 virtual DataPtr load(
const QString& uid,
const QString& filename);
120 void saveImage(
ImagePtr image,
const QString& filename);
130 virtual bool canLoad(
const QString& type,
const QString& filename)
132 QString fileType = QFileInfo(filename).suffix();
133 return (fileType.compare(
"png", Qt::CaseInsensitive) == 0);
135 virtual bool readInto(
DataPtr data, QString path);
136 bool readInto(
ImagePtr image, QString filename);
138 virtual DataPtr load(
const QString& uid,
const QString& filename);
152 virtual bool canLoad(
const QString& type,
const QString& filename)
154 QString fileType = QFileInfo(filename).suffix();
155 return (fileType.compare(
"vtk", Qt::CaseInsensitive) == 0);
157 virtual bool readInto(
DataPtr data, QString path);
158 bool readInto(
MeshPtr mesh, QString filename);
162 virtual DataPtr load(
const QString& uid,
const QString& filename);
174 virtual bool canLoad(
const QString& type,
const QString& filename)
176 QString fileType = QFileInfo(filename).suffix();
177 return (fileType.compare(
"stl", Qt::CaseInsensitive) == 0);
179 virtual bool readInto(
DataPtr data, QString path);
180 bool readInto(
MeshPtr mesh, QString filename);
183 virtual DataPtr load(
const QString& uid,
const QString& filename);
198 QString findDataTypeFromFile(QString filename);
199 void readInto(
DataPtr data, QString path);
202 DataReaderPtr findReader(
const QString& path,
const QString& type=
"unknown");
203 typedef std::set<DataReaderPtr> DataReadersType;
204 DataReadersType mDataReaders;
214 #endif // CXDATAREADERWRITER_H_
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
virtual QString canLoadDataType() const
boost::shared_ptr< class Image > ImagePtr
virtual bool canLoad(const QString &type, const QString &filename)
boost::shared_ptr< DataReader > DataReaderPtr
virtual vtkImageDataPtr loadVtkImageData(QString filename)
boost::shared_ptr< class Data > DataPtr
vtkSmartPointer< class vtkPolyData > vtkPolyDataPtr
virtual ~PNGImageReader()
virtual vtkPolyDataPtr loadVtkPolyData(QString filename)
virtual QString canLoadDataType() const
virtual ~PolyDataMeshReader()
virtual bool canLoad(const QString &type, const QString &filename)
Reader for portable network graphics .png files.
virtual bool canLoad(const QString &type, const QString &filename)
boost::shared_ptr< class Mesh > MeshPtr
Interface for Data file readers.
virtual QString canLoadDataType() const