0027819: Visualization - provide a possibility to redefine SelectMgr_SelectableObject...
authorvpa <vpa@opencascade.com>
Wed, 31 Aug 2016 14:42:50 +0000 (17:42 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 8 Sep 2016 07:45:02 +0000 (10:45 +0300)
- SelectMgr_SelectableObject::UpdateSelection calls redefineable SelectMgr_SelectableObject::updateSelection

src/SelectMgr/FILES
src/SelectMgr/SelectMgr_SelectableObject.cxx
src/SelectMgr/SelectMgr_SelectableObject.hxx
src/SelectMgr/SelectMgr_SelectableObject.lxx [deleted file]

index 328bad3..a251e20 100755 (executable)
@@ -26,7 +26,6 @@ SelectMgr_RectangularFrustum.cxx
 SelectMgr_RectangularFrustum.hxx
 SelectMgr_SelectableObject.cxx
 SelectMgr_SelectableObject.hxx
-SelectMgr_SelectableObject.lxx
 SelectMgr_SelectableObjectSet.cxx
 SelectMgr_SelectableObjectSet.hxx
 SelectMgr_SelectableObjectTrsfPersSet.cxx
index 2cfcdb3..f0d3e83 100644 (file)
@@ -411,12 +411,12 @@ void SelectMgr_SelectableObject::SetZLayer (const Graphic3d_ZLayerId theLayerId)
 }
 
 //=======================================================================
-//function : UpdateSelection
+//function : updateSelection
 //purpose  : Sets update status FULL to selections of the object. Must be
 //           used as the only method of UpdateSelection from outer classes
 //           to prevent BVH structures from being outdated.
 //=======================================================================
