Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

FigureEditor Class Reference

#include <FigureEditor.h>

Inheritance diagram for FigureEditor:

Inheritance graph
[legend]
Collaboration diagram for FigureEditor:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class implements additional QCanvasView functionality.

Attention:
This class knows about QCanvasItem objects. Any methods that need to know about classes derived from QCanvasItem that are not part of Qt should be implemented in a derived class.
The original source code was taken from $QTDIR/examples/canvas/canvas.h of version 3.0 of Qt.

Requests:
Move any attached text displays along with moved plotter display.

Requests:
For plots using pixmap, do not draw plot when resizing until mouse is release.

Todo:
Need ability to group and un-group items.

Todo:
add page by adding another standard size page (either A4 or US Letter depending on preferences set somewhere.

Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Sanket B. Malde <sanket@stanford.edu>

Engineers at Trolltech who wrote examples/canvas

Definition at line 64 of file FigureEditor.h.

Public Member Functions

void add (QCanvasItem *item)
 Adds the item to the canvas.
void addPage ()
 Adds a page to the canvas.
void addSelectedItem (QCanvasItem *item)
 Add an item to the selected list.
 canvas () const
void clear ()
 Removes all items from canvas and destroy them.
 drawContents (QPainter *p, int cx, int cy, int cw, int ch)
void ensureVisible (const QCanvasItem *item)
 Scrolls the canvas, if needed, so the QCanvasItem item is visible.
 FigureEditor (QCanvas *, QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
 The constructor.
std::vector< QCanvasItem * > & getSelectedItems ()
 Return the vector of selected items.
bool getZoomMode () const
 Returns the bool indicating whether zoom mode is enabled or not.
 inverseWorldMatrix () const
bool isSingleItemSelected () const
 Returns true if just one item is selected, else returns false.
void paste (QCanvasItem *item)
 Adds the item to the canvas.
void placeGraph (QCanvasRectangle *)
 Moves the QCanvasRectangle object to place on the canvas where it will not collide with existing QCanvasItem object and not be off the usable page area.
virtual void print (const std::string &filename)
 Prints the view to Postscript file filename.
virtual void print ()
 Prints the view to the printer.
void remove (QCanvasItem *item)
 Removes the item from the canvas and destroys it.
void removeSelectedItem (QCanvasItem *item)
 Removes an item from the selection list.
void resizeEvent (QResizeEvent *e)
 Resizes the QCanvas in response to parent window receiving QResizeEvent.
void scaleBy (double factor)
 Scales the size of the images by factor.
QCanvasItemselectedItem () const
 Returns the selected QCanvasItem.
void setAllSelected (bool flag=true)
 Sets selection flag on all QCanvasItem objects.
 setCanvas (QCanvas *canvas)
void setLocked (bool flag)
 Sets the selected QCanvasItem to be locked in size and position.
void setPrinterSettings ()
 Set the default printer settings.
void setSelectedFlags ()
 Set the selected flags.
void setSelectedItem (QCanvasItem *)
 Set the selected QCanvasItem.
 setWorldMatrix (const QWMatrix &wm)
void setZoomMode (bool flag)
 Sets the zoom mode to flag.
void showPrinterMargins (bool on)
 Sets showing the printer margins on or off.
 sizeHint () const
virtual void viewShowPickTable ()=0
 Show the pick table.
void viewZoomIn ()
 Enlarges the view of the canvas.
void viewZoomOut ()
 Reduces the view of the canvas.
void viewZoomReset ()
 Returns the view to normal size.
 worldMatrix () const

Static Public Member Functions

static void setAppKey (const std::string &)
 Sets the QSettings application key.

Protected Types

enum  Location {
  none, invalid, upper_left, upper_middle,
  upper_right, middle_left, middle_right, lower_left,
  lower_middle, lower_right
}
 Possible locations where on a QCanvasItem the mouse cursor was when clicked. More...

Protected Member Functions

void addPageMargin (int x, int y)
 Adds page margin.
void calcPrinterMetrics ()
 Calculate the size of a page by using the printer metrics.
void clearSelectedList ()
 De-selects all items, making the selection list empty.
void contentsMouseMoveEvent (QMouseEvent *, double aspect)
 Moves or resizes the selected QCanvasItem object.
virtual void contentsMousePressEvent (QMouseEvent *)
virtual void controlMousePressEvent ()=0
 Handles details of mouse press event with shift key pressed.
QRect getSelectedBounds () const
 Returns a QRect that enclosed the selected QCanvasItem objects.
void initPrinter ()
 Initializes the printer settings from the saved settings.
double maximumZ () const
 Returns the largest Z value of all the items on the canvas.
virtual void notifyObservers ()=0
 Notifies Observer objects, if any, that something has changed.
void placeGraphOnSelected (QCanvasRectangle *item)
 Adds the item on top of the currently selected item.
void print (QPrinter *printer)
 Prints the view to the printer.
void removeFromItemList (QCanvasItem *item)
 Removes the item from list of items on the canvas.
void resizeCanvasToFit (QCanvasItem *item)
 Resizes the canvas if necessary so that the item is on the canvas.
void saveAreaAsPixmap (const QRect &area, const std::string &filename)
 Saves the area area as pixmap to file filename.
void savePrinterSettings ()
 Saves the printer setting with QSettings.
void saveSelectedAsPixmap (const std::string &filename)
 Save the selected objects as Pixmap image file filename.
void setCollidingSelected (const QCanvasItem *target)
 Sets all QCanvasItems that collide with target to selected state.
void setSelectedItems (bool state)
 Sets the selected items to selection state state.
void setUnselectedVisible (bool yes)
 Sets the unselected items to visible or not.
void whereClicked ()
 Finds which knob on the selected item was clicked.

Protected Attributes

int m_apage_h
 The actual Page height in Postscript points.
int m_apage_w
 The actual Page width in Postscript points.
QCanvasm_canvas
 The canvas object.
std::vector< QCanvasItem * > m_items
 The list of view items on the canvas.
bool m_printer_bounds
 A flag to indicate if rectangle display usable printer boundary should be displayed or not.
double m_scale_factor
 The scale factor.
std::vector< QCanvasItem * > m_selected_list
 The list of currently selected QCanvasItem objects.
int m_upage_h
 The usable Page height in Postscript points.
int m_upage_w
 The usable Page width in Postscript points.
Location m_whereClicked
 Location where the mouse cursor clicked the object.
bool m_zoom_mode
 Set to true if zoom Mode is enabled.
QPoint moving_start
 The starting point of a mouse drag.
QPoint zoom_start
 The starting point of a mouse drag.for zoom.

Static Protected Attributes

static QString s_app_key
 The QSettings application key for searching for setting.
static QPrinters_printer = 0
 The single QPrinter instance.
static QString s_registry
 The QSettings Windows registry key.


Member Enumeration Documentation

enum FigureEditor::Location [protected]
 

Possible locations where on a QCanvasItem the mouse cursor was when clicked.

Enumerator:
none 
invalid 
upper_left 
upper_middle 
upper_right 
middle_left 
middle_right 
lower_left 
lower_middle 
lower_right 

Definition at line 191 of file FigureEditor.h.


Constructor & Destructor Documentation

FigureEditor::FigureEditor QCanvas ,
QWidget parent = 0,
const char *  name = 0,
Qt::WFlags  f = 0
 

The constructor.

Definition at line 89 of file FigureEditor.cxx.

References QSettings::insertSearchPath(), and QSettings::readNumEntry().


Member Function Documentation

void FigureEditor::add QCanvasItem item  ) 
 

Adds the item to the canvas.

Expands the canvas' size if necessary.

Definition at line 1373 of file FigureEditor.cxx.

Referenced by CanvasView::addView(), and CanvasView::initFrom().

void FigureEditor::addPage  ) 
 

