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

CanvasView Class Reference

#include <CanvasView.h>

Inheritance diagram for CanvasView:

Inheritance graph
[legend]
Collaboration diagram for CanvasView:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class implements additional FigureEditor functionality particular to QtView objects.

Attention:
Methods that only need to know about QCanvasItem objects should be implemented in the base class.
Requests:
Coordinates should show when mouse is over plot.
Should be no need for right mouse down.

Requests:
Need remove empty pages menu item.

Bug:
@@ When adding new plot, not all of the new plot becomes visible.

Bug:
@@ When pasting from pasteboard, views are not displayed when pasted on top of existing view.

Bug:
Canvas size doesn't automatically enlarge when size of a view is dragged to be larger than canvas.

Todo:
Should implemented method hasSelectedViews() since in a number of places the implementation calls selectedViews only to ask if vector is empty.

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

Sanket B. Malde <sanket@stanford.edu>

Definition at line 77 of file CanvasView.h.

Public Member Functions

void add (QCanvasItem *item)
 Adds the item to the canvas.
void addFromPasteboard ()
 Adds from pasteboard.
void addFuncDisplay (PlotterBase *plotter, const std::string &s)
 Add a text display which displays functions parameters.
void addPage ()
 Adds a page to the canvas.
void addPlotDisplay (PlotterBase *plotter)
 Creates a QtView object for the display and inserts it onto the canvas in the next available free place.
void addPlotDisplay (PlotterBase *plotter, bool select)
 Creates a QtView object for the display and inserts it onto the canvas in the next available free place.
void addSelectedItem (QCanvasItem *item)
 Add an item to the selected list.
void addTextDisplay (PlotterBase *plotter, const std::string &s, const std::string &text=std::string())
 Add a display of text Adds a display of text to that will be associated with plotter.
std::pair< double, double > addTextDisplayAt (PlotterBase *plotter, const std::string &type, const std::string &text, double xrel, double yrel)
 Adds a text display at the relative position (xrel, yrel) in the selected item's coordinates.
const std::stringapplicationName () const
 Returns the name of the application.
 canvas () const
 CanvasView (QCanvas *, QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
void clear ()
 Removes all the QCanvasItem objects from the canvas.
void copyFromPasteboard ()
 Copies from the pasteboard.
void copySelectedToPasteboard ()
 Copies selected items to pasteboard.
void deleteSelected (bool paste)
 Removes the selected items from canvas and copies them to the pasteboard.
 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 exportTextTuple (const std::string &suffix)
 Saves the DataSource as a text NTuple.
void fillPlotterList (std::vector< PlotterBase * > &plotter_list)
 Clears and fills plotter_list with all the PlotterBase objects on the canvas.
std::vector< double > & getCurrentRange ()
 Returns the current range of the selected plotter.
InspectorgetInspector ()
 Gets the inspector object.
std::vector< QCanvasItem * > & getSelectedItems ()
 Return the vector of selected items.
std::vector< PlotterBase * > getSelectedPlotters () const
 Returns a list of selected plotters.
QtViewgetViewFor (const PlotterBase *plotter) const
 Returns the QtView object that is the Observer of the plotter.
bool getZoomMode () const
 Returns the bool indicating whether zoom mode is enabled or not.
void helpAbout ()
 Brings up dialog version numbers and contributors.
void initFrom (const std::list< ViewBase * > &views)
void initFromFile (const std::string &filename)
 Initializes canvas from data in file filename.
 inverseWorldMatrix () const
bool isSingleItemSelected () const
 Returns true if just one item is selected, else returns false.
const std::vector< double > & mouseEventData ()
 Retrieve a vector of (x, y, z) points from the next mouse event.
void notifyObservers ()
 Notifies observers of a change in CanvasView.
void paste (QCanvasItem *item)
 Adds the item to the canvas.
void pasteViews (const std::list< ViewBase * > &views)
 Adds the views 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.
void previousView ()
 Switches View to the previous view for the selected item on the canvas.
virtual void print (const std::string &filename)
 Prints the view to Postscript file filename.
virtual void print ()
 Prints the canvas.
void remove (QCanvasItem *item)
 Removes the item from the canvas and destroys it.
void removeDisplay (PlotterBase *plotter)
 Removes the display from the canvas.
void removeSelected ()
 Removes the selected objects from the canvas.
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 restoreFromSelectCopy ()
 Restores the selected views from the selection copy.
void reTile ()
 Re-tiles the canvas.
void reTilePage ()
 Re-tiles the current page.
void saveAs (const std::string &filename) const
 Saves the canvas to a XML file.
void savePlotAsImage (const PlotterBase *, const std::string &filename)
 Saves the selected plot as image file filename.
void saveSelectedImages (const std::string &filename)
 Save the selected objects to an image file, overwriting the file.
void saveSelectedImages ()
 Saves the selected QCanvasItem objects to a image file.
void scaleBy (double factor)
 Scales the size of the images by factor.
QCanvasItemselectedItem () const
 Returns the selected QCanvasItem.
PlotterBaseselectedPlotter () const
 Returns the selected PlotterBase object.
const std::vector< const ViewBase * > & selectedViews () const
 Returns temporary list of selected QtView objects on the canvas.
void setAddedSelected (bool yes)
 Sets to flag to make plot in its selected state when added to the canvas.
void setAllSelected (bool flag=true)
 Sets selection flag on all QCanvasItem objects.
 setCanvas (QCanvas *canvas)
void setCurrentRange ()
 Saves the current range of the selected plotter.
void setFonts (const QFont &font)
 Sets the fonts for the views.
void setInspector (Inspector *inspector)
 Sets the Inspector object.
void setIntervalEnabled (bool yes=true)
 Sets the display interval feature of all views to enabled if yes is true, otherwise sets the feature to disable.
void setLocked (bool flag)
 Sets the selected QCanvasItem to be locked in size and position.
void setPlotMatrix (unsigned int columns, unsigned int rows)
 Sets the number of columns and rows of plots displayed on each page.
void setPrinterSettings ()
 Set the default printer settings.
void setSelectedFlags ()
 Set the selected flags.
void setSelectedItem (QCanvasItem *)
 Set the selected QCanvasItem.
void setup ()
 Raises the settings dialog.
 setWorldMatrix (const QWMatrix &wm)
void setZoomMode (bool flag)
 Sets the zoom mode to flag.
void showInspector ()
 Show the Inspector window.
void showPrinterMargins (bool on)
 Sets showing the printer margins on or off.
 sizeHint () const
const std::vector< const ViewBase * > & views () const
 Returns temporary list of all QtView objects on the canvas.
void viewShowPickTable ()
 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 contentsMouseMoveEvent (QMouseEvent *)
 Overrides the QScrollView event handler.
virtual void contentsMousePressEvent (QMouseEvent *)
virtual void contentsMouseReleaseEvent (QMouseEvent *)
 Overrides inherited method to receive mouse released events.
virtual void controlMousePressEvent ()
 Overrides inherited method to receive mouse pressed events.
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.
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.

Private Member Functions

void addView (QtView *view, bool select)
 Adds a QtView object to the CanvasView.
virtual void calcDefaultSize (QtView *view, double aspect_ratio=0.0)
 Sets the default size and position for the view.
QFileDialogcreateImageDialog ()
 Creates the QFileDialog with supported filters string for supported image types.
bool existingFileWarning (const std::string &filename)
 Raises dialog to query over writing existing file.
void fillSelectedWithObservers (std::vector< const ViewBase * > &)
 Fills the input vector with selected items and their observers.
void initSettings ()
 Initialize the settings save from previous session.
void invalidImageFormatError (const std::string &filename)
 Raises dialog box for error in image format.
void moveToPlotter (const PlotterBase *plotter, QtView *view)
 Moves the view to a nice position with respect to the plotter's QCanvasItem.
std::pair< double, double > moveToPlotterAt (const PlotterBase *plotter, QtView *view, double x, double y)
 Moves the view to the specified position with respect to the currently view for plotter.
void placeItems (const std::vector< QCanvasItem * > &items)
 Places each item in items on the canvas.
void saveSelectedAsEps (const std::string &filename)
 Saves the selected objects as EPS image file filename.
void saveSelectedImages (const std::string &filename, bool check_existing)
 Saves the selected objects to image file filename.
void saveSettings () const
 Saves the settings for use in future session.
void setChanged (bool yes=true)
 Sets the canvas as being changed.
void setVisibleNonViews (bool visible)
 Sets visible state of QCanvasItem objects that are not also QtView objects to visible.

Static Private Member Functions

static void createImageFilters ()
 Creates the image filters string.
static bool isValidImageFormat (const std::string &suffix)
 Returns true if suffix string is one for valid image format.
static void toLower (std::string &upper)
 Converts the string to lower case.

Private Attributes

QCanvasRectangledrag_rect
 Rectangle showing the area which is to be magnified.
bool m_add_selected
 Set to true if displays should be selected when added.
std::vector< double > m_current_range
 Set to the current range of the slected plotter.
QFileDialogm_image_dialog
 The QFileDialog for saving images.
Inspectorm_inspector
 The Inspector object.
std::vector< double > m_mouseData
 3-vector of mouse event data
int m_num_height
 Number of default sized plots vertically.
int m_num_width
 Number of default sized plots horizontally.
std::vector< const ViewBase * > m_sel_views
 Temporary list of selected QtView objects on the canvas.
std::map< const QtView *,
PickTable * > 
m_table_map
 A map from a view to the PickTable.
std::vector< const ViewBase * > m_views
 Temporary list of QtView objects on the canvas.
XmlControllerm_xml_controller
 The XML controller.

Static Private Attributes

static const std::string s_app_name = "HippoDraw"
 The application name.
static std::string s_image_filters
 A QFileDialog filters string for supported image types.


Member Enumeration Documentation

enum FigureEditor::Location [protected, inherited]
 

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

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

Definition at line 99 of file CanvasView.cxx.

References QtXMLController::instance().


Member Function Documentation

void FigureEditor::add QCanvasItem item  )  [inherited]
 

