Rectangle Class Reference

A type of PDF annotation: a rectangular region selected for further processing (for example, OCR). More...

#include <rectangle.h>

List of all members.

Public Types

enum  { Type = UserType + 1 }
enum  ResizeHandleIdx {
  RH_NONE, RH_TOP_LEFT, RH_TOP_RIGHT, RH_BOTTOM_RIGHT,
  RH_BOTTOM_LEFT
}

Public Member Functions

 Rectangle (qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent=0)
int type () const
ResizeHandleIdx handleAt (QPointF pos)
void startResize ()
void resize (ResizeHandleIdx hidx, QPointF pos)
void rotate (bool clockwise)
int handleWidth ()
double actualWidth ()
double actualHeight ()
QRectF boundingRect () const
void resizeDone ()
void buttonDown (QPointF scenePos)
 Inform this item that the mouse was clicked at the given position.
QPointF buttonDownPos ()
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 If selected, overlay the resize handle images.

Protected Member Functions

virtual QRectF innerBoundingRect () const

Protected Attributes

QPointF m_buttonDownPos
 Last position given to buttonDown(), mapped to item coord system.

Static Protected Attributes

static QPixmap * resizeHandle


Detailed Description

A type of PDF annotation: a rectangular region selected for further processing (for example, OCR).

It can be dragged to size, moved around, selected, and later resized by dragging the corner handles.

Definition at line 13 of file rectangle.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
Type 

Definition at line 19 of file rectangle.h.

Enumerator:
RH_NONE 
RH_TOP_LEFT 
RH_TOP_RIGHT 
RH_BOTTOM_RIGHT 
RH_BOTTOM_LEFT 

Definition at line 22 of file rectangle.h.


Constructor & Destructor Documentation

Rectangle::Rectangle ( qreal  x,
qreal  y,
qreal  width,
qreal  height,
QGraphicsItem *  parent = 0 
)

Definition at line 10 of file rectangle.cpp.


Member Function Documentation

double Rectangle::actualHeight (  ) 

double Rectangle::actualWidth (  ) 

QRectF Rectangle::boundingRect (  )  const

Definition at line 16 of file rectangle.cpp.

References HANDLE_MARGIN.

Referenced by innerBoundingRect(), paint(), and resize().

Here is the caller graph for this function:

void Rectangle::buttonDown ( QPointF  scenePos  ) 

Inform this item that the mouse was clicked at the given position.

Will remember buttonDownPos in its own coord system for later use while dragging.

Definition at line 108 of file rectangle.cpp.

References m_buttonDownPos.

QPointF Rectangle::buttonDownPos (  )  [inline]

Definition at line 52 of file rectangle.h.

References m_buttonDownPos.

Referenced by SelectTool::mouseMoveEvent().

Here is the caller graph for this function:

Rectangle::ResizeHandleIdx Rectangle::handleAt ( QPointF  pos  ) 

Definition at line 60 of file rectangle.cpp.

References HANDLE_VIRTUAL_SIZE, innerBoundingRect(), RH_BOTTOM_LEFT, RH_BOTTOM_RIGHT, RH_NONE, RH_TOP_LEFT, and RH_TOP_RIGHT.

Referenced by SelectTool::mousePressEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

int Rectangle::handleWidth (  ) 

Definition at line 81 of file rectangle.cpp.

References resizeHandle.

Referenced by paint().

Here is the caller graph for this function:

QRectF Rectangle::innerBoundingRect (  )  const [protected, virtual]

Definition at line 26 of file rectangle.cpp.

References boundingRect().

Referenced by handleAt().

Here is the call graph for this function:

Here is the caller graph for this function:

void Rectangle::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)

If selected, overlay the resize handle images.

Definition at line 88 of file rectangle.cpp.

References boundingRect(), handleWidth(), and resizeHandle.

Here is the call graph for this function:

void Rectangle::resize ( ResizeHandleIdx  hidx,
QPointF  pos 
)

Definition at line 31 of file rectangle.cpp.

References boundingRect(), RH_BOTTOM_LEFT, RH_BOTTOM_RIGHT, RH_TOP_LEFT, and RH_TOP_RIGHT.

Referenced by SelectTool::mouseMoveEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

void Rectangle::resizeDone (  ) 

Definition at line 55 of file rectangle.cpp.

Referenced by SelectTool::mouseReleaseEvent().

Here is the caller graph for this function:

void Rectangle::rotate ( bool  clockwise  ) 

void Rectangle::startResize (  ) 

int Rectangle::type (  )  const [inline]

Definition at line 20 of file rectangle.h.

References Type.


Member Data Documentation

QPointF Rectangle::m_buttonDownPos [protected]

Last position given to buttonDown(), mapped to item coord system.

Definition at line 68 of file rectangle.h.

Referenced by buttonDown(), and buttonDownPos().

QPixmap * Rectangle::resizeHandle [static, protected]

Definition at line 69 of file rectangle.h.

Referenced by handleWidth(), and paint().


The documentation for this class was generated from the following files:

Generated on Tue Sep 8 15:09:49 2009 for Taborca by  doxygen 1.5.8