MNE-CPP  0.1.9
A Framework for Electrophysiology
abstractview.cpp
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 }
User GUI control for the View3D.
Definition: control3dview.h:81
QSharedPointer< DISP3DLIB::View3D > m_p3DView
Definition: abstractview.h:149
QSharedPointer< DISPLIB::Control3DView > getControlView()
void showFullScreen(bool bShowFullScreen)
QSharedPointer< DISP3DLIB::Data3DTreeModel > getTreeModel()
Visualizes 3D data.
Definition: view3D.h:90
void setQuickControlWidgets(const QList< QWidget *> &lControlWidgets)
AbstractView(QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
void sceneColorChanged(const QColor &color)
Provides a delegate to render user specific input methods in the tree model.
Declaration of the QuickControlView Class.
Control3DView class declaration.
FiffDigPointSet class declaration.
void toggleCoordAxis(bool bChecked)
Definition: view3D.cpp:236
QPointer< DISPLIB::QuickControlView > getQuickControl()
void setSceneColor(const QColor &colSceneColor)
Definition: view3D.cpp:229
void showCoordAxis(bool bShowCoordAxis)
QSharedPointer< Control3DView > SPtr
Definition: control3dview.h:86
QPointer< DISPLIB::QuickControlView > m_pQuickControlView
Definition: abstractview.h:153
QSharedPointer< AbstractView > SPtr
Definition: abstractview.h:86
void setLightIntensity(double value)
Definition: view3D.cpp:264
The QuickControlView class provides a quick control view for scaling, filtering, projector and other ...
QSharedPointer< DISP3DLIB::Data3DTreeModel > m_pData3DModel
Definition: abstractview.h:150
void startStopCameraRotation(bool bChecked)
Definition: view3D.cpp:396
Dipole Fit Setting class declaration.
void takeScreenshot()
Definition: view3D.cpp:273
void showFullScreen(bool bChecked)
Definition: view3D.cpp:243
void setLightColor(const QColor &color)
Definition: view3D.cpp:255
void lightIntensityChanged(double value)
QSharedPointer< DISP3DLIB::View3D > getView()
void lightColorChanged(const QColor &color)
void rotationChanged(bool bRotationChanged)
MNEBem class declaration.
Data3DTreeModel provides a tree based data model to hold all information about data which was added t...
QSharedPointer< DISPLIB::Control3DView > m_pControl3DView
Definition: abstractview.h:152