ZoomWindow Class Reference

This class is used to enable zoom feature. More...

#include <zoomwindow.h>

List of all members.

Public Member Functions

 ZoomWindow (const QRect &rect)
 Constructor using a QRect.
 ~ZoomWindow ()
 Destructor.
 operator QRect () const
 Conversion to a QRect.
bool zoom (float factor, float centerX, float centerY)
 Zooms the width and the height of the rectangle by factor and center it on the specified center (centerX, centerY).
bool zoom (float factor, const QPoint &center)
 This is an overloaded member function, provided for convenience.
bool zoom (int firstClickX, int firstClickY, int secondClickX, int secondClickY)
 Zooms on the rectangle specified by two diagonal points (firstClickX,firstClickY) and (secondClickX,secondClickY).
bool zoom (QPoint firstPoint, QPoint secondPoint)
 This is an overloaded member function, provided for convenience.
void reset ()
 Resets the zoomWindow to its initialize state.
 ZoomWindow (const QRect &rect)
 Constructor using a QRect.
 ~ZoomWindow ()
 Destructor.
 operator QRect () const
 Conversion to a QRect.
bool zoom (float factor, float centerX, float centerY)
 Zooms the width and the height of the rectangle by factor and center it on the specified center (centerX, centerY).
bool zoom (float factor, const QPoint &center)
 This is an overloaded member function, provided for convenience.
bool zoom (int firstClickX, int firstClickY, int secondClickX, int secondClickY)
 Zooms on the rectangle specified by two diagonal points (firstClickX,firstClickY) and (secondClickX,secondClickY).
bool zoom (QPoint firstPoint, QPoint secondPoint)
 This is an overloaded member function, provided for convenience.
void reset ()
 Resets the zoomWindow to its initialize state.

Protected Member Functions

void correctWindow ()
 Make sure that the new window remains inside the intial boundaries.
void correctWindow ()
 Make sure that the new window remains inside the intial boundaries.


Detailed Description

This class is used to enable zoom feature.

It computes the dimensions of the QRect (the window of a Qframe) corresponding to the part of the drawing which will actually be drawn onto the widget. The calculs are made in world coordinates system (the drawing coordinates system).

Author:
Lynn Hazan


Constructor & Destructor Documentation

ZoomWindow::ZoomWindow ( const QRect &  rect  ) 

Constructor using a QRect.

Parameters:
rect initial rectangle.

ZoomWindow::ZoomWindow ( const QRect &  rect  ) 

Constructor using a QRect.

Parameters:
rect initial rectangle.


Member Function Documentation

bool ZoomWindow::zoom ( float  factor,
float  centerX,
float  centerY 
)

Zooms the width and the height of the rectangle by factor and center it on the specified center (centerX, centerY).

Parameters:
factor zoom factor
centerX absciss of the center point for the newly zoomed rectangle
centerY ordinate of the center point for the newly zoomed rectangle
Returns:
boolean indicating if the zoom has been done

bool ZoomWindow::zoom ( float  factor,
const QPoint &  center 
) [inline]

This is an overloaded member function, provided for convenience.

It behaves essentially like the above function. Zoom the rectangle by factor and center it on center.

Parameters:
factor zoom factor
center center point for the newly zoomed rectangle
Returns:
boolean indicating if the zoom has been done

bool ZoomWindow::zoom ( int  firstClickX,
int  firstClickY,
int  secondClickX,
int  secondClickY 
)

Zooms on the rectangle specified by two diagonal points (firstClickX,firstClickY) and (secondClickX,secondClickY).

Parameters:
firstClickX absciss of the first selected point
firstClickY ordinate of the first selected point
secondClickX absciss of the second selected point
secondClickY ordinate of the first selected point
Returns:
boolean indicating if the zoom has been done

bool ZoomWindow::zoom ( QPoint  firstPoint,
QPoint  secondPoint 
) [inline]

This is an overloaded member function, provided for convenience.

It behaves essentially like the above function. Zoom on the rectangle specified by two diagonal points firstPoint and secondPoint.

Parameters:
firstPoint Qpoint of the first selected point
secondPoint Qpoint of the first selected point
Returns:
boolean indicating if the zoom has been done

bool ZoomWindow::zoom ( float  factor,
float  centerX,
float  centerY 
)

Zooms the width and the height of the rectangle by factor and center it on the specified center (centerX, centerY).

Parameters:
factor zoom factor
centerX absciss of the center point for the newly zoomed rectangle
centerY ordinate of the center point for the newly zoomed rectangle
Returns:
boolean indicating if the zoom has been done

bool ZoomWindow::zoom ( float  factor,
const QPoint &  center 
) [inline]

This is an overloaded member function, provided for convenience.

It behaves essentially like the above function. Zoom the rectangle by factor and center it on center.

Parameters:
factor zoom factor
center center point for the newly zoomed rectangle
Returns:
boolean indicating if the zoom has been done

bool ZoomWindow::zoom ( int  firstClickX,
int  firstClickY,
int  secondClickX,
int  secondClickY 
)

Zooms on the rectangle specified by two diagonal points (firstClickX,firstClickY) and (secondClickX,secondClickY).

Parameters:
firstClickX absciss of the first selected point
firstClickY ordinate of the first selected point
secondClickX absciss of the second selected point
secondClickY ordinate of the first selected point
Returns:
boolean indicating if the zoom has been done

bool ZoomWindow::zoom ( QPoint  firstPoint,
QPoint  secondPoint 
) [inline]

This is an overloaded member function, provided for convenience.

It behaves essentially like the above function. Zoom on the rectangle specified by two diagonal points firstPoint and secondPoint.

Parameters:
firstPoint Qpoint of the first selected point
secondPoint Qpoint of the first selected point
Returns:
boolean indicating if the zoom has been done


The documentation for this class was generated from the following files:
Generated on Mon Sep 17 20:47:35 2007 for NeuroScope by  doxygen 1.5.1