CustusX  22.04-rc5
An IGT application
cxCameraStyle.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 #include "cxCameraStyle.h"
13 
14 #include <QAction>
15 #include "cxLogger.h"
16 #include "cxView.h"
17 #include "cxViewGroup.h"
18 #include "cxLogger.h"
19 
20 namespace cx
21 {
22 
24  mCameraStyle(cstDEFAULT_STYLE),
25  mBackend(backend),
26  mViewGroupData(viewGroupData)
27 {
28 }
29 
31 {
32  if (!view || view->getType()!=View::VIEW_3D)
33  return;
34 
35  CameraStyleForViewPtr style(new CameraStyleForView(mBackend));
36  style->setView(view);
37  style->setCameraStyle(CameraStyleData(mCameraStyle));
38  mViews.push_back(style);
39 }
40 
42 {
43  mViews.clear();
44 }
45 
47 {
48  return mCameraStyle;
49 }
50 
52 {
53  if (mCameraStyle == style)
54  return;
55 
56  for (unsigned i=0; i<mViews.size(); ++i)
57  mViews[i]->setCameraStyle(style);
58  mCameraStyle = style;
59 
60  emit cameraStyleChanged();
61 }
62 
63 
64 
65 }//namespace cx
CameraStyle(CoreServicesPtr backend, ViewGroupDataPtr viewGroupData)
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:29
void addView(ViewPtr view)
void setCameraStyle(CameraStyleData style)
Select tool style. This replaces the vtkInteractor Style.
boost::shared_ptr< class View > ViewPtr
cstDEFAULT_STYLE
Definition: cxViewService.h:34
boost::shared_ptr< class CameraStyleForView > CameraStyleForViewPtr
void cameraStyleChanged()
CameraStyleData getCameraStyle() const
boost::shared_ptr< class CoreServices > CoreServicesPtr
Definition: cxCameraStyle.h:37
Namespace for all CustusX production code.