CustusX  22.04-rc3
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
void rotationChanged(int value)
vtkSmartPointer< class vtkCardinalSpline > vtkCardinalSplinePtr
void setAutomaticRotation(bool automaticRotation)
void cameraRawPointsSlot(MeshPtr mesh)
double positionPercentageAdjusted(double positionPercentage)
boost::shared_ptr< class TrackingService > TrackingServicePtr
void setCameraRotations(std::vector< double > cameraRotations)
vtkSmartPointer< class vtkParametricSpline > vtkParametricSplinePtr
boost::shared_ptr< class ViewService > ViewServicePtr
void cameraPathPositionSlot(int positionPercentage)
void cameraRotateAngleSlot(int angle)
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
void cameraViewAngleSlot(int angle)
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
void setRoutePositions(std::vector< Eigen::Vector3d > routePositions)
boost::shared_ptr< class Mesh > MeshPtr
CXVBcameraPath(TrackingServicePtr tracker, PatientModelServicePtr patientModel, ViewServicePtr visualization)
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr