|
Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
00001 /*============================================================================== 00002 00003 Program: 3D Slicer 00004 00005 Copyright (c) Kitware Inc. 00006 00007 See COPYRIGHT.txt 00008 or http://www.slicer.org/copyright/copyright.txt for details. 00009 00010 Unless required by applicable law or agreed to in writing, software 00011 distributed under the License is distributed on an "AS IS" BASIS, 00012 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 See the License for the specific language governing permissions and 00014 limitations under the License. 00015 00016 This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc. 00017 and was partially funded by NIH grant 3P41RR013218-12S1 00018 00019 ==============================================================================*/ 00020 00021 #ifndef __qSlicerAbstractCoreModule_h 00022 #define __qSlicerAbstractCoreModule_h 00023 00024 // Qt includes 00025 #include <QObject> 00026 #include <QStringList> 00027 00028 // CTK includes 00029 #include <ctkPimpl.h> 00030 00031 // QTBase includes 00032 #include "qSlicerBaseQTCoreExport.h" 00033 00034 class qSlicerAbstractModuleRepresentation; 00035 class vtkMRMLAbstractLogic; 00036 class vtkSlicerApplicationLogic; 00037 class vtkMRMLScene; 00038 class qSlicerAbstractCoreModulePrivate; 00039 00040 00041 #define qSlicerGetTitleMacro(_TITLE) \ 00042 static QString staticTitle() { return _TITLE; } \ 00043 virtual QString title()const { return _TITLE; } 00044 00046 // 00055 class Q_SLICER_BASE_QTCORE_EXPORT qSlicerAbstractCoreModule : public QObject 00056 { 00059 Q_OBJECT 00060 00063 00073 Q_PROPERTY(QString name READ name) 00074 00075 00076 00077 00078 00079 00080 00081 Q_PROPERTY(QString title READ title) 00082 00092 Q_PROPERTY(QStringList categories READ categories) 00093 00101 Q_PROPERTY(int index READ index) 00102 00108 Q_PROPERTY(bool hidden READ isHidden) 00109 00114 Q_PROPERTY(QString helpText READ helpText) 00115 00123 Q_PROPERTY(QString acknowledgementText READ acknowledgementText) 00124 00132 Q_PROPERTY(QStringList contributors READ contributors) 00133 00137 Q_PROPERTY(QString slicerWikiUrl READ slicerWikiUrl) 00138 00145 Q_PROPERTY(QStringList dependencies READ dependencies) 00146 00153 Q_PROPERTY(QString path READ path) 00154 00159 Q_PROPERTY(bool isInstalled READ isInstalled) 00160 00161 public: 00162 00163 typedef QObject Superclass; 00169 qSlicerAbstractCoreModule(QObject *parent=0); 00170 virtual ~qSlicerAbstractCoreModule(); 00171 00172 virtual void printAdditionalInfo(); 00173 00175 QString slicerWikiUrl()const{ return "http://www.slicer.org/slicerWiki/index.php"; } 00176 00179 void initialize(vtkSlicerApplicationLogic* appLogic); 00180 inline bool initialized() { return this->Initialized; } 00181 00185 virtual QString name()const; 00186 virtual void setName(const QString& name); 00187 00190 virtual QString title()const = 0; 00191 00197 virtual QStringList categories()const; 00198 00200 virtual int index()const; 00201 00205 virtual bool isHidden()const; 00206 00208 virtual QStringList contributors()const; 00209 00212 virtual QString helpText()const; 00213 00216 virtual QString acknowledgementText()const; 00217 00221 qSlicerAbstractModuleRepresentation* widgetRepresentation(); 00222 00225 void setAppLogic(vtkSlicerApplicationLogic* appLogic); 00226 vtkSlicerApplicationLogic* appLogic() const; 00227 00232 Q_INVOKABLE vtkMRMLAbstractLogic* logic(); 00233 00235 Q_INVOKABLE vtkMRMLScene* mrmlScene() const; 00236 00237 virtual QStringList dependencies()const; 00238 00241 QString path()const; 00242 void setPath(const QString& newPath); 00243 00246 bool isInstalled()const; 00247 void setInstalled(bool value); 00248 00249 public slots: 00250 00253 virtual void setMRMLScene(vtkMRMLScene*); 00254 00255 protected: 00257 virtual void setup() = 0; 00258 00260 virtual qSlicerAbstractModuleRepresentation* createWidgetRepresentation() = 0; 00261 00264 virtual vtkMRMLAbstractLogic* createLogic() = 0; 00265 00266 protected: 00267 QScopedPointer<qSlicerAbstractCoreModulePrivate> d_ptr; 00268 00269 private: 00270 Q_DECLARE_PRIVATE(qSlicerAbstractCoreModule); 00271 Q_DISABLE_COPY(qSlicerAbstractCoreModule); 00272 friend class qSlicerAbstractModuleRepresentation; 00273 void representationDeleted(); 00275 bool Initialized; 00276 }; 00277 00278 #endif
1.7.4