00001
00002
00003
00004
00005
00006
00007
00008
00010
00011 #ifndef CRVTKCAPTURE_H
00012 #define CRVTKCAPTURE_H
00013
00014 #ifdef __GNUG__
00015 #pragma interface "CRVtkCapture.h"
00016 #endif
00017
00018 #include <wxGuiTest/Common.h>
00019
00020 #include <wxGuiTest/WxGuiTestApp.h>
00021 #include <wxGuiTest/CRCapture.h>
00022
00023 namespace wxTst {
00024
00025
00029 class CRVtkCapture : public CRCapture
00030 {
00031 public:
00035 CRVtkCapture ();
00036
00037
00041 virtual ~CRVtkCapture ();
00042
00043
00054 #define VTK_CAPTURE \
00055 { \
00056 wxApp *app = wxTheApp; \
00057 wxASSERT (app != NULL); \
00058 wxTst::WxGuiTestApp *guiTestApp = dynamic_cast< wxTst::WxGuiTestApp * >(app); \
00059 wxASSERT (guiTestApp != NULL); \
00060 guiTestApp->SetEventFilter (wxTst::CREventCaptureManager::GetInstance ()); \
00061 \
00062 std::string excMsg; \
00063 wxTst::CRVtkCapture *capture = new wxTst::CRVtkCapture (); \
00064 try { \
00065 capture->Capture (__FILE__, __LINE__); \
00066 } catch (std::exception &e) { \
00067 excMsg = e.what (); \
00068 } catch (...) { \
00069 excMsg = "Unexpected capturing exception"; \
00070 } \
00071 guiTestApp->SetEventFilter (NULL); \
00072 delete capture; \
00073 wxTst::CRCppEmitter::Destroy (); \
00074 if (!excMsg.empty ()) { \
00075 CPPUNIT_FAIL (excMsg.c_str ()); \
00076 } \
00077 }
00078
00079 protected:
00085 virtual CRCaptureControl * CreateEvtHandler () const;
00086
00087
00091 virtual void CreateDialog ();
00092
00093
00099 virtual wxPanel * LoadPanel ();
00100
00101 private:
00102
00103 };
00104
00105 }
00106
00107 #endif // CRVTKCAPTURE_H
00108