Adds a page to the canvas.

Definition at line 1590 of file FigureEditor.cxx.

References addPageMargin(), QCanvas::height(), m_apage_h, m_canvas, QCanvas::resize(), and QCanvas::width().

Referenced by CanvasWindow::viewAddPage().

void FigureEditor::addPageMargin int  x,
int  y
[protected]
 

Adds page margin.

Adds an indication of the page's margin. Only the contents inside the margin is printable.

Definition at line 221 of file FigureEditor.cxx.

References m_apage_h, m_apage_w, m_canvas, m_printer_bounds, m_upage_h, and m_upage_w.

Referenced by addPage(), and showPrinterMargins().

void FigureEditor::addSelectedItem QCanvasItem item  ) 
 

Add an item to the selected list.

Definition at line 333 of file FigureEditor.cxx.

Referenced by contentsMousePressEvent(), CanvasView::pasteViews(), and setSelectedItem().

void FigureEditor::calcPrinterMetrics  )  [protected]
 

Calculate the size of a page by using the printer metrics.

The size of a printable page is calculated on the basis that one pixel will become one Postscript point. A QPaintDeviceMetrics object is created to find the actual and usable size of a page in millimeters which is then converted to Postscript Points.

Definition at line 251 of file FigureEditor.cxx.

References QSize::height(), QString::isNull(), m_apage_h, m_apage_w, m_upage_h, m_upage_w, QPrinter::printerName(), s_printer, std::swap(), and QSize::width().

