Fraxinus  16.5.0-fx-rc6
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxProbeImpl.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  * \brief
35  *
36  * \date Feb 3, 2011
37  * \author Christian Askeland, SINTEF
38  * \author Ole Vegard Solberg, SINTEF
39  */
40 
41 #ifndef CXPROBEIMPL_H_
42 #define CXPROBEIMPL_H_
43 
44 #include "cxResourceExport.h"
45 
46 #include "cxProbe.h"
47 #include <map>
49 
50 namespace cx
51 {
58 typedef boost::shared_ptr<class ProbeImpl> ProbeImplPtr;
59 
63 class cxResource_EXPORT ProbeImpl: public Probe
64 {
65 Q_OBJECT
66 public:
67  static ProbeImplPtr New(QString instrumentUid, QString scannerUid, ProbeXmlConfigParserPtr xml = ProbeXmlConfigParserPtr());
68  virtual ~ProbeImpl(){}
69  virtual bool isValid() const;
70 
71  virtual QStringList getAvailableVideoSources();
72  virtual VideoSourcePtr getRTSource(QString uid = "active") const;
73  virtual ProbeDefinition getProbeDefinition(QString uid = "active") const;
74  virtual ProbeSectorPtr getSector(QString uid = "active");
75 
76  virtual void addXml(QDomNode& dataNode);
77  virtual void parseXml(QDomNode& dataNode);
78 
79  virtual QStringList getConfigIdList() const;
80  virtual QString getConfigName(QString uid);
81  virtual QString getConfigId() const;
82  virtual QString getConfigurationPath() const;
83 
84  virtual void applyNewConfigurationWithId(QString uid);
85  virtual void setTemporalCalibration(double val);
86  virtual void setSoundSpeedCompensationFactor(double val);
87  virtual void setProbeDefinition(ProbeDefinition probeDefinition);
88  virtual void setRTSource(VideoSourcePtr source);
89  virtual void removeRTSource(VideoSourcePtr source);
90 
91  virtual void setActiveStream(QString uid);
92  virtual QString getActiveStream() const;
93 
94  ProbeXmlConfigParser::Configuration getConfiguration();
95  virtual void removeCurrentConfig();
96  virtual void saveCurrentConfig(QString uid, QString name);
97 
98  QString getRtSourceName(QString configurationId = "") const;
99 
100 private:
101  ProbeImpl(QString instrumentUid, QString scannerUid);
102  void initProbeXmlConfigParser(ProbeXmlConfigParserPtr xml);
103  void initConfigId();
104  ProbeXmlConfigParser::Configuration getConfiguration(QString uid) const;
105  QString getInstrumentId() const;
106  QString getInstrumentScannerId() const;
107  bool hasRtSource() const;
108 
109  void setConfigId(QString uid);
110  void updateProbeSector();
111  bool isValidConfigId();
112  ProbeDefinition createProbeSector();
113  void updateTemporalCalibration();
114  void applyConfig();
115 
116  QString mActiveUid;
117  std::map<QString, ProbeDefinition> mProbeDefinition;
118  std::map<QString, VideoSourcePtr> mSource;
119  ProbeWeakPtr mSelf;
120 
121  QString mInstrumentUid;
122  QString mScannerUid;
123  double mSoundSpeedCompensationFactor;
124  bool mOverrideTemporalCalibration;
125  double mTemporalCalibration;
126 
128  QString mConfigurationId;
129 
131  QString findRtSource(QString configId) const;
132 };
133 
137 } // namespace cx
138 
139 #endif /* CXPROBEIMPL_H_ */
140 
< a easy-to-work-with struct for a specific xml configuration
US Probe interface.
Definition: cxProbe.h:53
boost::weak_ptr< Probe > ProbeWeakPtr
Definition: cxProbe.h:94
boost::shared_ptr< class VideoSource > VideoSourcePtr
boost::shared_ptr< ProbeXmlConfigParser > ProbeXmlConfigParserPtr
boost::shared_ptr< class ProbeSector > ProbeSectorPtr
Definition of characteristics for an Ultrasound Probe Sector.
boost::shared_ptr< class ProbeImpl > ProbeImplPtr
virtual ~ProbeImpl()
Definition: cxProbeImpl.h:68