Adds the item to the canvas.

Expands the canvas' size if necessary.

Definition at line 1373 of file FigureEditor.cxx.

Referenced by addView(), and initFrom().

void CanvasView::addFromPasteboard  ) 
 

Adds from pasteboard.

Copies from the pasteboard and adds the plot to next available space.

Definition at line 297 of file CanvasView.cxx.

References addView(), XmlController::getFromPasteboard(), QtViewFactory::instance(), m_xml_controller, FigureEditor::placeGraph(), and views().

void CanvasView::addFuncDisplay PlotterBase plotter,
const std::string s
 

Add a text display which displays functions parameters.

Definition at line 801 of file CanvasView.cxx.

References addView(), FunctionController::createFuncView(), QtViewFactory::instance(), FunctionController::instance(), and moveToPlotter().

Referenced by CanvasWindow::addFuncDisplay().

void FigureEditor::addPage  )  [inherited]
 

Adds a page to the canvas.

Definition at line 1590 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 FigureEditor::addPageMargin int  x,
int  y
[protected, inherited]
 

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 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(), and FigureEditor::showPrinterMargins().

void CanvasView::addPlotDisplay PlotterBase plotter  ) 
 

Creates a QtView object for the display and inserts it onto the canvas in the next available free place.

Selects the created view if the user settings for this is true.

Definition at line 571 of file CanvasView.cxx.

References addPlotDisplay(), and m_add_selected.

void CanvasView::addPlotDisplay PlotterBase plotter,
bool  select
 

Creates a QtView object for the display and inserts it onto the canvas in the next available free place.

Selects the created view if select is true.

Definition at line 576 of file CanvasView.cxx.

References addView(), calcDefaultSize(), ViewFactory::createView(), QtViewFactory::instance(), m_inspector, FigureEditor::m_upage_w, FigureEditor::placeGraph(), and setInspector().

Referenced by CanvasWindow::addDisplay(), CanvasWindow::addPlotDisplay(), and addPlotDisplay().

void FigureEditor::addSelectedItem QCanvasItem item  )  [inherited]
 

Add an item to the selected list.

Definition at line 333 of file FigureEditor.cxx.

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

void CanvasView::addTextDisplay PlotterBase plotter,
const std::string s,
const std::string text = std::string()
 

