Fraxinus  16.5.0-fx-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxVolumePropertiesWidget.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 
34 
35 #include <QComboBox>
36 #include <QTabWidget>
37 #include <QVBoxLayout>
38 #include <QPushButton>
41 #include "cxImage.h"
43 #include "cxCroppingWidget.h"
44 #include "cxClippingWidget.h"
45 #include "cxShadingWidget.h"
46 #include "cxDataInterface.h"
47 #include "cxDataSelectWidget.h"
49 #include "cxVolumeInfoWidget.h"
50 #include "cxVolumeHelpers.h"
51 #include "cxTypeConversions.h"
52 #include "cxPatientModelService.h"
53 #include "cxVisServices.h"
55 
56 namespace cx
57 {
58 
62 
64  BaseWidget(parent, "ActiveVolumeWidget", "Active Volume")
65 {
66  this->setToolTip("The currently selected active volume");
67  QVBoxLayout* layout = new QVBoxLayout(this);
68  layout->setMargin(0);
69  layout->addWidget(new DataSelectWidget(viewService, patientModelService, this, StringPropertyActiveImage::New(patientModelService)));
70 }
71 
75 
77  TabbedWidget(parent, "VolumePropertiesWidget", "Volume Properties")
78 {
79  this->setToolTip("Volume properties");
80  this->insertWidgetAtTop(new ActiveVolumeWidget(services->patient(), services->view(), this));
81 
82  bool connectToActiveImage = true;
83 
84  this->addTab(new VolumeInfoWidget(services->patient(), this), "Info");
85  this->addTab(new TransferFunctionWidget(services->patient(), this, connectToActiveImage), QString("Transfer Functions"));
86  this->addTab(new ShadingWidget(services->patient()->getActiveData(), this, connectToActiveImage), "Properties");
87  this->addTab(new CroppingWidget(services->patient(), services->view(), this), "Crop");
88  this->addTab(new SelectClippersForImageWidget(services, this), "Clip");
89 }
90 
91 }//namespace
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:62
ActiveVolumeWidget(PatientModelServicePtr patientModelService, ViewServicePtr viewService, QWidget *parent)
boost::shared_ptr< class ViewService > ViewServicePtr
void insertWidgetAtTop(QWidget *newWidget)
Widget that contains a select active image combobox.
VolumePropertiesWidget(VisServicesPtr services, QWidget *parent)
void addTab(BaseWidget *newTab, QString newTabName)
Interface for making widgets with a hierarchy of tabs.
static StringPropertyActiveImagePtr New(PatientModelServicePtr patientModelService)
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Widget for displaying various volume information.
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:108
cxLogicManager_EXPORT ViewServicePtr viewService()