[RQt-devel] an easy way to rotate a layer?

Yihui Xie xieyihui at gmail.com
Thu Oct 21 05:50:26 CEST 2010


Perfect! Thanks so much!

I didn't find the updateSceneGeometry() method, instead, there are
update() and updateGeometry() methods which work as well.

BTW, when there are texts in a layer, I will get this warning:

Painter::setTransform: rotating matrices not supported

To reproduce, run the code in this page:
http://github.com/bigbear/cranvas/wiki/How-to-rotate-a-view

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



On Wed, Oct 20, 2010 at 10:03 PM, Michael Lawrence
<lawrence.michael at gene.com> wrote:
> 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.
>>> For more options, visit this group at
>>> http://groups.google.com/group/ggobi-core?hl=en.
>>>
>>
>
>
> _______________________________________________
> Qtinterfaces-devel mailing list
> Qtinterfaces-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel
>
>


More information about the Qtinterfaces-devel mailing list