Add a display of text Adds a display of text to that will be associated with plotter.

Uses the optional text if needed by the display.

Definition at line 757 of file CanvasView.cxx.

References addView(), DisplayController::createTextView(), QtViewFactory::instance(), DisplayController::instance(), and moveToPlotter().

Referenced by CanvasWindow::addTextDisplay().

std::pair< double, double > CanvasView::addTextDisplayAt PlotterBase plotter,
const std::string type,
const std::string text,
double  xrel,
double  yrel
 

Adds a text display at the relative position (xrel, yrel) in the selected item's coordinates.

This method returns the relative coordinates of the lower left corner as a pair of doubles.

Definition at line 778 of file CanvasView.cxx.

References addView(), DisplayController::createTextView(), QtViewFactory::instance(), DisplayController::instance(), and moveToPlotterAt().

Referenced by CanvasWindow::addTextDisplayAt().

void CanvasView::addView QtView view,
bool  select
[private]
 

Adds a QtView object to the CanvasView.

If select is true, then sets added object as selected item.

Definition at line 453 of file CanvasView.cxx.

References FigureEditor::add(), FigureEditor::ensureVisible(), fillSelectedWithObservers(), m_xml_controller, notifyObservers(), and FigureEditor::setSelectedItem().

Referenced by addFromPasteboard(), addFuncDisplay(), addPlotDisplay(), addTextDisplay(), and addTextDisplayAt().

const std::string & CanvasView::applicationName  )  const
 

Returns the name of the application.

Definition at line 1691 of file CanvasView.cxx.

References s_app_name.

Referenced by initFromFile().

void CanvasView::calcDefaultSize QtView view,
double  aspect_ratio = 0.0
[private, virtual]
 

Sets the default size and position for the view.

Definition at line 556 of file CanvasView.cxx.

References m_num_height, m_num_width, FigureEditor::m_upage_h, and FigureEditor::m_upage_w.

Referenced by addPlotDisplay().

void FigureEditor::calcPrinterMetrics  )  [protected, inherited]
 

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(), FigureEditor::m_apage_h, FigureEditor::m_apage_w, FigureEditor::m_upage_h, FigureEditor::m_upage_w, QPrinter::printerName(), FigureEditor::s_printer, std::swap(), and QSize::width().

Referenced by FigureEditor::print().

void CanvasView::clear  ) 
 

Removes all the QCanvasItem objects from the canvas.

Reimplemented from FigureEditor.

Definition at line 348 of file CanvasView.cxx.

References FigureEditor::clear(), and notifyObservers().

Referenced by CanvasWindow::clear().

void FigureEditor::clearSelectedList  )  [protected, inherited]
 

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

Definition at line 478 of file FigureEditor.cxx.

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

Referenced by pasteViews().

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

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(), FigureEditor::getZoomMode(), FigureEditor::invalid, QCanvasView::inverseWorldMatrix(), FigureEditor::isSingleItemSelected(), FigureEditor::lower_left, FigureEditor::lower_middle, FigureEditor::lower_right, FigureEditor::m_canvas, FigureEditor::m_whereClicked, QStatusBar::message(), FigureEditor::middle_left, FigureEditor::middle_right, FigureEditor::moving_start, FigureEditor::none, QMouseEvent::pos(), FigureEditor::selectedItem(), QtViewImp::setCrossX(), QtViewImp::setCrossY(), QApplication::setOverrideCursor(), QtView::setShowCrossHairs(), num_util::size(), QMouseEvent::state(), QCanvas::update(), QtView::update(), FigureEditor::upper_left, FigureEditor::upper_middle, FigureEditor::upper_right, QPoint::x(), and QPoint::y().

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

void CanvasView::contentsMouseMoveEvent QMouseEvent  )  [protected, virtual]
 

Overrides the QScrollView event handler.

Definition at line 1179 of file CanvasView.cxx.

References QMouseEvent::button(), QCanvasView::canvas(), FigureEditor::contentsMouseMoveEvent(), drag_rect, ViewBase::getAspectRatio(), FigureEditor::getZoomMode(), QCanvasView::inverseWorldMatrix(), FigureEditor::isSingleItemSelected(), std::max(), std::min(), FigureEditor::selectedItem(), QMouseEvent::state(), QPoint::x(), QPoint::y(), and FigureEditor::zoom_start.

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

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

Reimplemented from FigureEditor.

Definition at line 1164 of file CanvasView.cxx.

References FigureEditor::contentsMousePressEvent(), fillSelectedWithObservers(), m_xml_controller, notifyObservers(), XmlController::saveToSelectionCopy(), and selectedViews().

void CanvasView::contentsMouseReleaseEvent QMouseEvent  )  [protected, virtual]
 

Overrides inherited method to receive mouse released events.

See also:
QSrollView::contentsMouseReleaseEvent.

Definition at line 1439 of file CanvasView.cxx.

References QMouseEvent::button(), QCanvasView::canvas(), QStatusBar::clear(), drag_rect, FigureEditor::getZoomMode(), FigureEditor::invalid, QCanvasView::inverseWorldMatrix(), FigureEditor::isSingleItemSelected(), m_mouseData, m_table_map, FigureEditor::m_whereClicked, std::max(), std::min(), mouseEvent, QMouseEvent::pos(), FigureEditor::selectedItem(), selectedPlotter(), setCurrentRange(), PlotterBase::setCurrentRangeSaved(), QtView::setShowCrossHairs(), QtView::update(), QWaitCondition::wakeAll(), QPoint::x(), QPoint::y(), hippodraw::Axes::Z, and FigureEditor::zoom_start.

void CanvasView::controlMousePressEvent  )  [protected, virtual]
 

Overrides inherited method to receive mouse pressed events.

See also:
QSrollView::contentsMousePressEvent.

Implements FigureEditor.

Definition at line 1133 of file CanvasView.cxx.

References ViewBase::getPlotter(), and FigureEditor::m_selected_list.

void CanvasView::copyFromPasteboard  ) 
 

Copies from the pasteboard.

Copies from pasteboard and pastes the views to the canvas.

Definition at line 285 of file CanvasView.cxx.

References XmlController::getFromPasteboard(), QtViewFactory::instance(), m_xml_controller, pasteViews(), and views().