Referenced by print().

void FigureEditor::clear  ) 
 

Removes all items from canvas and destroy them.

Reimplemented in CanvasView.

Definition at line 863 of file FigureEditor.cxx.

References m_items, and m_selected_list.

Referenced by CanvasView::clear().

void FigureEditor::clearSelectedList  )  [protected]
 

De-selects all items, making the selection list empty.

Definition at line 478 of file FigureEditor.cxx.

References m_selected_list, and setSelectedItems().

Referenced by CanvasView::pasteViews().

void FigureEditor::contentsMouseMoveEvent QMouseEvent ,
double  aspect
[protected]
 

Moves or resizes the selected QCanvasItem object.

The is moved if one of its knobs was selected, otherwise, it is resized. If aspect is non zero, then keeps its aspect ratio is kept while resizing.

Definition at line 885 of file FigureEditor.cxx.

References std::abs(), QMouseEvent::button(), getZoomMode(), invalid, QCanvasView::inverseWorldMatrix(), isSingleItemSelected(), lower_left, lower_middle, lower_right, m_canvas, m_whereClicked, QStatusBar::message(), middle_left, middle_right, moving_start, none, QMouseEvent::pos(), selectedItem(), QtViewImp::setCrossX(), QtViewImp::setCrossY(), QApplication::setOverrideCursor(), QtView::setShowCrossHairs(), num_util::size(), QMouseEvent::state(), QCanvas::update(), QtView::update(), upper_left, upper_middle, upper_right, QPoint::x(), and QPoint::y().

Referenced by CanvasView::contentsMouseMoveEvent(), and contentsMousePressEvent().

void FigureEditor::contentsMousePressEvent QMouseEvent e  )  [protected, virtual]
 

Bug:
Ctrl and shift click do not select plots like Windows selects files.

Reimplemented in CanvasView.

Definition at line 655 of file FigureEditor.cxx.

References addSelectedItem(), QMouseEvent::button(), QCanvas::collisions(), contentsMouseMoveEvent(), controlMousePressEvent(), std::find(), QCanvasView::inverseWorldMatrix(), m_canvas, m_items, m_selected_list, moving_start, QMouseEvent::pos(), removeSelectedItem(), setSelectedFlags(), setSelectedItem(), QMouseEvent::state(), whereClicked(), and zoom_start.

Referenced by CanvasView::contentsMousePressEvent().

virtual void FigureEditor::controlMousePressEvent  )  [protected, pure virtual]
 

Handles details of mouse press event with shift key pressed.

Implemented in CanvasView.

Referenced by contentsMousePressEvent().

void FigureEditor::ensureVisible const QCanvasItem item  ) 
 

Scrolls the canvas, if needed, so the QCanvasItem item is visible.

Definition at line 555 of file FigureEditor.cxx.

References QCanvasItem::boundingRect(), and QRect::rect().

Referenced by CanvasView::addView().

QRect FigureEditor::getSelectedBounds  )  const [protected]
 

Returns a QRect that enclosed the selected QCanvasItem objects.

Definition at line 367 of file FigureEditor.cxx.

References m_selected_list.

Referenced by CanvasView::saveSelectedAsEps(), and saveSelectedAsPixmap().

std::vector< QCanvasItem * > & FigureEditor::getSelectedItems  ) 
 

Return the vector of selected items.

Definition at line 325 of file FigureEditor.cxx.

References m_selected_list.

Referenced by CanvasView::saveSelectedImages(), and setLocked().

bool FigureEditor::getZoomMode  )  const
 

Returns the bool indicating whether zoom mode is enabled or not.

Definition at line 1648 of file FigureEditor.cxx.

References m_zoom_mode.

