casa
$Rev:20696$
|
High(ish)-level plotter class that manages the GUI (semi-) transparently to the rest of PlotMS. More...
#include <PlotMSPlotter.qo.h>
Public Slots | |
void | showError (const String &message, const String &title, bool isWarning) |
Shows the given error/warning message in a GUI window. | |
void | showMessage (const String &message, const String &title) |
Shows the given informational message in a GUI window. | |
void | showAbout () |
Slot for showing an "about" dialog. | |
void | prepareForPlotting () |
Take any clean-up actions before a Plot is made 1) unclick any zoom, pan, etc buttons to avoid bug in zoom stack 2) ... | |
Public Member Functions | |
PlotMSPlotter (PlotMSApp *parent, Plotter::Implementation impl=Plotter::DEFAULT) | |
Non-Static //. | |
~PlotMSPlotter () | |
Destructor. | |
PlotMSApp * | getParent () |
Accessor methods. | |
PlotFactoryPtr | getFactory () |
PlotterPtr | getPlotter () |
QtProgressWidget * | getProgressWidget () |
PlotMSPlotTab * | getPlotTab () |
PlotMSToolsTab * | getToolsTab () |
PlotMSOptionsTab * | getOptionsTab () |
PlotMSFlaggingTab * | getFlaggingTab () |
PlotMSAnnotator & | getAnnotator () |
bool | isDrawing () const |
bool | isClosed () const |
void | showGUI (bool show=true) |
Execution Methods //. | |
bool | guiShown () const |
Returns true if the GUI is currently visible, false otherwise. | |
int | execLoop () |
Enters the plotter's execution loop, and returns its return value. | |
int | showAndExec (bool show=true) |
See showGUI() and execLoop(). | |
void | doThreadedOperation (PlotMSThread *thread) |
Runs the given operation thread, keeping GUI and progress information synchronized as necessary. | |
bool | canvasDrawBeginning (PlotOperationPtr drawOperation, bool drawingIsThreaded, int drawnLayersFlag) |
Implements PlotDrawWatcher::canvasDrawBeginning(). | |
void | showIterationButtons (bool show) |
GUI Methods //. | |
bool | showQuestion (const String &message, const String &title) |
Pops up a dialog to ask the user the given question with the given window title. | |
void | holdDrawing () |
Holds/Releases drawing on all visible plot canvases. | |
void | releaseDrawing () |
bool | allDrawingHeld () const |
Returns true if drawing is being held on ALL visible plot canvases, false otherwise. | |
vector< PlotCanvasPtr > | currentCanvases () |
Returns all currently shown canvases in the plotter. | |
void | setWindowTitle (const String &windowTitle) |
Plotter Customization Methods //. | |
void | setStatusText (const String &statusText) |
Sets the status bar text to the given. | |
void | clearStatusText () |
Clears the status bar text. | |
void | setToolButtonStyle (Qt::ToolButtonStyle style) |
Overrides QMainWindow::setToolButtonStyle(). | |
const QMap< PlotMSAction::Type, QAction * > & | plotActionMap () const |
Action Methods //. | |
void | synchronizeAction (PlotMSAction::Type action, QAbstractButton *button) |
Synchronizes the given button with the given action type. | |
String | actionText (PlotMSAction::Type type) |
Gets/Sets the text for the QAction associated with the given PlotMSApp action. | |
void | setActionText (PlotMSAction::Type type, const String &text) |
bool | actionIsChecked (PlotMSAction::Type type) const |
Gets/Sets whether the QAction associated with the given PlotMSApp action is checked. | |
void | setActionIsChecked (PlotMSAction::Type type, bool checked, bool alsoTriggerAction=false) |
bool | exportPlot (const PlotExportFormat &format, const bool interactive, const bool async) |
export a plot to a file | |
Static Public Member Functions | |
static String | aboutText (Plotter::Implementation implementation, bool useHTML=true) |
Static //. | |
Protected Member Functions | |
void | closeEvent (QCloseEvent *event) |
Overrides QWidget::closeEvent(), in case we're dealing with a plotter that isn't Qt and thus is in its own window (and possibly its own execution loop). | |
Private Slots | |
void | action_ () |
Method for when an action has been triggered. | |
void | action (QAction *which) |
Method for when the given action has been triggered. | |
void | currentThreadFinished () |
Slot for when the currently running thread is finished. | |
Private Member Functions | |
bool | _triggerAction (PlotMSAction &action) |
void | initialize (Plotter::Implementation impl) |
Initializes the plotter with the given implementation. | |
Private Attributes | |
PlotMSApp * | itsParent_ |
PlotMSApp parent. | |
bool | isQt_ |
Flag for whether the underlying Plotter is Qt-based or not. | |
bool | isClosed_ |
Flag for whether the widget is open or not. | |
PlotFactoryPtr | itsFactory_ |
Plot factory. | |
PlotterPtr | itsPlotter_ |
Plotter. | |
QList< QWidget * > | itsEnableWidgets_ |
Widgets to be enabled/disabled during threading. | |
PlotMSPlotTab * | itsPlotTab_ |
Plot tab. | |
PlotMSFlaggingTab * | itsFlaggingTab_ |
Flagging tab (on the plot tab). | |
PlotMSToolsTab * | itsToolsTab_ |
Tools tab. | |
PlotMSAnnotatorTab * | itsAnnotatorTab_ |
Annotator tab. | |
PlotMSOptionsTab * | itsOptionsTab_ |
Options tab. | |
QList< QToolButton * > | itsToolButtons_ |
Tool buttons on the tabs. | |
QtProgressWidget * | itsThreadProgress_ |
Widget for displaying thread progress. | |
PlotMSThread * | itsCurrentThread_ |
Current thread (or NULL for none). | |
vector< PlotMSThread * > | itsWaitingThreads_ |
Waiting threads. | |
QMap< PlotMSAction::Type, QAction * > | itsActionMap_ |
Map between PlotMSApp actions and QActions. | |
QtActionSynchronizer | itsActionSynchronizer_ |
Action synchronizer. | |
PlotMSAnnotator | itsAnnotator_ |
Annotator tool. | |
QString | itsAboutString_ |
"About" string. |
High(ish)-level plotter class that manages the GUI (semi-) transparently to the rest of PlotMS.
Definition at line 57 of file PlotMSPlotter.qo.h.
casa::PlotMSPlotter::PlotMSPlotter | ( | PlotMSApp * | parent, |
Plotter::Implementation | impl = Plotter::DEFAULT |
||
) |
Non-Static //.
Constructor that creates a plotter with the given parent using the given implementation.
Destructor.
bool casa::PlotMSPlotter::_triggerAction | ( | PlotMSAction & | action | ) | [private] |
static String casa::PlotMSPlotter::aboutText | ( | Plotter::Implementation | implementation, |
bool | useHTML = true |
||
) | [static] |
Static //.
Returns "about" text for the given implementation, using HTML or not.
void casa::PlotMSPlotter::action | ( | QAction * | which | ) | [private, slot] |
Method for when the given action has been triggered.
Referenced by action_().
void casa::PlotMSPlotter::action_ | ( | ) | [inline, private, slot] |
Method for when an action has been triggered.
Definition at line 284 of file PlotMSPlotter.qo.h.
References action().
bool casa::PlotMSPlotter::actionIsChecked | ( | PlotMSAction::Type | type | ) | const |
Gets/Sets whether the QAction associated with the given PlotMSApp action is checked.
Has no effect on actions that are not checkable.
Gets/Sets the text for the QAction associated with the given PlotMSApp action.
bool casa::PlotMSPlotter::allDrawingHeld | ( | ) | const |
Returns true if drawing is being held on ALL visible plot canvases, false otherwise.
bool casa::PlotMSPlotter::canvasDrawBeginning | ( | PlotOperationPtr | drawOperation, |
bool | drawingIsThreaded, | ||
int | drawnLayersFlag | ||
) | [virtual] |
Implements PlotDrawWatcher::canvasDrawBeginning().
Implements casa::PlotDrawWatcher.
void casa::PlotMSPlotter::clearStatusText | ( | ) | [inline] |
Clears the status bar text.
Definition at line 160 of file PlotMSPlotter.qo.h.
References setStatusText().
void casa::PlotMSPlotter::closeEvent | ( | QCloseEvent * | event | ) | [protected] |
Overrides QWidget::closeEvent(), in case we're dealing with a plotter that isn't Qt and thus is in its own window (and possibly its own execution loop).
vector<PlotCanvasPtr> casa::PlotMSPlotter::currentCanvases | ( | ) |
Returns all currently shown canvases in the plotter.
void casa::PlotMSPlotter::currentThreadFinished | ( | ) | [private, slot] |
Slot for when the currently running thread is finished.
Performs cleanup and starts next waiting thread if applicable.
void casa::PlotMSPlotter::doThreadedOperation | ( | PlotMSThread * | thread | ) |
Runs the given operation thread, keeping GUI and progress information synchronized as necessary.
The given thread will be deleted upon completion.
int casa::PlotMSPlotter::execLoop | ( | ) |
Enters the plotter's execution loop, and returns its return value.
Only during this execution loops will GUI windows be shown and GUI events be handled. The execution loop ends when the user clicks the "close" or "quit" buttons. This method can be called multiple times.
Referenced by showAndExec().
bool casa::PlotMSPlotter::exportPlot | ( | const PlotExportFormat & | format, |
const bool | interactive, | ||
const bool | async | ||
) |
export a plot to a file
PlotMSAnnotator& casa::PlotMSPlotter::getAnnotator | ( | ) | [inline] |
Definition at line 90 of file PlotMSPlotter.qo.h.
References itsAnnotator_.
PlotFactoryPtr casa::PlotMSPlotter::getFactory | ( | ) | [inline] |
Definition at line 83 of file PlotMSPlotter.qo.h.
References itsFactory_.
PlotMSFlaggingTab* casa::PlotMSPlotter::getFlaggingTab | ( | ) | [inline] |
Definition at line 89 of file PlotMSPlotter.qo.h.
References itsFlaggingTab_.
PlotMSOptionsTab* casa::PlotMSPlotter::getOptionsTab | ( | ) | [inline] |
Definition at line 88 of file PlotMSPlotter.qo.h.
References itsOptionsTab_.
PlotMSApp* casa::PlotMSPlotter::getParent | ( | ) | [inline] |
PlotMSPlotTab* casa::PlotMSPlotter::getPlotTab | ( | ) | [inline] |
Definition at line 86 of file PlotMSPlotter.qo.h.
References itsPlotTab_.
PlotterPtr casa::PlotMSPlotter::getPlotter | ( | ) | [inline] |
Definition at line 84 of file PlotMSPlotter.qo.h.
References itsPlotter_.
QtProgressWidget* casa::PlotMSPlotter::getProgressWidget | ( | ) | [inline] |
Definition at line 85 of file PlotMSPlotter.qo.h.
References itsThreadProgress_.
PlotMSToolsTab* casa::PlotMSPlotter::getToolsTab | ( | ) | [inline] |
Definition at line 87 of file PlotMSPlotter.qo.h.
References itsToolsTab_.
bool casa::PlotMSPlotter::guiShown | ( | ) | const |
Returns true if the GUI is currently visible, false otherwise.
void casa::PlotMSPlotter::holdDrawing | ( | ) |
Holds/Releases drawing on all visible plot canvases.
void casa::PlotMSPlotter::initialize | ( | Plotter::Implementation | impl | ) | [private] |
Initializes the plotter with the given implementation.
MUST be called from constructors.
bool casa::PlotMSPlotter::isClosed | ( | ) | const |
bool casa::PlotMSPlotter::isDrawing | ( | ) | const |
const QMap<PlotMSAction::Type, QAction*>& casa::PlotMSPlotter::plotActionMap | ( | ) | const |
void casa::PlotMSPlotter::prepareForPlotting | ( | ) | [slot] |
Take any clean-up actions before a Plot is made 1) unclick any zoom, pan, etc buttons to avoid bug in zoom stack 2) ...
anything else needed in the future ...
void casa::PlotMSPlotter::releaseDrawing | ( | ) |
void casa::PlotMSPlotter::setActionIsChecked | ( | PlotMSAction::Type | type, |
bool | checked, | ||
bool | alsoTriggerAction = false |
||
) |
void casa::PlotMSPlotter::setActionText | ( | PlotMSAction::Type | type, |
const String & | text | ||
) |
void casa::PlotMSPlotter::setStatusText | ( | const String & | statusText | ) |
Sets the status bar text to the given.
Referenced by clearStatusText().
void casa::PlotMSPlotter::setToolButtonStyle | ( | Qt::ToolButtonStyle | style | ) |
Overrides QMainWindow::setToolButtonStyle().
void casa::PlotMSPlotter::setWindowTitle | ( | const String & | windowTitle | ) |
Plotter Customization Methods //.
Sets the window title to the given.
void casa::PlotMSPlotter::showAbout | ( | ) | [slot] |
Slot for showing an "about" dialog.
int casa::PlotMSPlotter::showAndExec | ( | bool | show = true | ) | [inline] |
See showGUI() and execLoop().
Definition at line 112 of file PlotMSPlotter.qo.h.
References execLoop(), casa::dbus::show(), and showGUI().
void casa::PlotMSPlotter::showError | ( | const String & | message, |
const String & | title, | ||
bool | isWarning | ||
) | [slot] |
Shows the given error/warning message in a GUI window.
void casa::PlotMSPlotter::showGUI | ( | bool | show = true | ) |
void casa::PlotMSPlotter::showIterationButtons | ( | bool | show | ) |
GUI Methods //.
Shows/Hides the "iteration" widgets and actions on the GUI.
void casa::PlotMSPlotter::showMessage | ( | const String & | message, |
const String & | title | ||
) | [slot] |
Shows the given informational message in a GUI window.
bool casa::PlotMSPlotter::showQuestion | ( | const String & | message, |
const String & | title | ||
) |
Pops up a dialog to ask the user the given question with the given window title.
Returns true if the user says "Yes"; false for "No" or otherwise rejecting the dialog.
void casa::PlotMSPlotter::synchronizeAction | ( | PlotMSAction::Type | action, |
QAbstractButton * | button | ||
) |
Synchronizes the given button with the given action type.
(See QtActionSynchronizer class.)
bool casa::PlotMSPlotter::isClosed_ [private] |
Flag for whether the widget is open or not.
Definition at line 225 of file PlotMSPlotter.qo.h.
bool casa::PlotMSPlotter::isQt_ [private] |
Flag for whether the underlying Plotter is Qt-based or not.
Definition at line 222 of file PlotMSPlotter.qo.h.
QString casa::PlotMSPlotter::itsAboutString_ [private] |
"About" string.
Definition at line 273 of file PlotMSPlotter.qo.h.
QMap<PlotMSAction::Type, QAction*> casa::PlotMSPlotter::itsActionMap_ [private] |
Map between PlotMSApp actions and QActions.
Definition at line 264 of file PlotMSPlotter.qo.h.
Action synchronizer.
Definition at line 267 of file PlotMSPlotter.qo.h.
Annotator tab.
Definition at line 246 of file PlotMSPlotter.qo.h.
Current thread (or NULL for none).
Definition at line 258 of file PlotMSPlotter.qo.h.
QList<QWidget*> casa::PlotMSPlotter::itsEnableWidgets_ [private] |
Widgets to be enabled/disabled during threading.
Definition at line 234 of file PlotMSPlotter.qo.h.
Flagging tab (on the plot tab).
Definition at line 240 of file PlotMSPlotter.qo.h.
Referenced by getFlaggingTab().
PlotMSApp* casa::PlotMSPlotter::itsParent_ [private] |
PlotMSPlotTab* casa::PlotMSPlotter::itsPlotTab_ [private] |
PlotterPtr casa::PlotMSPlotter::itsPlotter_ [private] |
Widget for displaying thread progress.
Definition at line 255 of file PlotMSPlotter.qo.h.
Referenced by getProgressWidget().
QList<QToolButton*> casa::PlotMSPlotter::itsToolButtons_ [private] |
Tool buttons on the tabs.
Definition at line 252 of file PlotMSPlotter.qo.h.
PlotMSToolsTab* casa::PlotMSPlotter::itsToolsTab_ [private] |
vector<PlotMSThread*> casa::PlotMSPlotter::itsWaitingThreads_ [private] |
Waiting threads.
Definition at line 261 of file PlotMSPlotter.qo.h.