27 #include <qfiledialog.h>
28 #include <qmessagebox.h>
33 #include <Poco/Path.h>
36 #include <vtkSphereSource.h>
37 #include <vtkConeSource.h>
57 m_Controls->m_CalibrationLandmarksList->SetPointSetNode(NULL);
58 m_Controls->m_RegistrationLandmarksList->SetPointSetNode(NULL);
67 m_Controls =
new Ui::QmitkNavigationToolCreationWidgetControls;
76 connect( (QObject*)(
m_Controls->m_cancel), SIGNAL(clicked()),
this, SLOT(
OnCancel()) );
94 m_Controls->m_SurfaceChooser->SetAutoSelectNewItems(
true);
98 m_Controls->m_ToolNameEdit->setText(supposedName.c_str());
99 m_Controls->m_CalibrationFileName->setText(
"none");
100 m_Controls->m_Surface_Use_Sphere->setChecked(
true);
102 m_Controls->m_IdentifierEdit->setText(supposedIdentifier.c_str());
104 m_Controls->m_CalibrationLandmarksList->EnableEditButton(
false);
105 m_Controls->m_RegistrationLandmarksList->EnableEditButton(
false);
110 int index =
m_Controls->m_TrackingDeviceTypeChooser->findText(QString::fromStdString(type));
114 m_Controls->m_TrackingDeviceTypeChooser->setCurrentIndex(index);
135 if(
m_Controls->m_Surface_Use_Sphere->isChecked())
140 vtkData->SetAngle(5.0);
141 vtkData->SetResolution(50);
142 vtkData->SetHeight(6.0f);
143 vtkData->SetRadius(2.0f);
144 vtkData->SetCenter(0.0, 0.0, 0.0);
146 mySphere->SetVtkPolyData(vtkData->GetOutput());
148 newNode->SetData(mySphere);
152 newNode->SetData(
m_Controls->m_SurfaceChooser->GetSelectedNode()->GetData());
154 newNode->SetName(
m_Controls->m_ToolNameEdit->text().toLatin1());
174 m_CreatedTool->SetToolTipOrientation(tempND->GetOrientation());
180 m_CreatedTool->SetToolCalibrationLandmarks(toolCalLandmarks);
181 m_CreatedTool->SetToolRegistrationLandmarks(toolRegLandmarks);
195 std::string
filename = QFileDialog::getOpenFileName(NULL,tr(
"Open Surface"),
"/", tr(
"STL (*.stl)")).toLatin1().data();
202 MITK_ERROR <<
"Exception occured: " << e.what();
208 m_Controls->m_CalibrationFileName->setText(QFileDialog::getOpenFileName(NULL,tr(
"Open Calibration File"),
"/",
"*.*"));
213 m_Controls->m_ToolNameEdit->setText(QString(DefaultTool->GetDataNode()->GetName().c_str()));
214 m_Controls->m_IdentifierEdit->setText(QString(DefaultTool->GetIdentifier().c_str()));
215 m_Controls->m_SerialNumberEdit->setText(QString(DefaultTool->GetSerialNumber().c_str()));
217 int index =
m_Controls->m_TrackingDeviceTypeChooser->findText(QString::fromStdString(DefaultTool->GetTrackingDeviceType()));
221 m_Controls->m_TrackingDeviceTypeChooser->setCurrentIndex(index);
224 m_Controls->m_CalibrationFileName->setText(QString(DefaultTool->GetCalibrationFile().c_str()));
225 m_Controls->m_Surface_Use_Other->setChecked(
true);
226 switch(DefaultTool->GetType())
229 m_Controls->m_ToolTypeChooser->setCurrentIndex(0);
break;
231 m_Controls->m_ToolTypeChooser->setCurrentIndex(1);
break;
233 m_Controls->m_ToolTypeChooser->setCurrentIndex(2);
break;
235 m_Controls->m_ToolTypeChooser->setCurrentIndex(3);
break;
238 m_Controls->m_SurfaceChooser->SetSelectedNode(DefaultTool->GetDataNode());
239 FillUIToolLandmarkLists(DefaultTool->GetToolCalibrationLandmarks(),DefaultTool->GetToolRegistrationLandmarks());
249 msgBox.setText(s.c_str());
275 m_Controls->m_ShowAdvancedOptionsPB->setChecked(
false);
280 if(
m_Controls->m_Surface_Use_Sphere->isChecked())
287 dynamic_cast<mitk::DataNode*>(
m_Controls->m_SurfaceChooser->GetSelectedNode().GetPointer()));
293 m_Controls->m_LoadSurface->setEnabled(checked);
323 MITK_WARN <<
"No tracking device service found!";
331 if (
m_Controls->m_TrackingDeviceTypeChooser->findText(QString::fromStdString(name)) == -1)
333 m_Controls->m_TrackingDeviceTypeChooser->addItem(QString::fromStdString(name));
virtual bool InitializeViews(const BaseGeometry *geometry, RequestType type=REQUEST_UPDATE_ALL, bool preserveRoughOrientationInWorldSpace=false)
Data management class that handles 'was created by' relations.
itk::SmartPointer< Self > Pointer
This class is a collection for information of all Tracking Device Types (derived from abstract Tracki...
itk::SmartPointer< const Self > ConstPointer
virtual SetOfObjects::ConstPointer GetAll() const =0
returns a set of all data objects that are stored in the data storage
Data structure which stores a set of points. Superclass of mitk::Mesh.
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually...
static RenderingManager * GetInstance()
static const std::string filename
mitk::TimeGeometry::Pointer ComputeBoundingGeometry3D(const SetOfObjects *input, const char *boolPropertyKey=nullptr, const mitk::BaseRenderer *renderer=nullptr, const char *boolPropertyKey2=nullptr) const
Compute the axis-parallel bounding geometry of the input objects.
static Pointer New(const char *_arg)
std::string TrackingDeviceType
static DataStorage::SetOfObjects::Pointer Load(const std::string &path, DataStorage &storage)
Load a file into the given DataStorage.
std::vector< std::string > GetTrackingDeviceTypeNames()
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.