Referenced by CanvasWindow::editPaste().

void CanvasView::copySelectedToPasteboard  ) 
 

Copies selected items to pasteboard.

Bug:
If plot being copied is target of a cut, then cut should also be copied.

Definition at line 273 of file CanvasView.cxx.

References fillSelectedWithObservers(), m_xml_controller, XmlController::saveToPasteboard(), and selectedViews().

Referenced by CanvasWindow::editCopy().

QFileDialog * CanvasView::createImageDialog  )  [private]
 

Creates the QFileDialog with supported filters string for supported image types.

Definition at line 1000 of file CanvasView.cxx.

References createImageFilters(), s_image_filters, QFileDialog::setFilters(), and QFileDialog::setMode().

Referenced by saveSelectedImages().

void CanvasView::createImageFilters  )  [static, private]
 

Creates the image filters string.

Definition at line 953 of file CanvasView.cxx.

References QString::latin1(), QString::lower(), QImage::outputFormatList(), QImageIO::outputFormats(), and s_image_filters.

Referenced by createImageDialog(), invalidImageFormatError(), and isValidImageFormat().

void CanvasView::deleteSelected bool  paste  ) 
 

Removes the selected items from canvas and copies them to the pasteboard.

if paste is true.

Definition at line 315 of file CanvasView.cxx.

References fillSelectedWithObservers(), DisplayController::instance(), m_xml_controller, notifyObservers(), FigureEditor::remove(), DisplayController::removeTextObservers(), XmlController::saveToPasteboard(), and selectedViews().

Referenced by CanvasWindow::editCut(), and CanvasWindow::editDelete().

void FigureEditor::ensureVisible const QCanvasItem item  )  [inherited]
 

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 addView().

bool CanvasView::existingFileWarning const std::string filename  )  [private]
 

Raises dialog to query over writing existing file.

Definition at line 251 of file CanvasView.cxx.

References QMessageBox::warning().

Referenced by saveSelectedImages().

void CanvasView::exportTextTuple const std::string suffix  ) 
 

Saves the DataSource as a text NTuple.

Save the DataSource as a text NTuple. Saves the file with a file name suffix suffix.

Definition at line 1379 of file CanvasView.cxx.

References QString::endsWith(), DataSourceController::getNTupleNames(), QFileDialog::getSaveFileName(), QMessageBox::information(), NTupleController::instance(), DataSourceController::instance(), QString::latin1(), m_inspector, notifyObservers(), s_app_name, QString::upper(), and NTupleController::writeNTupleToFile().

void CanvasView::fillPlotterList std::vector< PlotterBase * > &  plotter_list  ) 
 

Clears and fills plotter_list with all the PlotterBase objects on the canvas.

Definition at line 914 of file CanvasView.cxx.

References ViewBase::getPlotter(), and views().

void CanvasView::fillSelectedWithObservers std::vector< const ViewBase * > &   )  [private]
 

Fills the input vector with selected items and their observers.

Definition at line 1151 of file CanvasView.cxx.

References DisplayController::addTextViewToList(), std::copy(), DisplayController::instance(), selectedViews(), and views().

Referenced by addView(), contentsMousePressEvent(), copySelectedToPasteboard(), and deleteSelected().

std::vector< double > & CanvasView::getCurrentRange  ) 
 

Returns the current range of the selected plotter.

Definition at line 1578 of file CanvasView.cxx.

References m_current_range.

Inspector * CanvasView::getInspector  ) 
 

Gets the inspector object.

Definition at line 394 of file CanvasView.cxx.

References m_inspector.

QRect FigureEditor::getSelectedBounds  )  const [protected, inherited]
 

Returns a QRect that enclosed the selected QCanvasItem objects.

Definition at line 367 of file FigureEditor.cxx.

References FigureEditor::m_selected_list.

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

std::vector< QCanvasItem * > & FigureEditor::getSelectedItems  )  [inherited]
 

Return the vector of selected items.

Definition at line 325 of file FigureEditor.cxx.

References FigureEditor::m_selected_list.

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

vector< PlotterBase * > CanvasView::getSelectedPlotters  )  const
 

Returns a list of selected plotters.

Definition at line 421 of file CanvasView.cxx.

References selectedViews(), and num_util::size().

Referenced by notifyObservers().

QtView * CanvasView::getViewFor const PlotterBase plotter  )  const
 

Returns the QtView object that is the Observer of the plotter.

Definition at line 932 of file CanvasView.cxx.

References ViewBase::getPlotter(), and views().

Referenced by CanvasWindow::getViewFor(), moveToPlotter(), moveToPlotterAt(), removeDisplay(), and savePlotAsImage().

bool FigureEditor::getZoomMode  )  const [inherited]
 

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

Definition at line 1648 of file FigureEditor.cxx.

References FigureEditor::m_zoom_mode.

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

void CanvasView::helpAbout  ) 
 

Brings up dialog version numbers and contributors.

Definition at line 1635 of file CanvasView.cxx.

References RootController::instance(), FitsController::instance(), QMessageBox::setButtonText(), WindowController::version(), and hippodraw::version().

void CanvasView::initFrom const std::list< ViewBase * > &  views  ) 
 

Definition at line 167 of file CanvasView.cxx.

References FigureEditor::add().

Referenced by initFromFile().

void CanvasView::initFromFile const std::string filename  ) 
 

Initializes canvas from data in file filename.

Definition at line 184 of file CanvasView.cxx.

References applicationName(), QString::arg(), QMessageBox::critical(), XmlController::getViews(), initFrom(), QtViewFactory::instance(), m_xml_controller, notifyObservers(), XmlController::OpenError, XmlController::openFile(), XmlController::ParseError, and XmlController::Success.

void FigureEditor::initPrinter  )  [protected, inherited]
 

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(), FigureEditor::s_app_key, FigureEditor::s_printer, FigureEditor::s_registry, QPrinter::setFullPage(), QPrinter::setOrientation(), QPrinter::setPageSize(), and num_util::size().

void CanvasView::initSettings  )  [private]
 

Initialize the settings save from previous session.

Definition at line 121 of file CanvasView.cxx.

