#include <FigureEditor.h>
Inheritance diagram for FigureEditor:
Definition at line 73 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. | |
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 QString & | getAppKey () const |
Returns a reference the application's QSettings key. | |
const QString & | getRegistry () const |
Returns a reference to the application's registry. | |
QCanvasItem * | getRightItem () |
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. | |
QCanvasItem * | selectedItem () 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. | |
QPixmap * | createPixmap (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. | |
QCanvas * | m_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. | |
QCanvasItem * | m_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. | |
QCanvasItem * | m_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 QPrinter * | s_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. | |
Classes | |
class | CanvasEvent |
An Qt event class which wraps a QCanvasItem to be processed by the event. More... |
enum Location [protected] |
Possible locations where on a QCanvasItem the mouse cursor was when clicked.
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.
FigureEditor | ( | QCanvas * | , | |
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().
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().
void addPage | ( | ) |
Adds a page to the canvas.
Definition at line 1620 of file FigureEditor.cxx.
References FigureEditor::addPageMargin(), QCanvas::height(), FigureEditor::m_apage_h, FigureEditor::m_canvas, QCanvas::resize(), and QCanvas::width().
Referenced by CanvasWindow::viewAddPage().
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 | ) |
Add an item to the selected list.
Definition at line 368 of file FigureEditor.cxx.
References FigureEditor::m_selected_list, and FigureEditor::setSelectedFlags().
Referenced by FigureEditor::contentsMousePressEvent(), CanvasView::groupView(), CanvasView::pasteViews(), FigureEditor::setSelectedItem(), and CanvasView::ungroupView().
void addToItemList | ( | QCanvasItem * | item | ) | [protected] |
Definition at line 996 of file FigureEditor.cxx.
References FigureEditor::m_canvas, and FigureEditor::m_items.
void calcPrinterMetrics | ( | QPaintDevice * | ) | [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 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.
Referenced by CanvasView::clear().
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 * | , | |
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.
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().
Referenced by CanvasView::contentsMouseMoveEvent().
void contentsMousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
If RightButton is clicked, the selItem will not be added to the list, but will update the m_rightItem and call contentsMouseMoveEvent(e,0) function.
Reimplemented in CanvasView.
Definition at line 756 of file FigureEditor.cxx.
References FigureEditor::addSelectedItem(), QMouseEvent::button(), QCanvas::collisions(), FigureEditor::controlMousePressEvent(), FigureEditor::getZoomMode(), QCanvasView::inverseWorldMatrix(), QtView::isTextView(), FigureEditor::m_canvas, FigureEditor::m_isMouseDown, FigureEditor::m_items, FigureEditor::m_mouse_down, FigureEditor::m_moving_start, FigureEditor::m_preSelected, FigureEditor::m_rightItem, FigureEditor::m_selected_list, FigureEditor::m_zoom_start, FigureEditor::maximumZ(), QMouseEvent::pos(), FigureEditor::removeSelectedItem(), FigureEditor::setSelectedFlags(), FigureEditor::setSelectedItem(), QMouseEvent::state(), and FigureEditor::whereClicked().
Referenced by CanvasView::contentsMousePressEvent().
void contentsMouseReleaseEvent | ( | QMouseEvent * | ) | [protected] |
Handles details of mouse release, right button.
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().
Referenced by CanvasView::contentsMouseReleaseEvent().
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().
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().
Creates and returns a new QPixmap from the area defined on the canvas.
Definition at line 1641 of file FigureEditor.cxx.
References 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().
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 | ( | ) |
Get the QCanvasItem clicked by right mouse button.
Definition at line 1758 of file FigureEditor.cxx.
References FigureEditor::m_rightItem.
Referenced by CanvasView::contentsMouseMoveEvent(), CanvasView::contentsMouseReleaseEvent(), and CanvasView::getRightClickedPlotter().
QRect getSelectedBounds | ( | ) | const [protected] |
Returns a QRect that enclosed the selected QCanvasItem objects.
Definition at line 402 of file FigureEditor.cxx.
References QCanvasItem::boundingRect(), and 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 |
Returns the bool indicating whether zoom mode is enabled or not.
Definition at line 1734 of file FigureEditor.cxx.
References FigureEditor::m_zoom_mode.
Referenced by FigureEditor::contentsMouseMoveEvent(), CanvasView::contentsMouseMoveEvent(), FigureEditor::contentsMousePressEvent(), FigureEditor::mouseMoveMultiItem(), and CanvasView::setPlotZoom().
void hide | ( | QCanvasItem * | item | ) |
Removes the item from the canvas but not destroys it.
Used in grouping several items together.
Definition at line 1025 of file FigureEditor.cxx.
References FigureEditor::m_selected_list, and FigureEditor::removeFromItemList().
Referenced by CanvasView::hideSelected().
void initPrinter | ( | ) | [protected] |
Initializes the printer settings from the saved settings.
If setting have not been saved, set the default values.
Definition at line 152 of file FigureEditor.cxx.
References indexToColorMode, indexToOrientation, indexToPageSize, QSettings::insertSearchPath(), QSettings::readNumEntry(), FigureEditor::s_app_key, FigureEditor::s_printer, FigureEditor::s_registry, QPrinter::setColorMode(), QPrinter::setFullPage(), QPrinter::setOrientation(), QPrinter::setPageSize(), and num_util::size().
bool isSingleItemSelected | ( | ) | const |
Returns true if just one item is selected, else returns false.
Definition at line 331 of file FigureEditor.cxx.
References FigureEditor::m_selected_list.
Referenced by FigureEditor::contentsMouseMoveEvent(), CanvasView::contentsMouseMoveEvent(), FigureEditor::placeGraphOnSelected(), FigureEditor::selectedItem(), CanvasView::viewShowPickTable(), and FigureEditor::whereClicked().
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 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] |
Move more than one items in the Canvas.
Definition at line 1765 of file FigureEditor.cxx.
References FigureEditor::getZoomMode(), QCanvasView::inverseWorldMatrix(), FigureEditor::m_canvas, FigureEditor::m_moving_start, FigureEditor::m_selected_list, FigureEditor::movePlotterWithText(), QMouseEvent::pos(), QCanvas::update(), QPoint::x(), and QPoint::y().
Referenced by CanvasView::contentsMouseMoveEvent().
void movePlotterWithText | ( | QCanvasItem * | item, | |
float | dx, | |||
float | dy | |||
) | [protected] |
Move a plotter with all its targetted text plotters.
Definition at line 1790 of file FigureEditor.cxx.
References QCanvas::allItems(), PlotterBase::getParentPlotter(), ViewBase::getPlotter(), PlotterBase::isTextPlotter(), and FigureEditor::m_canvas.
Referenced by FigureEditor::contentsMouseMoveEvent(), and FigureEditor::mouseMoveMultiItem().
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.
Definition at line 1403 of file FigureEditor.cxx.
Referenced by CanvasView::pasteViews().
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.
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(), CanvasView::placeItems(), and CanvasView::sizeAndPlace().
void placeGraphOnSelected | ( | QCanvasRectangle * | item | ) | [protected] |
Adds the item on top of the currently selected item.
Definition at line 727 of file FigureEditor.cxx.
References QRect::height(), FigureEditor::isSingleItemSelected(), FigureEditor::m_canvas, FigureEditor::m_items, FigureEditor::selectedItem(), QRect::width(), QRect::x(), and QRect::y().
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 | ( | ) | [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 1541 of file FigureEditor.cxx.
References FigureEditor::s_printer, and QPrinter::setup().
Referenced by FigureEditor::print(), and CanvasView::print().
void print | ( | QPrinter * | printer | ) | [protected] |
Prints the view to the printer.
Definition at line 1563 of file FigureEditor.cxx.
References QPainter::begin(), FigureEditor::calcPrinterMetrics(), QCanvas::collisions(), QPainter::device(), QCanvas::drawArea(), QPainter::end(), FigureEditor::m_apage_h, FigureEditor::m_apage_w, FigureEditor::m_canvas, FigureEditor::m_scale_factor, QPrinter::newPage(), QPainter::scale(), FigureEditor::setSelectedItems(), and QPainter::translate().
void remove | ( | QCanvasItem * | item | ) |
Removes the item from the canvas and destroys it.
Definition at line 1008 of file FigureEditor.cxx.
References FigureEditor::removeFromItemList(), and FigureEditor::removeSelectedItem().
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.
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(), FigureEditor::m_selected_list, and FigureEditor::setSelectedFlags().
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] |
Saves the printer setting with QSettings.
Definition at line 1509 of file FigureEditor.cxx.
References QSettings::insertSearchPath(), FigureEditor::s_app_key, FigureEditor::s_printer, FigureEditor::s_registry, and QSettings::writeEntry().
Referenced by FigureEditor::setPrinterSettings().
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 |
Returns the selected QCanvasItem.
Definition at line 342 of file FigureEditor.cxx.
References FigureEditor::isSingleItemSelected(), and FigureEditor::m_selected_list.
Referenced by FigureEditor::contentsMouseMoveEvent(), CanvasView::contentsMouseMoveEvent(), CanvasView::contentsMouseReleaseEvent(), CanvasView::fillPickedPoint(), FigureEditor::placeGraphOnSelected(), CanvasView::viewShowPickTable(), and FigureEditor::whereClicked().
void setAllSelected | ( | bool | flag = true |
) |
Sets selection flag on all QCanvasItem objects.
Definition at line 553 of file FigureEditor.cxx.
References FigureEditor::m_items, FigureEditor::m_selected_list, and QCanvasItem::setSelected().
Referenced by CanvasWindow::editSelectAll(), CanvasWindow::setAllSelected(), and FigureEditor::setSelectedFlags().
void setAppKey | ( | const std::string & | ) | [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 | ( | ) |
Set the selected flags.
Definition at line 577 of file FigureEditor.cxx.
References FigureEditor::customEvent(), FigureEditor::m_selected_list, and FigureEditor::setAllSelected().
Referenced by FigureEditor::addSelectedItem(), FigureEditor::contentsMousePressEvent(), FigureEditor::removeSelectedItem(), CanvasView::saveSelectedImages(), and FigureEditor::setSelectedItem().
void setSelectedItem | ( | QCanvasItem * | ) |
Set the selected QCanvasItem.
This is called only when just one item is selected.
Definition at line 634 of file FigureEditor.cxx.
References FigureEditor::addSelectedItem(), QtView::isTextView(), FigureEditor::m_selected_list, FigureEditor::maximumZ(), FigureEditor::notifyObservers(), and FigureEditor::setSelectedFlags().
Referenced by CanvasView::addView(), FigureEditor::contentsMousePressEvent(), FigureEditor::contentsMouseReleaseEvent(), and CanvasWindow::setSelected().
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.
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.
Referenced by FigureEditor::maximumZ(), and CanvasView::saveSelectedImages().
void setZoomMode | ( | bool | flag | ) |
Sets the zoom mode to flag.
Definition at line 1701 of file FigureEditor.cxx.
References FigureEditor::m_zoom_mode, QApplication::restoreOverrideCursor(), and QApplication::setOverrideCursor().
void showPrinterMargins | ( | bool | on | ) |
Sets showing the printer margins on or off.
Definition at line 192 of file FigureEditor.cxx.
References FigureEditor::addPageMargin(), FigureEditor::m_apage_h, FigureEditor::m_canvas, and FigureEditor::m_printer_bounds.
Referenced by FigureEditor::scaleBy(), CanvasView::setup(), and CanvasView::swapOrientation().
virtual void viewShowPickTable | ( | ) | [pure virtual] |
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.
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] |
Finds which knob on the selected item was clicked.
Definition at line 902 of file FigureEditor.cxx.
References FigureEditor::invalid, FigureEditor::isSingleItemSelected(), FigureEditor::lower_left, FigureEditor::lower_middle, FigureEditor::lower_right, FigureEditor::m_moving_start, FigureEditor::m_whereClicked, FigureEditor::middle_left, FigureEditor::middle_right, FigureEditor::none, FigureEditor::selectedItem(), FigureEditor::upper_left, FigureEditor::upper_middle, FigureEditor::upper_right, QPoint::x(), and QPoint::y().
Referenced by FigureEditor::contentsMousePressEvent().
int m_apage_h [protected] |
The actual Page height in Postscript points.
Definition at line 130 of file FigureEditor.h.
Referenced by FigureEditor::addPage(), FigureEditor::addPageMargin(), FigureEditor::calcPrinterMetrics(), FigureEditor::placeGraph(), FigureEditor::print(), FigureEditor::resizeCanvasToFit(), CanvasView::reTilePage(), FigureEditor::scaleBy(), FigureEditor::showPrinterMargins(), and CanvasView::swapOrientation().
int m_apage_w [protected] |
The actual Page width in Postscript points.
Definition at line 127 of file FigureEditor.h.
Referenced by FigureEditor::addPageMargin(), FigureEditor::calcPrinterMetrics(), FigureEditor::placeGraph(), FigureEditor::print(), CanvasView::reTilePage(), FigureEditor::scaleBy(), and CanvasView::swapOrientation().
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 283 of file FigureEditor.h.
Referenced by FigureEditor::add(), FigureEditor::addPage(), FigureEditor::addPageMargin(), FigureEditor::addToItemList(), FigureEditor::contentsMouseMoveEvent(), FigureEditor::contentsMousePressEvent(), FigureEditor::createPixmap(), FigureEditor::mouseMoveMultiItem(), FigureEditor::movePlotterWithText(), FigureEditor::placeGraph(), FigureEditor::placeGraphOnSelected(), FigureEditor::print(), FigureEditor::resizeCanvasToFit(), FigureEditor::resizeEvent(), CanvasView::reTilePage(), FigureEditor::scaleBy(), CanvasView::setVisibleNonViews(), FigureEditor::showPrinterMargins(), and CanvasView::views().
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.
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] |
The starting point of a mouse drag.
Definition at line 296 of file FigureEditor.h.
Referenced by FigureEditor::contentsMouseMoveEvent(), FigureEditor::contentsMousePressEvent(), FigureEditor::mouseMoveMultiItem(), and FigureEditor::whereClicked().
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] |
The list of currently selected QCanvasItem objects.
Definition at line 290 of file FigureEditor.h.
Referenced by FigureEditor::addSelectedItem(), FigureEditor::clear(), FigureEditor::clearSelectedList(), FigureEditor::contentsMousePressEvent(), CanvasView::controlMousePressEvent(), FigureEditor::getSelectedBounds(), FigureEditor::getSelectedItems(), FigureEditor::hide(), FigureEditor::isSingleItemSelected(), FigureEditor::mouseMoveMultiItem(), FigureEditor::removeSelectedItem(), CanvasView::saveSelectedImages(), FigureEditor::selectedItem(), CanvasView::selectedViews(), FigureEditor::setAllSelected(), FigureEditor::setCollidingSelected(), FigureEditor::setSelectedFlags(), FigureEditor::setSelectedItem(), and FigureEditor::setSelectedItems().
int m_upage_h [protected] |
The usable Page height in Postscript points.
Definition at line 225 of file FigureEditor.h.
Referenced by FigureEditor::addPageMargin(), CanvasView::calcDefaultSize(), FigureEditor::calcPrinterMetrics(), FigureEditor::placeGraph(), FigureEditor::scaleBy(), and CanvasView::swapOrientation().
int m_upage_w [protected] |
The usable Page width in Postscript points.
Definition at line 222 of file FigureEditor.h.
Referenced by FigureEditor::addPageMargin(), CanvasView::addPlotDisplay(), CanvasView::calcDefaultSize(), FigureEditor::calcPrinterMetrics(), FigureEditor::placeGraph(), FigureEditor::scaleBy(), and CanvasView::swapOrientation().
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().
The QSettings application key for searching for setting.
The initial value is "HippoDraw", but may be changed by Starkey.
Definition at line 272 of file FigureEditor.h.
Referenced by CanvasView::autosaveSettings(), FigureEditor::getAppKey(), CanvasView::initDockWindows(), CanvasView::initFitterDefault(), FigureEditor::initPrinter(), CanvasView::initRecentFiles(), CanvasView::initSettings(), FigureEditor::savePrinterSettings(), CanvasView::saveSettings(), FigureEditor::setAppKey(), and CanvasView::setFitterDefault().
The single QPrinter instance.
Definition at line 143 of file FigureEditor.h.
Referenced by FigureEditor::calcPrinterMetrics(), FigureEditor::initPrinter(), FigureEditor::print(), FigureEditor::savePrinterSettings(), CanvasView::saveSettings(), FigureEditor::setPrinterSettings(), and CanvasView::setup().
QString s_registry [static, protected] |
The QSettings Windows registry key.
The key is the same as used for by Trolltech for their Qt applications
Definition at line 277 of file FigureEditor.h.
Referenced by CanvasView::autosaveSettings(), FigureEditor::getRegistry(), CanvasView::initDockWindows(), CanvasView::initFitterDefault(), FigureEditor::initPrinter(), CanvasView::initRecentFiles(), CanvasView::initSettings(), FigureEditor::savePrinterSettings(), CanvasView::saveSettings(), and CanvasView::setFitterDefault().