24 #include <QMessageBox> 33 m_MultiWidget(nullptr)
35 QListView::setAlternatingRowColors(
true);
37 QListView::setSelectionBehavior(QAbstractItemView::SelectItems);
38 QListView::setSelectionMode(QAbstractItemView::SingleSelection);
40 QString tooltip = QString(
"Use the F2/F3 keys to move a point up/down, the Del key to remove a point\nand the mouse " 41 "wheel to change the timestep.\n\nTimeStep:\t%1")
43 QListView::setToolTip(tooltip);
44 this->setContextMenuPolicy(Qt::CustomContextMenu);
46 this->setMinimumHeight(40);
48 this->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
52 connect(
this, SIGNAL(doubleClicked(
const QModelIndex &)),
this, SLOT(
OnPointDoubleClicked(
const QModelIndex &)));
54 connect(QListView::selectionModel(),
55 SIGNAL(selectionChanged(
const QItemSelection &,
const QItemSelection &)),
59 connect(
this, SIGNAL(customContextMenuRequested(
const QPoint &)),
this, SLOT(
ctxMenu(
const QPoint &)));
100 _EditPointDialog.exec();
106 if (pointSet ==
nullptr)
115 MITK_ERROR <<
"Point set has multiple selected points. This view is not designed for more than one selected point.";
120 if (selectedIndex == -1)
130 if (modelIndexOkay ==
true)
131 QListView::selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
139 const QItemSelection & )
146 if (pointSet ==
nullptr)
153 QModelIndexList selectedIndexes = selected.indexes();
156 int indexToSelect = -1;
158 for (mitk::PointSet::PointsContainer::Iterator it =
166 if (selectedIndexes.indexOf(index) != -1)
168 indexToSelect = it->Index();
178 if (indexToSelect > -1) {
184 snc->SelectSliceByPoint(p);
223 int whe =
event->delta();
225 unsigned int numberOfTS = ps->GetTimeSteps();
232 if ((currentTS + 1 >= (
int)numberOfTS))
239 if ((currentTS <= 0))
244 QString tooltip = QString(
"Use the F2/F3 keys to move a point up/down, the Del key to remove a point\nand the mouse " 245 "wheel to change the timestep.\n\nTimeStep:\t%1")
247 this->setToolTip(tooltip);
254 QMenu *
menu =
new QMenu;
257 QAction *showFading =
new QAction(
this);
258 showFading->setCheckable(
false);
259 showFading->setEnabled(
false);
260 showFading->setText(
"Fade TimeStep");
261 connect(showFading, SIGNAL(triggered(
bool)),
this, SLOT(
SetFading(
bool)));
262 menu->addAction(showFading);
265 QAction *clearList =
new QAction(
this);
266 clearList->setText(
"Clear List");
267 connect(clearList, SIGNAL(triggered()),
this, SLOT(
ClearPointList()));
268 menu->addAction(clearList);
271 QAction *clearTS =
new QAction(
this);
272 clearTS->setText(
"Clear current time step");
274 menu->addAction(clearTS);
276 menu->exec(this->mapToGlobal(pos));
289 if (curPS->GetSize() == 0)
292 switch (QMessageBox::question(
this,
294 tr(
"Remove all points from the displayed list?"),
295 QMessageBox::Yes | QMessageBox::No,
298 case QMessageBox::Yes:
302 while (!curPS->IsEmptyTimeStep(0))
304 curPsPoints = curPS->GetPointSet()->GetPoints();
305 it = curPsPoints->Begin();
306 curPS->SetSelectInfo(it->Index(),
true);
312 case QMessageBox::No:
DataType::PointsContainerIterator PointsIterator
A dialog for editing points directly (coordinates) via TextEdits.
void SetMultiWidget(QmitkStdMultiWidget *multiWidget)
If Multiwidget is set, the crosshair is automatically centering to the selected point As an alternati...
void AddSliceNavigationController(mitk::SliceNavigationController *snc)
Add a mitk::SliceNavigationController instance.
void RemoveSelectedPoint()
void OnPointDoubleClicked(const QModelIndex &index)
Filtering double click event for editing point coordinates via a dialog.
QmitkStdMultiWidget * GetMultiWidget() const
return the QmitkStdMultiWidget that is used for updating render window crosshair
void wheelEvent(QWheelEvent *event) override
change timestep of the current pointset by mouse wheel
virtual int SearchSelectedPoint(int t=0) const
searches a selected point and returns the id of that point. If no point is found, then -1 is returned...
mitk::PointSet * GetPointSet() const
which point set to work on
void MoveSelectedPointUp()
const mitk::PointSet * GetPointSet() const
which point set to work on
void SetTimeStep(int t)
which time step to display/model
virtual void SetSelectInfo(int position, bool selected, int t=0)
Controls the selection of the slice the associated BaseRenderer will display.
void SetPointSetNode(mitk::DataNode *pointSetNode)
which point set to work on
void SignalTimeStepChanged(int)
DataType::PointIdentifier PointIdentifier
std::set< mitk::SliceNavigationController * > m_Sncs
QmitkPointListModel * m_PointListModel
Data structure which stores a set of points. Superclass of mitk::Mesh.
~QmitkPointListView() override
virtual int GetNumberOfSelected(int t=0) const
returns the number of selected points
static RenderingManager * GetInstance()
The custom viewer plugin implements simple viewer functionality presented in a customized look and feel It was developed to demonstrate extensibility and customizability of the blueberry application framework As an example for the GUI customization capabilities provided by the BlueBerry application the custom viewer plugin was developed It features simple viewer functionality presented in a customized look and feel The custom viewer consists of two i e a viewer perspective and a DICOM perspective As part of the viewer an instance of QmitkDataManagerView allows for data selection Visualization of the selected data is then performed by a simple render window view According data can either be directly loaded from file or be imported as DICOM data DICOM import functionality is accessible from the DICOM perspective incorporating the QmitkDicomExternalDataWidget The customization of Qt Stylesheets is used to give the application a non native look and feel This is further emphasized by a Tab Widget like unification of the perspectives with the according perspective bar In addition to an absence of menu
int GetTimeStep() const
which time step to display/model
virtual DataType::Pointer GetPointSet(int t=0) const
returns the pointset
void SetFading(bool onOff)
Turn TimeStep Fading On/Off.
bool GetPointForModelIndex(const QModelIndex &index, mitk::PointSet::PointType &p, mitk::PointSet::PointIdentifier &id) const
get point and point ID that correspond to a given QModelIndex
void OnListViewSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
called when the selection of the view widget changes
bool GetModelIndexForPointID(mitk::PointSet::PointIdentifier id, QModelIndex &index) const
returns a QModelIndex for a given point ID
QmitkPointListView(QWidget *parent=nullptr)
DataType::PointsContainer PointsContainer
void MoveSelectedPointDown()
void ClearPointListTS()
delete all points in the list in the current timestep
void OnPointSetSelectionChanged()
called when the point set data structure changes
void keyPressEvent(QKeyEvent *e) override
react to F2, F3 and DEL keys
unsigned int GetTimeSteps() const
Get the number of time steps from the TimeGeometry As the base data has not a data vector given by it...
virtual mitk::SliceNavigationController * GetSliceNavigationController()
PointType GetPoint(PointIdentifier id, int t=0) const
Get the point with ID id in world coordinates.
void ClearPointList()
Delete all points in the list.
QmitkStdMultiWidget * m_MultiWidget
used to position the planes on a selected point
void ctxMenu(const QPoint &pos)
open ContextMenu
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
void SetPointSetNode(mitk::DataNode *pointSetNode)
assign a point set for observation
Class for nodes of the DataTree.
void SignalPointSelectionChanged()
this signal is emmitted, if the selection of a point in the pointset is changed
void RemoveSliceNavigationController(mitk::SliceNavigationController *snc)
Remove a mitk::SliceNavigationController instance.
void SetPoint(mitk::PointSet *_PointSet, mitk::PointSet::PointIdentifier _PointId, int timestep=0)