Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions

FigureEditor Class Reference

This class implements additional QCanvasView functionality. More...

#include <FigureEditor.h>

Inheritance diagram for FigureEditor:
Inheritance graph
[legend]
Collaboration diagram for FigureEditor:
Collaboration graph
[legend]

List of all members.

Classes

class  CanvasEvent
 An Qt event class which wraps a QCanvasItem to be processed by the event. More...

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.
void enterEvent (QEvent *)
 Grabs the event when mouse cursor enters the widget.
 FigureEditor (QCanvas *, QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
 The constructor.
const QStringgetAppKey () const
 Returns a reference the application's QSettings key.
const QStringgetRegistry () const
 Returns a reference to the application's registry.
QCanvasItemgetRightItem ()
 Get the QCanvasItem clicked by right mouse button.
std::vector< QCanvasItem * > & getSelectedItems ()
 Return the vector of selected items.
bool getZoomMode () const
 Returns the bool indicating whether zoom mode is enabled or not.
void hide (QCanvasItem *item)
 Removes the item from the canvas but not destroys it.
 inverseWorldMatrix () const
bool isSingleItemSelected () const
 Returns true if just one item is selected, else returns false.
void leaveEvent (QEvent *)
 Grabs the event when mouse cursor leaves the widget.
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)
 Re-sizes 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 addToItemList (QCanvasItem *item)
void calcPrinterMetrics (QPaintDevice *)
 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 re-sizes the selected QCanvasItem object.
virtual void contentsMousePressEvent (QMouseEvent *)
void contentsMouseReleaseEvent (QMouseEvent *)
 Handles details of mouse release, right button.
virtual void controlMousePressEvent ()=0
 Handles details of mouse press event with shift key pressed.
void copySelectedToClipboard ()
 Adds selected items to system clipboard.
QImage createImage (const QRect &rectange) const
 Creates and returns a QImage from the area defined on the canvas.
QPixmapcreatePixmap (const QRect &rectangle) const
 Creates and returns a new QPixmap from the area defined on the canvas.
QRect getSelectedBounds () const
 Returns a QRect that enclosed the selected QCanvasItem objects.
void initPrinter ()
 Initializes the printer settings from the saved settings.
void makeVisible (const QCanvasItem *item)
 Scrolls the canvas, if needed, so the QCanvasItem item is visible.
double maximumZ () const
 Returns the largest Z value of all the items on the canvas.
void mouseMoveMultiItem (QMouseEvent *e)
 Move more than one items in the Canvas.
void movePlotterWithText (QCanvasItem *item, float dx, float dy)
 Move a plotter with all its targetted text plotters.
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)
 Re-sizes 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.
bool m_ignore_margin
 a flag set to true if the printer margins should be ignored when adding a plot to the canvas.
bool m_isMouseDown
 The flag of mouse down or not, used when moving multiple plots.
std::vector< QCanvasItem * > m_items
 The list of view items on the canvas.
QPoint m_mouse_down
 The point of a mouse down, used when moving multiple plots.
QPoint m_moving_start
 The starting point of a mouse drag.
QCanvasItemm_preSelected
 The view item which is preselected when left mouse button down.
bool m_printer_bounds
 A flag to indicate if rectangle display usable printer boundary should be displayed or not.
QCanvasItemm_rightItem
 The view item which is clicked with right mouse button when contentsMousePressEvent() happens.
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 m_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.

Private Member Functions

virtual void customEvent (QCustomEvent *event)
 The receiver of Qt custom events.

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.

Bug:
@@@ Mac OS X only, printer margins not showing in correct place on the Canvas, however printing is working fine.
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:
Kaustuv <kaustuv@stanford.edu>
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>
Sanket B. Malde <sanket@stanford.edu>
Engineers at Trolltech who wrote examples/canvas

Definition at line 73 of file FigureEditor.h.


Member Enumeration Documentation

enum 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 309 of file FigureEditor.h.


Constructor & Destructor Documentation

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

The constructor.

Definition at line 114 of file FigureEditor.cxx.

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


Member Function Documentation

void add ( QCanvasItem item)

Adds the item to the canvas.

Expands the canvas' size if necessary.

Definition at line 1381 of file FigureEditor.cxx.

