From: asl Date: Fri, 2 Oct 2015 08:59:56 +0000 (+0300) Subject: refs #636: the flags of update 2d/3d geometry X-Git-Tag: v1.5~109^2~3^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d3d7ea6412ef12cf3ecdda87c52881fa03accfee;p=modules%2Fhydro.git refs #636: the flags of update 2d/3d geometry --- diff --git a/src/HYDROData/HYDROData_Channel.cxx b/src/HYDROData/HYDROData_Channel.cxx index 6099dba6..c49d1121 100644 --- a/src/HYDROData/HYDROData_Channel.cxx +++ b/src/HYDROData/HYDROData_Channel.cxx @@ -73,7 +73,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Channel,HYDROData_ArtificialObject) HYDROData_Channel::HYDROData_Channel() -: HYDROData_ArtificialObject() +: HYDROData_ArtificialObject( Geom_3d ) { } @@ -393,7 +393,7 @@ bool HYDROData_Channel::SetGuideLine( const Handle(HYDROData_Polyline3D)& theGui SetReferenceObject( theGuideLine, DataTag_GuideLine ); // Indicate model of the need to update the chanel presentation - SetToUpdate( true, true ); + Changed( Geom_3d ); return true; } @@ -413,7 +413,7 @@ void HYDROData_Channel::RemoveGuideLine() ClearReferenceObjects( DataTag_GuideLine ); // Indicate model of the need to update the chanel presentation - SetToUpdate( true, true ); + Changed( Geom_3d ); } bool HYDROData_Channel::SetProfile( const Handle(HYDROData_Profile)& theProfile ) @@ -432,7 +432,7 @@ bool HYDROData_Channel::SetProfile( const Handle(HYDROData_Profile)& theProfile SetReferenceObject( theProfile, DataTag_Profile ); // Indicate model of the need to update the chanel presentation - SetToUpdate( true, true ); + Changed( Geom_3d ); return true; } @@ -452,7 +452,7 @@ void HYDROData_Channel::RemoveProfile() ClearReferenceObjects( DataTag_Profile ); // Indicate model of the need to update the chanel presentation - SetToUpdate( true, true ); + Changed( Geom_3d ); } ObjectKind HYDROData_Channel::getAltitudeObjectType() const diff --git a/src/HYDROData/HYDROData_Confluence.cxx b/src/HYDROData/HYDROData_Confluence.cxx index 12f19b5a..6efb1a7f 100644 --- a/src/HYDROData/HYDROData_Confluence.cxx +++ b/src/HYDROData/HYDROData_Confluence.cxx @@ -29,7 +29,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Confluence,HYDROData_NaturalObject) HYDROData_Confluence::HYDROData_Confluence() -: HYDROData_NaturalObject() +: HYDROData_NaturalObject( Geom_3d ) { } diff --git a/src/HYDROData/HYDROData_DummyObject3D.cxx b/src/HYDROData/HYDROData_DummyObject3D.cxx index f4f665b6..fbc4851d 100644 --- a/src/HYDROData/HYDROData_DummyObject3D.cxx +++ b/src/HYDROData/HYDROData_DummyObject3D.cxx @@ -29,7 +29,7 @@ IMPLEMENT_STANDARD_HANDLE(HYDROData_DummyObject3D,HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_DummyObject3D,HYDROData_Entity) HYDROData_DummyObject3D::HYDROData_DummyObject3D() -: HYDROData_Entity() +: HYDROData_Entity( Geom_3d ) { } diff --git a/src/HYDROData/HYDROData_Entity.cxx b/src/HYDROData/HYDROData_Entity.cxx index 65edad85..1cb4d0f3 100644 --- a/src/HYDROData/HYDROData_Entity.cxx +++ b/src/HYDROData/HYDROData_Entity.cxx @@ -139,10 +139,11 @@ void HYDROData_Entity::Changed( Geometry theChangedGeometry ) if ( !aGeomChangeAttr.IsNull() ) aGeomChangeFlag = aGeomChangeAttr->Get(); - if( ( myGeom & theChangedGeometry ) == 0 ) + int aBitsToChange = ( myGeom & theChangedGeometry ); + if( aBitsToChange == 0 ) return; - aGeomChangeFlag = ( aGeomChangeFlag | theChangedGeometry ); + aGeomChangeFlag = ( aGeomChangeFlag | aBitsToChange ); TDataStd_Integer::Set( aGeomChangeLab, aGeomChangeFlag ); HYDROData_Iterator anIter( aDocument ); @@ -154,7 +155,7 @@ void HYDROData_Entity::Changed( Geometry theChangedGeometry ) { Handle(HYDROData_Entity) aRefObject = aRefSeq.Value( i ); if( aRefObject->Label()==myLab ) - Changed( theChangedGeometry ); + anObject->Changed( theChangedGeometry ); } } } diff --git a/src/HYDROData/HYDROData_Entity.h b/src/HYDROData/HYDROData_Entity.h index b05fb5d5..4e6e5f09 100644 --- a/src/HYDROData/HYDROData_Entity.h +++ b/src/HYDROData/HYDROData_Entity.h @@ -106,6 +106,7 @@ public: Geom_3d = Geom_2d | Geom_Z, Geom_2d_and_groups = Geom_2d | Geom_Groups, + Geom_All = Geom_3d | Geom_Groups | Geom_No, }; public: diff --git a/src/HYDROData/HYDROData_IAltitudeObject.cxx b/src/HYDROData/HYDROData_IAltitudeObject.cxx index 521308af..3bafc988 100644 --- a/src/HYDROData/HYDROData_IAltitudeObject.cxx +++ b/src/HYDROData/HYDROData_IAltitudeObject.cxx @@ -26,7 +26,7 @@ IMPLEMENT_STANDARD_HANDLE(HYDROData_IAltitudeObject, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_IAltitudeObject, HYDROData_Entity) HYDROData_IAltitudeObject::HYDROData_IAltitudeObject() -: HYDROData_Entity() +: HYDROData_Entity( Geom_Z ) { } diff --git a/src/HYDROData/HYDROData_IPolyline.cxx b/src/HYDROData/HYDROData_IPolyline.cxx index df150b0a..695bf84a 100755 --- a/src/HYDROData/HYDROData_IPolyline.cxx +++ b/src/HYDROData/HYDROData_IPolyline.cxx @@ -36,7 +36,7 @@ IMPLEMENT_STANDARD_HANDLE(HYDROData_IPolyline, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_IPolyline, HYDROData_Entity) HYDROData_IPolyline::HYDROData_IPolyline() -: HYDROData_Entity() +: HYDROData_Entity( Geom_2d ) { } diff --git a/src/HYDROData/HYDROData_Image.cxx b/src/HYDROData/HYDROData_Image.cxx index b7ec1096..e1787ada 100644 --- a/src/HYDROData/HYDROData_Image.cxx +++ b/src/HYDROData/HYDROData_Image.cxx @@ -46,7 +46,7 @@ IMPLEMENT_STANDARD_HANDLE(HYDROData_Image, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Image, HYDROData_Entity) HYDROData_Image::HYDROData_Image() -: HYDROData_Entity() +: HYDROData_Entity( Geom_2d ) { } @@ -175,7 +175,7 @@ QStringList HYDROData_Image::DumpToPython( MapOfTreatedObjects& theTreatedObject void HYDROData_Image::Update() { - bool anIsToUpdate = IsMustBeUpdated(); + bool anIsToUpdate = IsMustBeUpdated( Geom_2d ); HYDROData_Entity::Update(); @@ -226,7 +226,7 @@ void HYDROData_Image::Update() UpdateTrsf(); } - SetToUpdate( false ); + ClearChanged(); } bool HYDROData_Image::IsHas2dPrs() const @@ -294,7 +294,7 @@ void HYDROData_Image::SetImage(const QImage& theImage) SaveByteArray(0, aData, anImage.byteCount()); } - SetToUpdate( true ); + Changed( Geom_2d ); } bool HYDROData_Image::LoadImage( const QString& theFilePath ) @@ -326,7 +326,7 @@ void HYDROData_Image::SetFilePath( const QString& theFilePath ) TCollection_AsciiString anAsciiStr( theFilePath.toStdString().c_str() ); TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr ); - SetToUpdate( true ); + Changed( Geom_2d ); } QString HYDROData_Image::GetFilePath() const @@ -362,7 +362,7 @@ void HYDROData_Image::SetTrsf(const QTransform& theTrsf) anArray->SetValue(8, theTrsf.m32()); anArray->SetValue(9, theTrsf.m33()); - SetToUpdate( true ); + Changed( Geom_2d ); } QTransform HYDROData_Image::Trsf() const @@ -507,7 +507,7 @@ void HYDROData_Image::RemoveAllReferences() QImage anImage = Image(); if ( anImage.isNull() ) { - SetToUpdate( false ); + ClearChanged(); return; } @@ -528,7 +528,7 @@ void HYDROData_Image::RemoveAllReferences() SetGlobalPoints( ManualCartesian, aTrsfPointA, aTrsfPointB, aTrsfPointC ); - SetToUpdate( false ); + ClearChanged(); } void HYDROData_Image::SetLocalPoints( const QPoint& thePointA, @@ -552,7 +552,7 @@ void HYDROData_Image::SetLocalPoints( const QPoint& thePointA, if ( theIsUpdate ) UpdateTrsf(); - SetToUpdate( true ); + Changed( Geom_2d ); } bool HYDROData_Image::GetLocalPoints( QPoint& thePointA, @@ -607,7 +607,7 @@ void HYDROData_Image::SetGlobalPoints( const TransformationMode& theMode, if ( theIsUpdate ) UpdateTrsf(); - SetToUpdate( true ); + Changed( Geom_2d ); } bool HYDROData_Image::GetGlobalPoints( TransformationMode& theMode, @@ -759,7 +759,7 @@ bool HYDROData_Image::HasReferencePoints() const void HYDROData_Image::SetTrsfMode( const TransformationMode& theMode ) { TDataStd_Integer::Set( myLab.FindChild( DataTag_TrsfMode ), (int)theMode ); - SetToUpdate( true ); + Changed( Geom_2d ); } HYDROData_Image::TransformationMode HYDROData_Image::GetTrsfMode() const @@ -780,7 +780,7 @@ HYDROData_Image::TransformationMode HYDROData_Image::GetTrsfMode() const void HYDROData_Image::SetTrsfReferenceImage( const Handle(HYDROData_Image)& theRefImage ) { SetReferenceObject( theRefImage, DataTag_TrsfImage ); - SetToUpdate( true ); + Changed( Geom_2d ); } Handle(HYDROData_Image) HYDROData_Image::GetTrsfReferenceImage() const @@ -791,13 +791,13 @@ Handle(HYDROData_Image) HYDROData_Image::GetTrsfReferenceImage() const void HYDROData_Image::RemoveTrsfReferenceImage() { RemoveReferenceObject( DataTag_TrsfImage ); - SetToUpdate( true ); + Changed( Geom_2d ); } void HYDROData_Image::AppendReference( const Handle(HYDROData_Entity)& theReferenced ) { AddReferenceObject( theReferenced, 0 ); - SetToUpdate( true ); + Changed( Geom_2d ); } int HYDROData_Image::NbReferences() const @@ -814,26 +814,26 @@ void HYDROData_Image::ChangeReference( const int theIndex, Handle(HYDROData_Entity) theReferenced) { SetReferenceObject( theReferenced, 0, theIndex ); - SetToUpdate( true ); + Changed( Geom_2d ); } void HYDROData_Image::RemoveReference(const int theIndex) { RemoveReferenceObject( 0, theIndex ); - SetToUpdate( true ); + Changed( Geom_2d ); } void HYDROData_Image::ClearReferences() { ClearReferenceObjects( 0 ); - SetToUpdate( true ); + Changed( Geom_2d ); } void HYDROData_Image::SetOperatorName( const QString theOpName ) { TCollection_AsciiString anAsciiStr( theOpName.toStdString().c_str() ); TDataStd_AsciiString::Set( myLab.FindChild( DataTag_Operator ), anAsciiStr ); - SetToUpdate( true ); + Changed( Geom_2d ); } QString HYDROData_Image::OperatorName() const @@ -854,7 +854,7 @@ QString HYDROData_Image::OperatorName() const void HYDROData_Image::SetArgs(const QByteArray& theArgs) { SaveByteArray(DataTag_Operator, theArgs.constData(), theArgs.length()); - SetToUpdate( true ); + Changed( Geom_2d ); } QByteArray HYDROData_Image::Args() const @@ -873,7 +873,7 @@ void HYDROData_Image::SetIsSelfSplitted(bool theFlag) } else { myLab.ForgetAttribute(GUID_SELF_SPLITTED); } - SetToUpdate( true ); + Changed( Geom_2d ); } bool HYDROData_Image::IsSelfSplitted() const diff --git a/src/HYDROData/HYDROData_ImmersibleZone.cxx b/src/HYDROData/HYDROData_ImmersibleZone.cxx index 8382e12a..9b0cfdd8 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.cxx +++ b/src/HYDROData/HYDROData_ImmersibleZone.cxx @@ -49,7 +49,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ImmersibleZone,HYDROData_NaturalObject) HYDROData_ImmersibleZone::HYDROData_ImmersibleZone() -: HYDROData_NaturalObject() +: HYDROData_NaturalObject( Geom_2d ) { } @@ -265,7 +265,7 @@ void HYDROData_ImmersibleZone::SetPolyline( const Handle(HYDROData_PolylineXY)& return; SetReferenceObject( thePolyline, DataTag_Polyline ); - SetToUpdate( true ); + Changed( Geom_2d ); } Handle(HYDROData_PolylineXY) HYDROData_ImmersibleZone::GetPolyline() const @@ -277,7 +277,7 @@ Handle(HYDROData_PolylineXY) HYDROData_ImmersibleZone::GetPolyline() const void HYDROData_ImmersibleZone::RemovePolyline() { ClearReferenceObjects( DataTag_Polyline ); - SetToUpdate( true ); + Changed( Geom_2d ); } diff --git a/src/HYDROData/HYDROData_LandCover.cxx b/src/HYDROData/HYDROData_LandCover.cxx index 278f42c5..d17b5243 100644 --- a/src/HYDROData/HYDROData_LandCover.cxx +++ b/src/HYDROData/HYDROData_LandCover.cxx @@ -46,6 +46,7 @@ IMPLEMENT_STANDARD_HANDLE( HYDROData_LandCover, HYDROData_Entity ) IMPLEMENT_STANDARD_RTTIEXT( HYDROData_LandCover, HYDROData_Entity ) HYDROData_LandCover::HYDROData_LandCover() +: HYDROData_Entity( Geom_2d ) { } @@ -133,7 +134,7 @@ void HYDROData_LandCover::Update() void HYDROData_LandCover::SetPolylines( const HYDROData_SequenceOfObjects& thePolylines ) { SetReferenceObjects( thePolylines, DataTag_Polylines ); - SetToUpdate( true ); + Changed( Geom_2d ); } HYDROData_SequenceOfObjects HYDROData_LandCover::GetPolylines() const diff --git a/src/HYDROData/HYDROData_NaturalObject.cxx b/src/HYDROData/HYDROData_NaturalObject.cxx index fb7e9314..d1142455 100644 --- a/src/HYDROData/HYDROData_NaturalObject.cxx +++ b/src/HYDROData/HYDROData_NaturalObject.cxx @@ -21,8 +21,8 @@ IMPLEMENT_STANDARD_HANDLE(HYDROData_NaturalObject,HYDROData_Object) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_NaturalObject,HYDROData_Object) -HYDROData_NaturalObject::HYDROData_NaturalObject() -: HYDROData_Object() +HYDROData_NaturalObject::HYDROData_NaturalObject( Geometry theGeometry ) +: HYDROData_Object( theGeometry ) { } diff --git a/src/HYDROData/HYDROData_NaturalObject.h b/src/HYDROData/HYDROData_NaturalObject.h index 4454437d..e002b9a7 100644 --- a/src/HYDROData/HYDROData_NaturalObject.h +++ b/src/HYDROData/HYDROData_NaturalObject.h @@ -48,7 +48,7 @@ protected: * Creates new object in the internal data structure. Use higher level objects * to create objects with real content. */ - HYDRODATA_EXPORT HYDROData_NaturalObject(); + HYDRODATA_EXPORT HYDROData_NaturalObject( Geometry ); /** * Destructs properties of the object and object itself, removes it from the document. diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index fff074ad..88ce930a 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -75,12 +75,12 @@ void HYDROData_Object::SetName( const QString& theName ) void HYDROData_Object::Update() { - if( IsMustBeUpdated2d() ) + if( IsMustBeUpdated( Geom_2d ) ) { removeTopShape(); removeGroupObjects(); } - if( IsMustBeUpdated3d() ) + if( IsMustBeUpdated( Geom_3d ) ) removeShape3D(); checkAndSetAltitudeObject(); diff --git a/src/HYDROData/HYDROData_Obstacle.cxx b/src/HYDROData/HYDROData_Obstacle.cxx index 1218bbc4..32759823 100644 --- a/src/HYDROData/HYDROData_Obstacle.cxx +++ b/src/HYDROData/HYDROData_Obstacle.cxx @@ -62,7 +62,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Obstacle,HYDROData_ArtificialObject) HYDROData_Obstacle::HYDROData_Obstacle() -: HYDROData_ArtificialObject() +: HYDROData_ArtificialObject( Geom_3d ) { } diff --git a/src/HYDROData/HYDROData_Polyline3D.cxx b/src/HYDROData/HYDROData_Polyline3D.cxx index 67098e95..c53dd105 100644 --- a/src/HYDROData/HYDROData_Polyline3D.cxx +++ b/src/HYDROData/HYDROData_Polyline3D.cxx @@ -55,7 +55,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Polyline3D,HYDROData_Object) HYDROData_Polyline3D::HYDROData_Polyline3D() -: HYDROData_Object() +: HYDROData_Object( Geom_3d ) { } @@ -246,7 +246,7 @@ bool HYDROData_Polyline3D::SetPolylineXY( const Handle(HYDROData_PolylineXY)& th updateChildProfilePoints(); // Indicate model of the need to update the polyline presentation - SetToUpdate( true ); + Changed( Geom_2d ); return true; } @@ -266,7 +266,7 @@ void HYDROData_Polyline3D::RemovePolylineXY() ClearReferenceObjects( DataTag_PolylineXY ); // Indicate model of the need to update the polyline presentation - SetToUpdate( true ); + Changed( Geom_2d ); } bool HYDROData_Polyline3D::SetProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile ) @@ -284,7 +284,7 @@ bool HYDROData_Polyline3D::SetProfileUZ( const Handle(HYDROData_ProfileUZ)& theP RemoveAltitudeObject(); // Indicate model of the need to update the polyline presentation - SetToUpdate( true ); + Changed( Geom_Z ); return true; } @@ -304,7 +304,7 @@ void HYDROData_Polyline3D::RemoveProfileUZ() ClearReferenceObjects( DataTag_ProfileUZ ); // Indicate model of the need to update the polyline presentation - SetToUpdate( true ); + Changed( Geom_Z ); } bool HYDROData_Polyline3D::SetAltitudeObject( diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index 839e949a..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,7 +1071,7 @@ void HYDROData_PolylineXY::RemovePoint( const int theSectionIndex, } } - SetToUpdate( true ); + Changed( Geom_2d ); } HYDROData_PolylineXY::PointsList HYDROData_PolylineXY::GetPoints( const int theSectionIndex, bool IsConvertToGlobal ) const @@ -1156,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 ) diff --git a/src/HYDROData/HYDROData_Profile.cxx b/src/HYDROData/HYDROData_Profile.cxx index 2649e2b0..9c4eda1d 100755 --- a/src/HYDROData/HYDROData_Profile.cxx +++ b/src/HYDROData/HYDROData_Profile.cxx @@ -56,7 +56,7 @@ IMPLEMENT_STANDARD_HANDLE(HYDROData_Profile, HYDROData_Object) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Profile, HYDROData_Object) HYDROData_Profile::HYDROData_Profile() -: HYDROData_Object() +: HYDROData_Object( Geom_3d ) { } @@ -239,7 +239,7 @@ void HYDROData_Profile::SetLeftPoint( const gp_XY& theGPoint, bool IsConvertFrom anArray->SetValue( 0, aLPoint.X() ); anArray->SetValue( 1, aLPoint.Y() ); - SetToUpdate( true ); + Changed( Geom_3d ); } bool HYDROData_Profile::GetLeftPoint( gp_XY& thePoint, bool IsConvertToGlobal, @@ -291,7 +291,7 @@ void HYDROData_Profile::SetRightPoint( const gp_XY& theGPoint, bool IsConvertFro anArray->SetValue( 0, aLPoint.X() ); anArray->SetValue( 1, aLPoint.Y() ); - SetToUpdate( true ); + Changed( Geom_3d ); } bool HYDROData_Profile::GetRightPoint( gp_XY& thePoint, bool IsConvertToGlobal, @@ -336,7 +336,7 @@ void HYDROData_Profile::Invalidate() if ( !aLastLabel.IsNull() ) aLastLabel.ForgetAllAttributes(); - SetToUpdate( true ); + Changed( Geom_3d ); } Handle(HYDROData_ProfileUZ) HYDROData_Profile::GetProfileUZ( const bool theIsCreate ) const @@ -369,7 +369,7 @@ void HYDROData_Profile::RemovePoints() if ( !aProfileUZ.IsNull() ) { aProfileUZ->RemoveSections(); - SetToUpdate( true ); + Changed( Geom_3d ); } } @@ -384,7 +384,7 @@ void HYDROData_Profile::SetParametricPoints( const HYDROData_ProfileUZ::PointsLi aProfileUZ->AddPoint( 0, aPoint ); } - SetToUpdate( true ); + Changed( Geom_3d ); } HYDROData_ProfileUZ::PointsList HYDROData_Profile::GetParametricPoints() const diff --git a/src/HYDROData/HYDROData_Region.cxx b/src/HYDROData/HYDROData_Region.cxx index c82d17e9..582357e8 100644 --- a/src/HYDROData/HYDROData_Region.cxx +++ b/src/HYDROData/HYDROData_Region.cxx @@ -52,7 +52,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Region, HYDROData_Entity) HYDROData_Region::HYDROData_Region() - : HYDROData_Entity() + : HYDROData_Entity( Geom_2d ) { } diff --git a/src/HYDROData/HYDROData_River.cxx b/src/HYDROData/HYDROData_River.cxx index 2bb5cef7..88f7c84c 100644 --- a/src/HYDROData/HYDROData_River.cxx +++ b/src/HYDROData/HYDROData_River.cxx @@ -29,7 +29,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HYDROData_River,HYDROData_NaturalObject) HYDROData_River::HYDROData_River() -: HYDROData_NaturalObject() +: HYDROData_NaturalObject( Geom_3d ) { } diff --git a/src/HYDROData/HYDROData_ShapesGroup.cxx b/src/HYDROData/HYDROData_ShapesGroup.cxx index 35015221..12807de7 100644 --- a/src/HYDROData/HYDROData_ShapesGroup.cxx +++ b/src/HYDROData/HYDROData_ShapesGroup.cxx @@ -137,7 +137,7 @@ void HYDROData_ShapesGroup::GroupDefinition::Dump( std::ostream& theSt HYDROData_ShapesGroup::HYDROData_ShapesGroup() -: HYDROData_Entity() +: HYDROData_Entity( Geom_Groups ) { } diff --git a/src/HYDROData/HYDROData_Stream.cxx b/src/HYDROData/HYDROData_Stream.cxx index 24231090..a0f663f8 100644 --- a/src/HYDROData/HYDROData_Stream.cxx +++ b/src/HYDROData/HYDROData_Stream.cxx @@ -95,7 +95,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Stream,HYDROData_NaturalObject) HYDROData_Stream::HYDROData_Stream() -: HYDROData_NaturalObject() +: HYDROData_NaturalObject( Geom_3d ) { } @@ -352,7 +352,7 @@ bool HYDROData_Stream::SetHydraulicAxis( const Handle(HYDROData_PolylineXY)& the updateProfilesOrder(); // Indicate model of the need to update the stream presentation - SetToUpdate( true ); + Changed( Geom_3d ); return true; } @@ -375,7 +375,7 @@ void HYDROData_Stream::RemoveHydraulicAxis() RemoveProfiles(); // Indicate model of the need to update the stream presentation - SetToUpdate( true ); + Changed( Geom_3d ); } bool HYDROData_Stream::HasIntersection( const Handle(HYDROData_Profile)& theProfile, @@ -509,7 +509,7 @@ bool HYDROData_Stream::AddProfile( const Handle(HYDROData_Profile)& theProfile ) insertProfileInToOrder( theProfile, aProfileIndex ); // Indicate model of the need to update the stream presentation - SetToUpdate( true ); + Changed( Geom_3d ); return true; } @@ -554,7 +554,7 @@ bool HYDROData_Stream::SetProfiles( const HYDROData_SequenceOfObjects& theProfil SetReferenceObjects( theProfiles, DataTag_Profile ); if ( anIsToUpdate ) - SetToUpdate( true ); + Changed( Geom_3d ); } return true; @@ -597,22 +597,20 @@ bool HYDROData_Stream::RemoveProfile( const Handle(HYDROData_Profile)& theProfil removeParameter( aProfileIndex ); // Indicate model of the need to update the stream presentation - SetToUpdate( true ); + Changed( Geom_3d ); return true; } void HYDROData_Stream::RemoveProfiles() { - bool anIsToUpdate = IsMustBeUpdated() || NbReferenceObjects( DataTag_Profile ) > 0; - ClearReferenceObjects( DataTag_Profile ); // Remove the parameters array removeParametersArray(); // Indicate model of the need to update the stream presentation - SetToUpdate( anIsToUpdate ); + Changed( Geom_3d ); } void HYDROData_Stream::insertProfileInToOrder( const Handle(HYDROData_Profile)& theProfile, diff --git a/src/HYDROData/HYDROData_StricklerTable.cxx b/src/HYDROData/HYDROData_StricklerTable.cxx index d3ef0b86..5d7623d8 100644 --- a/src/HYDROData/HYDROData_StricklerTable.cxx +++ b/src/HYDROData/HYDROData_StricklerTable.cxx @@ -32,7 +32,8 @@ IMPLEMENT_STANDARD_HANDLE( HYDROData_StricklerTable, HYDROData_Entity ) IMPLEMENT_STANDARD_RTTIEXT( HYDROData_StricklerTable, HYDROData_Entity ) - HYDROData_StricklerTable::HYDROData_StricklerTable() +HYDROData_StricklerTable::HYDROData_StricklerTable() +: HYDROData_Entity( Geom_No ) { } diff --git a/src/HYDROData/HYDROData_VisualState.cxx b/src/HYDROData/HYDROData_VisualState.cxx index e2867ea8..e7d8ff79 100644 --- a/src/HYDROData/HYDROData_VisualState.cxx +++ b/src/HYDROData/HYDROData_VisualState.cxx @@ -24,7 +24,7 @@ IMPLEMENT_STANDARD_HANDLE(HYDROData_VisualState, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_VisualState, HYDROData_Entity) HYDROData_VisualState::HYDROData_VisualState() -: HYDROData_Entity() +: HYDROData_Entity( Geom_No ) { } diff --git a/src/HYDROData/HYDROData_Zone.cxx b/src/HYDROData/HYDROData_Zone.cxx index c6e3da1a..b114810b 100644 --- a/src/HYDROData/HYDROData_Zone.cxx +++ b/src/HYDROData/HYDROData_Zone.cxx @@ -38,7 +38,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Entity) HYDROData_Zone::HYDROData_Zone() -: HYDROData_Entity() +: HYDROData_Entity( Geom_2d ) { myInterpolator = NULL; } diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx index edce573b..c4d3902e 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx @@ -632,7 +632,7 @@ void HYDROGUI_CalculationOp::onRemoveObjects() bool HYDROGUI_CalculationOp::confirmRegionsChange() const { // Check if the case is already modified or not - bool isConfirmed = myEditedObject->IsMustBeUpdated(); + bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ); if ( !isConfirmed ) { // If not modified check if the case has already defined regions with zones @@ -657,7 +657,7 @@ bool HYDROGUI_CalculationOp::confirmRegionsChange() const bool HYDROGUI_CalculationOp::confirmOrderChange() const { // Check if the case is already modified or not - bool isConfirmed = myEditedObject->IsMustBeUpdated(); + bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ); if ( !isConfirmed ) { // If not modified check if the case has already defined regions with zones @@ -682,7 +682,7 @@ bool HYDROGUI_CalculationOp::confirmOrderChange() const bool HYDROGUI_CalculationOp::confirmRuleChange() const { // Check if the case is already modified or not - bool isConfirmed = myEditedObject->IsMustBeUpdated(); + bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ); if ( !isConfirmed ) { // If not modified check if the case has already defined regions with zones @@ -707,7 +707,7 @@ bool HYDROGUI_CalculationOp::confirmRuleChange() const bool HYDROGUI_CalculationOp::confirmModeChange() const { // Check if the case is already modified or not - bool isConfirmed = myEditedObject->IsMustBeUpdated(); + bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ); if ( !isConfirmed ) { // If not modified check if the case has already defined regions with zones @@ -761,7 +761,7 @@ bool HYDROGUI_CalculationOp::confirmContinueWithWarning( const HYDROData_Warning bool HYDROGUI_CalculationOp::confirmLandCoverRegionsChange() const { // Check if the case is already modified or not - bool isConfirmed = myEditedObject->IsMustBeUpdated(); + bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No ); if ( !isConfirmed ) { // If not modified check if the case has already defined regions with land cover zones @@ -786,7 +786,7 @@ bool HYDROGUI_CalculationOp::confirmLandCoverRegionsChange() const bool HYDROGUI_CalculationOp::confirmLandCoverModeChange() const { // Check if the case is already modified or not - bool isConfirmed = myEditedObject->IsMustBeUpdated(); + bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No ); if ( !isConfirmed ) { // If not modified check if the case has already defined regions with land cover zones @@ -811,7 +811,7 @@ bool HYDROGUI_CalculationOp::confirmLandCoverModeChange() const bool HYDROGUI_CalculationOp::confirmLandCoverOrderChange() const { // Check if the case is already modified or not - bool isConfirmed = myEditedObject->IsMustBeUpdated(); + bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No ); if ( !isConfirmed ) { // If not modified check if the case has already defined regions with land cover zones @@ -836,7 +836,7 @@ bool HYDROGUI_CalculationOp::confirmLandCoverOrderChange() const bool HYDROGUI_CalculationOp::confirmLandCoverRuleChange() const { // Check if the case is already modified or not - bool isConfirmed = myEditedObject->IsMustBeUpdated(); + bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No ); if ( !isConfirmed ) { // If not modified check if the case has already defined regions with land cover zones @@ -987,10 +987,10 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex ) } } aPanel->setStricklerTableNames( aList, anEntryList ); - bool anUpdateState = myEditedObject->IsMustBeUpdated(); + //@ASL: bool anUpdateState = myEditedObject->IsMustBeUpdated(); if ( !aList.isEmpty() ) aPanel->setStricklerTable( aList.at( 0 ), false ); - myEditedObject->SetToUpdate( anUpdateState ); + //@ASL: myEditedObject->SetToUpdate( anUpdateState ); // Fill in list widget with all available land covers aSeq = HYDROGUI_Tool::GetLandCovers( module() ); @@ -1060,7 +1060,7 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex ) if ( aMode == HYDROData_CalculationCase::AUTOMATIC ) { // Set objects in the specified order - if( myEditedObject->IsMustBeUpdated() ) + if( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) ) { myEditedObject->RemoveGeometryObjects(); foreach ( const QString& aName, aPanel->getAllGeomObjects() ) @@ -1093,7 +1093,7 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex ) if ( aMode == HYDROData_CalculationCase::AUTOMATIC ) { // Set objects in the specified order - if( myEditedObject->IsMustBeUpdated() ) + if( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) ) { myEditedObject->RemoveLandCovers(); foreach ( const QString& aName, aPanel->getAllLandCovers() ) @@ -1119,7 +1119,7 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex ) } aPanel->setEditLandCoverZonesEnabled( aMode == HYDROData_CalculationCase::MANUAL ); - if ( myEditedObject->IsMustBeUpdated() ) + if ( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No ) ) { myShowZones = true; myEditedObject->Update(); @@ -1577,7 +1577,7 @@ void HYDROGUI_CalculationOp::setAvailableGroups() aGroupsNames.append( aGroup->GetName() ); } } - if( myEditedObject->IsMustBeUpdated() ) { + if( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) ) { for( int anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ ) { Handle(HYDROData_ShapesGroup) aGeomGroup = Handle(HYDROData_ShapesGroup)::DownCast( aSeq.Value( anIndex ) ); @@ -1590,7 +1590,7 @@ void HYDROGUI_CalculationOp::setAvailableGroups() aPanel->setAvailableGroups( aGroupsNames ); aPanel->includeGroups( aList ); - bool isUpdated = myEditedObject->IsMustBeUpdated(); + //@ASL: bool isUpdated = myEditedObject->IsMustBeUpdated(); } void HYDROGUI_CalculationOp::onAddGroups() @@ -1747,7 +1747,7 @@ void HYDROGUI_CalculationOp::onOrderChanged( bool& isConfirmed ) isConfirmed = confirmOrderChange(); if( isConfirmed ) - myEditedObject->SetToUpdate( true ); + myEditedObject->Changed( HYDROData_Entity::Geom_2d ); } void HYDROGUI_CalculationOp::onOrderLandCoverChanged( bool& isConfirmed ) @@ -1759,7 +1759,7 @@ void HYDROGUI_CalculationOp::onOrderLandCoverChanged( bool& isConfirmed ) isConfirmed = confirmLandCoverOrderChange(); if( isConfirmed ) - myEditedObject->SetToUpdate( true ); + myEditedObject->Changed( HYDROData_Entity::Geom_No ); } void HYDROGUI_CalculationOp::onRuleChanged( bool& isConfirmed ) @@ -1771,7 +1771,7 @@ void HYDROGUI_CalculationOp::onRuleChanged( bool& isConfirmed ) isConfirmed = confirmRuleChange(); if( isConfirmed ) - myEditedObject->SetToUpdate( true ); + myEditedObject->Changed( HYDROData_Entity::Geom_2d ); } void HYDROGUI_CalculationOp::onRuleLandCoverChanged( bool& isConfirmed ) @@ -1783,7 +1783,7 @@ void HYDROGUI_CalculationOp::onRuleLandCoverChanged( bool& isConfirmed ) isConfirmed = confirmLandCoverRuleChange(); if( isConfirmed ) - myEditedObject->SetToUpdate( true ); + myEditedObject->Changed( HYDROData_Entity::Geom_No ); } void HYDROGUI_CalculationOp::onRegenerateColors() diff --git a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx index f00d5804..1141a006 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx @@ -211,7 +211,7 @@ bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags, myEditedObject->SetProfile( aProfile ); } - if ( myEditedObject->IsMustBeUpdated() ) + if ( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) ) myEditedObject->Update(); erasePreview(); diff --git a/src/HYDROGUI/HYDROGUI_DataObject.cxx b/src/HYDROGUI/HYDROGUI_DataObject.cxx index e0183809..8ec9658d 100644 --- a/src/HYDROGUI/HYDROGUI_DataObject.cxx +++ b/src/HYDROGUI/HYDROGUI_DataObject.cxx @@ -74,7 +74,7 @@ QFont HYDROGUI_DataObject::font( const int theId ) const if( theId == NameId ) { Handle(HYDROData_Entity) aDataObject = modelObject(); - if( !aDataObject.IsNull() && aDataObject->IsMustBeUpdated() ) + if( !aDataObject.IsNull() && aDataObject->IsMustBeUpdated( HYDROData_Entity::Geom_All ) ) { aFont.setItalic( true ); aFont.setBold( true ); @@ -108,7 +108,7 @@ QColor HYDROGUI_DataObject::color( const ColorRole theRole, const int theId ) co if ( !aColor.isValid() ) { Handle(HYDROData_Entity) aDataObject = modelObject(); - if( !aDataObject.IsNull() && aDataObject->IsMustBeUpdated() ) + if( !aDataObject.IsNull() && aDataObject->IsMustBeUpdated( HYDROData_Entity::Geom_All ) ) { switch ( theRole ) { @@ -148,7 +148,7 @@ QPixmap HYDROGUI_DataObject::icon( const int theId ) const } else { - QString aNeedUpdate( aDataObject->IsMustBeUpdated() ? "M_" : "" ); + QString aNeedUpdate( aDataObject->IsMustBeUpdated( HYDROData_Entity::Geom_All ) ? "M_" : "" ); int anObjectKind = (int)aDataObject->GetKind(); if ( anObjectKind == KIND_DUMMY_3D ) diff --git a/src/HYDROGUI/HYDROGUI_LandCoverOp.cxx b/src/HYDROGUI/HYDROGUI_LandCoverOp.cxx index 17ac4487..32d45fd4 100644 --- a/src/HYDROGUI/HYDROGUI_LandCoverOp.cxx +++ b/src/HYDROGUI/HYDROGUI_LandCoverOp.cxx @@ -372,7 +372,7 @@ bool HYDROGUI_LandCoverOp::confirmPolylinesChange() const return true; // Check if the land cover object is already modified or not - bool isConfirmed = myEditedObject->IsMustBeUpdated(); + bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ); if ( !isConfirmed ) { // If not modified check if the land cover has already defined polylines diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index 60609a97..81ad9fa0 100644 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -399,7 +399,7 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient, anIsVisibleInSelection |= aVisibility; anIsHiddenInSelection |= !aVisibility; - if ( anObject->CanBeUpdated() && anObject->IsMustBeUpdated() ) + if ( anObject->CanBeUpdated() && anObject->IsMustBeUpdated( HYDROData_Entity::Geom_All ) ) { anIsMustObjectBeUpdated = true; } diff --git a/src/HYDROGUI/HYDROGUI_ProfileOp.cxx b/src/HYDROGUI/HYDROGUI_ProfileOp.cxx index 759795a5..d7995dd1 100644 --- a/src/HYDROGUI/HYDROGUI_ProfileOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ProfileOp.cxx @@ -232,7 +232,7 @@ bool HYDROGUI_ProfileOp::processApply( int& theUpdateFlags, } // At first we update the child u,z profile object - aProfileUZ->SetToUpdate( true ); + aProfileUZ->Changed( HYDROData_Entity::Geom_2d ); aProfileUZ->Update(); // And now we update our edited object diff --git a/src/HYDROGUI/HYDROGUI_StreamOp.cxx b/src/HYDROGUI/HYDROGUI_StreamOp.cxx index 6162acb8..4123e5be 100755 --- a/src/HYDROGUI/HYDROGUI_StreamOp.cxx +++ b/src/HYDROGUI/HYDROGUI_StreamOp.cxx @@ -245,7 +245,7 @@ bool HYDROGUI_StreamOp::processApply( int& theUpdateFlags, myEditedObject->SetHydraulicAxis( aHydAxis ); myEditedObject->SetProfiles( aRefProfiles, false ); - if ( myEditedObject->IsMustBeUpdated() ) + if ( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) ) myEditedObject->Update(); if ( !myIsEdit ) diff --git a/src/HYDROGUI/HYDROGUI_UpdateObjectOp.cxx b/src/HYDROGUI/HYDROGUI_UpdateObjectOp.cxx index d7925e36..08a1de81 100644 --- a/src/HYDROGUI/HYDROGUI_UpdateObjectOp.cxx +++ b/src/HYDROGUI/HYDROGUI_UpdateObjectOp.cxx @@ -73,7 +73,7 @@ void HYDROGUI_UpdateObjectOp::updateObject( const Handle(HYDROData_Entity)& theO updateObject( anObject, theMapOfTreated ); } - if ( !myIsForced && !theObject->IsMustBeUpdated() ) + if ( !myIsForced && !theObject->IsMustBeUpdated( HYDROData_Entity::Geom_All ) ) return; theObject->Update(); diff --git a/src/HYDROPy/HYDROData_Entity.sip b/src/HYDROPy/HYDROData_Entity.sip index 7ef4fd13..ee4e4841 100644 --- a/src/HYDROPy/HYDROData_Entity.sip +++ b/src/HYDROPy/HYDROData_Entity.sip @@ -154,6 +154,16 @@ class HYDROData_Entity %End public: + enum Geometry + { + Geom_No = 1, + Geom_2d = 2, + Geom_Z = 4, + Geom_Groups = 8, + + Geom_3d = 6, + Geom_2d_and_groups = 10, + }; /** * Returns the kind of this object. Must be redefined in all objects of known type. @@ -186,19 +196,6 @@ public: */ virtual QVariant GetDataVariant(); - - /** - * Sets the "MustBeUpdated" flag: if object is depended on updated features. - * \param theFlag is true for objects that must be updated, false for up-to-date - */ - virtual void SetToUpdate( bool theFlag ); - - /** - * Returns the "MustBeUpdated" flag: is object data must be updated or not - * \returns false if object is up to date - */ - virtual bool IsMustBeUpdated() const; - /** * Returns flag indicating that object is updateble or not. */ @@ -261,7 +258,7 @@ protected: * Creates new object in the internal data structure. Use higher level objects * to create objects with real content. */ - HYDROData_Entity(); + HYDROData_Entity( Geometry ); /** * Destructs properties of the object and object itself, removes it from the document.