Referenced by contentsMouseMoveEvent(), CanvasView::contentsMouseMoveEvent(), and CanvasView::contentsMouseReleaseEvent().

void FigureEditor::initPrinter  )  [protected]
 

Initializes the printer settings from the saved settings.

If setting have not been saved, set the default values.

Definition at line 124 of file FigureEditor.cxx.

References indexToOrientation, indexToPageSize, QSettings::insertSearchPath(), QSettings::readNumEntry(), s_app_key, s_printer, s_registry, QPrinter::setFullPage(), QPrinter::setOrientation(), QPrinter::setPageSize(), and num_util::size().

bool FigureEditor::isSingleItemSelected  )  const
 

Returns true if just one item is selected, else returns false.

Definition at line 296 of file FigureEditor.cxx.

References m_selected_list.

Referenced by contentsMouseMoveEvent(), CanvasView::contentsMouseMoveEvent(), CanvasView::contentsMouseReleaseEvent(), selectedItem(), CanvasView::viewShowPickTable(), and whereClicked().

double FigureEditor::maximumZ  )  const [protected]
 

Returns the largest Z value of all the items on the canvas.

Definition at line 394 of file FigureEditor.cxx.

References m_items, std::max(), and setUnselectedVisible().

Referenced by setSelectedItem().

virtual void FigureEditor::notifyObservers  )  [protected, pure virtual]
 

Notifies Observer objects, if any, that something has changed.

Implemented in CanvasView.

Referenced by setSelectedItem().

void FigureEditor::paste QCanvasItem item  ) 
 

Adds the item to the canvas.

This method differs from add in that it displaces the item by a fixed amount before adding.

Definition at line 1390 of file FigureEditor.cxx.

Referenced by CanvasView::pasteViews().

void FigureEditor::placeGraph QCanvasRectangle  ) 
 

Moves the QCanvasRectangle object to place on the canvas where it will not collide with existing QCanvasItem object and not be off the usable page area.

Definition at line 1313 of file FigureEditor.cxx.

References QRect::bottom(), and QRect::top().

Referenced by CanvasView::addFromPasteboard(), and CanvasView::addPlotDisplay().

void FigureEditor::placeGraphOnSelected QCanvasRectangle view  )  [protected]
 

Adds the item on top of the currently selected item.

Todo:
the rectangle of the a text display should be no bigger than necessary rather than the size of the rectangle of the selected.

Definition at line 626 of file FigureEditor.cxx.

References QRect::height(), QRect::width(), QRect::x(), and QRect::y().

void FigureEditor::print const std::string filename  )  [virtual]
 

Prints the view to Postscript file filename.

Reimplemented in CanvasView.

Definition at line 1526 of file FigureEditor.cxx.

References print(), and s_printer.

void FigureEditor::print  )  [virtual]
 

Prints the view to the printer.

Presents the Print dialog to user and then prints the view to the selected printer.

Reimplemented in CanvasView.

Definition at line 1516 of file FigureEditor.cxx.

References s_printer, and QPrinter::setup().

Referenced by print(), and CanvasView::print().

void FigureEditor::print QPrinter printer  )  [protected]
 

Prints the view to the printer.

Definition at line 1537 of file FigureEditor.cxx.

References QPainter::begin(), calcPrinterMetrics(), QCanvas::collisions(), QCanvas::drawArea(), QPainter::end(), m_apage_h, m_canvas, m_scale_factor, m_upage_h, m_upage_w, QPrinter::newPage(), QPainter::scale(), setSelectedItems(), and QPainter::translate().

void FigureEditor::remove QCanvasItem item  ) 
 

Removes the item from the canvas and destroys it.

Todo:
This function has a side effect of clearing the selection list, probably should not do that.

Definition at line 852 of file FigureEditor.cxx.

Referenced by CanvasView::deleteSelected(), CanvasView::removeDisplay(), and CanvasView::removeSelected().

void FigureEditor::removeFromItemList QCanvasItem item  )  [protected]
 

Removes the item from list of items on the canvas.

Definition at line 837 of file FigureEditor.cxx.

References std::remove().

Referenced by CanvasView::reTilePage().

void FigureEditor::removeSelectedItem QCanvasItem item  ) 
 

Removes an item from the selection list.

Definition at line 350 of file FigureEditor.cxx.

References QCanvasItem::isSelected(), and std::remove().

Referenced by contentsMousePressEvent().

