]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDRO_tests/TestViewer.h
Salome HOME
#662: updated hilight/select presentations for land covers
[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( bool );
28
29   static void select( int theViewX, int theViewY );
30
31 private:
32   static OCCViewer_ViewManager* myViewManager;
33   static OCCViewer_ViewWindow* myViewWindow;
34   static QString myKey;
35 };
36
37 #define CPPUNIT_ASSERT_IMAGES                              \
38   {                                                        \
39     QString aMessage;                                      \
40     if( !TestViewer::AssertImages( aMessage ) )            \
41     {                                                      \
42       std::string aMessageStl = aMessage.toStdString();    \
43       CPPUNIT_FAIL( aMessageStl.c_str() );                 \
44     }                                                      \
45   }                                                        \
46