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