void FigureEditor::resizeCanvasToFit QCanvasItem item  )  [protected]
 

Resizes the canvas if necessary so that the item is on the canvas.

Changes the height by one page size while keeping the width constant.

Definition at line 1410 of file FigureEditor.cxx.

References QRect::bottomRight().

void FigureEditor::resizeEvent QResizeEvent e  ) 
 

Resizes the QCanvas in response to parent window receiving QResizeEvent.

The QCanvas may grow in size, but is never made smaller by this method.

Definition at line 1575 of file FigureEditor.cxx.

References QCanvas::height(), QSize::height(), m_canvas, QCanvas::resize(), QResizeEvent::size(), QCanvas::width(), and QSize::width().

Referenced by CanvasWindow::resizeEvent().

void FigureEditor::saveAreaAsPixmap const QRect area,
const std::string filename
[protected]
 

Saves the area area as pixmap to file filename.

Definition at line 1610 of file FigureEditor.cxx.

References QPainter::begin(), QCanvas::drawArea(), QPainter::end(), QRect::height(), m_canvas, QPixmap::save(), setSelectedItems(), QPainter::translate(), QRect::width(), QRect::x(), and QRect::y().

Referenced by CanvasView::savePlotAsImage(), and saveSelectedAsPixmap().

void FigureEditor::savePrinterSettings  )  [protected]
 

Saves the printer setting with QSettings.

Definition at line 1492 of file FigureEditor.cxx.

References QSettings::insertSearchPath(), s_app_key, s_printer, s_registry, and QSettings::writeEntry().

Referenced by setPrinterSettings().

void FigureEditor::saveSelectedAsPixmap const std::string filename  )  [protected]
 

Save the selected objects as Pixmap image file filename.

Definition at line 1601 of file FigureEditor.cxx.

References getSelectedBounds(), saveAreaAsPixmap(), and setSelectedItems().

Referenced by CanvasView::saveSelectedImages().

void FigureEditor::scaleBy double  factor  ) 
 

Scales the size of the images by factor.

The factor might be modified to ensure we see at least a page in single glance of the canvas.

Definition at line 1429 of file FigureEditor.cxx.

References m_apage_h, m_apage_w, m_canvas, m_printer_bounds, m_scale_factor, m_upage_h, m_upage_w, and showPrinterMargins().

QCanvasItem * FigureEditor::selectedItem  )  const
 

Returns the selected QCanvasItem.

Definition at line 307 of file FigureEditor.cxx.

References isSingleItemSelected(), and m_selected_list.

Referenced by contentsMouseMoveEvent(), CanvasView::contentsMouseMoveEvent(), CanvasView::contentsMouseReleaseEvent(), CanvasView::viewShowPickTable(), and whereClicked().

void FigureEditor::setAllSelected bool  flag = true  ) 
 

Sets selection flag on all QCanvasItem objects.

Definition at line 489 of file FigureEditor.cxx.

References std::bind2nd(), std::for_each(), m_items, m_selected_list, std::mem_fun(), and QCanvasItem::setSelected().

Referenced by CanvasWindow::editSelectAll(), CanvasWindow::setAllSelected(), and setSelectedFlags().

void FigureEditor::setAppKey const std::string  )  [static]
 

Sets the QSettings application key.

Definition at line 150 of file FigureEditor.cxx.

References s_app_key.

void FigureEditor::setCollidingSelected const QCanvasItem target  )  [protected]
 

Sets all QCanvasItems that collide with target to selected state.

Definition at line 435 of file FigureEditor.cxx.

References m_items, m_selected_list, and setSelectedItems().

Referenced by CanvasView::saveSelectedImages().

void FigureEditor::setLocked bool  flag  ) 
 

Sets the selected QCanvasItem to be locked in size and position.

Definition at line 573 of file FigureEditor.cxx.

References std::bind2nd(), std::for_each(), getSelectedItems(), std::mem_fun(), and QCanvasItem::setActive().

Referenced by CanvasWindow::viewLock(), and CanvasWindow::viewUnlock().

void FigureEditor::setPrinterSettings  ) 
 

Set the default printer settings.

Definition at line 1504 of file FigureEditor.cxx.

References s_printer, and savePrinterSettings().

void FigureEditor::setSelectedFlags  ) 
 

Set the selected flags.

Definition at line 513 of file FigureEditor.cxx.

