Salome HOME
a27a8c7de5d1735ffd3e858d7318004d27b14ac0
[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 class Handle_AIS_InteractiveObject;
11
12 class TestViewer
13 {
14 public:
15   static OCCViewer_ViewManager* viewManager();
16   static OCCViewer_Viewer* viewer();
17   static OCCViewer_ViewWindow* viewWindow();
18
19   static void show( const Handle_AIS_InteractiveObject& theObject,
20                     int theMode, int theSelelctionMode, bool isFitAll );
21   static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor );
22   static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey );
23   static bool AssertImages( QString& theMessage );
24
25 private:
26   static OCCViewer_ViewManager* myViewManager;
27   static OCCViewer_ViewWindow* myViewWindow;
28   static QString myKey;
29 };
30
31 #define CPPUNIT_ASSERT_IMAGES                              \
32   {                                                        \
33     QString aMessage;                                      \
34     if( !TestViewer::AssertImages( aMessage ) )            \
35     {                                                      \
36       std::string aMessageStl = aMessage.toStdString();    \
37       CPPUNIT_FAIL( aMessageStl.c_str() );                 \
38     }                                                      \
39   }                                                        \
40