SliceO_Window::Wnd_2_Inf

 

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

 

 

Syntax

 

Point_2D  Wnd_2_Inf(

          Point_2D pos_wnd

) ;

 

Region_2D  Wnd_2_Inf(

          Region_2D reg_wnd

) ;

 

 

Parameters

 

pos_wnd

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

 

reg_wnd

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

·Inversing the vertical coordinates

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

 

 

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

//

//          Wnd_2_Inf()

//

//          param:          pos_wnd (Point_2D)          The position in "Wnd" space

//

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

//

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

Point_2D  SliceO_Window::Wnd_2_Inf( Point_2D pos_wnd )

{

Point_2D pos_inf( COORD_INF ) ;

 

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

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

 

          // --- just add the current slider values ---

          pos_inf.Set(   pos_wnd.x + val_x,

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

 

          return( pos_inf ) ;

}

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

 

 

See also

 

The Coordinate Systems