Fraxinus  17.12
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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 #include "cxStateService.h"
34 
35 #include <math.h>
36 #include <QColor>
37 #include "cxStateServiceNull.h"
38 #include "cxNullDeleter.h"
39 #include "cxVLCRecorder.h"
40 #include "cxDefinitions.h"
41 
42 namespace cx
43 {
44 
46 {
47 }
48 
49 Desktop::Desktop(QString layout, QByteArray mainwindowstate) :
50  mLayoutUid(layout), mMainWindowState(mainwindowstate)
51 {
52 }
53 
54 void Desktop::addPreset(QString name, int pos, bool tabbed)
55 {
56  Preset item;
57  item.name = name;
58  item.position = pos;
59  item.tabbed = tabbed;
60  mPresets.push_back(item);
61 }
62 
63 
65 {
66  static StateServicePtr mNull;
67  if (!mNull)
68  mNull.reset(new StateServiceNull, null_deleter());
69  return mNull;
70 }
71 
76 {
77  this->fillDefault("Automation/autoStartTracking", true);
78  this->fillDefault("Automation/autoStartStreaming", true);
79  this->fillDefault("Automation/autoReconstruct", true);
80  this->fillDefault("Automation/autoSelectActiveTool", true);
81  this->fillDefault("Automation/autoSave", true);
82  this->fillDefault("Automation/autoLoadRecentPatient", true);
83  this->fillDefault("Automation/autoLoadRecentPatientWithinHours", 8);
84  this->fillDefault("Automation/autoShowNewData", false);
85  this->fillDefault("Automation/autoShowNewDataInViewGroup0", true);
86  this->fillDefault("Automation/autoShowNewDataInViewGroup1", false);
87  this->fillDefault("Automation/autoShowNewDataInViewGroup3", false);
88  this->fillDefault("Automation/autoShowNewDataInViewGroup2", false);
89  this->fillDefault("Automation/autoShowNewDataInViewGroup4", false);
90  this->fillDefault("Automation/autoResetCameraToSuperiorViewWhenAutoShowingNewData", false);
91  this->fillDefault("Automation/autoCenterToImageCenterViewWhenAutoShowingNewData", false);
92  this->fillDefault("Automation/autoDeleteDICOMDatabase", true);
93 
94  this->fillDefault("TrackingPositionFilter/enabled", false);
95  this->fillDefault("TrackingPositionFilter/cutoffFrequency", 3.0);
96 
97  this->fillDefault("renderingInterval", 33);
98  this->fillDefault("backgroundColor", QColor(30,60,70)); // a dark, grey-blue hue
99  this->fillDefault("vlcPath", vlc()->getVLCPath());
100  this->fillDefault("globalPatientNumber", 1);
101  this->fillDefault("Ultrasound/acquisitionName", "US-Acq");
102  this->fillDefault("Ultrasound/8bitAcquisitionData", false);
103  this->fillDefault("Ultrasound/CompressAcquisition", true);
104  this->fillDefault("View3D/sphereRadius", 1.0);
105  this->fillDefault("View3D/labelSize", 2.5);
106  this->fillDefault("Navigation/anyplaneViewOffset", 0.25);
107  this->fillDefault("Navigation/followTooltip", true);
108  this->fillDefault("Navigation/followTooltipBoundary", 0.1);
109 
110  this->fillDefault("View2D/toolColor", QColor::fromRgbF(0.25, 0.87, 0.16));
111  this->fillDefault("View/toolTipPointColor", QColor::fromRgbF(0.96, 0.87, 0.17));
112  this->fillDefault("View/toolOffsetPointColor", QColor::fromRgbF(0.96, 0.87, 0.17));
113  this->fillDefault("View/toolOffsetLineColor", QColor::fromRgbF(1.0, 0.8, 0.0));
114  this->fillDefault("View2D/toolCrossHairColor", QColor::fromRgbF(1.0, 0.8, 0.0));
115  this->fillDefault("View2D/showToolCrosshair", true);
116  this->fillDefault("View3D/showManualTool", false);
117  this->fillDefault("View2D/showManualTool", true);
118 
119  this->fillDefault("showSectorInRTView", true);
120  this->fillDefault("View/showOrientationAnnotation", true);
121  this->fillDefault("View3D/stereoType", stFRAME_SEQUENTIAL);
122  this->fillDefault("View3D/eyeAngle", 4.0);
123  this->fillDefault("View/showDataText", true);
124  this->fillDefault("View/showLabels", true);
125  this->fillDefault("View/showMetricNamesInCorner", false);
126  this->fillDefault("View3D/annotationModelSize", 0.2);
127  this->fillDefault("View3D/annotationModel", "woman.stl");
128  this->fillDefault("View3D/depthPeeling", false);
129  this->fillDefault("View3D/ImageRender3DVisualizer", "vtkGPUVolumeRayCastMapper");
130  this->fillDefault("View3D/maxRenderSize", 10 * pow(10.0,6));
131  this->fillDefault("View/shadingOn", true);
132 
133  this->fillDefault("Gui/showMenuBar", true);
134 
135  this->fillDefault("stillUpdateRate", 0.001);
136 
137  this->fillDefault("View2D/useGPU2DRendering", true);
138  this->fillDefault("View2D/useLinearInterpolationIn2DRendering", true);
139 
140  this->fillDefault("optimizedViews", true);
141  this->fillDefault("smartRender", true);
142 
143  this->fillDefault("IGSTKDebugLogging", false);
144  this->fillDefault("giveManualToolPhysicalProperties", false);
145  this->fillDefault("renderSpeedLogging", false);
146 
147  this->fillDefault("applyTransferFunctionPresetsToAll", false);
148 
149  this->fillDefault("USsimulation/type", "Original data");
150  this->fillDefault("USsimulation/volume", "");
151  this->fillDefault("USsimulation/gain", 0.70);
152 
153  this->fillDefault("Dicom/ShowAdvanced", false);
154  this->fillDefault("Landmarks/ShowAdvanced", false);
155 }
156 
157 
158 } //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.