NorMIT-nav  22.09
An IGT application
cxView.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 CXVIEW_H_
13 #define CXVIEW_H_
14 
15 #include <QObject>
16 #include "sscConfig.h"
17 #include <boost/shared_ptr.hpp>
18 #include <boost/weak_ptr.hpp>
19 #include "vtkForwardDeclarations.h"
20 #include "cxIndent.h"
21 #include <QSize>
22 class QColor;
23 
24 #include "cxTransform3D.h"
25 
26 namespace cx
27 {
28 class DoubleBoundingBox3D;
29 typedef boost::shared_ptr<class Rep> RepPtr;
30 
48 class View : public QObject
49 {
50  Q_OBJECT
51 public:
52  enum Type
53  {
55  };
56 
57  virtual ~View() {}
58 
59  virtual Type getType() const = 0;
60  virtual QString getTypeString() const = 0;
61  virtual QString getUid() = 0;
62  virtual QString getName() = 0;
63 
64  virtual void addRep(const RepPtr& rep) = 0;
65  virtual void removeRep(const RepPtr& rep) = 0;
66  virtual bool hasRep(const RepPtr& rep) const = 0;
67  virtual std::vector<RepPtr> getReps() = 0;
68  virtual void removeReps() = 0;
69 
70  virtual vtkRendererPtr getRenderer() const = 0;
71  virtual vtkRenderWindowPtr getRenderWindow() const = 0;
72  virtual void setModified() = 0;
73  virtual void setBackgroundColor(QColor color) = 0;
74  virtual QSize size() const = 0;
75  virtual void setZoomFactor(double factor) = 0;
76  virtual double getZoomFactor() const = 0;
77  virtual Transform3D get_vpMs() const = 0;
78  virtual DoubleBoundingBox3D getViewport() const = 0;
79  virtual DoubleBoundingBox3D getViewport_s() const = 0;
80 
81 signals:
82  void resized(QSize size);
83  void mouseMove(int x, int y, Qt::MouseButtons buttons);
84  void mousePress(int x, int y, Qt::MouseButtons buttons);
85  void mouseRelease(int x, int y, Qt::MouseButtons buttons);
86  void mouseWheel(int x, int y, int delta, int orientation, Qt::MouseButtons buttons);
87  void shown();
88  void focusChange(bool gotFocus, Qt::FocusReason reason);
89  void customContextMenuRequested(const QPoint&);
90 };
91 typedef boost::shared_ptr<View> ViewPtr;
92 
93 } // namespace cx
94 
95 #endif /*CXVIEW_H_*/
cx::View::VIEW_REAL_TIME
@ VIEW_REAL_TIME
Definition: cxView.h:54
cx::DoubleBoundingBox3D
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,...
Definition: cxBoundingBox3D.h:63
cx::View::size
virtual QSize size() const =0
vtkRenderWindowPtr
vtkSmartPointer< class vtkRenderWindow > vtkRenderWindowPtr
Definition: vtkForwardDeclarations.h:124
cx::View::getUid
virtual QString getUid()=0
Get a views unique id.
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::View::getViewport_s
virtual DoubleBoundingBox3D getViewport_s() const =0
cx::View::~View
virtual ~View()
Definition: cxView.h:57
cx::View::VIEW_3D
@ VIEW_3D
Definition: cxView.h:54
cx::View::resized
void resized(QSize size)
cx::View::focusChange
void focusChange(bool gotFocus, Qt::FocusReason reason)
cx::View::getTypeString
virtual QString getTypeString() const =0
cx::View::setZoomFactor
virtual void setZoomFactor(double factor)=0
cx::View::getRenderWindow
virtual vtkRenderWindowPtr getRenderWindow() const =0
cx::View::hasRep
virtual bool hasRep(const RepPtr &rep) const =0
Checks if the view already have the rep.
cx::View::VIEW_2D
@ VIEW_2D
Definition: cxView.h:54
cx::View::mouseMove
void mouseMove(int x, int y, Qt::MouseButtons buttons)
cx::RepPtr
boost::shared_ptr< class Rep > RepPtr
Definition: cxRepManager.h:24
cx::View::getViewport
virtual DoubleBoundingBox3D getViewport() const =0
cx::View::getName
virtual QString getName()=0
Get a views name.
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::View::getType
virtual Type getType() const =0
cx::View::getRenderer
virtual vtkRendererPtr getRenderer() const =0
Get the renderer used by this View.
cx::View::shown
void shown()
vtkForwardDeclarations.h
cx::View::customContextMenuRequested
void customContextMenuRequested(const QPoint &)
cx::View::mouseRelease
void mouseRelease(int x, int y, Qt::MouseButtons buttons)
cx::ViewPtr
boost::shared_ptr< class View > ViewPtr
Definition: cxForwardDeclarations.h:110
cxIndent.h
cx::View::get_vpMs
virtual Transform3D get_vpMs() const =0
cx::View::setBackgroundColor
virtual void setBackgroundColor(QColor color)=0
cx::View::mousePress
void mousePress(int x, int y, Qt::MouseButtons buttons)
cx::View::VIEW
@ VIEW
Definition: cxView.h:54
cx::View::getReps
virtual std::vector< RepPtr > getReps()=0
Returns all reps in the view.
cx::View::mouseWheel
void mouseWheel(int x, int y, int delta, int orientation, Qt::MouseButtons buttons)
cx::View
Definition: cxView.h:48
cx::View::getZoomFactor
virtual double getZoomFactor() const =0
cxTransform3D.h
cx::View::removeReps
virtual void removeReps()=0
Removes all reps in the view.
cx::View::removeRep
virtual void removeRep(const RepPtr &rep)=0
Removes and disconnects the rep from the view.
vtkRendererPtr
vtkSmartPointer< class vtkRenderer > vtkRendererPtr
Definition: vtkForwardDeclarations.h:122
cx::View::setModified
virtual void setModified()=0
cx::View::Type
Type
Definition: cxView.h:52
cx::View::addRep
virtual void addRep(const RepPtr &rep)=0
Adds and connects a rep to the view.