NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxCustomMetricRep.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 CXCUSTOMMETRICREP_H
13 #define CXCUSTOMMETRICREP_H
14 
15 #include "cxResourceVisualizationExport.h"
16 
17 #include "cxDataMetricRep.h"
18 #include "vtkForwardDeclarations.h"
19 #include "cxForwardDeclarations.h"
21 #include "cxTransform3D.h"
22 
23 
24 namespace cx
25 {
26 typedef boost::shared_ptr<class CustomMetricRep> CustomMetricRepPtr;
27 typedef boost::shared_ptr<class CustomMetric> CustomMetricPtr;
28 typedef boost::shared_ptr<class GraphicalGeometric> GraphicalGeometricPtr;
29 typedef boost::shared_ptr<class Image2DProxy> Image2DProxyPtr;
30 
31 
40 class cxResourceVisualization_EXPORT CustomMetricRep: public DataMetricRep
41 {
42 Q_OBJECT
43 public:
44  static CustomMetricRepPtr New(const QString& uid = "");
45  virtual ~CustomMetricRep() {}
46 
47  virtual QString getType() const { return "CustomMetricRep"; }
48 
49 protected:
50  virtual void clear();
51  virtual void onModifiedStartRender();
52 
53  virtual void onEveryRender();
54 private:
56  CustomMetricPtr getCustomMetric();
57  void updateModel();
58 
59  std::vector<GraphicalGeometricPtr> mMeshGeometry;
60  std::vector<Image2DProxyPtr> mImageGeometryProxy;
61  std::vector<CaptionText3DPtr> mDistanceText;
62  void updateMeshModel(DataPtr model);
63  void updateImageModel(DataPtr model);
64  CaptionText3DPtr createDistanceText(Vector3D pos, double distance);
65  void createDistanceMarkers();
66  void hideDistanceMetrics();
67  bool isCloseToCamera(Vector3D pos);
68 };
69 
70 }
71 
72 #endif // CXCUSTOMMETRICREP_H
cx::CustomMetricRep
Definition: cxCustomMetricRep.h:40
cxGraphicalObjectWithDirection.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxForwardDeclarations.h
cx::CaptionText3DPtr
boost::shared_ptr< CaptionText3D > CaptionText3DPtr
Definition: cxGraphicalPrimitives.h:287
cx::CustomMetricRep::~CustomMetricRep
virtual ~CustomMetricRep()
constructor
Definition: cxCustomMetricRep.h:45
cx::Image2DProxyPtr
boost::shared_ptr< class Image2DProxy > Image2DProxyPtr
Definition: cxCustomMetricRep.h:29
cx::CustomMetricPtr
boost::shared_ptr< class CustomMetric > CustomMetricPtr
Definition: cxCustomMetric.h:29
cx::DataPtr
boost::shared_ptr< class Data > DataPtr
Definition: cxRegistrationApplicator.h:22
vtkForwardDeclarations.h
cx::DataMetricRep
Base class for all Data Metric reps.
Definition: cxDataMetricRep.h:39
cxDataMetricRep.h
cxTransform3D.h
cx::CustomMetricRep::getType
virtual QString getType() const
Definition: cxCustomMetricRep.h:47
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cx::GraphicalGeometricPtr
boost::shared_ptr< class GraphicalGeometric > GraphicalGeometricPtr
Definition: cxCustomMetricRep.h:28
cx::CustomMetricRepPtr
boost::shared_ptr< class CustomMetricRep > CustomMetricRepPtr
Definition: cxCustomMetricRep.h:26