Salome HOME
9768982a2c603f3d0453520f7530ea78dbea07ef
[modules/hydro.git] / src / HYDRO_tests / TestViewer.h
1
2 #pragma once
3
4 class OCCViewer_ViewManager;
5 class OCCViewer_Viewer;
6 class OCCViewer_ViewWindow;
7 class TopoDS_Shape;
8 class QString;
9 class QColor;
10
11 class TestViewer
12 {
13 public:
14   static OCCViewer_ViewManager* viewManager();
15   static OCCViewer_Viewer* viewer();
16   static OCCViewer_ViewWindow* viewWindow();
17
18   static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor );
19   static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey );
20   static bool AssertImages( QString& theMessage );
21
22 private:
23   static OCCViewer_ViewManager* myViewManager;
24   static OCCViewer_ViewWindow* myViewWindow;
25   static QString myKey;
26 };
27
28 #define CPPUNIT_ASSERT_IMAGES                              \
29   {                                                        \
30     QString aMessage;                                      \
31     if( !TestViewer::AssertImages( aMessage ) )            \
32     {                                                      \
33       std::string aMessageStl = aMessage.toStdString();    \
34       CPPUNIT_FAIL( aMessageStl.c_str() );                 \
35     }                                                      \
36   }                                                        \
37