From 73c6183c872b9bef4db51730512666316f055553 Mon Sep 17 00:00:00 2001 From: asl Date: Wed, 21 Oct 2015 17:25:31 +0300 Subject: [PATCH] test for polyline presentation --- src/HYDROData/HYDROData_BSplineOperation.cxx | 4 -- src/HYDROGUI/HYDROGUI_Polyline.cxx | 13 ++++- src/HYDRO_tests/CMakeLists.txt | 7 ++- src/HYDRO_tests/ExternalFiles.cmake | 1 + src/HYDRO_tests/TestViewer.cxx | 14 +++-- .../reference_data/Polyline_Presentation.png | Bin 0 -> 7750 bytes src/HYDRO_tests/test_HYDROData_PolylineXY.cxx | 54 +++++++++++++++++- src/HYDRO_tests/test_HYDROData_PolylineXY.h | 2 + 8 files changed, 80 insertions(+), 15 deletions(-) create mode 100644 src/HYDRO_tests/reference_data/Polyline_Presentation.png diff --git a/src/HYDROData/HYDROData_BSplineOperation.cxx b/src/HYDROData/HYDROData_BSplineOperation.cxx index 058005d9..64ae37d4 100644 --- a/src/HYDROData/HYDROData_BSplineOperation.cxx +++ b/src/HYDROData/HYDROData_BSplineOperation.cxx @@ -23,9 +23,7 @@ #include #include -#ifndef LIGHT_MODE #include -#endif Handle(Geom_BSplineCurve) HYDROData_BSplineOperation::ComputeCurve( const NCollection_Sequence& thePoints, @@ -58,11 +56,9 @@ Handle(Geom_BSplineCurve) HYDROData_BSplineOperation::ComputeCurve( // compute BSpline Handle(Geom_BSplineCurve) aBSpline; -#ifndef LIGHT_MODE if( CurveCreator_Utils::constructBSpline( aHCurvePoints, theIsClosed, aBSpline ) ) return aBSpline; else -#endif return Handle(Geom_BSplineCurve)(); } diff --git a/src/HYDROGUI/HYDROGUI_Polyline.cxx b/src/HYDROGUI/HYDROGUI_Polyline.cxx index 91e0a06a..4f070b47 100644 --- a/src/HYDROGUI/HYDROGUI_Polyline.cxx +++ b/src/HYDROGUI/HYDROGUI_Polyline.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -82,8 +83,11 @@ void HYDROGUI_Polyline::Compute(const Handle(PrsMgr_PresentationManager3d)& aPre aPrs->Clear(); Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup( aPrs ); - Handle(Graphic3d_AspectLine3d) anAspect = Attributes()->FaceBoundaryAspect()->Aspect(); - aGroup->SetGroupPrimitivesAspect( anAspect ); + Quantity_Color aColor; + Aspect_TypeOfLine aType; + Standard_Real anWidth; + Attributes()->LineAspect()->Aspect()->Values( aColor, aType, anWidth ); + Handle(Graphic3d_AspectLine3d) anAspect = new Graphic3d_AspectLine3d( aColor, aType, anWidth ); TopExp_Explorer Exp1 ( myshape, TopAbs_EDGE ); for ( ; Exp1.More(); Exp1.Next() ) @@ -91,7 +95,10 @@ void HYDROGUI_Polyline::Compute(const Handle(PrsMgr_PresentationManager3d)& aPre TopoDS_Edge anEdge = TopoDS::Edge( Exp1.Current() ); Handle( Graphic3d_ArrayOfPolylines ) anArray = BuildEdgePresentation( anEdge, 0.1 ); if( !anArray.IsNull() ) - aGroup->AddPrimitiveArray ( anArray ); + { + aGroup->SetPrimitivesAspect( anAspect ); + aGroup->AddPrimitiveArray( anArray ); + } } diff --git a/src/HYDRO_tests/CMakeLists.txt b/src/HYDRO_tests/CMakeLists.txt index 7f1e99b1..14b5b4dc 100644 --- a/src/HYDRO_tests/CMakeLists.txt +++ b/src/HYDRO_tests/CMakeLists.txt @@ -59,6 +59,7 @@ SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT_DIR}/include ) SET( CAS_INCLUDES $ENV{CAS_ROOT_DIR}/inc ) SET( QT_INCLUDES $ENV{QT4_ROOT_DIR}/include $ENV{QT4_ROOT_DIR}/include/QtCore $ENV{QT4_ROOT_DIR}/include/QtGui $ENV{QT4_ROOT_DIR}/include/QtTest ) SET( GUI_INCLUDES $ENV{GUI_ROOT_DIR}/include/salome ) +SET( GEOM_INCLUDES $ENV{GEOM_ROOT_DIR}/include/salome ) IF( ${WIN32} ) link_directories( $ENV{CAS_ROOT_DIR}/win32/libd ) @@ -81,8 +82,9 @@ ELSE() SET( CPPUNIT_LIBRARIES cppunit ) ENDIF() -link_directories( $ENV{GUI_ROOT_DIR}/lib/salome ) +link_directories( $ENV{GUI_ROOT_DIR}/lib/salome $ENV{GEOM_ROOT_DIR}/lib/salome ) SET( GUI_LIBRARIES ImageComposer qtx suit LightApp CAM OCCViewer ) +SET( GEOM_LIBRARIES CurveCreator ) include_directories( ${BOOST_INCLUDES} @@ -90,6 +92,7 @@ include_directories( ${QT_INCLUDES} ${CPPUNIT_INCLUDES} ${GUI_INCLUDES} + ${GEOM_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../HYDROData ${CMAKE_CURRENT_SOURCE_DIR}/../HYDROGUI ${CMAKE_CURRENT_SOURCE_DIR}/../shapelib @@ -98,7 +101,7 @@ include_directories( source_group( "External files" FILES ${EXTERNAL_FILES} ) add_executable( HYDROData_tests ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${EXTERNAL_FILES} ) -target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${CAS_LIBRARIES} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} shapelib ) +target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${GEOM_LIBRARIES} ${CAS_LIBRARIES} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} shapelib ) IF( ${WIN32} ) add_custom_command( TARGET HYDROData_tests POST_BUILD COMMAND $(TargetPath) COMMENT "Running tests" ) diff --git a/src/HYDRO_tests/ExternalFiles.cmake b/src/HYDRO_tests/ExternalFiles.cmake index 663cd087..7ccb5c26 100644 --- a/src/HYDRO_tests/ExternalFiles.cmake +++ b/src/HYDRO_tests/ExternalFiles.cmake @@ -56,4 +56,5 @@ set( EXTERNAL_FILES ../HYDROGUI/HYDROGUI_ListModel.cxx ../HYDROGUI/HYDROGUI_DataObject.cxx ../HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx + ../HYDROGUI/HYDROGUI_Polyline.cxx ) diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index d6ae86ff..44e3fc2c 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -89,17 +89,21 @@ QColor TestViewer::GetColor(int i) void TestViewer::show( const Handle(AIS_InteractiveObject)& theObject, int theMode, int theSelectionMode, bool isFitAll, const char* theKey ) { - context()->CloseLocalContext(); - context()->EraseAll( Standard_False ); + QString aNewKey = theKey; + if( !aNewKey.isEmpty() ) + { + myKey = aNewKey; + context()->CloseLocalContext(); + context()->EraseAll( Standard_False ); + } + + context()->Display( theObject, theMode, theSelectionMode ); if( theSelectionMode > 0 ) { - context()->Display( theObject, theMode, theSelectionMode ); context()->OpenLocalContext(); context()->Activate( theObject, theSelectionMode, Standard_True ); } - myKey = theKey; - if( isFitAll ) { viewWindow()->onTopView(); diff --git a/src/HYDRO_tests/reference_data/Polyline_Presentation.png b/src/HYDRO_tests/reference_data/Polyline_Presentation.png new file mode 100644 index 0000000000000000000000000000000000000000..acbf8663999106bb59067551edfc22af7aa71f2b GIT binary patch literal 7750 zcmaiY2{@Gf*Z;X^h8g>iWgb}uEtHs^6j_HXk*)2aqJ}mp5tAs(jR|eEC?pv|c3M=3 z29KrmphVJBL|MvKNC@wD^gRFf_x`WZ`J8jU=bST+_EuuT^1=Wh zX1&pT3jmQ0KyaoAqM7Ud;Xde(!$aLHIO_*lS+rJ8qv8*Fj&aF5^I%__+%Ua8UA?l0owq{dUT$7{}J>@Xg@*YxgS%Iv`d zP0z2dU6Ud~8h%qUIb3q8>HU+533o==Sa^%B7l5OQWS^%ez>sU z^Y_pLot=IIf9nw+HOdho&fS5hx0JR`t@VeozQ$ffgNsoTdhpR#lCkr|^4{Hr55r$q zygvB75E0S2q`D<(zSj7CcE{At2MO1ZYFf682uT-*jXIMI6O{68q5Xm6vIn<`iGtfI zTvh&@5&SgjMq<4Y=Uku=U+>6L3-nG^Fb)9ChOpCJg6Sf6`V>azHYgc;!1MU*Z8~?< zF6x;8=ncECesuaN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RO_tests/test_HYDROData_PolylineXY.cxx b/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx index a311e48d..e11b3a23 100644 --- a/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx +++ b/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx @@ -27,8 +27,13 @@ #include #include #include +#include #include +#include +#include +#include +#include #include #include #include @@ -157,7 +162,7 @@ void test_HYDROData_PolylineXY::test_extraction_immersible_zone() void test_HYDROData_PolylineXY::test_extraction_channel_refs_611() { -Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); Handle(HYDROData_PolylineXY) aPolyline2d = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -211,3 +216,50 @@ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); aDoc->Close(); } + +void test_HYDROData_PolylineXY::test_presentation() +{ + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + + Handle(HYDROData_PolylineXY) aPolyline2d = + Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); + aPolyline2d->SetName( "polyline2d_1" ); + aPolyline2d->AddSection( "", HYDROData_IPolyline::SECTION_SPLINE, false ); + + QList aPoints = QList() << gp_XY( 0, 0 ) + << gp_XY( 10, 10 ) + << gp_XY( 20, 40 ) + << gp_XY( 30, 10 ) + << gp_XY( 40, 50 ) + << gp_XY( 50, 60 ) + << gp_XY( -10, 40 ) + << gp_XY( -9, 39 ) + << gp_XY( -8, 38 ) + << gp_XY( 0, 20 ); + Handle(TColgp_HArray1OfPnt) aPnts = new TColgp_HArray1OfPnt( 1, aPoints.size() ); + int i = 1; + foreach( gp_XY aPoint, aPoints ) + { + aPolyline2d->AddPoint( 0, aPoint ); + aPnts->SetValue( i, gp_Pnt( aPoint.X(), aPoint.Y(), 0 ) ); + i++; + } + aPolyline2d->Update(); + + CPPUNIT_ASSERT_EQUAL( false, (bool)aPolyline2d->GetShape().IsNull() ); + + Handle(AIS_PointCloud) aPointsPrs = new AIS_PointCloud(); + aPointsPrs->SetPoints( aPnts ); + aPointsPrs->SetColor( Quantity_NOC_BLUE1 ); + aPointsPrs->Attributes()->PointAspect()->SetTypeOfMarker( Aspect_TOM_O ); + + Handle(HYDROGUI_Polyline) aNewPolylinePrs = new HYDROGUI_Polyline( aPolyline2d->GetShape() ); + aNewPolylinePrs->SetColor( Quantity_NOC_DARKGREEN ); + + TestViewer::show( aPointsPrs, AIS_PointCloud::DM_Points, 0, true, "Polyline_Presentation" ); + TestViewer::show( aPolyline2d->GetShape(), 0, true, Qt::red ); + TestViewer::show( aNewPolylinePrs, AIS_PointCloud::DM_Points, 0, true, "" ); + CPPUNIT_ASSERT_IMAGES + + aDoc->Close(); +} diff --git a/src/HYDRO_tests/test_HYDROData_PolylineXY.h b/src/HYDRO_tests/test_HYDROData_PolylineXY.h index cf58c980..dde74539 100644 --- a/src/HYDRO_tests/test_HYDROData_PolylineXY.h +++ b/src/HYDRO_tests/test_HYDROData_PolylineXY.h @@ -23,6 +23,7 @@ class test_HYDROData_PolylineXY : public CppUnit::TestFixture { CPPUNIT_TEST( testPolyline ); CPPUNIT_TEST( testCopy ); CPPUNIT_TEST( testSplit_refs_624 ); + CPPUNIT_TEST( test_presentation ); CPPUNIT_TEST( test_extraction_immersible_zone ); CPPUNIT_TEST( test_extraction_channel_refs_611 ); CPPUNIT_TEST_SUITE_END(); @@ -45,6 +46,7 @@ public: void test_extraction_immersible_zone(); void test_extraction_channel_refs_611(); + void test_presentation(); }; CPPUNIT_TEST_SUITE_REGISTRATION(test_HYDROData_PolylineXY); -- 2.39.2