~ubuntu-branches/ubuntu/wily/ginkgocadx/wily-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/main/controllers/hangingprotocolcontroller.h

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-10-24 21:28:17 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20131024212817-ej1skb9og09d3ht6
Tags: 3.5.0.1137.31+dfsg-1
New upstream release [October 2013]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  
3
 
 *  $Id: hangingprotocolcontroller.h $
4
 
 *  Ginkgo CADx Project
5
 
 *
6
 
 *  Copyright 2008-12 MetaEmotion S.L. All rights reserved.
7
 
 *  http://ginkgo-cadx.com
8
 
 *
9
 
 *  This file is licensed under LGPL v3 license.
10
 
 *  See License.txt for details
11
 
 *
12
 
 *
 
1
/*
 
2
 *  
 
3
 *  $Id: hangingprotocolcontroller.h $
 
4
 *  Ginkgo CADx Project
 
5
 *
 
6
 *  Copyright 2008-14 MetaEmotion S.L. All rights reserved.
 
7
 *  http://ginkgo-cadx.com
 
8
 *
 
9
 *  This file is licensed under LGPL v3 license.
 
10
 *  See License.txt for details
 
11
 *
 
12
 *
13
13
 */
14
14
#include <string>
15
15
#include <map>
19
19
class wxXmlNode;
20
20
class wxSizer;
21
21
class wxWindow;
22
 
class wxSizerItem;
 
22
class wxSizerItem;
23
23
 
24
24
namespace GNC {
25
25
        namespace GCS {
39
39
                class IHangingProtocolContract 
40
40
                {
41
41
                public:
42
 
                        virtual wxWindow* createSeriesViewer(const std::map<std::string, std::string>& properties, long pk = -1, const GNC::GCS::Ptr<GNC::GCS::Matcher>& pMatcher = NULL) = 0;
 
42
                        virtual wxWindow* createSeriesSlot(const std::map<std::string, std::string>& properties, long pk = -1, const GNC::GCS::Ptr<GNC::GCS::Matcher>& pMatcher = NULL) = 0;
43
43
                        virtual const std::list<long>& getOpeningSeries() = 0;
44
44
                };
45
45
                /**
150
150
                };
151
151
 
152
152
                /**
 
153
                * window level setting
 
154
                */
 
155
                class WindowLevelSetting 
 
156
                {
 
157
                public:
 
158
                        WindowLevelSetting();
 
159
                        WindowLevelSetting(double window, double level, const std::string& label);
 
160
                        WindowLevelSetting(wxXmlNode* node);
 
161
                        WindowLevelSetting(const WindowLevelSetting& other);
 
162
                        ~WindowLevelSetting();
 
163
                        /**
 
164
                        serialize to XML
 
165
                        */
 
166
                        wxXmlNode* serialize();
 
167
 
 
168
                        double getWindow() const;
 
169
                        double getLevel() const;
 
170
                        const std::string& getLabel() const;
 
171
 
 
172
                        std::string toString() const;
 
173
 
 
174
                        void setWindow(double window);
 
175
                        void setLevel(double level);
 
176
                        void setLabel(const std::string& label);
 
177
                        
 
178
                protected:
 
179
                        double window;
 
180
                        double level;
 
181
                        std::string label;
 
182
                };
 
183
 
 
184
                /**
 
185
                * default modality settings
 
186
                */
 
187
                class DefaultModalitySettings 
 
188
                {
 
189
                public:
 
190
                        typedef enum TInterpolationMode{
 
191
                                TIM_NEAREST_NEIGHBOUR,
 
192
                                TIM_LINEAR,
 
193
                                TIM_CUBIC
 
194
                        }TInterpolationMode;
 
195
                        typedef std::list<GNC::GCS::Ptr<WindowLevelSetting> > TListOfWLSettings;
 
196
                        DefaultModalitySettings();
 
197
                        DefaultModalitySettings(wxXmlNode* node);
 
198
                        DefaultModalitySettings(const DefaultModalitySettings& other);
 
199
                        ~DefaultModalitySettings();
 
200
                        /**
 
201
                        serialize to XML
 
202
                        */
 
203
                        wxXmlNode* serialize();
 
204
 
 
205
                        static std::string getDefaultWindowLevelLabel();
 
206
                        static std::string getAutocalculateWindowLevelLabel();
 
207
 
 
208
                        const TListOfWLSettings& getWLSettings() const;
 
209
                        const std::string& getModality() const;
 
210
                        const std::string& getInitialWindowLevelLabel() const;
 
211
                        TInterpolationMode getInterpolationMode() const;
 
212
 
 
213
                        void addWindowLevel(const GNC::GCS::Ptr<WindowLevelSetting>& wlSetting);
 
214
                        void clearWindowLevels();
 
215
                        void setModality(const std::string& modality);
 
216
                        void setInitialWindowLevelLabel(const std::string& label);
 
217
                        void setInterpolationMode(TInterpolationMode mode);
 
218
                protected:
 
219
                        std::string modality;
 
220
                        std::string initialWindowLevelLabel;
 
221
                        TInterpolationMode interpolationMode;
 
222
                        TListOfWLSettings listOfWLSettings;
 
223
                };
 
224
 
 
225
                /**
153
226
                HangingProtocol class, defines a hanging protocol
154
227
                */
155
228
                class HangingProtocol {
156
229
                public:
157
230
                        typedef std::list<GNC::GCS::Ptr<Layout> > TListOfLayouts;
 
231
                        typedef std::map<std::string, GNC::GCS::Ptr<DefaultModalitySettings> > TMapOfModalitySettings;
158
232
                        HangingProtocol();
159
233
                        /**
160
234
                        deserialize from xml
162
236
                        HangingProtocol(wxXmlNode* node);
163
237
                        HangingProtocol(const HangingProtocol& other);
164
238
                        ~HangingProtocol();
 
239
                        void LoadDefaultModalitySettings();
165
240
                        /**
166
241
                        serialize to XML
167
242
                        */
187
262
                        const TListOfLayouts& getLayouts();
188
263
                        void addLayout(const GNC::GCS::Ptr<Layout>& layout);
189
264
                        void clearLayouts();
 
265
                        const TMapOfModalitySettings& getModalitySettingsMap();
 
266
                        void addModalitySettings(const GNC::GCS::Ptr<DefaultModalitySettings>& settings);
 
267
                        void clearModalitySettings();
 
268
                        GNC::GCS::Ptr<DefaultModalitySettings> getModalitySettings(const std::string& modality);
190
269
                        std::map<std::string, std::string>& getProperties();
191
270
                        void setProperties(const std::map<std::string, std::string>& properties);
192
271
                        bool isActive();
215
294
                        layout of the protocol
216
295
                        */
217
296
                        TListOfLayouts layouts;
 
297
                        /**
 
298
                        visualization modality settings
 
299
                        */
 
300
                        TMapOfModalitySettings modalitySettings;
218
301
                        /*
219
302
                        here modules can insert key/value properies
220
303
                        */
285
368
                        std::list<GNC::GCS::Ptr<HangingProtocol> > listOfProtocols;
286
369
                };
287
370
        }
288
 
}
 
371
}