SliceO_Frame::Frm_2_Inf

 

This method enable you to convert coordinates in "Frm" space to coordinates in "Inf" space.

 

 

Syntax

 

Point_2D  Frm_2_Inf(

          SliceO_Window * window,

          Point_2D pos_frm

) ;

 

Region_2D  Frm_2_Inf(

          SliceO_Window * window,

          Region_2D reg_frm

) ;

 

 

Parameters

 

window

          Pointer to the window used for the conversion.

 

pos_frm

          2D point to convert from "Frm" space to "Inf" space.

 

reg_frm

          2D region to convert from "Frm" space to "Inf" space.

 

 

Return value

 

This method return either a transformed 2D point or a 2D region depending on its arguments.

 

 

Remarks

 

The transformation is computed by:

·Scaling each coordinates by the current scaling factor for the desired window.

·Scaling the "y" coordinate by the pixel aspect ratio.

·Adding the origin of the frame in "Inf" space to the coordinates.

 

 

// ----------------------------------------------------------------------------

//

//          Frm_2_Inf()

//

//          param:          window (SliceO_Window *)   The curent window

//                    pos_frm (Point_2D)          The position in "Frm" space

//

//          return:          (Point_2D)          new coord in "Inf" space

//

// ----------------------------------------------------------------------------

Point_2D          SliceO_Frame::Frm_2_Inf( SliceO_Window *window, Point_2D pos_frm )

{

Point_2D    off_inf( COORD_INF ) ;

 

          off_inf.Set( pos_frm.x *  m_scale[window->Id_Get()][window->Mode_Get()],

                         pos_frm.y * (m_scale[window->Id_Get()][window->Mode_Get()] * m_ratio) ) ;

 

          Region_2D   reg_inf = Inside_Get( window ) ;

          Point_2D    pos_inf = reg_inf.Get_Min() + off_inf ;

 

          return( pos_inf ) ;

}

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

 

 

See also

 

The Coordinate Systems