[RQt-devel] an easy way to rotate a layer?
Michael Lawrence
lawrence.michael at gene.com
Thu Oct 21 05:03:22 CEST 2010
This should be supported now.
Qt supports rotations at the view using methods like scale, rotate, etc.
Most of the work was supporting this in conjunction with the rescaling
performed by our special PlotView class. When using geometry rescale mode
(the default, and desirable for your use-case) you'll need to tell the
PlotView to update the scene geometry by calling the updateSceneGeometry()
method.
So it's like:
v$rotate(90)
v$updateSceneGeometry()
Michael
On Tue, Oct 19, 2010 at 4:15 PM, Michael Lawrence <michafla at gene.com> wrote:
> Again, moved this over to qtinterfaces-devel.
>
> There are basically two transforms involved: one from item (layer) to scene
> and one from scene to view (which might be translated by a third transform
> to screen coordinates if there is a scrolled viewport). To rotate the entire
> plot, axes layers included, it's probably best to modify the view transform.
>
> Unfortunately, the view transform basically must be identity if you're
> using the geometry rescale mode in the plot view (the plot view is then
> making sure that the plot fits in the viewport by changing the geometry of
> the layer in the scene). I might be able to improve that if necessary
> though. I guess I had not anticipated this use-case. It doesn't make sense
> to zoom with the geometry rescale mode but rotations might make sense.
>
> Thanks for this suggestion,
> Michael
>
>
> On Tue, Oct 19, 2010 at 2:31 PM, Yihui Xie <xieyihui at gmail.com> wrote:
>
>> Hi everyone,
>>
>> I still feel lost in the Qt sea, but I believe it should be very easy
>> to rotate a layer by 90 degrees, and I feel it is something like
>> qdeviceTransform(), but I just don't know how to use this function.
>> Can anyone give me an example? e.g. switch x and y in a scatter plot
>> (without really switching the values of x and y)
>>
>> This can reduce the efforts on considering the direction of a plot,
>> being horizontal or vertical; in my par-coords plots, I did this on
>> the R level long ago. Maybe that is a waste of time.
>>
>> Thanks!
>>
>> Regards,
>> Yihui
>> --
>> Yihui Xie <xieyihui at gmail.com>
>> Phone: 515-294-2465 Web: http://yihui.name
>> Department of Statistics, Iowa State University
>> 2215 Snedecor Hall, Ames, IA
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "GGobi core" group.
>> To post to this group, send email to ggobi-core at googlegroups.com.
>> To unsubscribe from this group, send email to
>> ggobi-core+unsubscribe at googlegroups.com<ggobi-core%2Bunsubscribe at googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/ggobi-core?hl=en.
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/qtinterfaces-devel/attachments/20101020/20200f98/attachment-0001.htm>
More information about the Qtinterfaces-devel
mailing list