References QSettings::insertSearchPath(), m_add_selected, m_num_height, m_num_width, QSettings::readBoolEntry(), QSettings::readNumEntry(), FigureEditor::s_app_key, and FigureEditor::s_registry.

void CanvasView::invalidImageFormatError const std::string filename  )  [private]
 

Raises dialog box for error in image format.

Definition at line 224 of file CanvasView.cxx.

References createImageFilters(), QMessageBox::critical(), s_image_filters, num_util::size(), and hippodraw::Symbol::types.

Referenced by saveSelectedImages().

bool FigureEditor::isSingleItemSelected  )  const [inherited]
 

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

Definition at line 296 of file FigureEditor.cxx.

References FigureEditor::m_selected_list.

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

bool CanvasView::isValidImageFormat const std::string suffix  )  [static, private]
 

Returns true if suffix string is one for valid image format.

Definition at line 1261 of file CanvasView.cxx.

References createImageFilters(), s_image_filters, and toLower().

Referenced by saveSelectedImages().

double FigureEditor::maximumZ  )  const [protected, inherited]
 

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

Definition at line 394 of file FigureEditor.cxx.

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

Referenced by FigureEditor::setSelectedItem().

const std::vector< double > & CanvasView::mouseEventData  ) 
 

Retrieve a vector of (x, y, z) points from the next mouse event.

Definition at line 1622 of file CanvasView.cxx.

References m_mouseData, mouseEvent, and QWaitCondition::wait().

Referenced by CanvasWindow::mouseEventData().

void CanvasView::moveToPlotter const PlotterBase plotter,
QtView view
[private]
 

Moves the view to a nice position with respect to the plotter's QCanvasItem.

Definition at line 716 of file CanvasView.cxx.

References getViewFor(), QRect::height(), and QRect::width().

Referenced by addFuncDisplay(), and addTextDisplay().

std::pair< double, double > CanvasView::moveToPlotterAt const PlotterBase plotter,
QtView view,
double  x,
double  y
[private]
 

Moves the view to the specified position with respect to the currently view for plotter.

Definition at line 730 of file CanvasView.cxx.

References getViewFor(), QRect::height(), and QRect::width().

Referenced by addTextDisplayAt().

void CanvasView::notifyObservers  )  [virtual]
 

Notifies observers of a change in CanvasView.

Attention:
This method is implemented using QApplication::postEvent mechanism. It appears that under Microsoft Windows, that when code supporting one window wants to call a method in code supporting another window that the event mechanism must be used. Otherwise, the application freezes solid.

Implements FigureEditor.

Definition at line 408 of file CanvasView.cxx.

References getSelectedPlotters(), m_inspector, QApplication::postEvent(), and setChanged().

Referenced by addView(), clear(), contentsMousePressEvent(), deleteSelected(), CanvasWindow::editUndo(), exportTextTuple(), initFromFile(), and restoreFromSelectCopy().

void FigureEditor::paste QCanvasItem item  )  [inherited]
 

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 pasteViews().

void CanvasView::pasteViews const std::list< ViewBase * > &  views  ) 
 

Adds the views to the canvas.

Adds the views slightly displayed from their original position.

Definition at line 375 of file CanvasView.cxx.

References FigureEditor::addSelectedItem(), FigureEditor::clearSelectedList(), FigureEditor::paste(), and setChanged().

Referenced by copyFromPasteboard(), and restoreFromSelectCopy().

void FigureEditor::placeGraph QCanvasRectangle  )  [inherited]
 

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 addFromPasteboard(), and addPlotDisplay().

void FigureEditor::placeGraphOnSelected QCanvasRectangle view  )  [protected, inherited]
 

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 CanvasView::placeItems const std::vector< QCanvasItem * > &  items  )  [private]
 

Places each item in items on the canvas.

Definition at line 663 of file CanvasView.cxx.

References reTilePage().

Referenced by reTile(), and reTilePage().

void CanvasView::previousView  ) 
 

Switches View to the previous view for the selected item on the canvas.

void FigureEditor::print QPrinter printer  )  [protected, inherited]
 

Prints the view to the printer.

Definition at line 1537 of file FigureEditor.cxx.

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

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

Prints the view to Postscript file filename.

Reimplemented from FigureEditor.

Definition at line 859 of file CanvasView.cxx.

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

void CanvasView::print  )  [virtual]
 

Prints the canvas.

Prints the QtView items on the canvas.

Reimplemented from FigureEditor.

Definition at line 850 of file CanvasView.cxx.

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

Referenced by CanvasWindow::filePrint(), and setVisibleNonViews().

void FigureEditor::remove QCanvasItem item  )  [inherited]
 

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 deleteSelected(), removeDisplay(), and removeSelected().

void CanvasView::removeDisplay PlotterBase plotter  ) 
 

Removes the display from the canvas.

Bug:
Need to also remove any views observing this plotter as cutSelectedToPasteboard does.

Definition at line 819 of file CanvasView.cxx.

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

Referenced by CanvasWindow::removeDisplay().

void FigureEditor::removeFromItemList QCanvasItem item  )  [protected, inherited]
 

Removes the item from list of items on the canvas.

Definition at line 837 of file FigureEditor.cxx.

References std::remove().

Referenced by reTilePage().

void CanvasView::removeSelected  ) 
 

Removes the selected objects from the canvas.

Bug:
Need to remove any text displays that are observing this view as cutSelectedToPasteboard does.

Definition at line 358 of file CanvasView.cxx.

References FigureEditor::remove(), selectedViews(), and views().

Referenced by restoreFromSelectCopy().

void FigureEditor::removeSelectedItem QCanvasItem item  )  [inherited]
 

Removes an item from the selection list.

Definition at line 350 of file FigureEditor.cxx.

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

Referenced by FigureEditor::contentsMousePressEvent().

void FigureEditor::resizeCanvasToFit QCanvasItem item  )  [protected, inherited]
 

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  )  [inherited]
 

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(), FigureEditor::m_canvas, QCanvas::resize(), QResizeEvent::size(), QCanvas::width(), and QSize::width().

Referenced by CanvasWindow::resizeEvent().

void CanvasView::restoreFromSelectCopy  ) 
 

Restores the selected views from the selection copy.

Definition at line 1116 of file CanvasView.cxx.

