Salome HOME
Merge remote-tracking branch 'origin/BR_LAND_COVER_MAP' into BR_LAND_COVER_REMOVING
[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   static QColor GetColor(int i);
26
27   static Handle_Aspect_ColorScale showColorScale();
28
29 private:
30   static OCCViewer_ViewManager* myViewManager;
31   static OCCViewer_ViewWindow* myViewWindow;
32   static QString myKey;
33 };
34
35 #define CPPUNIT_ASSERT_IMAGES                              \
36   {                                                        \
37     QString aMessage;                                      \
38     if( !TestViewer::AssertImages( aMessage ) )            \
39     {                                                      \
40       std::string aMessageStl = aMessage.toStdString();    \
41       CPPUNIT_FAIL( aMessageStl.c_str() );                 \
42     }                                                      \
43   }                                                        \
44