#include <CanvasWindow.h>
Inheritance diagram for CanvasWindow:


Kaustuv <kaustuv@stanford.edu>
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>
Sanket B. Malde <sanket@stanford.edu>
Definition at line 106 of file CanvasWindow.h.
Public Member Functions | |
| void | addDisplay (PlotterBase *plotter) |
| Adds a new plot to the canvas and selects it. | |
| void | addFuncDisplay (PlotterBase *plotter, const std::string &name) |
| Adds function textual display to the canvas. | |
| void | addPlotDisplay (PlotterBase *plotter, bool select) |
| Adds a new plot display to the canvas. | |
| void | addPlotDisplay (PlotterBase *plotter) |
| Adds a new plot display to the canvas. | |
| void | addTextDisplay (PlotterBase *plotter, const std::string &type, const std::string &text) |
| Adds a textual display to the canvas of type type. | |
| void | addTextDisplay (PlotterBase *plotter, const std::string &type) |
| Adds a textual display to the canvas of type type. | |
| 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. | |
| bool | allowClose () |
| If document has changed and not saved, opens a dialog box for user to choose to save, discard or cancel. | |
| CanvasWindow (const CanvasWindow &) | |
| A copy constructor that does nothing except keep boost.python happy. | |
| CanvasWindow (QWidget *parent=0, const char *name=0, Qt::WFlags fl=Qt::WType_TopLevel) | |
| constructor. | |
| void | clear () |
| Removes all items from the canvas. | |
| virtual bool | closeNoPrompt () |
| Closes the window. | |
| virtual void | customEvent (QCustomEvent *event) |
| Responds to QCustomEvents. | |
| virtual void | fileNew () |
| Creates a new document CanvasWindow. | |
| void | fileSave () |
| Saves the document. | |
| virtual void | fileSaveAs () |
| Saves the document after display a file dialog to the user. | |
| virtual void | fileSaveSelectedImages (const std::string &filename) |
| Saves the selected ViewBase objects as an image file with the given filename. | |
| virtual void | fileSaveSelectedImages () |
| Saves the selected ViewBase object as an image file. | |
| void | fillPlotterList (std::vector< PlotterBase * > &plotter_list) |
| Clears and fills plotter_list with all the PlotterBase objects on the canvas. | |
| CanvasView * | getCanvasView () |
| Returns the CanvasView object. | |
| QtView * | getViewFor (const PlotterBase *plotter) const |
| Returns the QtView object that is the Observer of the plotter. | |
| void | inhibitClose (bool yes=true) |
If yes is true, sets a flag so that this object will not accept close events. | |
| void | initFromFile (const std::string &filename) |
| Initializes this object from contents of file. | |
| const std::vector< double > & | mouseEventData () |
| Retrieve a vector (x, y, z) points from the next mouse event. | |
| void | print (const std::string &filename) |
| Prints the view to Postscript file without prompting user. | |
| void | removeDisplay (PlotterBase *plotter) |
| Removes the plotter and its view from the canvas. | |
| void | saveAllAs (const std::string &filename) |
| Saves the document along with its NTuple objects. | |
| void | saveAs (const std::string &filename) |
| Saves the document to the specified file. | |
| void | saveAsImage (const PlotterBase *plotter, const std::string &filename) |
| Saves the plotter as image file. | |
| void | savePlotAsImage (const PlotterBase *plotter, const std::string &filename) |
| Saves the plotter as image file. | |
| void | savePlotAsImageImmediate (const PlotterBase *plotter, const std::string &filename) |
| Save plot as image file without posting an event. | |
| PlotterBase * | selectedPlotter () |
| Returns the selected plotter. | |
| void | setAddedSelected (bool yes) |
| Sets to flag to make plots in their selected state when added to the canvas. | |
| void | setAllowClose (bool yes=true) |
| Sets the window to allowed to be closed by user without prompting. | |
| void | setAllSelected (bool flag=true) |
| Select or de-select all views in the window. | |
| void | setCaption () |
| Sets the Windows title. | |
| void | setChanged (bool flag=true) |
| Sets the changed flag. | |
| void | setIntervalEnabled (bool yes=true) |
Sets the display interval feature to enabled if yes is true, otherwise sets it to disabled. | |
| void | setPlotMatrix (unsigned int columns, unsigned int rows) |
| Sets the number of columns and rows of plots on each page. | |
| void | setSelected (QtView *view) |
| Select a specific view in the window. | |
| void | updateActions () |
| Update Action objects. | |
| const std::vector< const ViewBase * > & | views () |
| Returns the list of ViewBase objects on the canvas. | |
| virtual | ~CanvasWindow () |
Static Public Member Functions | |
| static void | resetFontSize () |
| Resets the font size to be no larger than 10. | |
Protected Slots | |
| virtual void | on_fileBrowse_actived () |
| Browse a document file, without opening a window for it. | |
| virtual void | on_fileExit_activated () |
| Responds to the Quit item in the File menu. | |
| virtual void | on_fileOpen_activated () |
| Opens an existing file. | |
Protected Member Functions | |
| virtual void | closeEvent (QCloseEvent *e) |
| Informs the application object that is window is about to close. | |
| virtual void | editClear () |
| Responds to "Clear" menu item. | |
| virtual void | editCopy () |
| virtual void | editCut () |
| Removes selected items from canvas and add them to the pasteboard. | |
| virtual void | editDelete () |
| Removes selected items from canvas without copying them to the pasteboard. | |
| virtual void | editPaste () |
| virtual void | editReTile () |
| Re tiles the entire document. | |
| virtual void | editReTilePage () |
| Re tiles only the current page. | |
| virtual void | editSelectAll () |
| Sets all QCanvasItem objects to selected. | |
| virtual void | editUndo () |
| Responds to the undo action. | |
| virtual void | fileExportTextTuple () |
| virtual void | filePrint () |
| Prints the canvas to a Postscript file. | |
| virtual void | fileSaveAll () |
| Saves the canvas document and any NTuple that were not read from or written to a file. | |
| virtual void | fileSaveAllAs () |
| Saves the canvas document and its NTuple. | |
| virtual void | helpAbout () |
| Brings up standard window showing version, authors, etc. | |
| virtual void | hideEvent (QHideEvent *e) |
| Informs the application object that the window has been hidden. | |
| void | nextView () |
| Switches View to the next view for the selected item on the canvas. | |
| virtual void | on_aboutQt_activated () |
| Brings up Qt's about message box. | |
| void | previousView () |
| Switches View to the previous view for the selected item on the canvas. | |
| virtual void | resizeEvent (QResizeEvent *) |
| Informs the Canvas to resize as well. | |
| virtual void | settingCanvas () |
| Sets the canvas settings. | |
| virtual void | settingFonts () |
| Sets the font settings. | |
| virtual void | settingPrinter () |
| Sets the printer settings. | |
| virtual void | setZoomMode () |
| Sets the zoom mode to true or false. | |
| virtual void | showEvent (QShowEvent *e) |
| Informs the application object that the window has been shown. | |
| virtual void | viewAddPage () |
| Adds a page to the canvas. | |
| virtual void | viewLock () |
| Locks a canvas item. | |
| virtual void | viewShowInspector () |
| Shows the Inspector window. | |
| virtual void | viewShowPickTable () |
| Shows the pick table window. | |
| virtual void | viewShowPlotTable () |
| Shows the plot table. | |
| virtual void | viewUnlock () |
| Unlocks a canvas item. | |
| virtual void | viewZoomIn () |
| Enlarges the view of the canvas. | |
| virtual void | viewZoomOut () |
| Reduces the view of the canvas. | |
| virtual void | viewZoomReset () |
| Returns the view of the canvas to normal. | |
| virtual void | windowActivationChange (bool oldActive) |
| Informs the application object if this window has become the active one. | |
Private Member Functions | |
| bool | areDataSourcesSaved () |
Returns true if all the data sources used by the document have been saved to or read from a file. | |
| bool | setFilenameFromDialog () |
| Sets the file name of document. | |
| void | setTitleFileName (const std::string &name) |
| Sets the file name component of the window's title. | |
Private Attributes | |
| bool | m_allow_close |
A flag set to true to allow the window to close without prompting the user. | |
| CanvasView * | m_browsed_canvas |
| The CanvasView object that is being browsed. | |
| CanvasView * | m_canvas_view |
| The CanvasView object which is the central widget. | |
| QString | m_changed |
| The changed status part of the window title. | |
| QtFileDialog * | m_file_dialog |
| The open file dialog for this window. | |
| std::string | m_filename |
| The file name part of the window title. | |
| bool | m_filenameExists |
| True if filename has been assigned, false if not. | |
| bool | m_hasChanged |
| The current changed status. | |
| bool | m_inhibit_close |
A flag set to true if the CanvasWindow should not accept a close event. | |
| QString | m_prefix |
| The prefix part of the window title. | |
| XmlController * | m_xml_controller |
| The controller object capable of serializing the canvas contents as XML and serializing them. | |
Static Private Attributes | |
| static PlotTable * | s_plot_table = 0 |
| The singleton instance of PlotTable. | |
|
||||||||||||||||
|
constructor. The arguments are defined by the inherited Qt QMainWindow class Definition at line 65 of file CanvasWindow.cxx. References WindowController::instance(), QtXMLController::instance(), m_canvas_view, m_file_dialog, m_xml_controller, WindowController::newWindow(), and setCaption(). Referenced by fileNew(), and on_fileOpen_activated(). |
|
|
A copy constructor that does nothing except keep boost.python happy. Without it, boost.python interface wouldn't compile because QMainWindow copy constructor is private. Definition at line 117 of file CanvasWindow.cxx. |
|
|
Definition at line 122 of file CanvasWindow.cxx. References QCanvasView::canvas(), and m_canvas_view. |
|
|
Adds a new plot to the canvas and selects it.
Definition at line 856 of file CanvasWindow.cxx. References CanvasView::addPlotDisplay(), and m_canvas_view. |
|
||||||||||||
|
Adds function textual display to the canvas.
Definition at line 839 of file CanvasWindow.cxx. References CanvasView::addFuncDisplay(), and m_canvas_view. Referenced by Inspector::summaryNew(). |
|
||||||||||||
|
Adds a new plot display to the canvas.
Adds a new plot display to the canvas and puts it in selected state if select is Definition at line 851 of file CanvasWindow.cxx. References CanvasView::addPlotDisplay(), and m_canvas_view. |
|
|
Adds a new plot display to the canvas. Adds a new plot display to the canvas and puts it in selected state if user settings are so set. Definition at line 846 of file CanvasWindow.cxx. References CanvasView::addPlotDisplay(), and m_canvas_view. Referenced by PyCanvas::addDisplay(), and Inspector::newPlotButton_clicked(). |
|
||||||||||||||||
|
Adds a textual display to the canvas of type type. This method is used when the text type requires additional text. Definition at line 820 of file CanvasWindow.cxx. References CanvasView::addTextDisplay(), and m_canvas_view. |
|
||||||||||||
|
Adds a textual display to the canvas of type type.
Definition at line 812 of file CanvasWindow.cxx. References CanvasView::addTextDisplay(), and m_canvas_view. Referenced by PyCanvas::addText(), and Inspector::summaryNew(). |
|
||||||||||||||||||||||||
|
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 829 of file CanvasWindow.cxx. References CanvasView::addTextDisplayAt(), and m_canvas_view. Referenced by PyCanvas::addTextAt(). |
|
|
If document has changed and not saved, opens a dialog box for user to choose to save, discard or cancel. Otherwise, return true. Intended to be used for closeEvent. Definition at line 191 of file CanvasWindow.cxx. References QString::append(), QString::arg(), fileSave(), QMessageBox::information(), m_allow_close, m_canvas_view, m_filename, and m_hasChanged. Referenced by closeEvent(), and WindowController::okToQuit(). |
|
|
Returns If any data sources are only in memory, then inform the user with dialog and return false. Definition at line 587 of file CanvasWindow.cxx. References XmlController::areDataSourcesSaved(), QMessageBox::critical(), m_canvas_view, m_xml_controller, CanvasView::views(), and views(). Referenced by fileSave(), and fileSaveAs(). |
|
|
Removes all items from the canvas.
Definition at line 570 of file CanvasWindow.cxx. References CanvasView::clear(), and m_canvas_view. Referenced by editClear(). |
|
|
Informs the application object that is window is about to close.
Definition at line 242 of file CanvasWindow.cxx. References QCloseEvent::accept(), allowClose(), QString::append(), QCloseEvent::ignore(), QMessageBox::information(), WindowController::instance(), m_allow_close, m_canvas_view, and m_inhibit_close. |
|
|
Closes the window.
If no_prompt is Definition at line 235 of file CanvasWindow.cxx. References QWidget::close(), and m_allow_close. |
|
|
Responds to QCustomEvents. Responds to SaveAsImageEvent custom events. All others are ignored. Definition at line 136 of file CanvasWindow.cxx. References PlotTableEvent::Close, PlotTableEvent::Copy, m_browsed_canvas, m_canvas_view, s_plot_table, savePlotAsImage(), and num_util::type(). |
|
|
Responds to "Clear" menu item. Prompts the user with a warning dialog, then removes all canvas items or not depending on user response.
Definition at line 378 of file CanvasWindow.cxx. References QString::append(), clear(), WindowController::instance(), updateActions(), and QMessageBox::warning(). |
|
|
Definition at line 368 of file CanvasWindow.cxx. References CanvasView::copySelectedToPasteboard(), WindowController::instance(), m_canvas_view, and updateActions(). |
|
|
Removes selected items from canvas and add them to the pasteboard.
Definition at line 396 of file CanvasWindow.cxx. References CanvasView::deleteSelected(), WindowController::instance(), m_canvas_view, and updateActions(). |
|
|
Removes selected items from canvas without copying them to the pasteboard.
Definition at line 404 of file CanvasWindow.cxx. References CanvasView::deleteSelected(), WindowController::instance(), m_canvas_view, and updateActions(). |
|
|
Definition at line 436 of file CanvasWindow.cxx. References CanvasView::copyFromPasteboard(), and m_canvas_view. |
|
|
Re tiles the entire document.
Definition at line 414 of file CanvasWindow.cxx. References m_canvas_view, and CanvasView::reTile(). |
|
|
Re tiles only the current page.
Definition at line 421 of file CanvasWindow.cxx. References m_canvas_view, and CanvasView::reTilePage(). |
|
|
Sets all QCanvasItem objects to selected.
Definition at line 443 of file CanvasWindow.cxx. References WindowController::instance(), m_canvas_view, FigureEditor::setAllSelected(), and updateActions(). |
|
|
Responds to the undo action.
Definition at line 428 of file CanvasWindow.cxx. References m_canvas_view, CanvasView::notifyObservers(), and CanvasView::restoreFromSelectCopy(). |
|
|
Definition at line 735 of file CanvasWindow.cxx. References QtFileDialog::getTextSuffix(), and m_canvas_view. |
|
|
Creates a new document CanvasWindow.
Definition at line 451 of file CanvasWindow.cxx. References CanvasWindow(), WindowController::instance(), and setCaption(). Referenced by hippodraw::Python::export_CanvasWindow(). |
|
|
Prints the canvas to a Postscript file.
Definition at line 363 of file CanvasWindow.cxx. References m_canvas_view, and CanvasView::print(). |
|
|
Saves the document. If the document already corresponds to a saved document, prompts the user with a warning dialog before over writing the file. If no file name has been assigned, then invokes the fileSaveAs() member function. Definition at line 619 of file CanvasWindow.cxx. References QString::append(), areDataSourcesSaved(), fileSaveAs(), m_filename, m_filenameExists, m_hasChanged, saveAs(), and QMessageBox::warning(). Referenced by allowClose(). |
|
|
Saves the canvas document and any NTuple that were not read from or written to a file. The NTuple objects are saved in the same directory as the canvas document. Their name becomes just the file name with index number with the suffix ".tnt". The path is striped from the name. Definition at line 671 of file CanvasWindow.cxx. References fileSaveAllAs(), m_filename, m_filenameExists, and saveAllAs(). |
|
|
Saves the canvas document and its NTuple. This function is similar to fileSaveAll(), but it always prompts the user for a filename. Definition at line 682 of file CanvasWindow.cxx. References m_filename, saveAllAs(), and setFilenameFromDialog(). Referenced by fileSaveAll(). |
|
|
Saves the document after display a file dialog to the user.
Definition at line 657 of file CanvasWindow.cxx. References areDataSourcesSaved(), m_filename, saveAs(), and setFilenameFromDialog(). Referenced by fileSave(). |
|
|
Saves the selected ViewBase objects as an image file with the given filename.
Definition at line 710 of file CanvasWindow.cxx. References m_canvas_view, and CanvasView::saveSelectedImages(). |
|
|
Saves the selected ViewBase object as an image file.
Definition at line 705 of file CanvasWindow.cxx. References m_canvas_view, and CanvasView::saveSelectedImages(). Referenced by PyCanvas::saveSelectedImages(). |
|
|
Clears and fills plotter_list with all the PlotterBase objects on the canvas.
Definition at line 884 of file CanvasWindow.cxx. References m_canvas_view. |
|
|
Returns the CanvasView object.
Definition at line 728 of file CanvasWindow.cxx. References m_canvas_view. Referenced by WindowController::newWindow(). |
|
|
Returns the QtView object that is the Observer of the plotter.
Definition at line 891 of file CanvasWindow.cxx. References CanvasView::getViewFor(), and m_canvas_view. Referenced by PyCanvas::findSelectedView(). |
|
|
Brings up standard window showing version, authors, etc.
Definition at line 783 of file CanvasWindow.cxx. References m_canvas_view. |
|
|
Informs the application object that the window has been hidden.
Definition at line 291 of file CanvasWindow.cxx. References WindowController::instance(). |
|
|
If yes is
Definition at line 301 of file CanvasWindow.cxx. References m_inhibit_close. Referenced by WindowController::aboutToClose(), and WindowController::newWindow(). |
|
|
Initializes this object from contents of file.
Definition at line 559 of file CanvasWindow.cxx. References m_canvas_view, setChanged(), and setTitleFileName(). Referenced by on_fileBrowse_actived(), and on_fileOpen_activated(). |
|
|
Retrieve a vector (x, y, z) points from the next mouse event.
Definition at line 1001 of file CanvasWindow.cxx. References m_canvas_view, and CanvasView::mouseEventData(). Referenced by PyCanvas::mouseData(). |
|
|
Switches View to the next view for the selected item on the canvas.
Definition at line 980 of file CanvasWindow.cxx. References m_canvas_view, CanvasView::selectedPlotter(), and selectedPlotter(). Referenced by previousView(). |
|
|
Brings up Qt's about message box.
Definition at line 790 of file CanvasWindow.cxx. References QMessageBox::aboutQt(). |
|
|
Browse a document file, without opening a window for it.
Definition at line 461 of file CanvasWindow.cxx. References initFromFile(), QString::latin1(), m_browsed_canvas, m_file_dialog, s_plot_table, and QString::stripWhiteSpace(). |
|
|
Responds to the Quit item in the File menu.
Definition at line 743 of file CanvasWindow.cxx. References WindowController::instance(). |
|
|
Opens an existing file. Opens an existing document or data file after prompting the user for the document's file name and/or type. Definition at line 497 of file CanvasWindow.cxx. References CanvasWindow(), initFromFile(), QString::latin1(), m_canvas_view, m_file_dialog, setChanged(), and QString::stripWhiteSpace(). |
|
|
Switches View to the previous view for the selected item on the canvas.
Definition at line 969 of file CanvasWindow.cxx. References m_canvas_view, nextView(), CanvasView::selectedPlotter(), and selectedPlotter(). |
|
|
Prints the view to Postscript file without prompting user.
Definition at line 1036 of file CanvasWindow.cxx. References m_canvas_view. |
|
|
Removes the plotter and its view from the canvas.
Definition at line 865 of file CanvasWindow.cxx. References m_canvas_view, and CanvasView::removeDisplay(). Referenced by PyCanvas::removeDisplay(). |
|
|
Resets the font size to be no larger than 10.
Definition at line 107 of file CanvasWindow.cxx. References QApplication::font(), QFont::pointSize(), QApplication::setFont(), QFont::setPointSize(), and num_util::size(). Referenced by QtApp::QtApp(). |
|
|
Informs the Canvas to resize as well.
Definition at line 575 of file CanvasWindow.cxx. References m_canvas_view, QWidget::resizeEvent(), and FigureEditor::resizeEvent(). |
|
|
Saves the document along with its NT |