NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxAxesRep.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 
13 #include "cxAxesRep.h"
14 
15 #include "boost/bind.hpp"
16 #include <vtkAxesActor.h>
17 #include <vtkRenderer.h>
18 #include <vtkMatrix4x4.h>
19 #include <vtkCaptionActor2D.h>
20 #include <vtkTextProperty.h>
21 #include <vtkAssembly.h>
22 
23 #include "cxTypeConversions.h"
24 #include "cxView.h"
25 #include "cxGraphicalPrimitives.h"
26 #include "cxGraphicalAxes3D.h"
27 
28 namespace cx
29 {
30 
31 AxesRepPtr AxesRep::New(const QString& uid)
32 {
33  return wrap_new(new AxesRep(), uid);
34 }
35 
37  RepImpl()
38 {
39  mAxes.reset(new GraphicalAxes3D());
40  this->setAxisLength(0.2);
41  this->setShowAxesLabels(true);
42  this->setFontSize(0.04);
43 }
44 
46 {
47 }
48 
50 {
51  mAxes->setRenderer(view->getRenderer());
52 }
53 
55 {
56  mAxes->setRenderer(NULL);
57 }
58 
59 void AxesRep::setVisible(bool on)
60 {
61  mAxes->setVisible(on);
62 }
63 
65 {
66  mAxes->setShowAxesLabels(on);
67 }
68 
69 void AxesRep::setCaption(const QString& caption, const Vector3D& color)
70 {
71  mAxes->setCaption(caption, color);
72 }
73 
74 void AxesRep::setFontSize(double size)
75 {
76  mAxes->setFontSize(size);
77 }
78 
80 {
81  mAxes->setAxisLength(length);
82 }
83 
85 {
86  mAxes->setTransform(rMt);
87 }
88 
89 
90 } // namespace cx
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::AxesRep::setTransform
void setTransform(Transform3D rMt)
Definition: cxAxesRep.cpp:84
cxGraphicalPrimitives.h
cx::AxesRep::setShowAxesLabels
void setShowAxesLabels(bool on)
Definition: cxAxesRep.cpp:64
cx::AxesRep::setVisible
void setVisible(bool on)
Definition: cxAxesRep.cpp:59
cx::AxesRep::removeRepActorsFromViewRenderer
virtual void removeRepActorsFromViewRenderer(ViewPtr view)
Definition: cxAxesRep.cpp:54
cx::AxesRep::New
static AxesRepPtr New(const QString &uid="")
Definition: cxAxesRep.cpp:31
length
RealScalar length() const
Definition: cxMatrixBaseEigenAddons.h:35
cx::AxesRep::AxesRep
AxesRep()
Definition: cxAxesRep.cpp:36
cx::AxesRep::~AxesRep
virtual ~AxesRep()
Definition: cxAxesRep.cpp:45
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::AxesRep::setAxisLength
void setAxisLength(double length)
Definition: cxAxesRep.cpp:79
cxTypeConversions.h
cxView.h
cx::AxesRep::setCaption
void setCaption(const QString &caption, const Vector3D &color)
Definition: cxAxesRep.cpp:69
cx::AxesRep::setFontSize
void setFontSize(double size)
Definition: cxAxesRep.cpp:74
cx::AxesRep::addRepActorsToViewRenderer
virtual void addRepActorsToViewRenderer(ViewPtr view)
Definition: cxAxesRep.cpp:49
cx::GraphicalAxes3D
Visualization for one 3D coordinate axis triplet.
Definition: cxGraphicalAxes3D.h:38
cx::ViewPtr
boost::shared_ptr< class View > ViewPtr
Definition: cxForwardDeclarations.h:110
cx::RepImpl
Default implementation of Rep.
Definition: cxRepImpl.h:42
cx::AxesRepPtr
boost::shared_ptr< class AxesRep > AxesRepPtr
Definition: cxForwardDeclarations.h:63
cx::AxesRep::mAxes
GraphicalAxes3DPtr mAxes
Definition: cxAxesRep.h:55
cxAxesRep.h
cx::RepImpl::wrap_new
static boost::shared_ptr< REP > wrap_new(REP *object, QString uid)
Definition: cxRepImpl.h:62
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cxGraphicalAxes3D.h