]> OCCT Git - occt-copy.git/commitdiff
0030425: Visualization - possibility to redefine AIS_Selection
authornds <nds@opencascade.com>
Tue, 25 Dec 2018 06:26:49 +0000 (09:26 +0300)
committernds <nds@opencascade.com>
Tue, 11 Jun 2019 10:40:54 +0000 (13:40 +0300)
(cherry picked from commit 672fb1a467db74be47f4c41ab56d2a519b4cbb70)
(cherry picked from commit 28ab6a20977f69318559db4f2bd3dd8f49ac3b28)

src/AIS/AIS_InteractiveContext.hxx
src/AIS/AIS_Selection.hxx

index 43da8b2ae289155f044293f21c0ed9bb798baa78..9cc9b235831bee0e71fc76226cfe0dee59d527fb 100644 (file)
@@ -1192,6 +1192,13 @@ public: //! @name sub-intensity management (deprecated)
   Standard_EXPORT void SubIntensityOff (const Handle(AIS_InteractiveObject)& theIObj,
                                         const Standard_Boolean               theToUpdateViewer);
 
+  //! Sets selection instance to manipulate a container of selected owners
+  //! \param theSelection an instance of the selection
+  void SetSelection (const Handle(AIS_Selection)& theSelection) { mySelection = theSelection; }
+
+  //! Returns selection instance
+  const Handle(AIS_Selection)& Selection() const { return mySelection; }
+
 protected: //! @name internal methods
 
   Standard_EXPORT void GetDefModes (const Handle(AIS_InteractiveObject)& anIobj, Standard_Integer& Dmode, Standard_Integer& HiMod, Standard_Integer& SelMode) const;
index 92f2e0b8fbb701b08750f8dbee29bfca84653e43..8e7cf50e91dd39aa26c7571670340a74175016b2 100644 (file)
@@ -32,18 +32,18 @@ public:
   Standard_EXPORT AIS_Selection();
   
   //! removes all the object of the selection.
-  Standard_EXPORT void Clear();
+  Standard_EXPORT virtual void Clear();
   
   //! if the object is not yet in the selection, it will be added.
   //! if the object is already in the selection, it will be removed.
-  Standard_EXPORT AIS_SelectStatus Select (const Handle(SelectMgr_EntityOwner)& theObject);
+  Standard_EXPORT virtual AIS_SelectStatus Select (const Handle(SelectMgr_EntityOwner)& theObject);
   
   //! the object is always add int the selection.
   //! faster when the number of objects selected is great.
-  Standard_EXPORT AIS_SelectStatus AddSelect (const Handle(SelectMgr_EntityOwner)& theObject);
+  Standard_EXPORT virtual AIS_SelectStatus AddSelect (const Handle(SelectMgr_EntityOwner)& theObject);
 
   //! clears the selection and adds the object in the selection.
-  void ClearAndSelect (const Handle(SelectMgr_EntityOwner)& theObject)
+  virtual void ClearAndSelect (const Handle(SelectMgr_EntityOwner)& theObject)
   {
     Clear();
     Select (theObject);