CanvasViewProxy.cxx
Go to the documentation of this file.
1 
12 #include "CanvasViewProxy.h"
13 
14 #include "CanvasView.h"
15 
16 #if _MSC_VER
17 #include "PlotterEvent.h"
18 #endif
19 
20 #include "qapplication.h"
21 
22 using namespace hippodraw;
23 
26  : m_canvas_view ( view )
27 {
28  connect ( this, SIGNAL ( addDisplaySignal ( PlotterBase * ) ),
29  m_canvas_view, SLOT ( addPlotDisplay ( PlotterBase * ) ) );
30 
31  connect ( this, SIGNAL ( saveAsImageSignal ( const PlotterBase *,
32  const std::string & ) ),
33  m_canvas_view, SLOT ( savePlotAsImage ( const PlotterBase *,
34  const std::string & ) ) );
35 
36  connect ( this, SIGNAL ( swapOrientationSignal ( ) ),
37  m_canvas_view, SLOT ( swapOrientation ( ) ) );
38 
39  connect ( this, SIGNAL ( clearSignal () ),
40  m_canvas_view, SLOT ( clear () ) );
41 
42 }
43 
46 {
47 }
48 
49 void
51 lock ()
52 {
53  if ( QApplication::closingDown () == false ) {
54  qApp -> lock();
55  }
56 }
57 
58 void
61 {
62  if ( QApplication::closingDown () == false ) {
63  qApp -> unlock();
64  }
65 }
66 
67 void
69 addDisplay ( PlotterBase * plotter )
70 {
71 #if QT_VERSION < 0x040000
72  lock ();
73 #endif
74  emit addDisplaySignal ( plotter );
75 #if QT_VERSION < 0x040000
76  unlock ();
77 #endif
78 }
79 
80 void
83 {
84 #if QT_VERSION < 0x040000
85  lock ();
86 #endif
87  emit clearSignal ();
88 #if QT_VERSION < 0x040000
89  unlock ();
90 #endif
91 }
92 
93 void
95 saveAsImage ( const PlotterBase * plotter, const std::string & filename )
96 {
97 #if QT_VERSION < 0x040000
98  lock ();
99  emit saveAsImageSignal ( plotter, filename );
100  unlock ();
101 #else
102  emit saveAsImageSignal ( plotter, filename );
103 #endif
104 }
105 
106 void
109 {
110 #if QT_VERSION < 0x040000
111  lock ();
112  emit swapOrientationSignal ();
113  unlock ();
114 #else
115  emit swapOrientationSignal ();
116 #endif
117 }

Generated for HippoDraw Class Library by doxygen