[vtk-developers] Convenience methods for vtkCamera

Aashish Chaudhary aashish.chaudhary at kitware.com
Thu Jul 21 18:17:02 EDT 2011


On Thu, Jul 21, 2011 at 6:10 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Aashish,
> My objection is these methods are pure syntactic sugar.  They increase
> the weight of the VTK interface without adding any new capabilities.
> Also, if these methods are added here, they might entice people to add
> similar methods to vtkProp3D and elsewhere.
> I know that VTK is already rife with such methods, but at least in most
> cases they are implemented by macros to ensure that they are consistently
> applied throughout VTK.
> My own preference is interfaces that are austere and orthogonal.  I'm not
> even
> a fan of the Rotate() and SetPosition() methods of vtkActor, when vtkActor
> could have instead just had a SetTransform method and people could have
> used the Transform methods to modify the actor matrix.

I completely agree with you. In fact that's why I just added
SetModelTransformMatrix and not ways to construct it because an
application can construct it however it can and just set the matrix
appropriately to the camera.

We will have a blog / white paper about these changes (and why we
added these methods). This is part of our current project to support
off axis stereo in VTK / ParaView. In fact we got it working without
using paraview in a cave like system and now we are testing ParaView
off axis stereo.

Like I said I will see if it can be removed. I will send another email
tomorrow.

>  - David
>
> On Thu, Jul 21, 2011 at 3:52 PM, Aashish Chaudhary
> <aashish.chaudhary at kitware.com> wrote:
>>
>> Hi David,
>>
>> On Thu, Jul 21, 2011 at 5:28 PM, David Gobbi <david.gobbi at gmail.com>
>> wrote:
>> > I noticed these two new methods in vtkCamera today, and if possible, I'd
>> > like for them to be removed:
>> >
>> >  void SetModelTransformMatrix( double x00,  double x01,  double
>> > x02, double
>> > x03,
>> >    double x10,  double x11,  double x12,  double x13,
>> >    double x20,  double x21,  double x22,  double x23,
>> >    double x30,  double x31,  double x32,  double x33);
>> >
>> >  void SetEyeTransformMatrix( double x00,  double x01,  double x02,
>> >  double
>> > x03,
>> >    double x10,  double x11,  double x12,  double x13,
>> >    double x20,  double x21,  double x22,  double x23,
>> >    double x30,  double x31,  double x32,  double x33);
>> >
>> > Is it really so hard to create a vtkMatrix4x4 and then pass it as an
>> > argument?
>>
>> No it is not. We added this as part of paraview - vtk stereo
>> integration. I will talk to Utkarsh (along with Nikhil) tomorrow to
>> figure out if we can remove them. Initially we didn't put them as I
>> didn't want to have something like this.
>>
>> I would though like to hear reasoning behind your objections. Said
>> that I am not favoring these two functions but would like to know what
>> you are thinking.
>>
>> > There is even a vtkMatrix4x4::DeepCopy method to make it easy to create
>> > a matrix from an array of doubles.
>>
>> Sure.
>>
>> >
>> > - David
>> >
>>
>>
>>
>> --
>> | Aashish Chaudhary
>> | R&D Engineer
>> | Kitware Inc.
>> | www.kitware.com
>
>



-- 
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com



More information about the vtk-developers mailing list