diff --git a/src/TDataXtd/TDataXtd_Presentation.cxx b/src/TDataXtd/TDataXtd_Presentation.cxx index 53d3d9fea6..b389e603c0 100644 --- a/src/TDataXtd/TDataXtd_Presentation.cxx +++ b/src/TDataXtd/TDataXtd_Presentation.cxx @@ -285,11 +285,12 @@ void TDataXtd_Presentation::SetMode(const Standard_Integer theMode) //function : SetSelectionMode //purpose : //======================================================================= -void TDataXtd_Presentation::SetSelectionMode(const Standard_Integer theSelectionMode) +void TDataXtd_Presentation::SetSelectionMode(const Standard_Integer theSelectionMode, const Standard_Boolean theTransaction) { if (! myHasOwnSelectionMode || mySelectionMode != theSelectionMode) { - Backup(); + if (theTransaction) + Backup(); mySelectionMode = theSelectionMode; myHasOwnSelectionMode = Standard_True; } diff --git a/src/TDataXtd/TDataXtd_Presentation.hxx b/src/TDataXtd/TDataXtd_Presentation.hxx index e92dc574ca..9911b2462e 100644 --- a/src/TDataXtd/TDataXtd_Presentation.hxx +++ b/src/TDataXtd/TDataXtd_Presentation.hxx @@ -114,7 +114,13 @@ public: Standard_EXPORT void SetMode(const Standard_Integer theMode); - Standard_EXPORT void SetSelectionMode(const Standard_Integer theSelectionMode); + //! Sets selection mode. + //! If "theTransaction" flag is OFF, modification of the attribute doesn't influence the transaction mechanism + //! (the attribute doesn't participate in undo/redo). + //! Certainly, if any other data of the attribute is modified (display mode, color, ...), + //! the attribute will be included into transaction. + //! Obsolete method (may be removed later). + Standard_EXPORT void SetSelectionMode(const Standard_Integer theSelectionMode, const Standard_Boolean theTransaction = Standard_True); Standard_EXPORT Standard_Integer MaterialIndex() const; diff --git a/src/TPrsStd/TPrsStd_AISPresentation.cxx b/src/TPrsStd/TPrsStd_AISPresentation.cxx index cc8d75f530..173639ab58 100644 --- a/src/TPrsStd/TPrsStd_AISPresentation.cxx +++ b/src/TPrsStd/TPrsStd_AISPresentation.cxx @@ -591,10 +591,11 @@ Standard_Boolean TPrsStd_AISPresentation::HasOwnSelectionMode() const //function : SetSelectionMode //purpose : //======================================================================= -void TPrsStd_AISPresentation::SetSelectionMode(const Standard_Integer theSelectionMode) +void TPrsStd_AISPresentation::SetSelectionMode(const Standard_Integer theSelectionMode, const Standard_Boolean theTransaction) { - Backup(); - getData()->SetSelectionMode (theSelectionMode); + if (theTransaction) + Backup(); + getData()->SetSelectionMode (theSelectionMode, theTransaction); if ( myAIS.IsNull() ) AISUpdate(); diff --git a/src/TPrsStd/TPrsStd_AISPresentation.hxx b/src/TPrsStd/TPrsStd_AISPresentation.hxx index e72b75982c..6d5ddd22df 100644 --- a/src/TPrsStd/TPrsStd_AISPresentation.hxx +++ b/src/TPrsStd/TPrsStd_AISPresentation.hxx @@ -157,8 +157,14 @@ public: Standard_EXPORT void UnsetMode(); Standard_EXPORT Standard_Integer SelectionMode() const; - - Standard_EXPORT void SetSelectionMode (const Standard_Integer theSelectionMode); + + //! Sets selection mode. + //! If "theTransaction" flag is OFF, modification of the attribute doesn't influence the transaction mechanism + //! (the attribute doesn't participate in undo/redo). + //! Certainly, if any other data of the attribute is modified (display mode, color, ...), + //! the attribute will be included into transaction. + //! Obsolete method (may be removed later). + Standard_EXPORT void SetSelectionMode (const Standard_Integer theSelectionMode, const Standard_Boolean theTransaction = Standard_True); Standard_EXPORT Standard_Boolean HasOwnSelectionMode() const;