Salome HOME
Merge branch 'BR_MULTI_BATHS' into HEAD
[modules/hydro.git] / src / HYDRO_tests / test_HYDROGUI_Shape.cxx
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #undef HYDROGUI_EXPORTS
20
21 #include <test_HYDROGUI_Shape.h>
22 #include <HYDROGUI_Shape.h>
23 #include <TestShape.h>
24 #include <TestViewer.h>
25 #include <TopoDS_Face.hxx>
26
27 void test_HYDROGUI_Shape::test_face_in_preview()
28 {
29   TopoDS_Face aFace = Face( QList<double>() << 21 << 34 << 24 << 25 << 37   << 37 << 40  << 61 <<
30                                               44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 <<
31                                              128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 <<
32                                               31 << 114 );
33
34   Handle_AIS_InteractiveContext aContext = TestViewer::context();
35   Handle_HYDROData_Entity anEntity; //it should be null as in preview
36
37   HYDROGUI_Shape* aPreview = new HYDROGUI_Shape( aContext, anEntity );
38   aPreview->setFace( aFace, true, true, "" );
39   aPreview->setFillingColor( Qt::red, false, false );
40   aPreview->setBorderColor( Qt::darkBlue, false, false );
41   
42   TestViewer::show( aPreview->getAISObject(), AIS_Shaded, 0, true, "Shape_preview_im_zone" );
43   CPPUNIT_ASSERT_IMAGES
44
45   delete aPreview;
46 }