19 #include <QFileDialog>
20 #include <QHBoxLayout>
21 #include <QMessageBox>
32 m_PointListView(NULL),
36 m_MovePointUpBtn(NULL),
37 m_MovePointDownBtn(NULL),
38 m_RemovePointBtn(NULL),
39 m_SavePointsBtn(NULL),
40 m_LoadPointsBtn(NULL),
41 m_ToggleAddPoint(NULL),
46 m_DataInteractor(NULL),
95 m_ToggleAddPoint->setToolTip(
"Toggle point editing (use SHIFT + Left Mouse Button to add Points)");
96 QIcon iconAdd(
":/QtWidgetsExt/btnSetPoints.xpm");
102 QIcon iconAddManually(
":/QtWidgetsExt/btnSetPointsManually.xpm");
107 const QIcon iconDel(
":/QtWidgetsExt/btnClear.xpm");
113 const QIcon iconUp(
":/QtWidgetsExt/btnUp.xpm");
119 const QIcon iconDown(
":/QtWidgetsExt/btnDown.xpm");
125 QIcon iconSave(
":/QtWidgetsExt/btnSave.xpm");
131 QIcon iconLoad(
":/QtWidgetsExt/btnLoad.xpm");
133 m_LoadPointsBtn->setToolTip(
"Load list of points from file (REPLACES current content)");
143 lay1 =
new QVBoxLayout(
this);
144 lay2 =
new QHBoxLayout();
149 lay1 =
new QHBoxLayout(
this);
150 lay2 =
new QVBoxLayout();
155 lay1 =
new QHBoxLayout(
this);
156 lay2 =
new QVBoxLayout();
161 lay1 =
new QVBoxLayout(
this);
162 lay2 =
new QHBoxLayout();
169 this->setLayout(lay1);
170 lay1->addLayout(lay2);
182 this->setLayout(lay1);
206 if ((dynamic_cast<mitk::PointSet *>(
m_PointSetNode->GetData())) == NULL)
208 if ((dynamic_cast<mitk::PointSet *>(
m_PointSetNode->GetData()))->GetSize() == 0)
213 nodeName =
"/" + nodeName +
".mps";
214 QString fileNameProposal = QString();
215 fileNameProposal.append(nodeName.c_str());
217 QString aFilename = QFileDialog::getSaveFileName(
218 NULL,
"Save point set", QDir::currentPath() + fileNameProposal,
"MITK Pointset (*.mps)");
219 if (aFilename.isEmpty())
228 QMessageBox::warning(
this,
230 QString(
"File writer reported problems writing %1\n\n"
231 "PLEASE CHECK output file!")
239 QString
filename = QFileDialog::getOpenFileName(NULL,
"Open MITK Pointset",
"",
"MITK Point Sets (*.mps)");
240 if (filename.isEmpty())
247 if (pointSet.IsNull())
249 QMessageBox::warning(
this,
"Load point set", QString(
"File reader could not read %1").arg(filename));
259 QMessageBox::warning(
this,
"Load point set", QString(
"File reader collapsed while reading %1").arg(filename));
364 editPointDialog.exec();
383 if (enabled ==
false)
DataType::PointsContainerIterator PointsIterator
PointsIterator GetMaxId(int t=0)
Get an iterator to the max ID element if existent. Return End() otherwise.
static void Save(const mitk::BaseData *data, const std::string &path)
Save a mitk::BaseData instance.
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...
itk::SmartPointer< Self > Pointer
void AddSliceNavigationController(mitk::SliceNavigationController *snc)
Add a mitk::SliceNavigationController instance.
void RemoveSelectedPoint()
virtual int GetSize(unsigned int t=0) const
returns the current size of the point-list
void MoveSelectedPointUp()
GUI widget for handling mitk::PointSet.
Controls the selection of the slice the associated BaseRenderer will display.
DataType::PointIdentifier PointIdentifier
Data structure which stores a set of points. Superclass of mitk::Mesh.
static RenderingManager * GetInstance()
static const std::string filename
static mitk::PointSet::Pointer LoadPointSet(const std::string &path)
LoadPointSet Convenience method to load an arbitrary mitkPointSet.
void MoveSelectedPointDown()
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 RemoveSliceNavigationController(mitk::SliceNavigationController *snc)
Remove a mitk::SliceNavigationController instance.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.
void SetPoint(mitk::PointSet *_PointSet, mitk::PointSet::PointIdentifier _PointId, int timestep=0)