References m_selected_list, and setAllSelected().

Referenced by contentsMousePressEvent(), CanvasView::saveSelectedImages(), and setSelectedItem().

void FigureEditor::setSelectedItem QCanvasItem  ) 
 

Set the selected QCanvasItem.

This is called only when just one item is selected.

Definition at line 536 of file FigureEditor.cxx.

References addSelectedItem(), m_selected_list, maximumZ(), notifyObservers(), and setSelectedFlags().

Referenced by CanvasView::addView(), contentsMousePressEvent(), and CanvasWindow::setSelected().

void FigureEditor::setSelectedItems bool  state  )  [protected]
 

Sets the selected items to selection state state.

For each QCanvasItem in the selection list, set their selection state to state. Does not alter the selection list.

Definition at line 460 of file FigureEditor.cxx.

References m_selected_list.

Referenced by clearSelectedList(), print(), saveAreaAsPixmap(), saveSelectedAsPixmap(), and setCollidingSelected().

void FigureEditor::setUnselectedVisible bool  yes  )  [protected]
 

Sets the unselected items to visible or not.

Definition at line 416 of file FigureEditor.cxx.

References m_items.

Referenced by maximumZ(), and CanvasView::saveSelectedImages().

void FigureEditor::setZoomMode bool  flag  ) 
 

Sets the zoom mode to flag.

Definition at line 1634 of file FigureEditor.cxx.

References m_zoom_mode, and QApplication::setOverrideCursor().

void FigureEditor::showPrinterMargins bool  on  ) 
 

Sets showing the printer margins on or off.

Definition at line 157 of file FigureEditor.cxx.

References addPageMargin(), m_apage_h, m_canvas, and m_printer_bounds.

Referenced by scaleBy(), and CanvasView::setup().

virtual void FigureEditor::viewShowPickTable  )  [pure virtual]
 

Show the pick table.

Implemented in CanvasView.

void FigureEditor::viewZoomIn  ) 
 

Enlarges the view of the canvas.

Definition at line 1450 of file FigureEditor.cxx.

References QCanvasView::setWorldMatrix(), and QCanvasView::worldMatrix().

Referenced by CanvasWindow::viewZoomIn().

void FigureEditor::viewZoomOut  ) 
 

Reduces the view of the canvas.

Definition at line 1464 of file FigureEditor.cxx.

References QCanvasView::setWorldMatrix(), and QCanvasView::worldMatrix().

Referenced by CanvasWindow::viewZoomOut().

void FigureEditor::viewZoomReset  ) 
 

Returns the view to normal size.

Definition at line 1478 of file FigureEditor.cxx.

References QCanvasView::setWorldMatrix(), and QCanvasView::worldMatrix().

void FigureEditor::whereClicked  )  [protected]
 

Finds which knob on the selected item was clicked.

Definition at line 758 of file FigureEditor.cxx.

References invalid, isSingleItemSelected(), lower_left, lower_middle, lower_right, m_whereClicked, middle_left, middle_right, moving_start, none, selectedItem(), upper_left, upper_middle, upper_right, QPoint::x(), and QPoint::y().

Referenced by contentsMousePressEvent().


Member Data Documentation

int FigureEditor::m_apage_h [protected]
 

The actual Page height in Postscript points.

Definition at line 76 of file FigureEditor.h.

Referenced by addPage(), addPageMargin(), calcPrinterMetrics(), print(), CanvasView::reTilePage(), scaleBy(), CanvasView::setup(), and showPrinterMargins().

int FigureEditor::m_apage_w [protected]
 

The actual Page width in Postscript points.

Definition at line 73 of file FigureEditor.h.

Referenced by addPageMargin(), calcPrinterMetrics(), CanvasView::reTilePage(), scaleBy(), and CanvasView::setup().

QCanvas* FigureEditor::m_canvas [protected]
 

The canvas object.

Although one can always retrieve the canvas object by calling the canvas() member function, it is convenient to have this as a data member.

Definition at line 171 of file FigureEditor.h.

Referenced by addPage(), addPageMargin(), contentsMouseMoveEvent(), contentsMousePressEvent(), print(), resizeEvent(), CanvasView::reTilePage(), saveAreaAsPixmap(), scaleBy(), CanvasView::setVisibleNonViews(), showPrinterMargins(), and CanvasView::views().

