papyrus logo

Papyrus::Translator Class Reference

#include <translator.h>

Inheritance diagram for Papyrus::Translator:
Inheritance graph
[legend]

List of all members.

Public Types

typedef PapyrusPointer
< Translator
pointer

Public Member Functions

virtual ~Translator ()
unsigned transforms ()
void set_transforms (unsigned transforms)
void enable_transforms (unsigned transforms)
void disable_transforms (unsigned transforms)
void grid (double &x, double &y)
 Gets the current grid size.
void set_grid (double x, double y)
 Sets the grid x and y sizes.
void set_grid_x (double x)
void set_grid_y (double y)

Static Public Member Functions

static Translator::pointer create (unsigned transforms=TRANSLATE_X|TRANSLATE_Y)
static Translator::pointer create (const Glib::ustring &id, DrawableSet::pointer drawables, unsigned transforms=TRANSLATE_X|TRANSLATE_Y)
static Translator::pointer create (const Glib::ustring &id, unsigned transforms=TRANSLATE_X|TRANSLATE_Y)
static Translator::pointer create (DrawableSet::pointer drawables, unsigned transforms=TRANSLATE_X|TRANSLATE_Y)

Protected Member Functions

 Translator (const Glib::ustring &id, DrawableSet::pointer drawables, unsigned transforms=TRANSLATE_X|TRANSLATE_Y)
virtual bool on_motion (const Event::Motion &event)
virtual bool on_button_press (const Event::ButtonPress &event)

Protected Attributes

double m_last_position [2]
double m_original_position [2]
unsigned m_transforms
double m_grid [2]

Detailed Description

Author:
Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>

Member Typedef Documentation

typedef PapyrusPointer<Translator> Papyrus::Translator::pointer

Reimplemented from Papyrus::AffineController.


Constructor & Destructor Documentation

Papyrus::Translator::Translator ( const Glib::ustring &  id,
DrawableSet::pointer  drawables,
unsigned  transforms = TRANSLATE_X|TRANSLATE_Y 
) [protected]
Papyrus::Translator::~Translator (  )  [virtual]

Member Function Documentation

Translator::pointer Papyrus::Translator::create ( DrawableSet::pointer  drawables,
unsigned  transforms = TRANSLATE_X|TRANSLATE_Y 
) [static]

References PAPYRUS_CREATE.

Translator::pointer Papyrus::Translator::create ( const Glib::ustring &  id,
unsigned  transforms = TRANSLATE_X|TRANSLATE_Y 
) [static]

References PAPYRUS_CREATE.

Translator::pointer Papyrus::Translator::create ( const Glib::ustring &  id,
DrawableSet::pointer  drawables,
unsigned  transforms = TRANSLATE_X|TRANSLATE_Y 
) [static]

References PAPYRUS_CREATE.

Translator::pointer Papyrus::Translator::create ( unsigned  transforms = TRANSLATE_X|TRANSLATE_Y  )  [static]

References PAPYRUS_CREATE.

void Papyrus::Translator::disable_transforms ( unsigned  transforms  ) 

References m_transforms.

void Papyrus::Translator::enable_transforms ( unsigned  transforms  ) 

References m_transforms.

void Papyrus::Translator::grid ( double &  x,
double &  y 
)

Gets the current grid size.

References m_grid.

bool Papyrus::Translator::on_button_press ( const Event::ButtonPress event  )  [protected, virtual]

Reimplemented from Papyrus::Controller.

References m_last_position, and m_original_position.

bool Papyrus::Translator::on_motion ( const Event::Motion event  )  [protected, virtual]
void Papyrus::Translator::set_grid ( double  x,
double  y 
)

Sets the grid x and y sizes.

If either is <= 0.0 then the grid will be turned off for that dimension.

References m_grid.

void Papyrus::Translator::set_grid_x ( double  x  ) 

References m_grid.

void Papyrus::Translator::set_grid_y ( double  y  ) 

References m_grid.

void Papyrus::Translator::set_transforms ( unsigned  transforms  ) 

References m_transforms.

unsigned Papyrus::Translator::transforms (  ) 

References m_transforms.


Member Data Documentation

double Papyrus::Translator::m_grid[2] [protected]
double Papyrus::Translator::m_last_position[2] [protected]

Referenced by on_button_press(), and on_motion().

Referenced by on_button_press(), and Translator().

unsigned Papyrus::Translator::m_transforms [protected]

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

Generated on Fri Apr 16 12:41:09 2010 for papyrus by doxygen 1.6.1