7 #include "uiVisuQt/PointEditor.hpp" 9 #include <fwCom/Slot.hpp> 10 #include <fwCom/Slot.hxx> 11 #include <fwCom/Slots.hpp> 12 #include <fwCom/Slots.hxx> 14 #include <fwCore/base.hpp> 16 #include <fwData/Composite.hpp> 17 #include <fwData/String.hpp> 19 #include <fwGuiQt/container/QtContainer.hpp> 21 #include <fwMath/IntrasecTypes.hpp> 23 #include <fwServices/IService.hpp> 24 #include <fwServices/macros.hpp> 26 #include <QDoubleValidator> 27 #include <QHBoxLayout> 30 #include <QSpacerItem> 31 #include <QStringList> 32 #include <QVBoxLayout> 40 static const ::fwCom::Slots::SlotKeyType s_GET_INTERACTION_SLOT =
"getInteraction";
44 newSlot(s_GET_INTERACTION_SLOT, &PointEditor::getInteraction,
this);
60 ::fwGuiQt::container::QtContainer::sptr qtContainer = ::fwGuiQt::container::QtContainer::dynamicCast(
61 this->getContainer() );
63 QHBoxLayout* hLayout =
new QHBoxLayout();
65 QLabel* staticText_x =
new QLabel( tr(
"x:"));
66 hLayout->addWidget( staticText_x, 0, Qt::AlignVCenter );
68 m_textCtrl_x =
new QLineEdit();
69 m_textCtrl_x->setValidator(
new QDoubleValidator(m_textCtrl_x) );
70 hLayout->addWidget( m_textCtrl_x, 1, Qt::AlignVCenter );
72 QLabel* staticText_y =
new QLabel( tr(
"y:") );
73 hLayout->addWidget( staticText_y, 0, Qt::AlignVCenter );
75 m_textCtrl_y =
new QLineEdit();
76 m_textCtrl_y->setValidator(
new QDoubleValidator(m_textCtrl_y) );
77 hLayout->addWidget( m_textCtrl_y, 1, Qt::AlignVCenter );
79 QLabel* staticText_z =
new QLabel( tr(
"z:"));
80 hLayout->addWidget( staticText_z, 0, Qt::AlignVCenter );
82 m_textCtrl_z =
new QLineEdit();
83 m_textCtrl_z->setValidator(
new QDoubleValidator(m_textCtrl_z) );
84 hLayout->addWidget( m_textCtrl_z, 1, Qt::AlignVCenter );
86 qtContainer->setLayout( hLayout );
124 if ( info.
m_eventId == ::fwDataTools::PickingInfo::Event::MOUSE_MOVE )
126 m_textCtrl_x->setText(QString(
"%1").arg(info.
m_worldPos[0], 0,
'f', 3));
127 m_textCtrl_y->setText(QString(
"%1").arg(info.
m_worldPos[1], 0,
'f', 3));
128 m_textCtrl_z->setText(QString(
"%1").arg(info.
m_worldPos[2], 0,
'f', 3));
136 _sstream <<
"Point Editor";
PointEditor service allows to display point information.
virtual void info(std::ostream &_sstream) override
Overrides.
#define SLM_TRACE_FUNC()
Trace contextual function signature.
void updating() override
Perform some computations according to object (this service is attached to) attribute values and its ...
void configuring() override
Configure the service before starting. Apply the configuration to service.
Defines the service interface managing the editor service for object.
FWGUI_API void destroy()
Stops sub-views and toobar services. Destroys view, sub-views and toolbar containers.
The namespace uiVisuQt supplies user interface editors done with Qt.
void swapping() override
Swap the service from associated object to another object.
virtual UIVISUQT_API ~PointEditor() noexcept
Destructor. Do nothing.
virtual void stopping() override
This method launches the IEditor::stopping method.
FWGUI_API void create()
Creates view, sub-views and toolbar containers. Manages sub-views and toobar services.
virtual void starting() override
This method launches the IEditor::starting method.
This class defines a composite object.
FWGUI_API void initialize()
Initialize managers.
UIVISUQT_API PointEditor() noexcept
Constructor. Do nothing.