* \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.
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,
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,