CustusX  22.04-rc5
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_*/
virtual vtkRendererPtr getRenderer() const =0
Get the renderer used by this View.
virtual DoubleBoundingBox3D getViewport() const =0
virtual QString getTypeString() const =0
virtual void setZoomFactor(double factor)=0
virtual bool hasRep(const RepPtr &rep) const =0
Checks if the view already have the rep.
virtual double getZoomFactor() const =0
void customContextMenuRequested(const QPoint &)
void resized(QSize size)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
void focusChange(bool gotFocus, Qt::FocusReason reason)
void mouseWheel(int x, int y, int delta, int orientation, Qt::MouseButtons buttons)
virtual vtkRenderWindowPtr getRenderWindow() const =0
vtkSmartPointer< class vtkRenderWindow > vtkRenderWindowPtr
virtual void setBackgroundColor(QColor color)=0
virtual void removeRep(const RepPtr &rep)=0
Removes and disconnects the rep from the view.
virtual std::vector< RepPtr > getReps()=0
Returns all reps in the view.
boost::shared_ptr< class View > ViewPtr
void mouseRelease(int x, int y, Qt::MouseButtons buttons)
void mousePress(int x, int y, Qt::MouseButtons buttons)
vtkSmartPointer< class vtkRenderer > vtkRendererPtr
virtual void setModified()=0
virtual void addRep(const RepPtr &rep)=0
Adds and connects a rep to the view.
virtual ~View()
Definition: cxView.h:57
virtual QString getName()=0
Get a views name.
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
virtual DoubleBoundingBox3D getViewport_s() const =0
virtual QString getUid()=0
Get a views unique id.
virtual QSize size() const =0
void mouseMove(int x, int y, Qt::MouseButtons buttons)
virtual Transform3D get_vpMs() const =0
virtual void removeReps()=0
Removes all reps in the view.
boost::shared_ptr< class Rep > RepPtr
Definition: cxRepManager.h:24
void shown()
virtual Type getType() const =0
Namespace for all CustusX production code.