References XmlController::getFromSelectionCopy(), QtViewFactory::instance(), m_xml_controller, notifyObservers(), pasteViews(), removeSelected(), and views().

Referenced by CanvasWindow::editUndo().

void CanvasView::reTile  ) 
 

Re-tiles the canvas.

Removes all items from the canvas and adding them back with the default size and positions.

Definition at line 624 of file CanvasView.cxx.

References std::bind2nd(), std::for_each(), FigureEditor::m_items, std::mem_fun(), placeItems(), QCanvasItem::setCanvas(), std::sort(), and sortViews().

Referenced by CanvasWindow::editReTile(), and setup().

void CanvasView::reTilePage  ) 
 

Re-tiles the current page.

Definition at line 683 of file CanvasView.cxx.

References FigureEditor::m_apage_h, FigureEditor::m_apage_w, FigureEditor::m_canvas, placeItems(), and FigureEditor::removeFromItemList().

Referenced by CanvasWindow::editReTilePage(), and placeItems().

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

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(), FigureEditor::m_canvas, QPixmap::save(), FigureEditor::setSelectedItems(), QPainter::translate(), QRect::width(), QRect::x(), and QRect::y().

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

void CanvasView::saveAs const std::string filename  )  const
 

Saves the canvas to a XML file.

Requests:
Raise error dialog if saving to file was not successful.

Definition at line 1363 of file CanvasView.cxx.

References m_xml_controller, XmlController::saveToFile(), XmlController::Success, and views().

void CanvasView::savePlotAsImage const PlotterBase ,
const std::string filename
 

Saves the selected plot as image file filename.

If filename has a suffix, then use the suffix to select the image format. If no suffix is given, use the last selected suffix, or "jpg" if one had not previously been selected.

Definition at line 1237 of file CanvasView.cxx.

References getViewFor(), and FigureEditor::saveAreaAsPixmap().

void FigureEditor::savePrinterSettings  )  [protected, inherited]
 

Saves the printer setting with QSettings.

Definition at line 1492 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 CanvasView::saveSelectedAsEps const std::string filename  )  [private]
 

Saves the selected objects as EPS image file filename.

Definition at line 1329 of file CanvasView.cxx.

References ViewBase::getPlotter(), FigureEditor::getSelectedBounds(), QRect::height(), QCanvasRectangle::rect(), selectedViews(), QRect::width(), QRect::x(), and QRect::y().

Referenced by saveSelectedImages().

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

Save the selected objects as Pixmap image file filename.

Definition at line 1601 of file FigureEditor.cxx.

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

Referenced by saveSelectedImages().

void CanvasView::saveSelectedImages const std::string filename,
bool  check_existing
[private]
 

Saves the selected objects to image file filename.

If filename has a suffix, then use the suffix to select the image format. If no suffix is given, use the last selected suffix, or "jpg" if one had not previously been selected. If check_existing is is true, then raise dialog if file already exists, otherwise over-write any existing file.

Definition at line 1276 of file CanvasView.cxx.

References existingFileWarning(), QFile::exists(), invalidImageFormatError(), isValidImageFormat(), QString::latin1(), m_image_dialog, saveSelectedAsEps(), FigureEditor::saveSelectedAsPixmap(), QFileDialog::selectedFilter(), FigureEditor::setUnselectedVisible(), and setVisibleNonViews().

void CanvasView::saveSelectedImages const std::string filename  ) 
 

Save the selected objects to an image file, overwriting the file.

Definition at line 1070 of file CanvasView.cxx.

References FigureEditor::getSelectedItems(), FigureEditor::m_selected_list, saveSelectedImages(), FigureEditor::setCollidingSelected(), FigureEditor::setSelectedFlags(), setVisibleNonViews(), and views().

void CanvasView::saveSelectedImages  ) 
 

Saves the selected QCanvasItem objects to a image file.

Definition at line 1025 of file CanvasView.cxx.

References createImageDialog(), FigureEditor::getSelectedItems(), QString::isEmpty(), QString::latin1(), m_image_dialog, FigureEditor::m_selected_list, QFileDialog::selectedFile(), FigureEditor::setCollidingSelected(), FigureEditor::setSelectedFlags(), setVisibleNonViews(), and views().

Referenced by CanvasWindow::fileSaveSelectedImages(), and saveSelectedImages().

void CanvasView::saveSettings  )  const [private]
 

Saves the settings for use in future session.

Definition at line 138 of file CanvasView.cxx.

References QSettings::insertSearchPath(), m_add_selected, m_num_height, m_num_width, FigureEditor::m_printer_bounds, FigureEditor::s_app_key, FigureEditor::s_printer, FigureEditor::s_registry, and QSettings::writeEntry().

Referenced by setup().

void FigureEditor::scaleBy double  factor  )  [inherited]
 

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 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 * FigureEditor::selectedItem  )  const [inherited]
 

Returns the selected QCanvasItem.

Definition at line 307 of file FigureEditor.cxx.

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

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

PlotterBase * CanvasView::selectedPlotter  )  const
 

Returns the selected PlotterBase object.

Definition at line 436 of file CanvasView.cxx.

References selectedViews().

Referenced by contentsMouseReleaseEvent(), CanvasWindow::nextView(), CanvasWindow::previousView(), CanvasWindow::selectedPlotter(), and setCurrentRange().

const vector< const ViewBase * > & CanvasView::selectedViews  )  const
 

Returns temporary list of selected QtView objects on the canvas.

The list is valid until the next time this function or views is called.

Definition at line 869 of file CanvasView.cxx.

References m_sel_views, and FigureEditor::m_selected_list.

Referenced by contentsMousePressEvent(), copySelectedToPasteboard(), deleteSelected(), fillSelectedWithObservers(), getSelectedPlotters(), removeSelected(), saveSelectedAsEps(), selectedPlotter(), and CanvasWindow::updateActions().

void CanvasView::setAddedSelected bool  yes  ) 
 

Sets to flag to make plot in its selected state when added to the canvas.

Definition at line 162 of file CanvasView.cxx.

References m_add_selected.

void FigureEditor::setAllSelected bool  flag = true  )  [inherited]
 

Sets selection flag on all QCanvasItem objects.

Definition at line 489 of file FigureEditor.cxx.

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

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

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

