MNE-CPP  0.1.9
A Framework for Electrophysiology
abstractview.cpp
Go to the documentation of this file.
1 //=============================================================================================================
35 //=============================================================================================================
36 // INCLUDES
37 //=============================================================================================================
38 
39 #include "abstractview.h"
40 
41 #include "../engine/view/view3D.h"
42 #include "../engine/model/data3Dtreemodel.h"
43 #include "../engine/delegate/data3Dtreedelegate.h"
44 
47 #include <mne/mne_bem.h>
50 
51 //=============================================================================================================
52 // QT INCLUDES
53 //=============================================================================================================
54 
55 #include <QGridLayout>
56 #include <QSizePolicy>
57 
58 //=============================================================================================================
59 // USED NAMESPACES
60 //=============================================================================================================
61 
62 using namespace DISP3DLIB;
63 
64 //=============================================================================================================
65 // DEFINE MEMBER METHODS
66 //=============================================================================================================
67 
69  Qt::WindowFlags f)
70 : QWidget(parent, f)
71 , m_p3DView(View3D::SPtr(new View3D()))
72 , m_pData3DModel(Data3DTreeModel::SPtr(new Data3DTreeModel()))
73 {
74  //Init 3D View
75  m_p3DView->setFlag(Qt::FramelessWindowHint, true);
76  m_p3DView->setModel(m_pData3DModel);
77 
78  // Init 3D control view
79  QStringList slControlFlags;
80  slControlFlags << "Data" << "View" << "Light";
81  m_pControl3DView = DISPLIB::Control3DView::SPtr(new DISPLIB::Control3DView("DISP3D", this, slControlFlags));
82 
83  Data3DTreeDelegate* pData3DTreeDelegate = new Data3DTreeDelegate(this);
84  m_pControl3DView->setDelegate(pData3DTreeDelegate);
85  m_pControl3DView->setModel(m_pData3DModel.data());
86 
89 
92 
95 
98 
101 
104 
107 
108  createGUI();
109 }
110 
111 //=============================================================================================================
112 
114 {
115 }
116 
117 //=============================================================================================================
118 
119 QSharedPointer<DISP3DLIB::View3D> AbstractView::getView()
120 {
121  return m_p3DView;
122 }
123 
124 //=============================================================================================================
125 
126 QSharedPointer<DISPLIB::Control3DView> AbstractView::getControlView()
127 {
128  return m_pControl3DView;
129 }
130 
131 //=============================================================================================================
132 
133 QSharedPointer<DISP3DLIB::Data3DTreeModel> AbstractView::getTreeModel()
134 {
135  return m_pData3DModel;
136 }
137 
138 //=============================================================================================================
139 
140 QPointer<DISPLIB::QuickControlView> AbstractView::getQuickControl()
141 {
142  return m_pQuickControlView;
143 }
144 
145 //=============================================================================================================
146 
147 void AbstractView::setQuickControlWidgets(const QList<QWidget*>& lControlWidgets)
148 {
149  if(m_pQuickControlView) {
150  for(int i = 0; i < lControlWidgets.size(); i++) {
151  if(lControlWidgets.at(i)) {
152  m_pQuickControlView->addGroupBox(lControlWidgets.at(i),
153  lControlWidgets.at(i)->windowTitle(),
154  "AbstractView");
155  }
156  }
157  }
158 }
159 
160 //=============================================================================================================
161 
163 {
165  "3D View",
166  Qt::Widget,
167  this,
168  false);
169  m_pQuickControlView->setVisiblityHideOpacityClose(false);
170 
171  //Create widget GUI
172  m_pQuickControlView->addGroupBox(m_pControl3DView.data(), "3D View", "AbstractView");
173 
174  QWidget *pWidgetContainer = QWidget::createWindowContainer(m_p3DView.data(), this, Qt::Widget);
175  pWidgetContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
176  pWidgetContainer->setMinimumSize(400,400);
177 
178  QGridLayout* pMainLayoutView = new QGridLayout();
179  pMainLayoutView->addWidget(pWidgetContainer,0,0);
180  pMainLayoutView->addWidget(m_pQuickControlView.data(),0,1);
181  pMainLayoutView->setContentsMargins(0,0,0,0);
182 
183  this->setLayout(pMainLayoutView);
184 }
DISP3DLIB::AbstractView::m_pData3DModel
QSharedPointer< DISP3DLIB::Data3DTreeModel > m_pData3DModel
Definition: abstractview.h:150
DISP3DLIB::View3D
Visualizes 3D data.
Definition: view3D.h:90
DISP3DLIB::AbstractView::createGUI
void createGUI()
Definition: abstractview.cpp:162
ecd_set.h
FiffDigPointSet class declaration.
DISP3DLIB::AbstractView::getControlView
QSharedPointer< DISPLIB::Control3DView > getControlView()
Definition: abstractview.cpp:126
DISP3DLIB::Data3DTreeDelegate
Provides a delegate to render user specific input methods in the tree model.
Definition: data3Dtreedelegate.h:78
DISP3DLIB::AbstractView::~AbstractView
~AbstractView()
Definition: abstractview.cpp:113
DISPLIB::Control3DView::sceneColorChanged
void sceneColorChanged(const QColor &color)
control3dview.h
Control3DView class declaration.
DISPLIB::Control3DView::rotationChanged
void rotationChanged(bool bRotationChanged)
DISPLIB::Control3DView
User GUI control for the View3D.
Definition: control3dview.h:81
quickcontrolview.h
Declaration of the QuickControlView Class.
DISPLIB::Control3DView::lightIntensityChanged
void lightIntensityChanged(double value)
DISP3DLIB::View3D::toggleCoordAxis
void toggleCoordAxis(bool bChecked)
Definition: view3D.cpp:236
DISP3DLIB::Data3DTreeModel
Data3DTreeModel provides a tree based data model to hold all information about data which was added t...
Definition: data3Dtreemodel.h:126
DISPLIB::Control3DView::showCoordAxis
void showCoordAxis(bool bShowCoordAxis)
DISP3DLIB::AbstractView::SPtr
QSharedPointer< AbstractView > SPtr
Definition: abstractview.h:86
DISP3DLIB::AbstractView::getTreeModel
QSharedPointer< DISP3DLIB::Data3DTreeModel > getTreeModel()
Definition: abstractview.cpp:133
DISP3DLIB::View3D::setSceneColor
void setSceneColor(const QColor &colSceneColor)
Definition: view3D.cpp:229
dipole_fit_settings.h
Dipole Fit Setting class declaration.
DISPLIB::Control3DView::takeScreenshotChanged
void takeScreenshotChanged()
DISP3DLIB::View3D::startStopCameraRotation
void startStopCameraRotation(bool bChecked)
Definition: view3D.cpp:396
DISP3DLIB::AbstractView::m_pControl3DView
QSharedPointer< DISPLIB::Control3DView > m_pControl3DView
Definition: abstractview.h:152
DISP3DLIB::AbstractView::AbstractView
AbstractView(QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
Definition: abstractview.cpp:68
DISPLIB::Control3DView::lightColorChanged
void lightColorChanged(const QColor &color)
DISP3DLIB::View3D::takeScreenshot
void takeScreenshot()
Definition: view3D.cpp:273
DISP3DLIB::AbstractView::setQuickControlWidgets
void setQuickControlWidgets(const QList< QWidget * > &lControlWidgets)
Definition: abstractview.cpp:147
mne_bem.h
MNEBem class declaration.
DISP3DLIB::AbstractView::getQuickControl
QPointer< DISPLIB::QuickControlView > getQuickControl()
Definition: abstractview.cpp:140
DISPLIB::Control3DView::showFullScreen
void showFullScreen(bool bShowFullScreen)
DISPLIB::QuickControlView
The QuickControlView class provides a quick control view for scaling, filtering, projector and other ...
Definition: quickcontrolview.h:82
DISP3DLIB::AbstractView::m_pQuickControlView
QPointer< DISPLIB::QuickControlView > m_pQuickControlView
Definition: abstractview.h:153
DISP3DLIB::View3D::showFullScreen
void showFullScreen(bool bChecked)
Definition: view3D.cpp:243
DISP3DLIB::AbstractView::getView
QSharedPointer< DISP3DLIB::View3D > getView()
Definition: abstractview.cpp:119
DISPLIB::Control3DView::SPtr
QSharedPointer< Control3DView > SPtr
Definition: control3dview.h:86
DISP3DLIB::View3D::setLightColor
void setLightColor(const QColor &color)
Definition: view3D.cpp:255
DISP3DLIB::View3D::setLightIntensity
void setLightIntensity(double value)
Definition: view3D.cpp:264
DISP3DLIB::AbstractView::m_p3DView
QSharedPointer< DISP3DLIB::View3D > m_p3DView
Definition: abstractview.h:149
abstractview.h
AbstractView class declaration.