CustusX  22.04-rc5
An IGT application
cxViewLinkingViewContainerItem.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 
13 
14 namespace cx
15 {
16 
18 {
19  boost::shared_ptr<ViewLinkingViewContainerItem> retval(new ViewLinkingViewContainerItem(base, renderWindow));
20  retval->mSelf = retval;
21  return retval;
22 }
23 
25  ViewRepCollection(renderWindow, "")
26 {
27  mBase = base;
28 
29  connect(base, SIGNAL(resized(QSize)), this, SIGNAL(resized(QSize)));
30  connect(base, SIGNAL(mouseMove(int, int, Qt::MouseButtons)), this, SIGNAL(mouseMove(int, int, Qt::MouseButtons)));
31  connect(base, SIGNAL(mousePress(int, int, Qt::MouseButtons)), this, SIGNAL(mousePress(int, int, Qt::MouseButtons)));
32  connect(base, SIGNAL(mouseRelease(int, int, Qt::MouseButtons)), this, SIGNAL(mouseRelease(int, int, Qt::MouseButtons)));
33  connect(base, SIGNAL(mouseWheel(int, int, int, int, Qt::MouseButtons)), this, SIGNAL(mouseWheel(int, int, int, int, Qt::MouseButtons)));
34  connect(base, SIGNAL(shown()), this, SIGNAL(shown()));
35  connect(base, SIGNAL(focusChange(bool, Qt::FocusReason)), this, SIGNAL(focusChange(bool, Qt::FocusReason)));
36  connect(base, SIGNAL(customContextMenuRequestedInGlobalPos(const QPoint &)), this, SIGNAL(customContextMenuRequested(const QPoint &)));
37 
38 }
39 
42 {
43  if (mBase)
44  return mBase->size();
45  return QSize(0,0);
46 }
48 {
49  if (mBase)
50  mBase->setZoomFactor(factor);
51 }
53 {
54  if (mBase)
55  return mBase->getZoomFactor();
56  return 1;
57 }
59 {
60  if (mBase)
61  return mBase->get_vpMs();
62  return Transform3D::Identity();
63 }
65 {
66  if (mBase)
67  return mBase->getViewport();
69 }
71 {
72  if (mBase)
73  return mBase->getViewport_s();
75 }
76 
77 } /* namespace cx */
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)
vtkSmartPointer< class vtkRenderWindow > vtkRenderWindowPtr
ViewLinkingViewContainerItem(ViewItem *base, vtkRenderWindowPtr renderWindow)
virtual DoubleBoundingBox3D getViewport() const
static ViewRepCollectionPtr create(ViewItem *base, vtkRenderWindowPtr renderWindow)
void mouseRelease(int x, int y, Qt::MouseButtons buttons)
void mousePress(int x, int y, Qt::MouseButtons buttons)
static DoubleBoundingBox3D zero()
boost::shared_ptr< class ViewRepCollection > ViewRepCollectionPtr
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.
void mouseMove(int x, int y, Qt::MouseButtons buttons)
virtual DoubleBoundingBox3D getViewport_s() const
void shown()
Namespace for all CustusX production code.