# ipeqt::TransformTool Class Reference
[Ipe Qt canvas]

A tool for transforming the selected objects on the canvas. More...

`#include <ipetool.h>`

Inherits ipeqt::Tool.

List of all members.

## Public Types

- enum TType { ETranslate, EScale, EStretch, ERotate }

## Public Member Functions

- TransformTool (Canvas *canvas, Page *page, int view, TType type, bool withShift)
- bool isValid () const
- virtual void draw (Painter &painter) const
- virtual void mouseButton (int button, bool press)
- virtual void mouseMove (int button)
- virtual void report ()

## Protected Member Functions

- void compute (const Vector &v)

## Protected Attributes

- Page * iPage
- int iView
- TType iType
- bool iWithShift
- bool iOnlyHorizontal
- bool iOnlyVertical
- Vector iMouseDown
- Matrix iTransform
- Vector iOrigin
- bool iValid

## Detailed Description

A tool for transforming the selected objects on the canvas.

Supports moving, rotating, scaling, and stretching.

## Member Enumeration Documentation

enum ipeqt::TransformTool::TType

Enumerator:

  ETranslate |
  EScale |
  EStretch |
  ERotate |

## Constructor & Destructor Documentation

TransformTool::TransformTool | ( | Canvas * | canvas,
|  | Page * | page,
|  | int | view,
|  | TType | type,
|  | bool | withShift |
| ) |  |  |

Constructor starts transformation.

After constructing a TransformTool, you must call isValid() to ensure that the transformation can be performed.

A transformation can fail because the selection contains pinned objects, or because the initial mouse position is identical to the transformation origin.

## Member Function Documentation

bool TransformTool::isValid | ( |  | ) | const

Check that the transformation can be performed.

void TransformTool::draw | ( | Painter & | painter | ) | const`[virtual]`

Implements ipeqt::Tool.

void TransformTool::mouseButton | ( | int | button,
|  | bool | press |
| ) |  |  | `[virtual]`

Reimplemented from ipeqt::Tool.

void TransformTool::mouseMove | ( | int | button | ) | `[virtual]`

Reimplemented from ipeqt::Tool.

void TransformTool::report | ( |  | ) | `[virtual]`

Report the final transformation chosen.

The implementation in TransformTool does nothing. Derived classes should reimplement report().

void TransformTool::compute | ( | const Vector & | v | ) | `[protected]`

## Member Data Documentation

Page* ipeqt::TransformTool::iPage`[protected]`

int ipeqt::TransformTool::iView`[protected]`

TType ipeqt::TransformTool::iType`[protected]`

bool ipeqt::TransformTool::iWithShift`[protected]`

bool ipeqt::TransformTool::iOnlyHorizontal`[protected]`

bool ipeqt::TransformTool::iOnlyVertical`[protected]`

Vector ipeqt::TransformTool::iMouseDown`[protected]`

Matrix ipeqt::TransformTool::iTransform`[protected]`

Vector ipeqt::TransformTool::iOrigin`[protected]`

bool ipeqt::TransformTool::iValid`[protected]`

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

- ipetool.h
- ipetool.cpp