std::vector< QCanvasItem * > FigureEditor::m_items [protected]
 

The list of view items on the canvas.

This list is a subset of the one kept by the QCanvas object,That one doesn't seem to maintain the order that items were inserted while this one does. Also, only application items are added to this list, not page decorations.

Attention:
All methods that add or remove items from the canvas should maintain this list. That means QCanvasItem::setCanvas and QCanvasItem::~QCanvasItem.

Definition at line 152 of file FigureEditor.h.

Referenced by clear(), contentsMousePressEvent(), maximumZ(), CanvasView::reTile(), setAllSelected(), setCollidingSelected(), and setUnselectedVisible().

bool FigureEditor::m_printer_bounds [protected]
 

A flag to indicate if rectangle display usable printer boundary should be displayed or not.

Definition at line 94 of file FigureEditor.h.

Referenced by addPageMargin(), CanvasView::saveSettings(), scaleBy(), CanvasView::setup(), and showPrinterMargins().

double FigureEditor::m_scale_factor [protected]
 

The scale factor.

The factor by which drawing has been reduced so that a canvas page fits in the window. This factor should be applied in inverse before printing.

Definition at line 82 of file FigureEditor.h.

Referenced by print(), and scaleBy().

std::vector< QCanvasItem * > FigureEditor::m_selected_list [protected]
 

The list of currently selected QCanvasItem objects.

Definition at line 178 of file FigureEditor.h.

Referenced by clear(), clearSelectedList(), contentsMousePressEvent(), CanvasView::controlMousePressEvent(), getSelectedBounds(), getSelectedItems(), isSingleItemSelected(), CanvasView::saveSelectedImages(), selectedItem(), CanvasView::selectedViews(), setAllSelected(), setCollidingSelected(), setSelectedFlags(), setSelectedItem(), and setSelectedItems().

int FigureEditor::m_upage_h [protected]
 

The usable Page height in Postscript points.

Definition at line 139 of file FigureEditor.h.

Referenced by addPageMargin(), CanvasView::calcDefaultSize(), calcPrinterMetrics(), print(), scaleBy(), and CanvasView::setup().

int FigureEditor::m_upage_w [protected]
 

The usable Page width in Postscript points.

Definition at line 136 of file FigureEditor.h.

Referenced by addPageMargin(), CanvasView::addPlotDisplay(), CanvasView::calcDefaultSize(), calcPrinterMetrics(), print(), scaleBy(), and CanvasView::setup().

Location FigureEditor::m_whereClicked [protected]
 

Location where the mouse cursor clicked the object.

Definition at line 197 of file FigureEditor.h.

Referenced by contentsMouseMoveEvent(), CanvasView::contentsMouseReleaseEvent(), and whereClicked().

bool FigureEditor::m_zoom_mode [protected]
 

Set to true if zoom Mode is enabled.

Definition at line 86 of file FigureEditor.h.

Referenced by getZoomMode(), and setZoomMode().

QPoint FigureEditor::moving_start [protected]
 

The starting point of a mouse drag.

Definition at line 184 of file FigureEditor.h.

Referenced by contentsMouseMoveEvent(), contentsMousePressEvent(), and whereClicked().

QString FigureEditor::s_app_key [static, protected]
 

The QSettings application key for searching for setting.

The initial value is "HippoDraw", but may be changed by Starkey.

Referenced by initPrinter(), CanvasView::initSettings(), savePrinterSettings(), CanvasView::saveSettings(), and setAppKey().

QPrinter * FigureEditor::s_printer = 0 [static, protected]
 

The single QPrinter instance.

Definition at line 83 of file FigureEditor.cxx.

Referenced by calcPrinterMetrics(), initPrinter(), print(), savePrinterSettings(), CanvasView::saveSettings(), setPrinterSettings(), and CanvasView::setup().

QString FigureEditor::s_registry [static, protected]
 

The QSettings Windows registry key.

The key is the same as used for by Trolltech for their Qt applications

Referenced by initPrinter(), CanvasView::initSettings(), savePrinterSettings(), and CanvasView::saveSettings().

QPoint FigureEditor::zoom_start [protected]
 

The starting point of a mouse drag.for zoom.

Definition at line 187 of file FigureEditor.h.

Referenced by CanvasView::contentsMouseMoveEvent(), contentsMousePressEvent(), and CanvasView::contentsMouseReleaseEvent().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3