QString aProfileName;
if( !myEditedObject.IsNull() )
{
- CurveCreator::Coordinates aCurveCoords;
- CurveCreator::SectionsMap aSectionsMap;
-
- HYDROData_ProfileUZ::PointsList aSectPointsList = myEditedObject->GetParametricPoints();
- CurveCreator::PosPointsList aPoints;
- for ( int k = 1, aNbPoints = aSectPointsList.Size(); k <= aNbPoints; ++k )
+ Handle(HYDROData_ProfileUZ) aProfileUZ = myEditedObject->GetProfileUZ( false );
+ if ( !aProfileUZ.IsNull() )
{
- const HYDROData_ProfileUZ::Point& aSectPoint = aSectPointsList.Value( k );
- aCurveCoords.clear();
- aCurveCoords.push_back( aSectPoint.X() );
- aCurveCoords.push_back( aSectPoint.Y() );
+ CurveCreator::Coordinates aCurveCoords;
+ CurveCreator::SectionsMap aSectionsMap;
+
+ HYDROData_ProfileUZ::PointsList aSectPointsList = aProfileUZ->GetPoints();
+ CurveCreator::PosPointsList aPoints;
+ for ( int k = 1, aNbPoints = aSectPointsList.Size(); k <= aNbPoints; ++k )
+ {
+ const HYDROData_ProfileUZ::Point& aSectPoint = aSectPointsList.Value( k );
+ aCurveCoords.clear();
+ aCurveCoords.push_back( aSectPoint.X() );
+ aCurveCoords.push_back( aSectPoint.Y() );
+
+ CurveCreator_PosPoint* aPosPoint = new CurveCreator_PosPoint( k, aCurveCoords );
+ aPoints.push_back( aPosPoint );
+ }
+
+ aSectionsMap[0] = aPoints;
+ myProfile->addPointsInternal( aSectionsMap );
- CurveCreator_PosPoint* aPosPoint = new CurveCreator_PosPoint( k, aCurveCoords );
- aPoints.push_back( aPosPoint );
+ HYDROData_ProfileUZ::SectionType aSectType = aProfileUZ->GetSectionType( 0 );
+
+ CurveCreator::SectionType aCurveType = CurveCreator::Polyline;
+ if( aSectType == HYDROData_ProfileUZ::SECTION_SPLINE )
+ aCurveType = CurveCreator::Spline;
+
+ myProfile->setSectionType( 0, aCurveType );
}
- aSectionsMap[0] = aPoints;
- myProfile->addPointsInternal( aSectionsMap );
aProfileName = myEditedObject->GetName();
}
if( aProfileObj.IsNull() )
return false;
+ Handle(HYDROData_ProfileUZ) aProfileUZ = aProfileObj->GetProfileUZ();
+ if ( aProfileUZ.IsNull() )
+ return false;
+
aProfileObj->SetName(aProfileName);
HYDROData_ProfileUZ::PointsList aProfileParamPoints;
}
aProfileObj->SetParametricPoints( aProfileParamPoints );
- theUpdateFlags = UF_Model;
+ HYDROData_ProfileUZ::SectionType aSectType = HYDROData_ProfileUZ::SECTION_POLYLINE;
+ if ( myProfile->getSectionType( 0 ) == CurveCreator::Spline )
+ aSectType = HYDROData_ProfileUZ::SECTION_SPLINE;
+
+ aProfileUZ->SetSectionType( 0, aSectType );
+
+ if ( !myIsEdit )
+ {
+ aProfileObj->SetBorderColor( HYDROData_Profile::DefaultBorderColor() );
+ }
+
+ // At first we update the child u,z profile object
+ aProfileUZ->SetToUpdate( true );
+ aProfileUZ->Update();
+
+ // And now we update our edited object
+ aProfileObj->Update();
+
+ theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced;
return true;
}