SliceO_Window::Inf_2_Wnd

 

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

 

 

Syntax

 

Point_2D  Inf_2_Wnd(

          Point_2D pos_inf

) ;

 

Region_2D  Inf_2_Wnd(

          Region_2D reg_inf

) ;

 

 

Parameters

 

pos_inf

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

 

reg_inf

          2D region to convert from "Inf" space to "Wnd" 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:

·Substracting the "val_x" and "val_y" slider values from horizontal and vertical the infinite coordinates.

·Inversing the vertical coordinates

 

 

//

//          Inf_2_Wnd()

//

//          param:          pos_inf (Point_2D)          The position in "Inf" space

//

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

//

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

Point_2D  SliceO_Window::Inf_2_Wnd( Point_2D pos_inf )

{

Point_2D    pos_wnd( COORD_WND ) ;

 

int          val_x = (int) (this->val_x.Cur_Value) ;

int          val_y = (int) (this->val_y.Cur_Value) ;

 

          // --- just remove the current slider values ---

          pos_wnd.Set(   pos_inf.x - val_x,

            (m_dim_y) - (pos_inf.y - val_y) ) ;

 

          return( pos_wnd ) ;

}

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

 

 

See also

 

The Coordinate Systems