]> OCCT Git - occt-copy.git/commitdiff
0031197: Visualization - SetTransformPersistence for highlight, select presentations
authornds <nds@opencascade.com>
Thu, 5 Dec 2019 14:15:09 +0000 (17:15 +0300)
committernds <nds@opencascade.com>
Tue, 27 Oct 2020 15:43:59 +0000 (18:43 +0300)
(cherry picked from commit df3644aa354c932483d89f553b09a2f399135f0f)
(cherry picked from commit 33ffefa2f7c052225012dde159c5001a3cc73ea5)
(cherry picked from commit 59433e7b4e49362dc1741dc00178ccec64c6cc5d)
(cherry picked from commit 35536f899d8ef8a031e3eeaf9147d0131b21b1b6)

src/AIS/AIS_InteractiveContext.cxx
src/AIS/AIS_InteractiveContext.hxx
src/AIS/AIS_InteractiveObject.cxx
src/AIS/AIS_InteractiveObject.hxx

index fe54d23a4eae5ab25649398abcfa192b396e9c70..bf6e9a08c6ee8d5c342557c39364d4e533017b01 100644 (file)
@@ -2405,6 +2405,15 @@ void AIS_InteractiveContext::SetTransformPersistence (const Handle(AIS_Interacti
                                                       const Handle(Graphic3d_TransformPers)& theTrsfPers)
 {
   theObject->SetTransformPersistence (theTrsfPers);
+  UpdateOnTransformPersistence (theObject);
+}
+
+//=======================================================================
+//function : UpdateOnTransformPersistence
+//purpose  :
+//=======================================================================
+void AIS_InteractiveContext::UpdateOnTransformPersistence (const Handle(AIS_InteractiveObject)& theObject)
+{
   if (!myObjects.IsBound (theObject))
   {
     return;
index c3d83448d8b9972f45e762bd09322152ede996ba..48551a44d1618e3857df73252896260f8e37bed1 100644 (file)
@@ -346,6 +346,11 @@ public: //! @name object local transformation management
   Standard_EXPORT void SetTransformPersistence (const Handle(AIS_InteractiveObject)& theObject,
                                                 const Handle(Graphic3d_TransformPers)& theTrsfPers);
 
+  //! Updates displayed interactive object by checking and recomputing its flagged as "to be recomputed" presentation and selection structures.
+  //! This method does not force any recomputation on its own.
+  //! The method recomputes selections even if they are loaded without activation in particular selector.
+  Standard_EXPORT void UpdateOnTransformPersistence (const Handle(AIS_InteractiveObject)& theIObj);
+
   Standard_DEPRECATED("This method is deprecated - SetTransformPersistence() taking Graphic3d_TransformPers should be called instead")
   void SetTransformPersistence (const Handle(AIS_InteractiveObject)& theObj,
                                 const Graphic3d_TransModeFlags&      theFlag,
index c0d8293e314746be2b3fe3a30cd62dddec841d1f..2d62f6b2f6b66985380b12e700902256a316e4bd 100644 (file)
@@ -98,6 +98,17 @@ void AIS_InteractiveObject::SetContext (const Handle(AIS_InteractiveContext)& th
   }
 }
 
+//-----------------------------------------------------------------------------
+void AIS_InteractiveObject::SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers)
+{
+  SelectMgr_SelectableObject::SetTransformPersistence (theTrsfPers);
+
+  if (!GetContext().IsNull())
+  {
+    GetContext()->UpdateOnTransformPersistence (this);
+  }
+}
+
 //=======================================================================
 //function : HasPresentation
 //purpose  :
index 8b4f9229f18863d94803761c7014227131f0b0ec..cd6372239adb565fbb2ccc1a6357336634700214 100644 (file)
@@ -125,6 +125,11 @@ public:
   //! Returns the context pointer to the interactive context.
   Standard_EXPORT Handle(AIS_InteractiveContext) GetContext() const;
 
+  //! Sets up Transform Persistence defining a special Local Coordinate system where this object should be located.
+  //! Updates the presentation in context if it is not NULL
+  //! @sa Graphic3d_TransformPers class description
+  Standard_EXPORT virtual void SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers);
+
   //! Returns TRUE when this object has a presentation in the current DisplayMode()
   Standard_EXPORT Standard_Boolean HasPresentation() const;