octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: units conversion (was: about contibuting to octave)


From: xianghang liu
Subject: Re: units conversion (was: about contibuting to octave)
Date: Mon, 1 Jun 2009 11:54:35 +0800



On Mon, Apr 20, 2009 at 7:14 PM, Michael Goffioul <address@hidden> wrote:
On Mon, Apr 20, 2009 at 11:27 AM, Shai Ayal <address@hidden> wrote:
> On Mon, Apr 20, 2009 at 12:17 PM, xianghang liu <address@hidden> wrote:
>> I tried again and found fltk_backend.oct could be built successfully with a
>> few modifications of fltk_backend.cc. The modification I made was moving
>> "#ifdef min ... #endif" which is originally in the middle of "#include ..."
>> instructions to the end them. Now it compiles fine and works well.
>
> I see this change was introduced by Michael in changeset 7965:
> http://hg.savannah.gnu.org/hgweb/octave/rev/6a6a030a3517
> with the comment "Fix compilation under MSVC".
> Will moving the #ifdef block below all includes break MSVC?
> If not then I say move it.

This might break compilation on MSVC. Could you track down
why you need to keep min and max #define'd?

Michael.
Hi,
I have a questiongs about units conversion from pixel to data.  While doing the text rendering, I use  transform method of the axes object to get the position of the text object in 'pixels' unit. The result is correct.
While doing the bounding box calculation, I add a property extent and doing the calculation in the new function:
       text::properties::get_extent (void) const
In this function, after get the bbox in 'pixels', I tried to use untransform method of the axes object to convert units  to "data". I call that method like this:       
       const base_properties& par_props = gh_manager::get_object (get_parent ()).get_properties ();
       const axes::properties& axes_props = dynamic_cast<const axes::properties&> (par_props);
       graphics_xform axes_xform = axes_props.get_transform ();
       ColumnVector bsize = axes_xform.untransform(cx,cy,0);  //cx, cy is the sizeof bbox in 'pixels'
The result is not correct. I also tried the axes::properties::pixel2coord method, and the result is not correct neither.
So my question is what is the mistake in my code and what is the right way to do the units conversion from 'pixels' to 'data'?
--
Xianghang Liu

reply via email to

[Prev in Thread] Current Thread [Next in Thread]