12 #ifndef CXPATIENTMODELSERVICE_H_
13 #define CXPATIENTMODELSERVICE_H_
15 #include "cxResourceExport.h"
19 #include "boost/shared_ptr.hpp"
30 typedef boost::shared_ptr<class Data>
DataPtr;
31 typedef boost::shared_ptr<class Image>
ImagePtr;
34 #define PatientModelService_iid "cx::PatientModelService"
39 class RegistrationTransform;
40 class LandmarkProperty;
98 virtual void insertData(
DataPtr data,
bool overWrite =
false) = 0;
99 virtual std::map<QString, DataPtr> getDatas(DataFilter filter = HideUnavailable)
const = 0;
100 virtual std::map<QString, DataPtr> getChildren(QString parent_uid, QString of_type=
"")
const = 0;
107 virtual DataPtr createData(QString type, QString uid, QString name=
"") = 0;
108 virtual void removeData(QString uid) = 0;
111 template <
class DATA>
112 std::map<QString, boost::shared_ptr<DATA> > getDataOfType()
const;
113 DataPtr getData(
const QString& uid)
const;
114 template <
class DATA>
115 boost::shared_ptr<DATA> getData(
const QString& uid)
const;
117 boost::shared_ptr<DATA> createSpecificData(QString uid, QString name=
"");
120 virtual std::map<QString, VideoSourcePtr> getStreams()
const = 0;
135 virtual std::map<QString, LandmarkProperty> getLandmarkProperties()
const = 0;
136 virtual void setLandmarkName(QString uid, QString name) = 0;
137 virtual void setLandmarkActive(QString uid,
bool active) = 0;
138 virtual QString addLandmark() = 0;
139 virtual void deleteLandmarks() = 0;
141 virtual void updateRegistration_rMpr(
const QDateTime& oldTime,
const RegistrationTransform& newTransform);
143 virtual QString getActivePatientFolder()
const = 0;
144 QString generateFilePath(QString folderName, QString ending);
146 virtual bool isPatientValid()
const = 0;
147 virtual DataPtr importData(QString fileName, QString &infoText) = 0;
148 virtual void exportPatient(PATIENT_COORDINATE_SYSTEM externalSpace) = 0;
152 virtual void setCenter(
const Vector3D& center) = 0;
153 virtual Vector3D getCenter()
const = 0;
158 virtual CLINICAL_VIEW getClinicalApplication()
const = 0;
159 virtual void setClinicalApplication(CLINICAL_VIEW application) = 0;
161 virtual void autoSave() = 0;
162 virtual bool isNull() = 0;
166 virtual void makeAvailable(
const QString& uid,
bool available) = 0;
169 void operatingTableChanged();
170 void centerChanged();
171 void dataAddedOrRemoved();
172 void landmarkPropertiesChanged();
173 void clinicalApplicationChanged();
176 void patientChanged();
177 void videoAddedToTrackedStream();
181 template <
class DATA>
184 std::map<QString, DataPtr> data = this->
getDatas();
185 std::map<QString, boost::shared_ptr<DATA> > retval;
186 for (std::map<QString, DataPtr>::const_iterator i=data.begin(); i!=data.end(); ++i)
188 boost::shared_ptr<DATA> val = boost::dynamic_pointer_cast<DATA>(i->second);
190 retval[val->getUid()] = val;
195 template <
class DATA>
198 return boost::dynamic_pointer_cast<DATA>(this->
getData(uid));
205 return boost::dynamic_pointer_cast<DATA>(retval);