
Class Reference
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; }
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.
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.
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.
const DK_IRect2& getScreenRect( void )
const { return _screenRect; }
Returns the size of the canvas in pixels.
const DK_Rect2& getOrthoRect ( void )
const { return _orthoRect; }
Returns the area of the image to be displayed.
DK_IVector2
orthoToScreen( const DK_Vector2& ) const;
Maps a position in ortho space to screen space and returns the result.
DK_Vector2
screenToOrtho( const DK_IVector2& ) const;
Maps a position in screen space to ortho space and returns the result.DK_Vector2 getZoomFactor( void ) const;Calculates the zoom factor, going from screen space to ortho space.