-void SelectMgr_SelectableObject::UpdateSelection (const Standard_Integer theMode)
+void SelectMgr_SelectableObject::updateSelection (const Standard_Integer theMode)
 {
   if (theMode == -1)
   {
index 4968243..ebb26b3 100644 (file)
@@ -101,17 +101,29 @@ public:
   Standard_EXPORT virtual Standard_Boolean HasSelection (const Standard_Integer theMode) const;
   
   //! Begins the iteration scanning for sensitive primitives.
-    void Init();
-  
+  void Init()
+  {
+    mycurrent = 1;
+  }
+
   //! Continues the iteration scanning for sensitive primitives.
-    Standard_Boolean More() const;
-  
+  Standard_Boolean More() const
+  {
+    return mycurrent <= myselections.Length();
+  }
+
   //! Continues the iteration scanning for sensitive primitives.
-    void Next();
-  
+  void Next()
+  {
+    mycurrent++;
+  }
+
   //! Returns the current selection in this framework.
-    const Handle(SelectMgr_Selection)& CurrentSelection() const;
-  
+  const Handle(SelectMgr_Selection)& CurrentSelection() const
+  {
+    return myselections (mycurrent);
+  }
+
   Standard_EXPORT void ResetTransformation() Standard_OVERRIDE;
   
   //! Recomputes the location of the selection aSelection.
@@ -153,8 +165,11 @@ public:
   
   //! Sets update status FULL to selections of the object. Must be used as the only method of UpdateSelection
   //! from outer classes to prevent BVH structures from being outdated.
-  Standard_EXPORT void UpdateSelection (const Standard_Integer theMode = -1);
-  
+  void UpdateSelection (const Standard_Integer theMode = -1)
+  {
+    updateSelection (theMode);
+  }
+
   //! Returns bounding box of selectable object
   //! by storing its minimum and maximum 3d coordinates
   //! to output parameters
@@ -164,8 +179,11 @@ public:
   Standard_EXPORT virtual void SetAttributes (const Handle(Prs3d_Drawer)& theDrawer);
   
   //! Returns the attributes settings.
-    const Handle(Prs3d_Drawer)& Attributes() const;
-  
+  const Handle(Prs3d_Drawer)& Attributes() const
+  {
+    return myDrawer;
+  }
+
   //! Clears settings provided by the drawing tool theDrawer.
   Standard_EXPORT virtual void UnsetAttributes();
   
@@ -173,8 +191,11 @@ public:
   Standard_EXPORT virtual void SetHilightAttributes (const Handle(Prs3d_Drawer)& theDrawer);
   
   //! Returns the hilight attributes settings.
-    const Handle(Prs3d_Drawer)& HilightAttributes() const;
-  
+  const Handle(Prs3d_Drawer)& HilightAttributes() const
+  {
+    return myHilightDrawer;
+  }
+
   //! Clears settings provided by the hilight drawing tool theDrawer.
   Standard_EXPORT virtual void UnsetHilightAttributes();
   
@@ -192,7 +213,10 @@ public:
   Standard_EXPORT Bnd_Box BndBoxOfSelected (Handle(SelectMgr_IndexedMapOfOwner)& theOwners);
 
   //! Returns the mode for selection of object as a whole
-  inline Standard_Integer GlobalSelectionMode() const;
+  Standard_Integer GlobalSelectionMode() const
+  {
+    return myGlobalSelMode;
+  }
 
   //! Returns the owner of mode for selection of object as a whole
   Standard_EXPORT virtual Handle(SelectMgr_EntityOwner) GlobalSelOwner() const;
@@ -205,34 +229,29 @@ friend class SelectMgr_SelectionManager;
 
 protected:
 
-  
   Standard_EXPORT SelectMgr_SelectableObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
 
-  inline void setGlobalSelMode (const Standard_Integer theMode);
+  void setGlobalSelMode (const Standard_Integer theMode)
+  {
+    myGlobalSelMode = theMode > 0 ? theMode : 0;
+  }
+
+  Standard_EXPORT virtual void updateSelection (const Standard_Integer theMode);
+
+protected:
 
   SelectMgr_SequenceOfSelection myselections;
   Handle(Prs3d_Drawer) myDrawer;
   Handle(Prs3d_Drawer) myHilightDrawer;
   Handle(SelectMgr_EntityOwner) myAssemblyOwner;
-
+  Standard_Boolean myAutoHilight;
 
 private:
 
-
   Standard_Integer mycurrent;
-  Standard_Boolean myAutoHilight;
   Handle(Prs3d_Presentation) mySelectionPrs;
   Handle(Prs3d_Presentation) myHilightPrs;
   Standard_Integer myGlobalSelMode;
-
-
 };
 
-
-#include <SelectMgr_SelectableObject.lxx>
-
-
-
-
-
 #endif // _SelectMgr_SelectableObject_HeaderFile
diff --git a/src/SelectMgr/SelectMgr_SelectableObject.lxx b/src/SelectMgr/SelectMgr_SelectableObject.lxx
deleted file mode 100644 (file)
index 214dbbe..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 1998-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-inline void SelectMgr_SelectableObject::Init()
-{mycurrent=1;}
-
-inline Standard_Boolean SelectMgr_SelectableObject::More() const
-{return (mycurrent<=myselections.Length());}
-
-inline void SelectMgr_SelectableObject::Next()
-{mycurrent++;}
-
-inline const Handle(SelectMgr_Selection)& SelectMgr_SelectableObject::
-CurrentSelection() const
-{return myselections(mycurrent);}
-
-inline const Handle(Prs3d_Drawer)& SelectMgr_SelectableObject::
-Attributes() const
-{return myDrawer;}
-
-inline const Handle(Prs3d_Drawer)& SelectMgr_SelectableObject::
-HilightAttributes() const
-{return myHilightDrawer;}
-
-//=======================================================================
-//function : GlobalSelectionMode
-//purpose  :
-//=======================================================================
-inline Standard_Integer SelectMgr_SelectableObject::GlobalSelectionMode() const
-{
-  return myGlobalSelMode;
-}
-
-//=======================================================================
-//function : setGlobalSelMode
-//purpose  :
-//=======================================================================
-inline void SelectMgr_SelectableObject::setGlobalSelMode (const Standard_Integer theMode)
-{
-  myGlobalSelMode = theMode > 0 ? theMode : 0;
-}