NorMIT-nav  22.09
An IGT application
cxVBcameraPath.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 CXVBCAMERAPATH_H
13 #define CXVBCAMERAPATH_H
14 
15 #include <QObject>
16 
17 #include "cxForwardDeclarations.h"
18 #include "cxVector3D.h"
19 #include "cxTransform3D.h"
20 #include "org_custusx_virtualbronchoscopy_Export.h"
21 
22 typedef vtkSmartPointer<class vtkCardinalSpline> vtkCardinalSplinePtr;
23 typedef vtkSmartPointer<class vtkParametricSpline> vtkParametricSplinePtr;
24 
25 namespace cx {
26 
38 class CXVBcameraPath : public QObject
39 {
40  Q_OBJECT
41 
42 private:
43  vtkParametricSplinePtr mSpline;
44  TrackingServicePtr mTrackingService;
45  PatientModelServicePtr mPatientModelService;
46  ViewServicePtr mViewService;
47  ToolPtr mManualTool;
48 
49  int mNumberOfInputPoints;
50  int mNumberOfControlPoints;
51  Vector3D mLastCameraPos_r;
52  Vector3D mLastCameraFocus_r;
53  Vector3D mLastStoredViewVector;
54  double mLastCameraViewAngle;
55  double mLastCameraRotAngle;
56  bool mAutomaticRotation;
57 
58  std::vector< Eigen::Vector3d > mRoutePositions;
59  std::vector< double > mCameraRotations;
60  std::vector< double > mCameraRotationsSmoothed;
61 
62  void updateManualToolPosition();
63  void generateSplineCurve(MeshPtr mesh);
64  void generateSplineCurve(std::vector< Eigen::Vector3d > routePositions);
65  std::vector< double > smoothCameraRotations(std::vector< double > cameraRotations);
66 
67 public:
69  ViewServicePtr visualization);
70 
71  void setRoutePositions(std::vector< Eigen::Vector3d > routePositions);
72  void setCameraRotations(std::vector< double > cameraRotations);
73  void setAutomaticRotation(bool automaticRotation);
74 
75 signals:
76  void rotationChanged(int value);
77 
78 public slots:
79  void cameraRawPointsSlot(MeshPtr mesh);
80  void cameraPathPositionSlot(int positionPercentage);
81  void cameraViewAngleSlot(int angle);
82  void cameraRotateAngleSlot(int angle);
83 
84 };
85 
86  double org_custusx_virtualbronchoscopy_EXPORT positionPercentageAdjusted(double positionPercentage);
87 
88 } /* namespace cx */
89 
90 #endif // CXVBCAMERAPATH_H
cx::CXVBcameraPath::cameraRotateAngleSlot
void cameraRotateAngleSlot(int angle)
Definition: cxVBcameraPath.cpp:208
cx::CXVBcameraPath
Definition: cxVBcameraPath.h:38
cx::CXVBcameraPath::rotationChanged
void rotationChanged(int value)
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::CXVBcameraPath::CXVBcameraPath
CXVBcameraPath(TrackingServicePtr tracker, PatientModelServicePtr patientModel, ViewServicePtr visualization)
Definition: cxVBcameraPath.cpp:32
cxForwardDeclarations.h
cx::CXVBcameraPath::setRoutePositions
void setRoutePositions(std::vector< Eigen::Vector3d > routePositions)
Definition: cxVBcameraPath.cpp:214
vtkCardinalSplinePtr
vtkSmartPointer< class vtkCardinalSpline > vtkCardinalSplinePtr
Definition: cxVBcameraPath.h:22
vtkParametricSplinePtr
vtkSmartPointer< class vtkParametricSpline > vtkParametricSplinePtr
Definition: cxVBcameraPath.h:23
cxVector3D.h
cx::positionPercentageAdjusted
double positionPercentageAdjusted(double positionPercentage)
Definition: cxVBcameraPath.cpp:230
cx::MeshPtr
boost::shared_ptr< class Mesh > MeshPtr
Definition: cxForwardDeclarations.h:48
cx::TrackingServicePtr
boost::shared_ptr< class TrackingService > TrackingServicePtr
Definition: cxToolFilterWidget.h:27
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cx::ViewServicePtr
boost::shared_ptr< class ViewService > ViewServicePtr
Definition: cxLogicManager.h:28
cx::CXVBcameraPath::setCameraRotations
void setCameraRotations(std::vector< double > cameraRotations)
Definition: cxVBcameraPath.cpp:219
cx::CXVBcameraPath::setAutomaticRotation
void setAutomaticRotation(bool automaticRotation)
Definition: cxVBcameraPath.cpp:225
cx::ToolPtr
boost::shared_ptr< class Tool > ToolPtr
Definition: cxVideoConnectionWidget.h:43
cx::CXVBcameraPath::cameraPathPositionSlot
void cameraPathPositionSlot(int positionPercentage)
Definition: cxVBcameraPath.cpp:98
cx::CXVBcameraPath::cameraRawPointsSlot
void cameraRawPointsSlot(MeshPtr mesh)
Definition: cxVBcameraPath.cpp:46
cxTransform3D.h
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cx::CXVBcameraPath::cameraViewAngleSlot
void cameraViewAngleSlot(int angle)
Definition: cxVBcameraPath.cpp:202