References FigureEditor::m_canvas, FigureEditor::m_items, and FigureEditor::resizeCanvasToFit().

Referenced by CanvasView::addView(), CanvasView::groupView(), CanvasView::initFrom(), FigureEditor::paste(), and CanvasView::ungroupView().

void addPage ( )
void 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 256 of file FigureEditor.cxx.

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

Referenced by FigureEditor::addPage(), FigureEditor::resizeCanvasToFit(), and FigureEditor::showPrinterMargins().

void addSelectedItem ( QCanvasItem item)
void addToItemList ( QCanvasItem item) [protected]

Definition at line 996 of file FigureEditor.cxx.

References FigureEditor::m_canvas, and FigureEditor::m_items.

void calcPrinterMetrics ( QPaintDevice device) [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.

Bug:
@@@ Talking the default printer at start-up causes large delays if printer is not available on the network.

Definition at line 286 of file FigureEditor.cxx.

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

Referenced by FigureEditor::print().

void clear ( )

Removes all items from canvas and destroy them.

Reimplemented in CanvasView.

Definition at line 1038 of file FigureEditor.cxx.

References FigureEditor::m_items, and FigureEditor::m_selected_list.

void clearSelectedList ( ) [protected]

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

Definition at line 542 of file FigureEditor.cxx.

References FigureEditor::m_selected_list, and FigureEditor::setSelectedItems().

Referenced by CanvasView::groupView(), CanvasView::pasteViews(), and CanvasView::ungroupView().

void contentsMouseMoveEvent ( QMouseEvent e,
double  aspect 
) [protected]

Moves or re-sizes the selected QCanvasItem object.

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

Todo:
This implementation depends on parent widget being CanvasWindow, thus making a circular dependency.

There ought to be a way to fix it. Or at least depend only on QMainWindow.

Todo:
The implementation uses QtView, thus should be moved to CanvasView.

Definition at line 1062 of file FigureEditor.cxx.

References FigureEditor::getZoomMode(), FigureEditor::invalid, QCanvasView::inverseWorldMatrix(), FigureEditor::isSingleItemSelected(), FigureEditor::lower_left, FigureEditor::lower_middle, FigureEditor::lower_right, FigureEditor::m_canvas, FigureEditor::m_moving_start, FigureEditor::m_whereClicked, FigureEditor::middle_left, FigureEditor::middle_right, FigureEditor::movePlotterWithText(), FigureEditor::none, QMouseEvent::pos(), FigureEditor::selectedItem(), QCanvas::update(), FigureEditor::upper_left, FigureEditor::upper_middle, FigureEditor::upper_right, QPoint::x(), and QPoint::y().

void contentsMousePressEvent ( QMouseEvent e) [protected, virtual]
void contentsMouseReleaseEvent ( QMouseEvent e) [protected]

Handles details of mouse release, right button.

Is processed in CanvasView class, do nothing in this class.

Reimplemented in CanvasView.

Definition at line 1292 of file FigureEditor.cxx.

References QCanvasView::inverseWorldMatrix(), FigureEditor::m_isMouseDown, FigureEditor::m_mouse_down, FigureEditor::m_preSelected, QMouseEvent::pos(), and FigureEditor::setSelectedItem().

virtual void controlMousePressEvent ( ) [protected, pure virtual]

Handles details of mouse press event with shift key pressed.

Implemented in CanvasView.

Referenced by FigureEditor::contentsMousePressEvent().

void copySelectedToClipboard ( ) [protected]

Adds selected items to system clipboard.

Definition at line 1684 of file FigureEditor.cxx.

References QApplication::clipboard(), FigureEditor::createImage(), and FigureEditor::getSelectedBounds().

Referenced by CanvasView::copySelectedToPasteboard().

QImage createImage ( const QRect rectange) const [protected]

Creates and returns a QImage from the area defined on the canvas.

Definition at line 1674 of file FigureEditor.cxx.

References FigureEditor::createPixmap().

Referenced by FigureEditor::copySelectedToClipboard().

QPixmap * createPixmap ( const QRect rectangle) const [protected]

Creates and returns a new QPixmap from the area defined on the canvas.

Definition at line 1641 of file FigureEditor.cxx.

References QPainter::begin(), QCanvas::drawArea(), QRect::height(), FigureEditor::m_canvas, QRect::width(), QRect::x(), and QRect::y().

Referenced by FigureEditor::createImage(), and FigureEditor::saveAreaAsPixmap().

void customEvent ( QCustomEvent event) [private, virtual]

The receiver of Qt custom events.

Definition at line 599 of file FigureEditor.cxx.

References FigureEditor::makeVisible().

Referenced by FigureEditor::setSelectedFlags().

void ensureVisible ( const QCanvasItem item)

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

Definition at line 659 of file FigureEditor.cxx.

References FigureEditor::makeVisible().

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

void enterEvent ( QEvent )

Grabs the event when mouse cursor enters the widget.

Definition at line 1725 of file FigureEditor.cxx.

References FigureEditor::m_zoom_mode, and QApplication::setOverrideCursor().

const QString & getAppKey ( ) const

Returns a reference the application's QSettings key.

Definition at line 1741 of file FigureEditor.cxx.

References FigureEditor::s_app_key.

const QString & getRegistry ( ) const

Returns a reference to the application's registry.

Definition at line 1748 of file FigureEditor.cxx.

References FigureEditor::s_registry.

QCanvasItem * getRightItem ( )
QRect getSelectedBounds ( ) const [protected]

Returns a QRect that enclosed the selected QCanvasItem objects.

Definition at line 402 of file FigureEditor.cxx.

References FigureEditor::m_selected_list.

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

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

Return the vector of selected items.

Definition at line 360 of file FigureEditor.cxx.

References FigureEditor::m_selected_list.

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

bool getZoomMode ( ) const
void hide ( QCanvasItem item)

Removes the item from the canvas but not destroys it.

Used in grouping several items together.

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

Definition at line 1025 of file FigureEditor.cxx.

References FigureEditor::m_selected_list, and FigureEditor::removeFromItemList().

Referenced by CanvasView::hideSelected().

void initPrinter ( ) [protected]
bool isSingleItemSelected ( ) const
void leaveEvent ( QEvent )

Grabs the event when mouse cursor leaves the widget.

Definition at line 1718 of file FigureEditor.cxx.

References QApplication::restoreOverrideCursor().

void makeVisible ( const QCanvasItem item) [protected]

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

Definition at line 614 of file FigureEditor.cxx.

References FigureEditor::ensureVisible(), and QRect::rect().

Referenced by FigureEditor::customEvent(), and FigureEditor::ensureVisible().

double maximumZ ( ) const [protected]

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

If the item is a text plotter, take z()-100 instead of z(). This is to keep all text plotters on top of XyPlotters.

Definition at line 429 of file FigureEditor.cxx.

References QtView::isTextView(), FigureEditor::m_items, and FigureEditor::setUnselectedVisible().

Referenced by CanvasView::addTextDisplay(), FigureEditor::contentsMousePressEvent(), and FigureEditor::setSelectedItem().

void mouseMoveMultiItem ( QMouseEvent e) [protected]
void movePlotterWithText ( QCanvasItem item,
float  dx,
float  dy 
) [protected]
virtual void notifyObservers ( ) [protected, pure virtual]

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

Implemented in CanvasView.

Referenced by FigureEditor::setSelectedItem().

void 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.

Bug:
If item is pasted second time, it should display even more.

Definition at line 1403 of file FigureEditor.cxx.

References FigureEditor::add().

Referenced by CanvasView::pasteViews().

void placeGraph ( QCanvasRectangle item)

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 1310 of file FigureEditor.cxx.

References QRect::bottom(), FigureEditor::m_apage_h, FigureEditor::m_apage_w, FigureEditor::m_canvas, FigureEditor::m_ignore_margin, FigureEditor::m_items, FigureEditor::m_upage_h, FigureEditor::m_upage_w, and QRect::top().

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

void 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 727 of file FigureEditor.cxx.

References QRect::height(), FigureEditor::isSingleItemSelected(), FigureEditor::m_canvas, FigureEditor::m_items, FigureEditor::selectedItem(), QRect::setX(), QRect::width(), QRect::x(), and QRect::y().

void print ( ) [virtual]

Prints the view to the printer.

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

Bug:
If user selects page range, it is ignored.

Reimplemented in CanvasView.

Definition at line 1541 of file FigureEditor.cxx.

References FigureEditor::s_printer, and QPrinter::setup().

Referenced by FigureEditor::print().

void print ( const std::string &  filename) [virtual]

Prints the view to Postscript file filename.

Reimplemented in CanvasView.

Definition at line 1552 of file FigureEditor.cxx.

References FigureEditor::print(), and FigureEditor::s_printer.

void print ( QPrinter printer) [protected]
void 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 1008 of file FigureEditor.cxx.

References FigureEditor::removeFromItemList(), and FigureEditor::removeSelectedItem().

Referenced by FigureEditor::removeFromItemList().

void removeFromItemList ( QCanvasItem item) [protected]

Removes the item from list of items on the canvas.

Definition at line 981 of file FigureEditor.cxx.

References FigureEditor::m_items, and FigureEditor::remove().

Referenced by CanvasView::groupView(), FigureEditor::hide(), FigureEditor::remove(), and CanvasView::reTilePage().

void removeSelectedItem ( QCanvasItem item)

Removes an item from the selection list.

Definition at line 385 of file FigureEditor.cxx.

References QCanvasItem::isSelected().

Referenced by FigureEditor::contentsMousePressEvent(), and FigureEditor::remove().

void resizeCanvasToFit ( QCanvasItem item) [protected]

Re-sizes 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 1424 of file FigureEditor.cxx.

References FigureEditor::addPageMargin(), QRect::bottomRight(), QCanvas::height(), FigureEditor::m_apage_h, FigureEditor::m_canvas, QCanvas::onCanvas(), QCanvas::resize(), and QCanvas::width().

Referenced by FigureEditor::add().

void resizeEvent ( QResizeEvent e)

Re-sizes 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 1605 of file FigureEditor.cxx.

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

Referenced by CanvasWindow::resizeEvent().

void saveAreaAsPixmap ( const QRect area,
const std::string &  filename 
) [protected]

Saves the area area as pixmap to file filename.

Definition at line 1656 of file FigureEditor.cxx.

References FigureEditor::createPixmap().

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

void savePrinterSettings ( ) [protected]
void saveSelectedAsPixmap ( const std::string &  filename) [protected]

Save the selected objects as Pixmap image file filename.

Definition at line 1631 of file FigureEditor.cxx.

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

Referenced by CanvasView::saveSelectedImages().

void 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 1443 of file FigureEditor.cxx.

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

QCanvasItem * selectedItem ( ) const
void setAllSelected ( bool  flag = true)
void setAppKey ( const std::string &  appkey) [static]

Sets the QSettings application key.

Definition at line 185 of file FigureEditor.cxx.

References FigureEditor::s_app_key.

void setCollidingSelected ( const QCanvasItem target) [protected]

Sets all QCanvasItems that collide with target to selected state.

Definition at line 499 of file FigureEditor.cxx.

References FigureEditor::m_items, FigureEditor::m_selected_list, and FigureEditor::setSelectedItems().

Referenced by CanvasView::saveSelectedImages().

void setLocked ( bool  flag)

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

Definition at line 674 of file FigureEditor.cxx.

References FigureEditor::getSelectedItems(), and QCanvasItem::setActive().

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

void setPrinterSettings ( )

Set the default printer settings.

Definition at line 1521 of file FigureEditor.cxx.

References FigureEditor::s_printer, and FigureEditor::savePrinterSettings().

void setSelectedFlags ( )
void setSelectedItem ( QCanvasItem item)
void 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 524 of file FigureEditor.cxx.

References FigureEditor::m_selected_list, and QCanvasItem::setSelected().

Referenced by FigureEditor::clearSelectedList(), FigureEditor::print(), FigureEditor::saveSelectedAsPixmap(), and FigureEditor::setCollidingSelected().

void setUnselectedVisible ( bool  yes) [protected]

Sets the unselected items to visible or not.

Definition at line 480 of file FigureEditor.cxx.

References FigureEditor::m_items, and QCanvasItem::setVisible().

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

void setZoomMode ( bool  flag)

Sets the zoom mode to flag.

Bug:
Mouse tracking is not working.

Definition at line 1701 of file FigureEditor.cxx.

References FigureEditor::m_zoom_mode, QApplication::restoreOverrideCursor(), and QApplication::setOverrideCursor().

void showPrinterMargins ( bool  on)
virtual void viewShowPickTable ( ) [pure virtual]

Show the pick table.

Implemented in CanvasView.

void viewZoomIn ( )

Enlarges the view of the canvas.

Definition at line 1464 of file FigureEditor.cxx.

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

Referenced by CanvasWindow::viewZoomIn().

void viewZoomOut ( )

Reduces the view of the canvas.

Bug:
Zooming out from the initial canvas, leave area where plots can be dragged, but they disappear.

Definition at line 1481 of file FigureEditor.cxx.

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

Referenced by CanvasWindow::viewZoomOut().

void viewZoomReset ( )

Returns the view to normal size.

Definition at line 1495 of file FigureEditor.cxx.

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

void whereClicked ( ) [protected]

Member Data Documentation

int m_apage_h [protected]
int m_apage_w [protected]
QCanvas* m_canvas [protected]
bool m_ignore_margin [protected]

a flag set to true if the printer margins should be ignored when adding a plot to the canvas.

Definition at line 153 of file FigureEditor.h.

Referenced by CanvasView::initSettings(), FigureEditor::placeGraph(), CanvasView::saveSettings(), and CanvasView::setup().

bool m_isMouseDown [protected]

The flag of mouse down or not, used when moving multiple plots.

Definition at line 305 of file FigureEditor.h.

Referenced by FigureEditor::contentsMousePressEvent(), and FigureEditor::contentsMouseReleaseEvent().

std::vector< QCanvasItem * > 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 238 of file FigureEditor.h.

Referenced by FigureEditor::add(), FigureEditor::addToItemList(), FigureEditor::clear(), FigureEditor::contentsMousePressEvent(), FigureEditor::maximumZ(), FigureEditor::placeGraph(), FigureEditor::placeGraphOnSelected(), FigureEditor::removeFromItemList(), CanvasView::reTile(), FigureEditor::setAllSelected(), FigureEditor::setCollidingSelected(), and FigureEditor::setUnselectedVisible().

QPoint m_mouse_down [protected]

The point of a mouse down, used when moving multiple plots.

Definition at line 302 of file FigureEditor.h.

Referenced by FigureEditor::contentsMousePressEvent(), and FigureEditor::contentsMouseReleaseEvent().

QPoint m_moving_start [protected]
QCanvasItem* m_preSelected [protected]

The view item which is preselected when left mouse button down.

Useful only when multiple items are selected and one of them is pressed. Need to decide whether to select or to move all plots.

Definition at line 263 of file FigureEditor.h.

Referenced by FigureEditor::contentsMousePressEvent(), and FigureEditor::contentsMouseReleaseEvent().

bool m_printer_bounds [protected]

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

Definition at line 148 of file FigureEditor.h.

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

QCanvasItem* m_rightItem [protected]

The view item which is clicked with right mouse button when contentsMousePressEvent() happens.

When contentsMoveMouseEvent() happens, get to this member, get the position of the cursor. When contentsReleaseMouseEvent() happens, reset the mouse cursor to arrow.

Definition at line 252 of file FigureEditor.h.

Referenced by FigureEditor::contentsMousePressEvent(), and FigureEditor::getRightItem().

double 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 136 of file FigureEditor.h.

Referenced by FigureEditor::print(), and FigureEditor::scaleBy().

std::vector< QCanvasItem * > m_selected_list [protected]
int m_upage_h [protected]
int m_upage_w [protected]
Location m_whereClicked [protected]

Location where the mouse cursor clicked the object.

Definition at line 315 of file FigureEditor.h.

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

bool m_zoom_mode [protected]

Set to true if zoom Mode is enabled.

Definition at line 140 of file FigureEditor.h.

Referenced by FigureEditor::enterEvent(), FigureEditor::getZoomMode(), and FigureEditor::setZoomMode().

QPoint m_zoom_start [protected]

The starting point of a mouse drag.for zoom.

Definition at line 299 of file FigureEditor.h.

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

QString s_app_key [static, protected]
QPrinter * s_printer = 0 [static, protected]
QString s_registry [static, protected]

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

Generated for HippoDraw Class Library by doxygen