• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kviewshell

GRectMapper Class Reference

Maps points from one rectangle to another rectangle. More...

#include <GRect.h>

List of all members.


Public Member Functions

void clear ()
GRect get_input ()
GRect get_output ()
 GRectMapper ()
void map (GRect &rect)
void map (int &x, int &y)
void mirrorx ()
void mirrory ()
void rotate (int count=1)
void set_input (const GRect &rect)
void set_output (const GRect &rect)
void unmap (GRect &rect)
void unmap (int &x, int &y)

Friends

int operator* (int n, GRatio r)
int operator/ (int n, GRatio r)

Detailed Description

Maps points from one rectangle to another rectangle.

This class represents a relation between the points of two rectangles. Given the coordinates of a point in the first rectangle (input rectangle), function {map} computes the coordinates of the corresponding point in the second rectangle (the output rectangle). This function actually implements an affine transform which maps the corners of the first rectangle onto the matching corners of the second rectangle. The scaling operation is performed using integer fraction arithmetic in order to maximize accuracy.

Definition at line 263 of file GRect.h.


Constructor & Destructor Documentation

GRectMapper::GRectMapper (  ) 

Constructs a rectangle mapper.

Definition at line 292 of file GRect.cpp.


Member Function Documentation

void GRectMapper::clear ( void   ) 

Resets the rectangle mapper state.

Both the input rectangle and the output rectangle are marked as undefined.

Definition at line 301 of file GRect.cpp.

GRect GRectMapper::get_input (  ) 

Returns the input rectangle.

Definition at line 441 of file GRect.cpp.

GRect GRectMapper::get_output (  ) 

Returns the output rectangle.

Definition at line 447 of file GRect.cpp.

void GRectMapper::map ( GRect &  rect  ) 

Maps a rectangle according to the affine transform.

This operation consists in mapping the rectangle corners and reordering the corners in the canonical rectangle representation. Variable rect# is overwritten with the new rectangle coordinates.

Definition at line 419 of file GRect.cpp.

void GRectMapper::map ( int &  x,
int &  y 
)

Maps a point according to the affine transform.

Variables x# and y# initially contain the coordinates of a point. This operation overwrites these variables with the coordinates of a second point located in the same position relative to the corners of the output rectangle as the first point relative to the matching corners of the input rectangle. Coordinates are rounded to the nearest integer.

Definition at line 379 of file GRect.cpp.

void GRectMapper::mirrorx (  ) 

Composes the affine transform with a symmetry with respect to the vertical line crossing the center of the output rectangle.

This operation essentially is a modification of the match between the corners of the input rectangle and the corners of the output rectangle.

Definition at line 358 of file GRect.cpp.

void GRectMapper::mirrory (  ) 

Composes the affine transform with a symmetry with respect to the horizontal line crossing the center of the output rectangle.

This operation essentially is a modification of the match between the corners of the input rectangle and the corners of the output rectangle.

Definition at line 364 of file GRect.cpp.

void GRectMapper::rotate ( int  count = 1  ) 

Composes the affine transform with a rotation of count# quarter turns counter-clockwise.

This operation essentially is a modification of the match between the corners of the input rectangle and the corners of the output rectangle.

Definition at line 332 of file GRect.cpp.

void GRectMapper::set_input ( const GRect &  rect  ) 

Sets the input rectangle.

Definition at line 309 of file GRect.cpp.

void GRectMapper::set_output ( const GRect &  rect  ) 

Sets the output rectangle.

Definition at line 323 of file GRect.cpp.

void GRectMapper::unmap ( GRect &  rect  ) 

Maps a rectangle according to the inverse of the affine transform.

This operation consists in mapping the rectangle corners and reordering the corners in the canonical rectangle representation. Variable rect# is overwritten with the new rectangle coordinates.

Definition at line 430 of file GRect.cpp.

void GRectMapper::unmap ( int &  x,
int &  y 
)

Maps a point according to the inverse of the affine transform.

Variables x# and y# initially contain the coordinates of a point. This operation overwrites these variables with the coordinates of a second point located in the same position relative to the corners of input rectangle as the first point relative to the matching corners of the input rectangle. Coordinates are rounded to the nearest integer.

Definition at line 399 of file GRect.cpp.


Friends And Related Function Documentation

int operator* ( int  n,
GRectMapper::GRatio  r 
) [friend]

Definition at line 260 of file GRect.cpp.

int operator/ ( int  n,
GRectMapper::GRatio  r 
) [friend]

Definition at line 274 of file GRect.cpp.


The documentation for this class was generated from the following files:
  • GRect.h
  • GRect.cpp

kviewshell

Skip menu "kviewshell"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kviewshell
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal