26 #include <qfiledialog.h>
27 #include <qinputdialog.h>
28 #include <qmessagebox.h>
29 #include <qscrollbar.h>
32 #include <igtlStringMessage.h>
33 #include <igtlBindMessage.h>
34 #include <igtlQuaternionTrackingDataMessage.h>
35 #include <igtlTrackingDataMessage.h>
38 #include <Poco/Path.h>
41 "org.mitk.views.igtldevicesourcemanagementwidget";
44 QWidget* parent, Qt::WindowFlags f)
45 : QWidget(parent, f), m_IsClient(false), m_MessageReceivedObserverTag(0), m_CommandReceivedObserverTag(0), m_LostConnectionObserverTag(0), m_NewConnectionObserverTag(0), m_StateModifiedObserverTag(0)
67 m_Controls =
new Ui::QmitkIGTLDeviceSourceManagementWidgetControls;
80 connect(
m_Controls->butSend, SIGNAL(clicked()),
103 this->
m_Controls->editSend->setEnabled(
false);
107 this->
m_Controls->editSend->setEnabled(
false);
111 if ( this->
m_IGTLDevice->GetNumberOfConnections() == 0 )
114 this->
m_Controls->editSend->setEnabled(
false);
151 if(sourceToLoad.IsNotNull())
163 if ( dynamic_cast<mitk::IGTLClient*>(
173 typedef itk::SimpleMemberCommand< QmitkIGTLDeviceSourceManagementWidget > CurCommandType;
175 messageReceivedCommand->SetCallbackFunction(
178 this->
m_IGTLDevice->AddObserver(mitk::MessageReceivedEvent(), messageReceivedCommand);
181 commandReceivedCommand->SetCallbackFunction(
184 this->
m_IGTLDevice->AddObserver(mitk::CommandReceivedEvent(), commandReceivedCommand);
187 connectionLostCommand->SetCallbackFunction(
190 mitk::LostConnectionEvent(), connectionLostCommand);
193 newConnectionCommand->SetCallbackFunction(
196 mitk::NewClientConnectionEvent(), newConnectionCommand);
199 stateModifiedCommand->SetCallbackFunction(
202 itk::ModifiedEvent(), stateModifiedCommand);
213 m_Controls->selectedSourceLabel->setText(
"<none>");
221 std::string toBeSend =
m_Controls->editSend->text().toStdString();
224 msg->SetString(toBeSend);
itk::SmartPointer< Self > Pointer
IGTLDeviceState
Type for state variable. The IGTLDevice is always in one of these states.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.