From c4738cc6d2fb23c60a1922847991007b3ac4e6d7 Mon Sep 17 00:00:00 2001 From: asl Date: Tue, 13 Sep 2016 12:09:30 +0300 Subject: [PATCH] debug of DTM presentation --- src/HYDROData/HYDROData_DTM.cxx | 2 +- src/HYDRO_tests/TestViewer.cxx | 11 +- src/HYDRO_tests/TestViewer.h | 14 ++- src/HYDRO_tests/reference_data/DTM_1.png | Bin 0 -> 10414 bytes src/HYDRO_tests/test_HYDROData_DTM.cxx | 131 +++++++++++++++++++++-- 5 files changed, 146 insertions(+), 12 deletions(-) create mode 100644 src/HYDRO_tests/reference_data/DTM_1.png diff --git a/src/HYDROData/HYDROData_DTM.cxx b/src/HYDROData/HYDROData_DTM.cxx index 9e4da231..4db3a948 100644 --- a/src/HYDROData/HYDROData_DTM.cxx +++ b/src/HYDROData/HYDROData_DTM.cxx @@ -520,7 +520,7 @@ HYDROData_Bathymetry::AltitudePoints HYDROData_DTM::Interpolate size_t q = p>0 ? 2*mid[0].size() : 1; AltitudePoints points; points.reserve( p*q ); - for( size_t i=0; idumpView(); + QImage anActualImage; + if( theImage ) + anActualImage = *theImage; + else + anActualImage = viewWindow()->dumpView(); + + if( theCase ) + myKey = theCase; QString anExpectedRefFilePath = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test/HYDRO"; anExpectedRefFilePath += "/" + myKey + ".png"; diff --git a/src/HYDRO_tests/TestViewer.h b/src/HYDRO_tests/TestViewer.h index 9030f33b..7173bb2f 100644 --- a/src/HYDRO_tests/TestViewer.h +++ b/src/HYDRO_tests/TestViewer.h @@ -24,6 +24,7 @@ class OCCViewer_ViewWindow; class TopoDS_Shape; class QString; class QColor; +class QImage; class Handle_AIS_InteractiveContext; class Handle_AIS_InteractiveObject; class Handle_Aspect_ColorScale; @@ -41,7 +42,7 @@ public: int theMode, int theSelectionMode, bool isFitAll, const char* theKey ); static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor ); static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey ); - static bool AssertImages( QString& theMessage ); + static bool AssertImages( QString& theMessage, const QImage* = 0, const char* theCase = 0 ); static QColor GetColor(int i); static Handle_Aspect_ColorScale colorScale(); @@ -72,6 +73,17 @@ private: } \ } \ +#define CPPUNIT_ASSERT_IMAGES2( theImage, theCase ) \ + { \ + QString aMessage; \ + if( !TestViewer::AssertImages( aMessage, theImage, theCase ) ) \ + { \ + TestViewer::showColorScale( false ); \ + std::string aMessageStl = aMessage.toStdString(); \ + CPPUNIT_FAIL( aMessageStl.c_str() ); \ + } \ + } \ + #define CPPUNIT_ASSERT_SCRIPTS_EQUAL( theBaseName, \ isExpectedUtf8, \ isActualUtf8, \ diff --git a/src/HYDRO_tests/reference_data/DTM_1.png b/src/HYDRO_tests/reference_data/DTM_1.png new file mode 100644 index 0000000000000000000000000000000000000000..e84a2fcaa7429e7231372eb04a545c5ed4265a53 GIT binary patch literal 10414 zcmeHt_g7QP_ckIRO}e18pj<$ui69_V6hXSuA#{{prIP>xLO_~|6sZ>wP+DlAg(OH7 z=|q|#p@$M$C?V8*`TQI2dw-a9);Tk?pP9X%J$tP=PvT2M?dy!Zj8s%q*L7ZK8dFhG zTmG-nQ(u0OppF89bB_0-t4jGNv>4ZPR-U%ejl~MZ z68AzM#Bkj^RpaOX$BOGYVzIn67Y?{Mq8zJI2~|ct@1~p-O7EOMq?#8vn~FkR^np-x zRG~&OZ14Wi+@|`$@RZ7!^F7r!QTi({4A`hY<_OUUJ<_0m;_=^r|NQVDAO0W73lj7w z^2)Bi083w#>BO%gd;xA~h4rp#WZwuq1O3yxAMey@*LPw$-@kqYG{hF+nBbVH8PR*K zpqP(o1X9-g`oFx9I2h|RnL0SE11U({q6ef3Ej!vOui{ky*&f|OiQVcg4D*foc&$!# zHCP&D>ExZ!p2_%mh~{>Pvvb_hl^Abm%@{<`Wwzi8U_Q6Qo8c+0fBOb*%hvg@vvE$; zSBiM$bI?*b5+WU~EKJ{;0W(oBTNM9_k9c&9v9V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{8%W;6n*XOj7ViI70N$HqDlaw12T|Xy;V7>5#N08+ENLf<7r^! ze!ji(JqwHI!`_*#A*T&kagfR2i@g+=qD#aMEopzwIE~80G8}sYF8;Vx$!8k7(|;4l z<=?=SoW}be796{_{%^-{_;DK}SkN@u_c9=X1KAu_^k6EGDFj9eU2_w6XNKtbX2%dm zfmOEiY|wH6O$wP~4%t0|W6%{|{iRST9ISMOW4`1E^kZxQZ9z$tP8v23VbPG<#f$L~EE# zRDUxI2()bg9{JVpl8jB?ZwZb)YbVJYo_dGo_0dMiP|49be~ZJmftXs3=ClJ7S?$=H z_!W?z@`fP38O7>D=StR301p(OF+KH++!W#wK|J31o4?ZD#RwVExOm}GPvhvT*oY*A zlHY<(H_a{$4sN7=(n53>2NgToEW9o?yBv{+8e6?zOG&^*%6KU+xKqjL*yU+oj@= OO6R$uX3bNFnEwMyl5Tqd literal 0 HcmV?d00001 diff --git a/src/HYDRO_tests/test_HYDROData_DTM.cxx b/src/HYDRO_tests/test_HYDROData_DTM.cxx index 96e779c7..97d122ab 100644 --- a/src/HYDRO_tests/test_HYDROData_DTM.cxx +++ b/src/HYDRO_tests/test_HYDROData_DTM.cxx @@ -30,12 +30,119 @@ #include #include #include -#include +#include +#include +#include +#include +#include const double EPS = 1E-3; NCollection_Sequence points; +class DTM_item : public QGraphicsItem +{ +public: + DTM_item( HYDROGUI_ShapeBathymetry* theDTM, double d ) + { + Handle(AIS_PointCloud) pc = Handle(AIS_PointCloud)::DownCast( theDTM->getAISObject() ); + Handle(Graphic3d_ArrayOfPoints) pp = pc->GetPoints(); + myBB = QRectF(); + double xmin, xmax, ymin, ymax; + myD = d; + + int n = pp->VertexNumber(); + + for( int i=1; i<=n; i++ ) + { + gp_Pnt pnt = pp->Vertice( i ); + Quantity_Color col = pp->VertexColor( i ); + + int r = col.Red()*255; + int g = col.Green()*255; + int b = col.Blue()*255; + int val = ( r << 16 ) + ( g << 8 ) + b; + double x = pnt.X(); + double y = -pnt.Y(); + QPointF aPnt( x, y ); + myPoints[val].append( aPnt ); + if( i==1 ) + { + xmin = x; + xmax = x; + ymin = y; + ymax = y; + } + else + { + if( x>xmax ) + xmax = x; + if( xymax ) + ymax = y; + if( y >::const_iterator it = myPoints.begin(), last = myPoints.end(); + for( ; it!=last; it++ ) + { + int r = ( it.key() >> 16 ) % 256; + int g = ( it.key() >> 8 ) % 256; + int b = ( it.key() >> 0 ) % 256; + QColor aColor( r, g, b ); + QBrush aBrush( aColor ); + foreach( QPointF pnt, it.value() ) + { + QRectF r( pnt.x()-myD/2, pnt.y()-myD/2, myD, myD ); + p->fillRect( r, aBrush ); + } + } + } + +private: + QRectF myBB; + double myD; + QMap > myPoints; +}; + +QImage draw_DTM( HYDROGUI_ShapeBathymetry* theDTM, double theD, int theWidth, int theHeight ) +{ + QGraphicsScene aScene; + QGraphicsView aView; + DTM_item anItem( theDTM, theD ); + + aView.setScene( &aScene ); + aView.setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); + aView.setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); + aScene.addItem( &anItem ); + + aView.resize( theWidth, theHeight ); + QRectF bb = anItem.boundingRect(); + aView.fitInView( bb, Qt::KeepAspectRatio ); + QApplication::processEvents(); + + QPixmap aPixmap = QPixmap::grabWidget( &aView ); + return aPixmap.toImage(); +} + + void test_HYDROData_DTM::setUp() { points.Clear(); @@ -99,6 +206,14 @@ void test_HYDROData_DTM::test_hydraulic_axis() CPPUNIT_ASSERT_DOUBLES_EQUAL( 43.499, distances[1], EPS ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 211.474, distances[2], EPS ); + gp_Pnt2d p; + gp_Vec2d q; + HA->D1( 0, p, q ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 13.75, p.X(), EPS ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 6.25, p.Y(), EPS ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.568, q.X(), EPS ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.568, q.Y(), EPS ); + aDoc->Close(); } @@ -409,13 +524,13 @@ void test_HYDROData_DTM::test_presentation() aProfile1->SetParametricPoints( points ); aProfile1->GetProfileUZ()->SetSectionType( 0, HYDROData_IPolyline::SECTION_SPLINE ); - aProfile1->SetLeftPoint( gp_XY( 20, 0 ) ); - aProfile1->SetRightPoint( gp_XY( 10, 10 ) ); + aProfile1->SetLeftPoint( gp_XY( 10, 10 ) ); + aProfile1->SetRightPoint( gp_XY( 20, 0 ) ); aProfile2->SetParametricPoints( points ); aProfile2->GetProfileUZ()->SetSectionType( 0, HYDROData_IPolyline::SECTION_SPLINE ); - aProfile2->SetLeftPoint( gp_XY( 100, 0 ) ); - aProfile2->SetRightPoint( gp_XY( 110, 0 ) ); + aProfile2->SetLeftPoint( gp_XY( 110, 10 ) ); + aProfile2->SetRightPoint( gp_XY( 100, 0 ) ); HYDROData_SequenceOfObjects seq; seq.Append( aProfile1 ); @@ -427,7 +542,7 @@ void test_HYDROData_DTM::test_presentation() CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, DTM->GetSpatialStep(), EPS ); DTM->Update(); - CPPUNIT_ASSERT_EQUAL( 10404, (int)DTM->GetAltitudePoints().size() ); + CPPUNIT_ASSERT_EQUAL( 10200, (int)DTM->GetAltitudePoints().size() ); Handle_AIS_InteractiveContext aContext = TestViewer::context(); HYDROGUI_ShapeBathymetry* aBathPrs = new HYDROGUI_ShapeBathymetry( 0, aContext, DTM ); @@ -440,8 +555,8 @@ void test_HYDROData_DTM::test_presentation() aCS->SetNumberOfIntervals( 10 ); aBathPrs->UpdateWithColorScale( aCS ); - TestViewer::show( aBathPrs->getAISObject(), AIS_PointCloud::DM_Points, 0, true, "DTM_1" ); - CPPUNIT_ASSERT_IMAGES + QImage aDTMPrs = draw_DTM( aBathPrs, 0.5, 600, 600 ); + CPPUNIT_ASSERT_IMAGES2( &aDTMPrs, "DTM_1" ); delete aBathPrs; aDoc->Close(); -- 2.39.2