0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / IVtkOCC / IVtkOCC_ShapePickerAlgo.hxx
index afed097..b0865c6 100644 (file)
@@ -19,6 +19,7 @@
 #include <IVtk_IShapePickerAlgo.hxx>
 #include <IVtkOCC_ViewerSelector.hxx>
 
+class IVtkOCC_ShapePickerAlgo;
 DEFINE_STANDARD_HANDLE( IVtkOCC_ShapePickerAlgo, IVtk_IShapePickerAlgo )
 
 //! @class IVtkOCC_ShapePickerAlgo 
@@ -37,15 +38,16 @@ public:
   //! Sets the picker's view interface.
   //! The picker uses the view to obtain parameters of
   //! the 3D view projection.
-  Standard_EXPORT virtual void SetView (const IVtk_IView::Handle& theView);
+  Standard_EXPORT virtual void SetView (const IVtk_IView::Handle& theView) Standard_OVERRIDE;
 
   //! Get number of picked entities.
-  Standard_EXPORT virtual int  NbPicked();
+  Standard_EXPORT virtual int  NbPicked() Standard_OVERRIDE;
 
   //! Get activated selection modes for a shape.
   //! @param [in] theShape a shape with activated selection mode(s)
   //! @return list of active selection modes
-  Standard_EXPORT virtual IVtk_SelectionModeList GetSelectionModes (const IVtk_IShape::Handle& theShape) const;
+  Standard_EXPORT virtual IVtk_SelectionModeList 
+    GetSelectionModes (const IVtk_IShape::Handle& theShape) const Standard_OVERRIDE;
 
 public: //! @name Set selectable shapes and selection modes
 
@@ -57,7 +59,7 @@ public: //! @name Set selectable shapes and selection modes
   //! @param [in] theIsTurnOn Flag to turn on/off the selection mode
   Standard_EXPORT virtual void SetSelectionMode (const IVtk_IShape::Handle& theShape,
                                                  const IVtk_SelectionMode theMode,
-                                                 const bool theIsTurnOn = true);
+                                                 const bool theIsTurnOn = true) Standard_OVERRIDE;
 
   //! Activates/deactivates the given selection mode for the shape.
   //! If mode == SM_None, the shape becomes non-selectable and 
@@ -67,35 +69,43 @@ public: //! @name Set selectable shapes and selection modes
   //! @param [in] theIsTurnOn Flag to turn on/off the selection mode
   Standard_EXPORT virtual void SetSelectionMode (const IVtk_ShapePtrList& theShapes,
                                                  const IVtk_SelectionMode theMode,
-                                                 const bool theIsTurnOn = true);
+                                                 const bool theIsTurnOn = true) Standard_OVERRIDE;
 
 public: //! @name Picking methods
 
-  Standard_EXPORT virtual bool Pick (const double theX, const double theY);
+  Standard_EXPORT virtual bool Pick (const double theX, const double theY) Standard_OVERRIDE;
 
   Standard_EXPORT virtual bool Pick (const double theXMin,
                                      const double theYMin,
                                      const double theXMax,
-                                     const double theYMax);
+                                     const double theYMax) Standard_OVERRIDE;
 
-  Standard_EXPORT virtual bool Pick (double** thePolyLine, const int theNbPoints);
+  Standard_EXPORT virtual bool Pick (double** thePolyLine, const int theNbPoints) Standard_OVERRIDE;
 
 public: //! @name Obtain picking results
 
   //! @return the list of picked top-level shape IDs,
   //! in the order of increasing depth (the ID of the shape closest to the eye 
   //! is the first in the list)
-  Standard_EXPORT virtual const IVtk_ShapeIdList& ShapesPicked() const;
+  Standard_EXPORT virtual const IVtk_ShapeIdList& ShapesPicked() const Standard_OVERRIDE;
 
   //! @param [in] theId Top-level shape ID
   //! @param [out] theShapeList the list of picked sub-shape IDs for the given top-level shape ID,
   //! in the order of increasing depth (the ID of the sub-shape closest to the eye 
   //! is the first in the list)
-  Standard_EXPORT virtual void SubShapesPicked (const IVtk_IdType theId, IVtk_ShapeIdList& theShapeList) const;
+  Standard_EXPORT virtual void 
+    SubShapesPicked (const IVtk_IdType theId, IVtk_ShapeIdList& theShapeList) const Standard_OVERRIDE;
+
+  //! Remove selectable object from the picker (from internal maps).
+  //! @param [in] theShape the selectable shape
+  Standard_EXPORT virtual void RemoveSelectableObject(const IVtk_IShape::Handle& theShape);
+
+  //! Return topmost picked 3D point or (Inf, Inf, Inf) if undefined.
+  const gp_Pnt& TopPickedPoint() const { return myTopPickedPoint; }
 
 public:
 
-  DEFINE_STANDARD_RTTI(IVtkOCC_ShapePickerAlgo, IVtk_IShapePickerAlgo)
+  DEFINE_STANDARD_RTTIEXT(IVtkOCC_ShapePickerAlgo,IVtk_IShapePickerAlgo)
 
 private:
 
@@ -114,6 +124,7 @@ private:
   IVtk_IView::Handle             myView;
   IVtk_ShapeIdList               myShapesPicked;
   IVtk_SubShapeMap               mySubShapesPicked;
+  gp_Pnt                         myTopPickedPoint;
   Handle(IVtkOCC_ViewerSelector) myViewerSelector;
 };