Salome HOME
Merge branch 'BR_1330' into BR_DEMO
authorasl <asl@opencascade.com>
Wed, 11 Oct 2017 05:22:41 +0000 (08:22 +0300)
committerasl <asl@opencascade.com>
Wed, 11 Oct 2017 05:22:41 +0000 (08:22 +0300)
# Conflicts:
# src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx
# src/HYDRO_tests/TestViewer.h
# src/HYDRO_tests/reference_data/Polyline_Presentation.png

1  2 
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/HYDROGUI_OCCDisplayer.h
src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx
src/HYDROGUI/HYDROGUI_ShapeBathymetry.h
src/HYDROGUI/resources/HYDROGUI_msg_en.ts
src/HYDRO_tests/TestViewer.cxx
src/HYDRO_tests/TestViewer.h
src/HYDRO_tests/reference_data/CMakeLists.txt

Simple merge
index 275954472bcd21b65b54531eab4ac330fc806517,f20132977cae43dd50560a853b6478c4148559c5..e7aea2a9d960a92485c276ad3a097b9fa82e34dc
@@@ -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.
index cf9a3681c99a0a7007b8fb5800bd7e4057bd87f9,3a72a138893dc1707e32925cd620335dedcaa9c8..35e8362aee08b5aa3b660e2081ecde63a3aad8bc
@@@ -63,8 -57,11 +63,10 @@@ void HYDROGUI_ShapeBathymetry::update( 
    HYDROGUI_Shape::update( theIsUpdateViewer, isDeactivateSelection );
  }
  
- Handle(AIS_InteractiveObject) HYDROGUI_ShapeBathymetry::createShape() const
 -
+ QList<Handle(AIS_InteractiveObject)> HYDROGUI_ShapeBathymetry::createShape() const
  {
+   QList<Handle(AIS_InteractiveObject)> shapes;
    Handle(AIS_InteractiveObject) aPntCloud;
  
    Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( getObject() );
      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)
      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,
index e505f8722db306575c1d435dd0959e26f048a284,91a0a7729b46bc70dbaf32d941e5d0ee342d775b..814337242d44f8d159d87d5620e827d87e10fcbf
@@@ -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<Handle(AIS_InteractiveObject)> createShape() const;
    virtual void displayShape( const bool theIsUpdateViewer );
  
    void setToUpdateColorScale( bool isChanged );
index bb76a837943b46d157ef413d5a63b803743c3518,71cd941b27ab2e332f21742e5f9e3dcc75818aab..ba0b7b5d059b76a37bb623a5179be8096df2aa77
@@@ -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,
index 24dccb63a81f78b231fea17609fd9b0f6ed2154a,8a0db3c9d00e5edec952a11c29aae25c3323aa24..99fadc09f40774034aec585dff6af21c36a7a335
@@@ -60,7 -60,7 +60,8 @@@ public
                                 int theLinesToOmit,
                                 QString& theMsg );
  
 +  static void setKey( const QString& );
+   static void fitAll();
  
  private:
    static OCCViewer_ViewManager* myViewManager;