X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_PolylineXY.cxx;h=8c97c15d21687c0fe0ee7c020d4a585a9bb7dfe4;hb=d6a8c59ee076938a924fcfd1e3f83ef1395b7336;hp=37559e3f3a43775ac7c1ef4a4c9501e839f5c9e2;hpb=2820a1f4283dfca3a02d7c5725faff632617f511;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index 37559e3f..8c97c15d 100755 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -484,7 +484,7 @@ void HYDROData_PolylineXY::Update() if ( !IsEditable() ) { // If polyline is not editable we no need to update it wire - SetToUpdate( false ); + ClearChanged(); return; } @@ -710,7 +710,7 @@ void HYDROData_PolylineXY::AddSection( const TCollection_AsciiString& theSectNam aTypesList->Append( theSectionType ); aClosuresList->Append( theIsClosed ); - SetToUpdate( true ); + Changed( Geom_2d ); } TCollection_AsciiString HYDROData_PolylineXY::GetSectionName( const int theSectionIndex ) const @@ -754,8 +754,6 @@ void HYDROData_PolylineXY::SetSectionName( const int theSec TDataStd_ListIteratorOfListOfExtendedString aNamesIter( anOldNamesList ); for ( int i = 0; aNamesIter.More(); aNamesIter.Next(), ++i ) aNamesList->Append( i == theSectionIndex ? aNewSectName : aNamesIter.Value() ); - - SetToUpdate( true ); } HYDROData_PolylineXY::SectionType HYDROData_PolylineXY::GetSectionType( const int theSectionIndex ) const @@ -793,7 +791,7 @@ void HYDROData_PolylineXY::SetSectionType( const int theSectionIndex, for ( int i = 0; aTypesIter.More(); aTypesIter.Next(), ++i ) aTypesList->Append( i == theSectionIndex ? theSectionType : aTypesIter.Value() ); - SetToUpdate( true ); + Changed( Geom_2d ); } bool HYDROData_PolylineXY::IsClosedSection( const int theSectionIndex ) const @@ -831,7 +829,7 @@ void HYDROData_PolylineXY::SetSectionClosed( const int theSectionIndex, for ( int i = 0; aClosuresIter.More(); aClosuresIter.Next(), ++i ) aClosuresList->Append( i == theSectionIndex ? theIsClosed : (bool)aClosuresIter.Value() ); - SetToUpdate( true ); + Changed( Geom_2d ); } void HYDROData_PolylineXY::GetSections( NCollection_Sequence& theSectNames, @@ -913,14 +911,14 @@ void HYDROData_PolylineXY::RemoveSection( const int theSectionIndex ) removePointsLists( theSectionIndex ); } - SetToUpdate( true ); + Changed( Geom_2d ); } void HYDROData_PolylineXY::RemoveSections() { removeSectionsLists(); removePointsLists(); - SetToUpdate( true ); + Changed( Geom_2d ); } void HYDROData_PolylineXY::AddPoint( const int theSectionIndex, @@ -966,7 +964,7 @@ void HYDROData_PolylineXY::AddPoint( const int theSectionIndex, } } - SetToUpdate( true ); + Changed( Geom_2d ); } void HYDROData_PolylineXY::SetPoint( const int theSectionIndex, @@ -1017,7 +1015,7 @@ void HYDROData_PolylineXY::SetPoint( const int theSectionIndex, } } - SetToUpdate( true ); + Changed( Geom_2d ); } void HYDROData_PolylineXY::SetPoints( const int theSectionIndex, @@ -1073,10 +1071,10 @@ void HYDROData_PolylineXY::RemovePoint( const int theSectionIndex, } } - SetToUpdate( true ); + Changed( Geom_2d ); } -HYDROData_PolylineXY::PointsList HYDROData_PolylineXY::GetPoints( const int theSectionIndex ) const +HYDROData_PolylineXY::PointsList HYDROData_PolylineXY::GetPoints( const int theSectionIndex, bool IsConvertToGlobal ) const { PointsList aResList; @@ -1092,9 +1090,12 @@ HYDROData_PolylineXY::PointsList HYDROData_PolylineXY::GetPoints( const int theS TColStd_ListIteratorOfListOfReal anIterX( aListX->List() ); TColStd_ListIteratorOfListOfReal anIterY( aListY->List() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( myLab ); for ( ; anIterX.More() && anIterY.More(); anIterX.Next(), anIterY.Next() ) { Point aPoint( anIterX.Value(), anIterY.Value() ); + if (IsConvertToGlobal) + aDoc->Transform( aPoint, false ); aResList.Append( aPoint ); } @@ -1153,7 +1154,7 @@ void HYDROData_PolylineXY::UpdateLocalCS( double theDx, double theDy ) } SetPoints( i, aPoints ); } - SetToUpdate( true ); + Changed( Geom_2d ); } void HYDROData_PolylineXY::Transform( const QTransform& theTrsf )