Sets the QSettings application key.

Definition at line 150 of file FigureEditor.cxx.

References FigureEditor::s_app_key.

void CanvasView::setChanged bool  yes = true  )  [private]
 

Sets the canvas as being changed.

Definition at line 399 of file CanvasView.cxx.

References CanvasWindow::setChanged().

Referenced by notifyObservers(), and pasteViews().

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

Sets all QCanvasItems that collide with target to selected state.

Definition at line 435 of file FigureEditor.cxx.

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

Referenced by saveSelectedImages().

void CanvasView::setCurrentRange  ) 
 

Saves the current range of the selected plotter.

Definition at line 1560 of file CanvasView.cxx.

References m_current_range, selectedPlotter(), hippodraw::Axes::X, and hippodraw::Axes::Y.

Referenced by contentsMouseReleaseEvent().

void CanvasView::setFonts const QFont font  ) 
 

Sets the fonts for the views.

Definition at line 541 of file CanvasView.cxx.

References views().

void CanvasView::setInspector Inspector inspector  ) 
 

Sets the Inspector object.

The Inspector object will receive notification of changes to the canvas.

Definition at line 388 of file CanvasView.cxx.

References Inspector::enableNewPlotBox(), and m_inspector.

Referenced by addPlotDisplay(), and WindowController::newWindow().

void CanvasView::setIntervalEnabled bool  yes = true  ) 
 

Sets the display interval feature of all views to enabled if yes is true, otherwise sets the feature to disable.

Todo:
Move this method and others that use PlotterBase to a controller.
This logic is independent of the GUI so should not be here.

Definition at line 1101 of file CanvasView.cxx.

References ViewBase::getPlotter(), DisplayController::instance(), and views().

Referenced by CanvasWindow::setIntervalEnabled().

void FigureEditor::setLocked bool  flag  )  [inherited]
 

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(), FigureEditor::getSelectedItems(), std::mem_fun(), and QCanvasItem::setActive().

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

void CanvasView::setPlotMatrix unsigned int  columns,
unsigned int  rows
 

Sets the number of columns and rows of plots displayed on each page.

Definition at line 469 of file CanvasView.cxx.

References m_num_height, and m_num_width.

Referenced by setup().

void FigureEditor::setPrinterSettings  )  [inherited]
 

Set the default printer settings.

Definition at line 1504 of file FigureEditor.cxx.

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

void FigureEditor::setSelectedFlags  )  [inherited]
 

Set the selected flags.

Definition at line 513 of file FigureEditor.cxx.

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

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

void FigureEditor::setSelectedItem QCanvasItem  )  [inherited]
 

Set the selected QCanvasItem.

This is called only when just one item is selected.

Definition at line 536 of file FigureEditor.cxx.

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

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

void FigureEditor::setSelectedItems bool  state  )  [protected, inherited]
 

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 FigureEditor::m_selected_list.

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

void FigureEditor::setUnselectedVisible bool  yes  )  [protected, inherited]
 

Sets the unselected items to visible or not.

Definition at line 416 of file FigureEditor.cxx.

References FigureEditor::m_items.

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

void CanvasView::setup  ) 
 

Raises the settings dialog.

Definition at line 477 of file CanvasView.cxx.

References CanvasSettings::AcceptedAndRetile, QCanvasView::canvas(), m_add_selected, FigureEditor::m_apage_h, FigureEditor::m_apage_w, m_num_height, m_num_width, FigureEditor::m_printer_bounds, FigureEditor::m_upage_h, FigureEditor::m_upage_w, reTile(), CanvasSettings::Retile, FigureEditor::s_printer, saveSettings(), setPlotMatrix(), FigureEditor::showPrinterMargins(), and std::swap().

void CanvasView::setVisibleNonViews bool  visible  )  [private]
 

Sets visible state of QCanvasItem objects that are not also QtView objects to visible.

Definition at line 828 of file CanvasView.cxx.

References QCanvas::allItems(), FigureEditor::m_canvas, and print().

Referenced by print(), and saveSelectedImages().

void FigureEditor::setZoomMode bool  flag  )  [inherited]
 

Sets the zoom mode to flag.

Definition at line 1634 of file FigureEditor.cxx.

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

void CanvasView::showInspector  ) 
 

Show the Inspector window.

Definition at line 1585 of file CanvasView.cxx.

References m_inspector.

void FigureEditor::showPrinterMargins bool  on  )  [inherited]
 

Sets showing the printer margins on or off.

Definition at line 157 of file FigureEditor.cxx.

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

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

void CanvasView::toLower std::string upper  )  [static, private]
 

Converts the string to lower case.

Definition at line 1251 of file CanvasView.cxx.

References num_util::size().

Referenced by isValidImageFormat().

const vector< const ViewBase * > & CanvasView::views  )  const
 

Returns temporary list of all QtView objects on the canvas.

The list is valid until the next time this function or selectedViews is called.

Definition at line 891 of file CanvasView.cxx.

References QCanvas::allItems(), FigureEditor::m_canvas, and m_views.

Referenced by addFromPasteboard(), CanvasWindow::areDataSourcesSaved(), copyFromPasteboard(), fillPlotterList(), fillSelectedWithObservers(), getViewFor(), PlotTable::initialize(), removeSelected(), restoreFromSelectCopy(), saveAs(), saveSelectedImages(), setFonts(), setIntervalEnabled(), and CanvasWindow::views().

void CanvasView::viewShowPickTable  )  [virtual]
 

Show the pick table.

Implements FigureEditor.

Definition at line 1592 of file CanvasView.cxx.

References ViewBase::getPlotter(), FigureEditor::isSingleItemSelected(), m_table_map, and FigureEditor::selectedItem().

Referenced by CanvasWindow::viewShowPickTable().

void FigureEditor::viewZoomIn  )  [inherited]
 

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  )  [inherited]
 

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  )  [inherited]
 

Returns the view to normal size.

Definition at line 1478 of file FigureEditor.cxx.

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

void FigureEditor::whereClicked  )  [protected, inherited]
 

Finds which knob on the selected item was clicked.

Definition at line 758 of file FigureEditor.cxx.

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

Referenced by FigureEditor::contentsMousePressEvent().


