From: asl Date: Wed, 11 Oct 2017 05:22:41 +0000 (+0300) Subject: Merge branch 'BR_1330' into BR_DEMO X-Git-Tag: v2.1~66^2~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ac056ee3c8e228f5b79eca9bad0fec624c595b1b;p=modules%2Fhydro.git Merge branch 'BR_1330' into BR_DEMO # Conflicts: # src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx # src/HYDRO_tests/TestViewer.h # src/HYDRO_tests/reference_data/Polyline_Presentation.png --- ac056ee3c8e228f5b79eca9bad0fec624c595b1b diff --cc src/HYDROGUI/HYDROGUI_OCCDisplayer.h index 27595447,f2013297..e7aea2a9 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.h +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.h @@@ -80,10 -80,11 +80,13 @@@ public * \param theViewerId viewer identifier * \return the color scale */ - Handle(AIS_ColorScale) GetColorScale( const int theViewerId ); + Handle(AIS_ColorScale) GetColorScale( const int theViewerId ); + + + void UpdatePolylines( int theViewerId, int theType, int theSize ); + void UpdateColorScale( const OCCViewer_Viewer* ); + protected: /** * \brief Erase all viewer objects. diff --cc src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx index cf9a3681,3a72a138..35e8362a --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx @@@ -63,8 -57,11 +63,10 @@@ void HYDROGUI_ShapeBathymetry::update( HYDROGUI_Shape::update( theIsUpdateViewer, isDeactivateSelection ); } - Handle(AIS_InteractiveObject) HYDROGUI_ShapeBathymetry::createShape() const - + QList HYDROGUI_ShapeBathymetry::createShape() const { + QList shapes; + Handle(AIS_InteractiveObject) aPntCloud; Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( getObject() ); @@@ -83,11 -80,32 +85,13 @@@ aThat->myColors = new Quantity_HArray1OfColor( aLower, anUpper ); for( int i=aLower; i<=anUpper; i++ ) aThat->myCoords->SetValue( i, gp_Pnt( aBathPoints[i].X, aBathPoints[i].Y, aBathPoints[i].Z ) ); + + shapes.append( aPntCloud ); } - return aPntCloud; + return shapes; } -void HYDROGUI_ShapeBathymetry::GetRange( double& theMin, double& theMax ) const -{ - theMin = 0; - theMax = 0; - if( myCoords.IsNull() ) - return; - - bool isFirst = true; - for( int i=myCoords->Lower(), n=myCoords->Upper(); i<=n; i++ ) - { - double aValue = myCoords->Value( i ).Z(); - if( isFirst || aValue < theMin ) - theMin = aValue; - if( isFirst || aValue > theMax ) - theMax = aValue; - isFirst = false; - } -} - void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(AIS_ColorScale)& theColorScale ) { if (!myCoords) @@@ -104,10 -117,9 +108,10 @@@ theColorScale->FindColor( z, aColor ); myColors->SetValue( i, aColor ); } - Handle(HYDROGUI_BathymetryPrs) aPntCloud = Handle(HYDROGUI_BathymetryPrs)::DownCast( getAISObject() ); - Handle(AIS_PointCloud) aPntCloud = Handle(AIS_PointCloud)::DownCast( getAISObjects()[0] ); ++ Handle(HYDROGUI_BathymetryPrs) aPntCloud = Handle(HYDROGUI_BathymetryPrs)::DownCast( getAISObject()[0] ); aPntCloud->SetPoints( myCoords, myColors ); - getContext()->Redisplay( aPntCloud, Standard_False ); + getContext()->RecomputePrsOnly( aPntCloud, Standard_True ); + getContext()->RecomputeSelectionOnly( aPntCloud ); } void HYDROGUI_ShapeBathymetry::setVisible( const bool theState, diff --cc src/HYDROGUI/HYDROGUI_ShapeBathymetry.h index e505f872,91a0a772..81433724 --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h @@@ -59,11 -47,8 +59,11 @@@ public virtual void setVisible( const bool theState, const bool theIsUpdateViewer = true ); + + void Build(); + protected: - virtual Handle(AIS_InteractiveObject) createShape() const; + virtual QList createShape() const; virtual void displayShape( const bool theIsUpdateViewer ); void setToUpdateColorScale( bool isChanged ); diff --cc src/HYDRO_tests/TestViewer.cxx index bb76a837,71cd941b..ba0b7b5d --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@@ -137,17 -137,18 +137,20 @@@ void TestViewer::show( const Handle(AIS if( theSelectionMode > 0 ) { context()->OpenLocalContext(); + context()->Display( theObject, theMode, theSelectionMode ); context()->Activate( theObject, theSelectionMode, Standard_True ); } + else + context()->Display( theObject, theMode, theSelectionMode ); if( isFitAll ) - { - viewWindow()->onTopView(); - viewWindow()->onFitAll(); - } + fitAll(); + } + + void TestViewer::fitAll() + { + viewWindow()->onTopView(); + viewWindow()->onFitAll(); } void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor, diff --cc src/HYDRO_tests/TestViewer.h index 24dccb63,8a0db3c9..99fadc09 --- a/src/HYDRO_tests/TestViewer.h +++ b/src/HYDRO_tests/TestViewer.h @@@ -60,7 -60,7 +60,8 @@@ public int theLinesToOmit, QString& theMsg ); + static void setKey( const QString& ); + static void fitAll(); private: static OCCViewer_ViewManager* myViewManager;