NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxShapeSensorWidget.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) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXTRACKINGSHAPEWIDGET_H_
13 #define CXTRACKINGSHAPEWIDGET_H_
14 
15 #include "org_custusx_tracking_shape_Export.h"
16 #include "cxBaseWidget.h"
17 #include "cxSocketConnection.h"
18 #include "cxForwardDeclarations.h"
19 #include "cxReadFbgsMessage.h"
20 class QVBoxLayout;
21 class QPushButton;
22 
23 namespace cx
24 {
25 
34 class org_custusx_tracking_shape_EXPORT ShapeSensorWidget : public BaseWidget
35 {
36  Q_OBJECT
37 public:
38  ShapeSensorWidget(VisServicesPtr services, QWidget* parent = 0);
39  virtual ~ShapeSensorWidget();
40 
41 private slots:
42  void shapePointLockChangedSlot();
43  void dataAvailableSlot();
44  void connectStateChangedSlot(CX_SOCKETCONNECTION_STATE status);
45  void connectClickedSlot();
46  void showClickedSlot();
47  void testShapeClickedSlot();
48  void saveShapeClickedSlot();
49  void toolChangedSlot();
50  void receiveTransforms(Transform3D prMt, double timestamp);
51 private:
52  VisServicesPtr mServices;
53  QVBoxLayout* mVerticalLayout;
54  SocketConnectionPtr mSocketConnection;
55  StringPropertyBasePtr mIpAddress;
56  DoublePropertyBasePtr mIpPort;
57  DoublePropertyPtr mShapePointLock;
58  QPushButton *mConnectButton;
59  QPushButton *mShowShapeButton;
60  QPushButton *mTestShapeButton;
61  QPushButton *mSaveShapeButton;
62  ReadFbgsMessagePtr mReadFbgsMessage = nullptr;
63  bool mShowShape = true;
64  StringPropertyBasePtr mSelector;
65  ToolPtr mTool;
66  int mDataLenght = 0;
67  QString mBuffer;
68 
69  QString defaultWhatsThis() const;
70  StringPropertyBasePtr getIPAddress(QDomElement root);
71  DoublePropertyBasePtr getIPPort(QDomElement root);
72  DoublePropertyPtr getShapePointLock(QDomElement root);
73  void readBuffer(QString buffer);
74  bool readShape(QString axisString, QString buffer);
75  bool readPositions(QString buffer, int bufferPos);
76  void updateShapePointLockRange();
77  void showShape();
78  bool readBuffer();
79  bool readMessageLenght();
80  void processData();
81 };
82 
83 } /* namespace cx */
84 
85 #endif /* CXTRACKINGSHAPEWIDGET_H_ */
cx::SocketConnectionPtr
boost::shared_ptr< class SocketConnection > SocketConnectionPtr
Definition: cxSocketConnection.h:53
cxBaseWidget.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::BaseWidget
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
cxForwardDeclarations.h
cx::VisServicesPtr
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
cx::DoublePropertyPtr
boost::shared_ptr< class DoubleProperty > DoublePropertyPtr
Definition: cxReconstructionMethodService.h:33
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::ToolPtr
boost::shared_ptr< class Tool > ToolPtr
Definition: cxVideoConnectionWidget.h:43
cxReadFbgsMessage.h
cx::DoublePropertyBasePtr
boost::shared_ptr< class DoublePropertyBase > DoublePropertyBasePtr
Definition: cxIGTLinkStreamerService.h:21
cx::StringPropertyBasePtr
boost::shared_ptr< class StringPropertyBase > StringPropertyBasePtr
Definition: cxIGTLinkStreamerService.h:20
cx::ShapeSensorWidget
Definition: cxShapeSensorWidget.h:34
cxSocketConnection.h
cx::CX_SOCKETCONNECTION_STATE
CX_SOCKETCONNECTION_STATE
Definition: cxSocketConnection.h:22
cx::ReadFbgsMessagePtr
boost::shared_ptr< class ReadFbgsMessage > ReadFbgsMessagePtr
Definition: cxReadFbgsMessage.h:26