Class Reference

DK_ScreenMap

DK_ScreenMap maps ortho space to screen space, taking the zoom factor into account. Screen space is measured from the origin of the window pane. You need to use this class directly only if you are creating your own subclasses of DK_Canvas.

You can use the following accessors for the private data:

const DK_IRect2& getScreenRect( void ) 
                   const { return _screenRect;}
const DK_Rect2&  getOrthoRect ( void ) 
                   const { return _orthoRect; }

Constructors

DK_ScreenMap( void ) {}
DK_ScreenMap( const DK_IRect2&, 
              const DK_Rect2& );
DK_ScreenMap( const DK_ScreenMap& );
Creates a screen map. The first form creates a null screen map. The second form creates a screen map that maps the second rectangle (the area of the image to be displayed) to the first rectangle (the size of the canvas in pixels). The third form creates a new screen map based on the specified one.

setScreenRect

void setScreenRect( const DK_IRect2& r ) 
                              { _screenRect=r; }
Sets the size of a rectangle in screen space in pixels. The DK_ScreenMap object updates to map the current ortho rectangle to the new screen rectangle.

setOrthoRect

void setOrthoRect ( const DK_Rect2&  r ) 
                              { _orthoRect=r;  }
Sets the size of a rectangle in ortho space. The DK_ScreenMap object updates to map the current screen rectangle to the new ortho rectangle.

getScreenRect

const DK_IRect2& getScreenRect( void ) 
                   const { return _screenRect; }
Returns the size of the canvas in pixels.

getOrthoRect

const DK_Rect2&  getOrthoRect ( void ) 
                   const { return _orthoRect;  }
Returns the area of the image to be displayed.

orthoToScreen

DK_IVector2 
      orthoToScreen( const DK_Vector2&  ) const;
Maps a position in ortho space to screen space and returns the result.

screenToOrtho

DK_Vector2  
      screenToOrtho( const DK_IVector2& ) const;
Maps a position in screen space to ortho space and returns the result.

getZoomFactor

DK_Vector2 getZoomFactor( void ) const;
Calculates the zoom factor, going from screen space to ortho space.

Constructors
setScreenRect
setOrthoRect
getScreenRect
getOrthoRect
orthoToScreen
screenToOrtho
getZoomFactor

SOFTIMAGE Eddie 3.5 - 10 JAN 1997