Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxFileManagerService.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXFILEMANAGERSERVICE_H
13 #define CXFILEMANAGERSERVICE_H
14 
15 #include <QObject>
16 #include "cxResourceExport.h"
17 #include "boost/shared_ptr.hpp"
18 #include "cxData.h"
19 
20 #define FileManagerService_iid "cx::FileManagerService"
21 
22 namespace cx
23 {
24 
25 typedef boost::shared_ptr<class FileManagerService> FileManagerServicePtr;
26 
27 
28 class cxResource_EXPORT FileManagerService : public QObject
29 {
30  Q_OBJECT
31 public:
32  virtual ~FileManagerService() {}
33 
34  virtual bool isNull() = 0;
35  static FileManagerServicePtr getNullObject();
36 
37  //TODO harmonize with filereaderwriter (read and write...)
38  //read
39  virtual bool canLoad(const QString& type, const QString& filename) = 0;
40  virtual QString canLoadDataType() const = 0;
41  virtual std::vector<DataPtr> read(const QString &filename) = 0;
42 
43  //--- TODO remove
44  virtual DataPtr load(const QString& uid, const QString& filename) = 0;
45  virtual bool readInto(DataPtr data, QString path) = 0;
46  //---
47 
48  //write
49  virtual void save(DataPtr data, const QString& filename) = 0;
50 
51  virtual vtkImageDataPtr loadVtkImageData(QString filename) = 0;
52  virtual vtkPolyDataPtr loadVtkPolyData(QString filename) = 0;
53 
54  virtual void addFileReaderWriter(FileReaderWriterService *service) = 0;
55  virtual void removeFileReaderWriter(FileReaderWriterService *service) = 0;
56 
57  virtual QString findDataTypeFromFile(QString filename) = 0;
58  virtual std::vector<FileReaderWriterServicePtr> getExportersForDataType(QString dataType) = 0;
59  virtual std::vector<FileReaderWriterServicePtr> getImportersForDataType(QString dataType) = 0;
60 
61  virtual QString getFileReaderName(const QString &filename) = 0;
62 };
63 
64 }
66 
67 #endif // CXFILEMANAGERSERVICE_H
boost::shared_ptr< class FileManagerService > FileManagerServicePtr
#define FileManagerService_iid
boost::shared_ptr< class Data > DataPtr
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Namespace for all CustusX production code.