NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxFrameMetricRep.cpp
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 #include "cxFrameMetricRep.h"
13 
14 #include "cxView.h"
15 #include "boost/bind.hpp"
16 #include "cxGraphicalAxes3D.h"
17 
18 namespace cx
19 {
20 
22 {
23  return wrap_new(new FrameMetricRep(), uid);
24 }
25 
26 FrameMetricRep::FrameMetricRep()
27 {
28 }
29 
31 {
32  mAxes.reset();
34 }
35 
36 FrameMetricPtr FrameMetricRep::getFrameMetric()
37 {
38  return boost::dynamic_pointer_cast<FrameMetric>(mMetric);
39 }
40 
42 {
43  FrameMetricPtr metric = this->getFrameMetric();
44 
45  if (!metric || !metric->isValid() || !this->getView())
46  return;
47 
48  if (!mAxes)
49  {
50  mAxes.reset(new GraphicalAxes3D());
51  mAxes->setFontSize(0.04);
52  mAxes->setAxisLength(0.05);
53  mAxes->setShowAxesLabels(false);
54  mAxes->setRenderer(this->getRenderer());
55  }
56 
57  mAxes->setTransform(metric->getRefFrame());
58  this->drawText();
59 }
60 
61 } // namespace cx
cx::FrameMetricPtr
boost::shared_ptr< class FrameMetric > FrameMetricPtr
Definition: cxFrameMetric.h:23
cx::FrameMetricRep::onModifiedStartRender
virtual void onModifiedStartRender()
Definition: cxFrameMetricRep.cpp:41
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::DataMetricRep::clear
virtual void clear()
Definition: cxDataMetricRep.cpp:84
cx::RepImpl::getRenderer
vtkRendererPtr getRenderer()
Definition: cxRepImpl.cpp:88
cxFrameMetricRep.h
cx::FrameMetricRepPtr
boost::shared_ptr< class FrameMetricRep > FrameMetricRepPtr
Definition: cxFrameMetricRep.h:29
cx::FrameMetricRep::New
static FrameMetricRepPtr New(const QString &uid="")
Definition: cxFrameMetricRep.cpp:21
cx::FrameMetricRep::clear
virtual void clear()
Definition: cxFrameMetricRep.cpp:30
cxView.h
cx::DataMetricRep::drawText
void drawText()
Definition: cxDataMetricRep.cpp:109
cx::GraphicalAxes3D
Visualization for one 3D coordinate axis triplet.
Definition: cxGraphicalAxes3D.h:38
cx::FrameMetricRep
Definition: cxFrameMetricRep.h:39
cx::DataMetricRep::mMetric
DataMetricPtr mMetric
Definition: cxDataMetricRep.h:68
cx::RepImpl::wrap_new
static boost::shared_ptr< REP > wrap_new(REP *object, QString uid)
Definition: cxRepImpl.h:62
cxGraphicalAxes3D.h