NorMIT-nav  22.09
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
cx::CameraStyle::cameraStyleChanged
void cameraStyleChanged()
cxLogger.h
cx::CameraStyle::getCameraStyle
CameraStyleData getCameraStyle() const
Definition: cxCameraStyle.cpp:46
cx::CameraStyleForViewPtr
boost::shared_ptr< class CameraStyleForView > CameraStyleForViewPtr
Definition: cxCameraStyleForView.h:33
cx::ViewGroupDataPtr
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:29
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::View::VIEW_3D
@ VIEW_3D
Definition: cxView.h:54
cx::CameraStyleForView
Definition: cxCameraStyleForView.h:87
cxViewGroup.h
cx::CameraStyle::setCameraStyle
void setCameraStyle(CameraStyleData style)
Select tool style. This replaces the vtkInteractor Style.
Definition: cxCameraStyle.cpp:51
cx::CoreServicesPtr
boost::shared_ptr< class CoreServices > CoreServicesPtr
Definition: cxCameraStyle.h:37
cxCameraStyle.h
cxView.h
cx::CameraStyleData
Definition: cxViewGroupData.h:41
cx::ViewPtr
boost::shared_ptr< class View > ViewPtr
Definition: cxForwardDeclarations.h:110
cx::CameraStyle::clearViews
void clearViews()
Definition: cxCameraStyle.cpp:41
cx::CameraStyle::addView
void addView(ViewPtr view)
Definition: cxCameraStyle.cpp:30
cstDEFAULT_STYLE
cstDEFAULT_STYLE
Definition: cxViewService.h:34
cx::CameraStyle::CameraStyle
CameraStyle(CoreServicesPtr backend, ViewGroupDataPtr viewGroupData)
Definition: cxCameraStyle.cpp:23