CustusX  15.8
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxData.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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 
34 #ifndef CXDATA_H_
35 #define CXDATA_H_
36 
37 #include "cxResourceExport.h"
38 #include "cxPrecompiledHeader.h"
39 
40 #include <string>
41 #include <set>
42 
43 #include <boost/shared_ptr.hpp>
44 #include <boost/weak_ptr.hpp>
45 
46 #include <QObject>
47 #include "vtkForwardDeclarations.h"
48 #include "cxTransform3D.h"
49 #include "cxForwardDeclarations.h"
50 #include "cxDefinitions.h"
51 
52 #include <QDateTime>
53 class QDomNode;
54 
55 namespace cx
56 {
58 typedef boost::weak_ptr<class Rep> RepWeakPtr;
59 typedef boost::shared_ptr<class RegistrationHistory> RegistrationHistoryPtr;
60 typedef boost::shared_ptr<class Landmarks> LandmarksPtr;
61 
62 
69 class cxResource_EXPORT Data: public QObject
70 {
71 Q_OBJECT
72 public:
73  Data(const QString& uid, const QString& name = "");
74  virtual ~Data();
75 
76  void setUid(const QString& uid);
77  void setName(const QString& name);
78  void setAcquisitionTime(QDateTime time);
79  virtual RegistrationHistoryPtr get_rMd_History();
80  LandmarksPtr getLandmarks();
81 
82  virtual QString getUid() const;
83  virtual QString getName() const;
84  virtual Transform3D get_rMd() const;
85  virtual QDateTime getAcquisitionTime() const;
86  virtual QString getType() const
87  {
88  return "data";
89  }
90 
91  virtual QString getFilename() const;
92  virtual void setFilename(QString val);
93 
94  virtual QString getSpace();
95  virtual QString getParentSpace();
96  virtual DoubleBoundingBox3D boundingBox() const = 0;
97 
98  virtual void addXml(QDomNode& dataNode);
99  virtual void parseXml(QDomNode& dataNode);
100 
101  //Consider removing this, as these are only implemented in Mesh and Image
102  virtual bool load(QString path) = 0;
103  virtual void save(const QString& basePath) = 0;
104 
105  virtual CoordinateSystem getCoordinateSystem();
106 
107 
108 signals:
109  void transformChanged();
110  void propertiesChanged();
111 
112 protected slots:
113  virtual void transformChangedSlot()
114  {
115  }
116 
117 protected:
118  QString mUid;
119  QString mName;
120  QString mFilename;
121  QDateTime mAcquisitionTime;
123 
124  REGISTRATION_STATUS mRegistrationStatus;
126 
127 private:
128  Data(const Data& other);
129  Data& operator=(const Data& other);
130 
131 };
132 
133 typedef boost::shared_ptr<Data> DataPtr;
134 
135 } // end namespace cx
136 
137 #endif /*CXDATA_H_*/
boost::shared_ptr< class RegistrationHistory > RegistrationHistoryPtr
Definition: cxDataManager.h:57
QString mUid
Definition: cxData.h:118
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
QString mName
Definition: cxData.h:119
boost::weak_ptr< class Rep > RepWeakPtr
Definition: cxData.h:57
boost::shared_ptr< class Landmarks > LandmarksPtr
Definition: cxData.h:60
boost::shared_ptr< class Data > DataPtr
QString mFilename
Definition: cxData.h:120
virtual QString getType() const
Definition: cxData.h:86
Identification of a Coordinate system.
QDateTime mAcquisitionTime
Definition: cxData.h:121
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
RegistrationHistoryPtr m_rMd_History
Definition: cxData.h:125
Superclass for all data objects.
Definition: cxData.h:69
virtual void transformChangedSlot()
Definition: cxData.h:113
REGISTRATION_STATUS mRegistrationStatus
Definition: cxData.h:124
LandmarksPtr mLandmarks
Definition: cxData.h:122