CustusX  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
void setShowAxesLabels(bool on)
Definition: cxAxesRep.cpp:64
void setFontSize(double size)
Definition: cxAxesRep.cpp:74
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
void setCaption(const QString &caption, const Vector3D &color)
Definition: cxAxesRep.cpp:69
Visualization for one 3D coordinate axis triplet.
static AxesRepPtr New(const QString &uid="")
Definition: cxAxesRep.cpp:31
static boost::shared_ptr< REP > wrap_new(REP *object, QString uid)
Definition: cxRepImpl.h:62
void setVisible(bool on)
Definition: cxAxesRep.cpp:59
boost::shared_ptr< class View > ViewPtr
void setTransform(Transform3D rMt)
Definition: cxAxesRep.cpp:84
virtual void removeRepActorsFromViewRenderer(ViewPtr view)
Definition: cxAxesRep.cpp:54
void setAxisLength(double length)
Definition: cxAxesRep.cpp:79
boost::shared_ptr< class AxesRep > AxesRepPtr
GraphicalAxes3DPtr mAxes
Definition: cxAxesRep.h:55
Default implementation of Rep.
Definition: cxRepImpl.h:42
virtual ~AxesRep()
Definition: cxAxesRep.cpp:45
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
RealScalar length() const
virtual void addRepActorsToViewRenderer(ViewPtr view)
Definition: cxAxesRep.cpp:49
Namespace for all CustusX production code.