[vtkusers] Where is the actors matrix being saved?

Ambar C ambarc at gmail.com
Fri Oct 1 18:01:51 EDT 2010


Hello,

I'm trying to use the setUserTransform method for a vtkActor to be
able to record a user's changes to the actor using a mouse (which I
believe using vtkInteractorStyleTrackballActor as my renderer window's
interactor style should let me do) but after I change the position of
my actors using a mouse and try to access the usertransform, I see
that there isn't really a user transform in the first place (I see it
as null).

Do I have to first set the user transform to something? I've aligned
my actor's initial position with the origin, and I only want the
userTransform to record what changes the user makes. Also, does the
userTransform automatically update from the trackball actor style
everytime some motion occurs?

If I'm on the wrong track completely, some pointers/links would be
great as well :)

Cheers,
Ambar

On Tue, Sep 7, 2010 at 2:24 AM, Jothy <jothybasu at gmail.com> wrote:
> Hi David,
>
> I was able to run the example in Qt Creator. I think the problem rises when
> you click the middle mouse button (before dragging). Have a look at what's
> happening on that! Because you are not over-riding it in the sub class.
>
> Jothy
>
> On Mon, Sep 6, 2010 at 11:05 PM, Darshan Pai <darshanpai at gmail.com> wrote:
>>
>> I think you need to reset the Origin and the Position of the Actor to its
>> Initial Position too .
>>
>> Regards
>> Darshan
>>
>> On Sun, Sep 5, 2010 at 2:22 PM, David Doria <daviddoria+vtk at gmail.com>
>> wrote:
>>>
>>> On Sun, Sep 5, 2010 at 2:05 PM, Sebastien Jourdain
>>> <sebastien.jourdain at kitware.com> wrote:
>>> > Did you look into the UserTransform ? As I remember, I was using that
>>> > instead...
>>> >
>>> > Just in case...
>>> >
>>> > Seb
>>>
>>> Thanks for the suggestion Sebastien, but I did try looking at both the
>>> UserMatrix and the UserTransform but they both seem to be NULL:
>>>
>>> I just added this code to the original link for verification:
>>>
>>>        vtkMatrix4x4* userMatrix = this->CubeActor->GetUserMatrix();
>>>        if(userMatrix)
>>>          {
>>>          std::cout << "Has userMatrix" << std::endl;
>>>          }
>>>        else
>>>          {
>>>          std::cout << "No userMatrix!" << std::endl;
>>>          }
>>>
>>>        vtkLinearTransform* userTransform =
>>>           this->CubeActor->GetUserTransform();
>>>        if(userTransform)
>>>          {
>>>          std::cout << "Has userTransform" << std::endl;
>>>          }
>>>        else
>>>          {
>>>          std::cout << "No userTransform!" << std::endl;
>>>          }
>>>
>>> It outputs:
>>>
>>> No userMatrix!
>>> No userTransform!
>>>
>>> Any other thoughts?
>>>
>>> David
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list