Member Data Documentation

QCanvasRectangle* CanvasView::drag_rect [private]
 

Rectangle showing the area which is to be magnified.

Definition at line 104 of file CanvasView.h.

Referenced by contentsMouseMoveEvent(), and contentsMouseReleaseEvent().

bool CanvasView::m_add_selected [private]
 

Set to true if displays should be selected when added.

Definition at line 131 of file CanvasView.h.

Referenced by addPlotDisplay(), initSettings(), saveSettings(), setAddedSelected(), and setup().

int FigureEditor::m_apage_h [protected, inherited]
 

The actual Page height in Postscript points.

Definition at line 76 of file FigureEditor.h.

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

int FigureEditor::m_apage_w [protected, inherited]
 

The actual Page width in Postscript points.

Definition at line 73 of file FigureEditor.h.

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

QCanvas* FigureEditor::m_canvas [protected, inherited]
 

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 FigureEditor::addPage(), FigureEditor::addPageMargin(), FigureEditor::contentsMouseMoveEvent(), FigureEditor::contentsMousePressEvent(), FigureEditor::print(), FigureEditor::resizeEvent(), reTilePage(), FigureEditor::saveAreaAsPixmap(), FigureEditor::scaleBy(), setVisibleNonViews(), FigureEditor::showPrinterMargins(), and views().

std::vector<double> CanvasView::m_current_range [private]
 

Set to the current range of the slected plotter.

Definition at line 136 of file CanvasView.h.

Referenced by getCurrentRange(), and setCurrentRange().

QFileDialog* CanvasView::m_image_dialog [private]
 

The QFileDialog for saving images.

The file dialog for saving images. It contains the supported image format file filters. each CanvasView has its own, if needed, because the dialog must have a parent widget.

Definition at line 112 of file CanvasView.h.

Referenced by saveSelectedImages().

Inspector* CanvasView::m_inspector [private]
 

The Inspector object.

See also:
setInspector.

Definition at line 94 of file CanvasView.h.

Referenced by addPlotDisplay(), exportTextTuple(), getInspector(), notifyObservers(), setInspector(), and showInspector().

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

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 FigureEditor::clear(), FigureEditor::contentsMousePressEvent(), FigureEditor::maximumZ(), reTile(), FigureEditor::setAllSelected(), FigureEditor::setCollidingSelected(), and FigureEditor::setUnselectedVisible().

std::vector<double> CanvasView::m_mouseData [private]
 

3-vector of mouse event data

Definition at line 119 of file CanvasView.h.

Referenced by contentsMouseReleaseEvent(), and mouseEventData().

int CanvasView::m_num_height [private]
 

Number of default sized plots vertically.

Definition at line 127 of file CanvasView.h.

Referenced by calcDefaultSize(), initSettings(), saveSettings(), setPlotMatrix(), and setup().

int CanvasView::m_num_width [private]
 

Number of default sized plots horizontally.

Definition at line 123 of file CanvasView.h.

Referenced by calcDefaultSize(), initSettings(), saveSettings(), setPlotMatrix(), and setup().

bool FigureEditor::m_printer_bounds [protected, inherited]
 

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 FigureEditor::addPageMargin(), saveSettings(), FigureEditor::scaleBy(), setup(), and FigureEditor::showPrinterMargins().

double FigureEditor::m_scale_factor [protected, inherited]
 

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 FigureEditor::print(), and FigureEditor::scaleBy().

std::vector< const ViewBase * > CanvasView::m_sel_views [mutable, private]
 

Temporary list of selected QtView objects on the canvas.

Definition at line 85 of file CanvasView.h.

Referenced by selectedViews().

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

The list of currently selected QCanvasItem objects.

Definition at line 178 of file FigureEditor.h.

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

std::map< const QtView *, PickTable * > CanvasView::m_table_map [private]
 

A map from a view to the PickTable.

Definition at line 88 of file CanvasView.h.

Referenced by contentsMouseReleaseEvent(), and viewShowPickTable().

int FigureEditor::m_upage_h [protected, inherited]
 

The usable Page height in Postscript points.

Definition at line 139 of file FigureEditor.h.

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

int FigureEditor::m_upage_w [protected, inherited]
 

The usable Page width in Postscript points.

Definition at line 136 of file FigureEditor.h.

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

std::vector< const ViewBase * > CanvasView::m_views [mutable, private]
 

Temporary list of QtView objects on the canvas.

Definition at line 82 of file CanvasView.h.

Referenced by views().

Location FigureEditor::m_whereClicked [protected, inherited]
 

Location where the mouse cursor clicked the object.

Definition at line 197 of file FigureEditor.h.

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

XmlController* CanvasView::m_xml_controller [private]
 

The XML controller.

Definition at line 91 of file CanvasView.h.

Referenced by addFromPasteboard(), addView(), contentsMousePressEvent(), copyFromPasteboard(), copySelectedToPasteboard(), deleteSelected(), initFromFile(), restoreFromSelectCopy(), and saveAs().

bool FigureEditor::m_zoom_mode [protected, inherited]
 

Set to true if zoom Mode is enabled.

Definition at line 86 of file FigureEditor.h.

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

QPoint FigureEditor::moving_start [protected, inherited]
 

The starting point of a mouse drag.

Definition at line 184 of file FigureEditor.h.

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

QString FigureEditor::s_app_key [static, protected, inherited]
 

The QSettings application key for searching for setting.

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

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

const string CanvasView::s_app_name = "HippoDraw" [static, private]
 

The application name.

Definition at line 91 of file CanvasView.cxx.

Referenced by applicationName(), and exportTextTuple().

string CanvasView::s_image_filters [static, private]
 

A QFileDialog filters string for supported image types.

Definition at line 92 of file CanvasView.cxx.

Referenced by createImageDialog(), createImageFilters(), invalidImageFormatError(), and isValidImageFormat().

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

The single QPrinter instance.

Definition at line 83 of file FigureEditor.cxx.

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

QString FigureEditor::s_registry [static, protected, inherited]
 

The QSettings Windows registry key.

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

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

QPoint FigureEditor::zoom_start [protected, inherited]
 

The starting point of a mouse drag.for zoom.

Definition at line 187 of file FigureEditor.h.

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


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