Hi Martin,

the QmlMitkRenderWindowItem should be considered as experimental / alpha 
code. I am not surprised that some things don't work out.

You should be aware of the fact that we are not using QML code 
ourselves, so erroneous behaviour is likely to be unnoticed on our side.

However, we will happily merge fixes for the QML classes.

Best,
Sascha

On 08/26/2014 05:04 PM, Martin Klemm wrote:
> Hi,
>
> while comparing the QmlMitkRenderWindowItem with the QmitkRenderWindow I
> realized a small but significant difference:
>
> mitk::Point2D QmlMitkRenderWindowItem::GetMousePosition(QMouseEvent* me)
> const
> {
>
>    mitk::Point2D point;
>    point[0] = me->x();
>    point[1] = me->y();
>    //the following line was missing in the QmlMitkRenderWindowItem
>    m_Renderer->GetDisplayGeometry()->ULDisplayToDisplay(point, point);
>    return point;
> }
>
> The missing line caused that the y coordinate was flipped.
> ULDisplayToDisplay is basically flipping the y coordinate, so that 0,0
> is not in the top left corner but in the bottom left corner. Now the
> picking worked perfectly fine. But now the display coordinate has to be
> flipped in my QML file. It works like this but I am wondering if there
> is a better way to solve this. If not I would create a new bug and
> attach the patch..
>
> Best regards,
>
> Martin
>
> On 21.08.2014 16:48, Martin Klemm wrote:
>> Hello everyone,
>>
>> I implemented a picking functionality for the QuickRender example and my
>> normal Workbench application. In both the same code is handling the
>> picking. While it works in the workbench it produces completely wrong
>> picks in the QuickRender example.
>>
>> The code of my Interactor looks basically like this:
>>
>> mitk::InteractionPositionEvent* positionEvent =
>>        dynamic_cast<mitk::InteractionPositionEvent*>(interactionEvent);
>>     if (positionEvent != NULL)
>>     {
>>        mitk::Point2D pos2D = positionEvent->GetPointerPositionOnScreen();
>>        mitk::Point3D pos3D = positionEvent->GetPositionInWorld();
>>        mitk::DataNode::Pointer pickedNode =
>> positionEvent->GetSender()->PickObject(pos2D, pos3D);
>>        if ( pickedNode.IsNotNull() )
>>        {
>>           MITK_DEBUG("Interactor") << "Picked node: " <<
>> pickedNode->GetName();
>>           //send message
>>           m_NodePickedMessage.Send(pickedNode);
>>        }
>>     }
>>
>> Does anyone knows where this error could come from? Is it possible that
>> the QmlMitkRenderWindowItem is not doing the same as the QmitkRenderWindow?
>>
>> Best regards
>>
>> Martin
>>


------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to