#include <CanvasViewProxy.h>
A Proxy for the CanvaView is responsible for invoking member functions of the CanvasView class in a thread safe manner. For example, the CanvasView object is executed in the GUI thread, while a Python script or command is in a different thread, perhaps the main thread. Thus Python should use the CanvasViewProxy to invoke member functions of the CanvasView object.
For Qt 3, this class users the QApplication::lock() and QApplication::unlock() methods in insure that the GUI thread is not running when modifying the canvas. For Qt 4, locking and unlocking is not needed since the signal/slot connection is thread safe, which was not the case for Qt 3.
Definition at line 45 of file CanvasViewProxy.h.
Signals | |
void | addDisplaySignal (PlotterBase *plotter) |
Signal used to add a plotter display to the canvas. | |
void | clearSignal () |
Signal used to clear all displays from canvas. | |
void | saveAsImageSignal (const PlotterBase *plotter, const std::string &filename) |
Save the plotter as an image file. | |
void | swapOrientationSignal () |
Swaps the orientation. | |
Public Member Functions | |
void | addDisplay (PlotterBase *plotter) |
Adds a plotter display to the canvas. | |
CanvasViewProxy (CanvasView *view) | |
The constructor taking the CanvasView object to be used. | |
void | clear () |
Clears the canvas of all displays. | |
void | saveAsImage (const PlotterBase *, const std::string &filename) |
Saves the plotter as image file with name filename. | |
void | swapOrientation () |
Swaps the orientation from portrait to landscape and vice verse. | |
virtual | ~CanvasViewProxy () |
The destructor. | |
Private Member Functions | |
blockSignals (bool block) | |
CanvasViewProxy (const CanvasViewProxy &) | |
Private copy constructor to prevent copying. | |
checkConnectArgs (const char *signal, const QObject *receiver, const char *member) | |
child (const char *objName, const char *inheritsClass=0, bool recursiveSearch=TRUE) | |
childEvent (QChildEvent *) | |
children () const | |
className () const | |
connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) | |
connect (const QObject *sender, const char *signal, const char *member) const | |
connectNotify (const char *signal) | |
customEvent (QCustomEvent *) | |
deleteLater () | |
destroyed (QObject *obj) | |
destroyed () | |
disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) | |
disconnect (const QObject *receiver, const char *member=0) | |
disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0) | |
disconnectNotify (const char *signal) | |
dumpObjectInfo () | |
dumpObjectTree () | |
event (QEvent *e) | |
eventFilter (QObject *watched, QEvent *e) | |
highPriority () const | |
inherits (const char *clname) const | |
insertChild (QObject *obj) | |
installEventFilter (const QObject *filterObj) | |
isA (const char *clname) const | |
isWidgetType () const | |
killTimer (int id) | |
killTimers () | |
void | lock () |
Gets mutex lock from application object. | |
metaObject () const | |
name (const char *defaultName) const | |
name () const | |
normalizeSignalSlot (const char *signalSlot) | |
objectTrees () | |
parent () const | |
prop -the name of this object | |
property (const char *name) const | |
qt_find_obj_child (QObject *parent, const char *type, const char *name) | |
queryList (const char *inheritsClass=0, const char *objName=0, bool regexpMatch=TRUE, bool recursiveSearch=TRUE) const | |
removeChild (QObject *obj) | |
removeEventFilter (const QObject *obj) | |
sender () | |
setName (const char *name) | |
setProperty (const char *name, const QVariant &value) | |
signalsBlocked () const | |
startTimer (int interval) | |
timerEvent (QTimerEvent *) | |
tr (const char *sourceText, const char *comment) | |
trUtf8 (const char *sourceText, const char *comment) | |
void | unlock () |
Releases the mutex lock to the application object. | |
Private Attributes | |
CanvasView * | m_canvas_view |
The CanvasView object managed by this proxy. |
CanvasViewProxy | ( | const CanvasViewProxy & | ) | [private] |
Private copy constructor to prevent copying.
CanvasViewProxy | ( | CanvasView * | view | ) |
The constructor taking the CanvasView object to be used.
Definition at line 25 of file CanvasViewProxy.cxx.
References CanvasViewProxy::addDisplaySignal(), CanvasViewProxy::clear(), CanvasViewProxy::clearSignal(), QObject::connect(), CanvasViewProxy::m_canvas_view, CanvasViewProxy::saveAsImageSignal(), CanvasViewProxy::swapOrientation(), and CanvasViewProxy::swapOrientationSignal().
~CanvasViewProxy | ( | ) | [virtual] |
void addDisplay | ( | PlotterBase * | plotter | ) |
Adds a plotter display to the canvas.
Definition at line 69 of file CanvasViewProxy.cxx.
References CanvasViewProxy::addDisplaySignal(), CanvasViewProxy::lock(), and CanvasViewProxy::unlock().
void addDisplaySignal | ( | PlotterBase * | plotter | ) | [signal] |
Signal used to add a plotter display to the canvas.
Referenced by CanvasViewProxy::addDisplay(), and CanvasViewProxy::CanvasViewProxy().
void clear | ( | ) |
Clears the canvas of all displays.
Definition at line 82 of file CanvasViewProxy.cxx.
References CanvasViewProxy::clearSignal(), CanvasViewProxy::lock(), and CanvasViewProxy::unlock().
Referenced by CanvasViewProxy::CanvasViewProxy().
void clearSignal | ( | ) | [signal] |
Signal used to clear all displays from canvas.
Referenced by CanvasViewProxy::CanvasViewProxy(), and CanvasViewProxy::clear().
void lock | ( | ) | [private] |
Gets mutex lock from application object.
Definition at line 51 of file CanvasViewProxy.cxx.
References QApplication::closingDown().
Referenced by CanvasViewProxy::addDisplay(), CanvasViewProxy::clear(), CanvasViewProxy::saveAsImage(), and CanvasViewProxy::swapOrientation().
void saveAsImage | ( | const PlotterBase * | plotter, | |
const std::string & | filename | |||
) |
Saves the plotter as image file with name filename.
Definition at line 95 of file CanvasViewProxy.cxx.
References CanvasViewProxy::lock(), CanvasViewProxy::saveAsImageSignal(), and CanvasViewProxy::unlock().
void saveAsImageSignal | ( | const PlotterBase * | plotter, | |
const std::string & | filename | |||
) | [signal] |
Save the plotter as an image file.
Referenced by CanvasViewProxy::CanvasViewProxy(), and CanvasViewProxy::saveAsImage().
void swapOrientation | ( | ) |
Swaps the orientation from portrait to landscape and vice verse.
Definition at line 108 of file CanvasViewProxy.cxx.
References CanvasViewProxy::lock(), CanvasViewProxy::swapOrientationSignal(), and CanvasViewProxy::unlock().
Referenced by CanvasViewProxy::CanvasViewProxy().
void swapOrientationSignal | ( | ) | [signal] |
Swaps the orientation.
Referenced by CanvasViewProxy::CanvasViewProxy(), and CanvasViewProxy::swapOrientation().
void unlock | ( | ) | [private] |
Releases the mutex lock to the application object.
Definition at line 60 of file CanvasViewProxy.cxx.
References QApplication::closingDown().
Referenced by CanvasViewProxy::addDisplay(), CanvasViewProxy::clear(), CanvasViewProxy::saveAsImage(), and CanvasViewProxy::swapOrientation().
CanvasView* m_canvas_view [private] |
The CanvasView object managed by this proxy.
Definition at line 53 of file CanvasViewProxy.h.
Referenced by CanvasViewProxy::CanvasViewProxy().