On Mon, 2010-09-27 at 19:45 -0400, Yuval Levy wrote:
> Hi all,
>
> a question to the coding experts (meaning: everybody who knows what I don't
> know) out there.
>
> why are there two (different) definitions of rotate in the same namespace
> Panorama.h (around line 145 and 158)?
It is a function overload: you can rotate the panorama by either
specifying Euler angles (yaw, pitch and roll: 3 floats), or a matrix
which performs the rotation when you multiply vectors by it (with type
Matrix3). The compiler picks the wanted overload by the argument types.
Hopefully they are both used somewhere where either the rotation matrix
or Euler angles are known.
> where are they implemented?
Right there: src/hugin1/PT/panorama.h, lines 149 to 152, and 158 to 161.
However, both use the HuginBase::RotatePanorama class[1], which has an
overloaded constructor: it also handles Euler angles or a rotation
matrix.
> is there one that should be preferred over the other?
The one with the easiest to supply arguments.
If you are writing something for the Hugin GUI, you probably want to use
PT::RotatePanoCmd[2] instead, like this:
GlobalCmdHist::getInstance().addCommand(
new PT::RotatePanoCmd(pano, yaw, pitch, roll));
This adds it to the undo stack and performs the rotation.
PT::RotatePanoCmd could be extended to support a rotation matrix in its
constructor instead of Euler angles.
[1]
http://hugin.sourceforge.net/docs/html/classHuginBase_1_1RotatePanorama.html
[2]
http://hugin.sourceforge.net/docs/html/classPT_1_1RotatePanoCmd.html
--
You received this message because you are subscribed to the Google Groups
"Hugin and other free panoramic software" group.
A list of frequently asked questions is available at:
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/hugin-ptx