if ( !aRiver.IsNull() )
{
startDocOperation();
- //aRiver->Interpolate( anIterp );
+ aRiver->Interpolate( anIterp );
if ( anIterp->GetErrorCode() == OK )
commitDocOperation();
else
if ( anIterp )
{
updateInterpolator( anIterp );
- if ( anIterp->Calculate() == OK )
+ anIterp->Calculate();
+ if ( anIterp->GetErrorCode() == OK )
{
- TopoDS_Shape aShape = previewShape( anIterp, aDlg->profileNumber() );
+ TopoDS_Shape aShape = previewShape( anIterp );
if ( !aShape.IsNull() )
{
myPreview = new AIS_Shape( aShape );
return aRes;
}
-TopoDS_Shape HYDROGUI_ProfileInterpolateOp::previewShape( HYDROData_IProfilesInterpolator* theInterp, int theNumber ) const
+TopoDS_Shape HYDROGUI_ProfileInterpolateOp::previewShape( HYDROData_IProfilesInterpolator* theInterp ) const
{
TopoDS_Compound aPreviewShape;
if ( theInterp )
{
BRep_Builder aBuilder;
aBuilder.MakeCompound( aPreviewShape );
- for ( int i = 0; i < theNumber; i++ )
+ for ( int i = 0; i < theInterp->GetCalculatedProfilesNumber(); i++ )
{
NCollection_Sequence<gp_XYZ> pointSeq;
std::vector<double> aPoints = theInterp->GetResultProfile( i );
- for ( int i = 0; i < aPoints.size(); i += 3 )
+ for ( int i = 0; i < (int) aPoints.size(); i += 3 )
pointSeq.Append( gp_XYZ( aPoints[i], aPoints[i+1], aPoints[i+2] ) );
TopoDS_Shape aWire = HYDROData_PolylineXY::BuildWire( HYDROData_IPolyline::SECTION_SPLINE, false, pointSeq );
if ( !aWire.IsNull() )
- aBuilder.Add( aWire, aPreviewShape );
+ aBuilder.Add( aPreviewShape, aWire );
}
}