CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxStateService.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 "cxStateService.h"
13 
14 #include <math.h>
15 #include <QColor>
16 #include "cxStateServiceNull.h"
17 #include "cxNullDeleter.h"
18 #include "cxVLCRecorder.h"
19 #include "cxDefinitions.h"
20 
21 namespace cx
22 {
23 
25 {
26 }
27 
28 Desktop::Desktop(QString layout, QByteArray mainwindowstate) :
29  mLayoutUid(layout), mMainWindowState(mainwindowstate)
30 {
31 }
32 
33 void Desktop::addPreset(QString name, int pos, bool tabbed)
34 {
35  Preset item;
36  item.name = name;
37  item.position = pos;
38  item.tabbed = tabbed;
39  mPresets.push_back(item);
40 }
41 
42 
44 {
45  static StateServicePtr mNull;
46  if (!mNull)
47  mNull.reset(new StateServiceNull, null_deleter());
48  return mNull;
49 }
50 
55 {
56  this->fillDefault("Automation/autoStartTracking", true);
57  this->fillDefault("Automation/autoStartStreaming", true);
58  this->fillDefault("Automation/autoReconstruct", true);
59  this->fillDefault("Automation/autoSelectActiveTool", true);
60  this->fillDefault("Automation/autoSave", true);
61  this->fillDefault("Automation/autoLoadRecentPatient", true);
62  this->fillDefault("Automation/autoLoadRecentPatientWithinHours", 8);
63  this->fillDefault("Automation/autoShowNewData", false);
64  this->fillDefault("Automation/autoShowNewDataInViewGroup0", true);
65  this->fillDefault("Automation/autoShowNewDataInViewGroup1", false);
66  this->fillDefault("Automation/autoShowNewDataInViewGroup3", false);
67  this->fillDefault("Automation/autoShowNewDataInViewGroup2", false);
68  this->fillDefault("Automation/autoShowNewDataInViewGroup4", false);
69  this->fillDefault("Automation/autoResetCameraToSuperiorViewWhenAutoShowingNewData", false);
70  this->fillDefault("Automation/autoCenterToImageCenterViewWhenAutoShowingNewData", false);
71  this->fillDefault("Automation/autoDeleteDICOMDatabase", true);
72 
73  this->fillDefault("TrackingPositionFilter/enabled", false);
74  this->fillDefault("TrackingPositionFilter/cutoffFrequency", 3.0);
75 
76  this->fillDefault("renderingInterval", 33);
77  this->fillDefault("backgroundColor", QColor(30,60,70)); // a dark, grey-blue hue
78  this->fillDefault("vlcPath", vlc()->getVLCPath());
79  this->fillDefault("globalPatientNumber", 1);
80  this->fillDefault("Ultrasound/acquisitionName", "US-Acq");
81  this->fillDefault("Ultrasound/8bitAcquisitionData", false);
82  this->fillDefault("Ultrasound/CompressAcquisition", true);
83  this->fillDefault("View3D/sphereRadius", 1.0);
84  this->fillDefault("View3D/labelSize", 2.5);
85  this->fillDefault("Navigation/anyplaneViewOffset", 0.25);
86  this->fillDefault("Navigation/followTooltip", true);
87  this->fillDefault("Navigation/followTooltipBoundary", 0.1);
88 
89  this->fillDefault("View2D/toolColor", QColor::fromRgbF(0.25, 0.87, 0.16));
90  this->fillDefault("View/toolTipPointColor", QColor::fromRgbF(0.96, 0.87, 0.17));
91  this->fillDefault("View/toolOffsetPointColor", QColor::fromRgbF(0.96, 0.87, 0.17));
92  this->fillDefault("View/toolOffsetLineColor", QColor::fromRgbF(1.0, 0.8, 0.0));
93  this->fillDefault("View2D/toolCrossHairColor", QColor::fromRgbF(1.0, 0.8, 0.0));
94  this->fillDefault("View2D/showToolCrosshair", true);
95  this->fillDefault("View3D/showManualTool", false);
96  this->fillDefault("View2D/showManualTool", true);
97 
98  this->fillDefault("showSectorInRTView", true);
99  this->fillDefault("View/showOrientationAnnotation", true);
100  this->fillDefault("View3D/stereoType", stFRAME_SEQUENTIAL);
101  this->fillDefault("View3D/eyeAngle", 4.0);
102  this->fillDefault("View/showDataText", true);
103  this->fillDefault("View/showLabels", true);
104  this->fillDefault("View/showMetricNamesInCorner", false);
105  this->fillDefault("View3D/annotationModelSize", 0.2);
106  this->fillDefault("View3D/annotationModel", "woman.stl");
107  this->fillDefault("View3D/depthPeeling", true);
108  this->fillDefault("View3D/ImageRender3DVisualizer", "vtkGPUVolumeRayCastMapper");
109  this->fillDefault("View3D/maxRenderSize", 10 * pow(10.0,6));
110  this->fillDefault("View/shadingOn", true);
111 
112  this->fillDefault("Gui/showMenuBar", true);
113 
114  this->fillDefault("stillUpdateRate", 0.001);
115 
116  this->fillDefault("View2D/useGPU2DRendering", false);
117  this->fillDefault("View2D/useLinearInterpolationIn2DRendering", true);
118 
119  this->fillDefault("optimizedViews", true);
120  this->fillDefault("smartRender", true);
121 
122  this->fillDefault("IGSTKDebugLogging", false);
123  this->fillDefault("giveManualToolPhysicalProperties", false);
124  this->fillDefault("renderSpeedLogging", false);
125 
126  this->fillDefault("applyTransferFunctionPresetsToAll", false);
127 
128  this->fillDefault("USsimulation/type", "Original data");
129  this->fillDefault("USsimulation/volume", "");
130  this->fillDefault("USsimulation/gain", 0.70);
131 
132  this->fillDefault("Dicom/ShowAdvanced", false);
133  this->fillDefault("Landmarks/ShowAdvanced", false);
134 }
135 
136 
137 } //namespace cx
std::vector< Preset > mPresets
boost::shared_ptr< class StateService > StateServicePtr
stFRAME_SEQUENTIAL
QByteArray mMainWindowState
static StateServicePtr getNullObject()
QString mLayoutUid
void addPreset(QString name, int pos, bool tabbed=true)
VLCRecorder * vlc()
Shortcut for accessing the vlc recorder.
Namespace for all CustusX production code.