]> OCCT Git - occt-copy.git/commitdiff
0027180: Visualization - improve selection logic of MeshVS_Mesh CR0_691_FixB
authorvpa <vpa@opencascade.com>
Tue, 1 Mar 2016 13:21:45 +0000 (16:21 +0300)
committerbugmaster <bugmaster@opencascade.com>
Tue, 1 Mar 2016 14:29:15 +0000 (17:29 +0300)
MeshVS_Mesh selection logic in MeshVS_SMF_Mesh mode (entire mesh) has been optimized.
MeshVS_Mesh::ComputeSelection() now creates single sensitive entity
MeshVS_CommonSensitiveEntity (new class) instead of small sensitive entity on each element.

20 files changed:
src/MeshVS/FILES
src/MeshVS/MeshVS_Buffer.hxx
src/MeshVS/MeshVS_CommonSensitiveEntity.cxx [new file with mode: 0644]
src/MeshVS/MeshVS_CommonSensitiveEntity.hxx [new file with mode: 0644]
src/MeshVS/MeshVS_Mesh.cxx
src/SelectBasics/SelectBasics_SelectingVolumeManager.hxx
src/SelectMgr/SelectMgr_BaseFrustum.cxx
src/SelectMgr/SelectMgr_BaseFrustum.hxx
src/SelectMgr/SelectMgr_Frustum.hxx
src/SelectMgr/SelectMgr_Frustum.lxx
src/SelectMgr/SelectMgr_RectangularFrustum.cxx
src/SelectMgr/SelectMgr_RectangularFrustum.hxx
src/SelectMgr/SelectMgr_SelectingVolumeManager.cxx
src/SelectMgr/SelectMgr_SelectingVolumeManager.hxx
src/SelectMgr/SelectMgr_TriangularFrustum.cxx
src/SelectMgr/SelectMgr_TriangularFrustum.hxx
src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx
src/SelectMgr/SelectMgr_TriangularFrustumSet.hxx
src/StdSelect/StdSelect_BRepSelectionTool.cdl
src/StdSelect/StdSelect_BRepSelectionTool.cxx

index fbc8f8c6a3972a7fa810ed9d2e02a783ee4f422a..57fdb2ba33e9af9122446c4de54bedadea16d656 100755 (executable)
@@ -1,4 +1,6 @@
 MeshVS_Buffer.hxx
+MeshVS_CommonSensitiveEntity.hxx
+MeshVS_CommonSensitiveEntity.cxx
 MeshVS_EntityType.hxx
 MeshVS_DisplayModeFlags.hxx
 MeshVS_DummySensitiveEntity.hxx
index 51ab75d70df9ae9e5ff93ef6b5060715fbac0412..47a83706a489673fd10c31a8b294001dfb1dea73 100644 (file)
@@ -17,6 +17,7 @@
 #define MeshVS_Buffer_HeaderFile
 
 #include <Standard.hxx>
+#include <gp_Pnt.hxx>
 
 /**
  * General purpose buffer that is allocated on the stack with a
@@ -68,6 +69,12 @@ public:
     return * (myDynData ? (Standard_Integer*) myDynData : (Standard_Integer*) myAutoData);
   }
 
+  //! Interpret the buffer as a reference to gp_Pnt
+  operator gp_Pnt& ()
+  {
+    return * (myDynData ? (gp_Pnt*) myDynData : (gp_Pnt*) myAutoData);
+  }
+
 private:
   //! Deprecate copy constructor
   MeshVS_Buffer(const MeshVS_Buffer&) {}
diff --git a/src/MeshVS/MeshVS_CommonSensitiveEntity.cxx b/src/MeshVS/MeshVS_CommonSensitiveEntity.cxx
new file mode 100644 (file)
index 0000000..aa60d95
--- /dev/null
@@ -0,0 +1,326 @@
+// Created on: 2016-02-18
+// Created by: Varvara POSKONINA
+// Copyright (c) 2016 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.
+
+#include <MeshVS_CommonSensitiveEntity.hxx>
+
+#include <MeshVS_Buffer.hxx>
+#include <MeshVS_Drawer.hxx>
+#include <MeshVS_DrawerAttribute.hxx>
+#include <TColStd_Array1OfInteger.hxx>
+#include <TColStd_Array1OfReal.hxx>
+#include <TColStd_PackedMapOfInteger.hxx>
+#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
+
+IMPLEMENT_STANDARD_HANDLE  (MeshVS_CommonSensitiveEntity, Select3D_SensitiveSet)
+IMPLEMENT_STANDARD_RTTIEXT (MeshVS_CommonSensitiveEntity, Select3D_SensitiveSet)
+
+//=======================================================================
+//function : Constructor
+//purpose  :
+//=======================================================================
+MeshVS_CommonSensitiveEntity::MeshVS_CommonSensitiveEntity (const Handle(SelectBasics_EntityOwner)& theOwner,
+                                                            const Handle(MeshVS_Mesh)&              theParentMesh,
+                                                            const MeshVS_MeshSelectionMethod        theSelMethod)
+: Select3D_SensitiveSet (theOwner),
+  myDataSource (theParentMesh->GetDataSource()),
+  mySelMethod (theSelMethod)
+{
+  theParentMesh->GetDrawer()->GetInteger (MeshVS_DA_MaxFaceNodes, myMaxFaceNodes);
+  Standard_ASSERT_RAISE (myMaxFaceNodes > 0,
+    "The maximal amount of nodes in a face must be greater than zero to create sensitive entity");
+  gp_XYZ aCenter (0.0, 0.0, 0.0);
+
+  if (mySelMethod == MeshVS_MSM_NODES)
+  {
+    Standard_Integer aNbSelectableNodes = 0;
+    const TColStd_PackedMapOfInteger& anAllNodesMap = myDataSource->GetAllNodes();
+    for (TColStd_MapIteratorOfPackedMapOfInteger aNodesIter (anAllNodesMap); aNodesIter.More(); aNodesIter.Next())
+    {
+      const Standard_Integer aNodeIdx = aNodesIter.Key();
+      if (theParentMesh->IsSelectableNode (aNodeIdx))
+      {
+        const gp_Pnt aVertex = getVertexByIndex (aNodeIdx);
+        aCenter += aVertex.XYZ();
+        myBndBox.Add (SelectMgr_Vec3 (aVertex.X(), aVertex.Y(), aVertex.Z()));
+        ++aNbSelectableNodes;
+        myItemIndexes.Append (aNodeIdx);
+      }
+    }
+
+    // increase sensitivity for vertices detection
+    SetSensitivityFactor (8);
+    myCOG = aCenter / aNbSelectableNodes;
+  }
+  else if (mySelMethod == MeshVS_MSM_PRECISE)
+  {
+    const TColStd_PackedMapOfInteger& anAllNodesMap = myDataSource->GetAllNodes();
+    for (TColStd_MapIteratorOfPackedMapOfInteger aNodesIter (anAllNodesMap); aNodesIter.More(); aNodesIter.Next())
+    {
+      const Standard_Integer aNodeIdx = aNodesIter.Key();
+      const gp_Pnt aVertex = getVertexByIndex (aNodeIdx);
+      aCenter += aVertex.XYZ();
+      myBndBox.Add (SelectMgr_Vec3 (aVertex.X(), aVertex.Y(), aVertex.Z()));
+    }
+    myCOG = aCenter / anAllNodesMap.Extent();
+
+    const TColStd_PackedMapOfInteger& anAllElementsMap = myDataSource->GetAllElements();
+    MeshVS_EntityType aType;
+    for (TColStd_MapIteratorOfPackedMapOfInteger anElemIter (anAllElementsMap); anElemIter.More(); anElemIter.Next())
+    {
+      const Standard_Integer anElemIdx = anElemIter.Key();
+      if (theParentMesh->IsSelectableElem (anElemIdx)
+       && myDataSource->GetGeomType (anElemIdx, Standard_True, aType)
+       && aType == MeshVS_ET_Face)
+      {
+        myItemIndexes.Append (anElemIdx);
+      }
+    }
+  }
+}
+
+//=======================================================================
+//function : Destructor
+//purpose  :
+//=======================================================================
+MeshVS_CommonSensitiveEntity::~MeshVS_CommonSensitiveEntity()
+{
+  myDataSource.Nullify();
+  myItemIndexes.Clear();
+}
+
+//=======================================================================
+//function : NbSubElements
+//purpose  :
+//=======================================================================
+Standard_Integer MeshVS_CommonSensitiveEntity::NbSubElements()
+{
+  return myItemIndexes.Size();
+}
+
+//=======================================================================
+//function : Size
+//purpose  :
+//=======================================================================
+Standard_Integer MeshVS_CommonSensitiveEntity::Size() const
+{
+  return myItemIndexes.Size();
+}
+
+//=======================================================================
+//function : getVertexByIndex
+//purpose  :
+//=======================================================================
+gp_Pnt MeshVS_CommonSensitiveEntity::getVertexByIndex (const Standard_Integer theNodeIdx) const
+{
+  Standard_Real aCoordsBuf[3];
+  TColStd_Array1OfReal aCoords (aCoordsBuf[0], 1, 3);
+  Standard_Integer aNbNodes;
+  MeshVS_EntityType aType;
+  if (!myDataSource->GetGeom (theNodeIdx, Standard_False, aCoords, aNbNodes, aType))
+  {
+    return gp_Pnt();
+  }
+  return gp_Pnt (aCoords.Value (1), aCoords.Value (2), aCoords.Value (3));
+}
+
+//=======================================================================
+//function : Box
+//purpose  :
+//=======================================================================
+Select3D_BndBox3d MeshVS_CommonSensitiveEntity::Box (const Standard_Integer theIdx) const
+{
+  const Standard_Integer anItemIdx = myItemIndexes.Value (theIdx);
+  Select3D_BndBox3d aBox;
+  if (mySelMethod == MeshVS_MSM_PRECISE)
+  {
+    MeshVS_Buffer aCoordsBuf (3 * myMaxFaceNodes * sizeof (Standard_Real));
+    TColStd_Array1OfReal aCoords (aCoordsBuf, 1, 3 * myMaxFaceNodes);
+    Standard_Integer aNbNodes;
+    MeshVS_EntityType aType;
+    if (!myDataSource->GetGeom (anItemIdx, Standard_True, aCoords, aNbNodes, aType)
+      || aNbNodes == 0)
+    {
+      return aBox;
+    }
+
+    MeshVS_Buffer aNodesBuf (aNbNodes * sizeof (Standard_Integer));
+    TColStd_Array1OfInteger aElemNodes (aNodesBuf, 1, aNbNodes);
+    if (!myDataSource->GetNodesByElement (anItemIdx, aElemNodes, aNbNodes))
+    {
+      return aBox;
+    }
+
+    for (Standard_Integer aNodeIdx = 1; aNodeIdx <= aNbNodes; aNodeIdx++)
+    {
+      const SelectMgr_Vec3 aPnt (aCoords (3 * aNodeIdx - 2),
+                                 aCoords (3 * aNodeIdx - 1),
+                                 aCoords (3 * aNodeIdx));
+      aBox.Add (aPnt);
+    }
+  }
+  else if (mySelMethod == MeshVS_MSM_NODES)
+  {
+    const gp_Pnt aVert = getVertexByIndex (anItemIdx);
+    aBox.Add (SelectMgr_Vec3 (aVert.X(), aVert.Y(), aVert.Z()));
+  }
+
+  return aBox;
+}
+
+//=======================================================================
+//function : Center
+//purpose  :
+//=======================================================================
+Standard_Real MeshVS_CommonSensitiveEntity::Center (const Standard_Integer theIdx,
+                                                    const Standard_Integer theAxis) const
+{
+  const Select3D_BndBox3d& aBox = Box (theIdx);
+  SelectMgr_Vec3 aCenter = (aBox.CornerMin () + aBox.CornerMax ()) * 0.5;
+
+  return theAxis == 0 ? aCenter.x() : (theAxis == 1 ? aCenter.y() : aCenter.z());
+}
+
+//=======================================================================
+//function : Swap
+//purpose  :
+//=======================================================================
+void MeshVS_CommonSensitiveEntity::Swap (const Standard_Integer theIdx1,
+                                         const Standard_Integer theIdx2)
+{
+  const Standard_Integer anItem1 = myItemIndexes.Value (theIdx1);
+  const Standard_Integer anItem2 = myItemIndexes.Value (theIdx2);
+  myItemIndexes.ChangeValue (theIdx1) = anItem2;
+  myItemIndexes.ChangeValue (theIdx2) = anItem1;
+}
+
+//=======================================================================
+//function : overlapsElement
+//purpose  :
+//=======================================================================
+Standard_Boolean MeshVS_CommonSensitiveEntity::overlapsElement (SelectBasics_SelectingVolumeManager& theMgr,
+                                                                Standard_Integer theElemIdx,
+                                                                Standard_Real& theMatchDepth)
+{
+  const Standard_Integer anItemIdx = myItemIndexes.Value (theElemIdx);
+  if (mySelMethod == MeshVS_MSM_PRECISE)
+  {
+    MeshVS_Buffer aCoordsBuf (3 * myMaxFaceNodes * sizeof (Standard_Real));
+    TColStd_Array1OfReal aCoords (aCoordsBuf, 1, 3 * myMaxFaceNodes);
+    Standard_Integer aNbNodes;
+    MeshVS_EntityType aType;
+    if (!myDataSource->GetGeom (anItemIdx, Standard_True, aCoords, aNbNodes, aType)
+      || aNbNodes == 0)
+    {
+      return Standard_False;
+    }
+
+    MeshVS_Buffer aNodesBuf (aNbNodes * sizeof (Standard_Integer));
+    TColStd_Array1OfInteger aElemNodes (aNodesBuf, 1, aNbNodes);
+    if (!myDataSource->GetNodesByElement (anItemIdx, aElemNodes, aNbNodes))
+    {
+      return Standard_False;
+    }
+    if (aNbNodes == 3)
+    {
+      return theMgr.Overlaps (gp_Pnt (aCoords (1), aCoords (2), aCoords (3)),
+                              gp_Pnt (aCoords (4), aCoords (5), aCoords (6)),
+                              gp_Pnt (aCoords (7), aCoords (8), aCoords (9)),
+                              Select3D_TOS_INTERIOR, theMatchDepth);
+    }
+
+    MeshVS_Buffer aFacePntsBuf (aNbNodes * 3 * sizeof (Standard_Real));
+    TColgp_Array1OfPnt aFacePnts (aFacePntsBuf, 1, aNbNodes);
+    for (Standard_Integer aNodeIdx = 1; aNodeIdx <= aNbNodes; aNodeIdx++)
+    {
+      aFacePnts.SetValue (aNodeIdx, gp_Pnt (aCoords (3 * aNodeIdx - 2),
+                                            aCoords (3 * aNodeIdx - 1),
+                                            aCoords (3 * aNodeIdx)));
+    }
+    return theMgr.Overlaps (aFacePnts, Select3D_TOS_INTERIOR, theMatchDepth);
+  }
+  else if (mySelMethod == MeshVS_MSM_NODES)
+  {
+    const gp_Pnt aVert = getVertexByIndex (anItemIdx);
+    return theMgr.Overlaps (aVert, theMatchDepth);
+  }
+  return Standard_False;
+}
+
+//=======================================================================
+//function : elementIsInside
+//purpose  :
+//=======================================================================
+Standard_Boolean MeshVS_CommonSensitiveEntity::elementIsInside (SelectBasics_SelectingVolumeManager& theMgr,
+                                                                const Standard_Integer theElemIdx)
+{
+  const Standard_Integer anItemIdx = myItemIndexes.Value (theElemIdx);
+  if (mySelMethod == MeshVS_MSM_PRECISE)
+  {
+    MeshVS_Buffer aCoordsBuf (3 * myMaxFaceNodes * sizeof (Standard_Real));
+    TColStd_Array1OfReal aCoords (aCoordsBuf, 1, 3 * myMaxFaceNodes);
+    Standard_Integer aNbNodes;
+    MeshVS_EntityType aType;
+    if (!myDataSource->GetGeom (anItemIdx, Standard_True, aCoords, aNbNodes, aType)
+      || aNbNodes == 0)
+    {
+      return Standard_False;
+    }
+
+    MeshVS_Buffer aNodesBuf (aNbNodes * sizeof (Standard_Integer));
+    TColStd_Array1OfInteger aElemNodes (aNodesBuf, 1, aNbNodes);
+    if (!myDataSource->GetNodesByElement (anItemIdx, aElemNodes, aNbNodes))
+    {
+      return Standard_False;
+    }
+
+    MeshVS_Buffer aFacePntsBuf (aNbNodes * 3 * sizeof (Standard_Real));
+    TColgp_Array1OfPnt aFacePnts (aFacePntsBuf, 1, aNbNodes);
+    for (Standard_Integer aNodeIdx = 1; aNodeIdx <= aNbNodes; ++aNodeIdx)
+    {
+      const gp_Pnt aPnt (aCoords (3 * aNodeIdx - 2),
+                         aCoords (3 * aNodeIdx - 1),
+                         aCoords (3 * aNodeIdx));
+      if (!theMgr.Overlaps (aPnt))
+      {
+        return Standard_False;
+      }
+    }
+    return Standard_True;
+  }
+  else if (mySelMethod == MeshVS_MSM_NODES)
+  {
+    const gp_Pnt aVert = getVertexByIndex (anItemIdx);
+    return theMgr.Overlaps (aVert);
+  }
+  return Standard_False;
+}
+
+//=======================================================================
+//function : distanceToCOG
+//purpose  :
+//=======================================================================
+Standard_Real MeshVS_CommonSensitiveEntity::distanceToCOG (SelectBasics_SelectingVolumeManager& theMgr)
+{
+  return theMgr.DistToGeometryCenter (myCOG);
+}
+
+//=======================================================================
+//function : BoundingBox
+//purpose  :
+//=======================================================================
+Select3D_BndBox3d MeshVS_CommonSensitiveEntity::BoundingBox()
+{
+  return myBndBox;
+}
diff --git a/src/MeshVS/MeshVS_CommonSensitiveEntity.hxx b/src/MeshVS/MeshVS_CommonSensitiveEntity.hxx
new file mode 100644 (file)
index 0000000..4b11edf
--- /dev/null
@@ -0,0 +1,94 @@
+// Created on: 2016-02-18
+// Created by: Varvara POSKONINA
+// Copyright (c) 2016 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.
+
+#ifndef _MeshVS_CommonSensitiveEntity_Header
+#define _MeshVS_CommonSensitiveEntity_Header
+
+#include <MeshVS_DataSource.hxx>
+#include <MeshVS_Mesh.hxx>
+#include <MeshVS_MeshSelectionMethod.hxx>
+#include <Select3D_SensitiveSet.hxx>
+
+//! Sensitive entity covering entire mesh for global selection.
+class MeshVS_CommonSensitiveEntity : public Select3D_SensitiveSet
+{
+public:
+
+  //! Default constructor.
+  Standard_EXPORT MeshVS_CommonSensitiveEntity (const Handle(SelectBasics_EntityOwner)& theOwner,
+                                                const Handle(MeshVS_Mesh)&              theParentMesh,
+                                                const MeshVS_MeshSelectionMethod        theSelMethod);
+
+  //! Destructor.
+  Standard_EXPORT virtual ~MeshVS_CommonSensitiveEntity();
+
+  //! Number of elements.
+  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+
+  //! Returns the amount of sub-entities of the complex entity
+  Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE;
+
+  //! Returns bounding box of sub-entity with index theIdx in sub-entity list
+  Standard_EXPORT virtual Select3D_BndBox3d Box (const Standard_Integer theIdx) const Standard_OVERRIDE;
+
+  //! Returns geometry center of sensitive entity index theIdx along the given axis theAxis
+  Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIdx,
+                                                const Standard_Integer theAxis) const Standard_OVERRIDE;
+
+  //! Swaps items with indexes theIdx1 and theIdx2
+  Standard_EXPORT virtual void Swap (const Standard_Integer theIdx1,
+                                     const Standard_Integer theIdx2) Standard_OVERRIDE;
+
+  //! Returns bounding box of the triangulation. If location
+  //! transformation is set, it will be applied
+  Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
+
+public:
+
+  DEFINE_STANDARD_RTTI (MeshVS_CommonSensitiveEntity)
+
+protected:
+
+  //! Checks whether the entity with index theIdx overlaps the current selecting volume
+  Standard_EXPORT virtual Standard_Boolean overlapsElement (SelectBasics_SelectingVolumeManager& theMgr,
+                                                            Standard_Integer theElemIdx,
+                                                            Standard_Real& theMatchDepth) Standard_OVERRIDE;
+
+  //! Checks whether the entity with index theIdx is inside the current selecting volume
+  Standard_EXPORT virtual Standard_Boolean elementIsInside (SelectBasics_SelectingVolumeManager& theMgr,
+                                                            const Standard_Integer theElemIdx) Standard_OVERRIDE;
+
+  //! Calculates distance from the 3d projection of used-picked screen point to center of the geometry
+  Standard_EXPORT virtual Standard_Real distanceToCOG (SelectBasics_SelectingVolumeManager& theMgr) Standard_OVERRIDE;
+
+private:
+
+  //! Return point for specified index.
+  gp_Pnt getVertexByIndex (const Standard_Integer theNodeIdx) const;
+
+private:
+
+  Handle(MeshVS_DataSource)            myDataSource;   //!< mesh data source
+  NCollection_Vector<Standard_Integer> myItemIndexes;  //!< indices for BVH tree reordering
+  MeshVS_MeshSelectionMethod           mySelMethod;    //!< selection mode
+  Standard_Integer                     myMaxFaceNodes; //!< maximum nodes within the element in mesh
+  gp_Pnt                               myCOG;          //!< center of gravity
+  Select3D_BndBox3d                    myBndBox;       //!< bounding box
+
+};
+
+DEFINE_STANDARD_HANDLE (MeshVS_CommonSensitiveEntity, Select3D_SensitiveSet)
+
+#endif // _MeshVS_CommonSensitiveEntity_Header
index 315d2b911b2947b6458201bd2cadd1d7b6b309cd..727c7fbc6397f7125e7db372a398b379d3836f4a 100644 (file)
@@ -37,6 +37,7 @@
 #include <SelectMgr_SequenceOfOwner.hxx>
 #include <Select3D_SensitiveGroup.hxx>
 #include <Select3D_SensitiveBox.hxx>
+#include <StdSelect_BRepSelectionTool.hxx>
 
 #include <Graphic3d_MaterialAspect.hxx>
 #include <Graphic3d_AspectFillArea3d.hxx>
@@ -51,6 +52,7 @@
 
 #include <Bnd_Box.hxx>
 
+#include <MeshVS_CommonSensitiveEntity.hxx>
 #include <MeshVS_DataSource.hxx>
 #include <MeshVS_MeshEntityOwner.hxx>
 #include <MeshVS_MeshOwner.hxx>
@@ -304,113 +306,16 @@ void MeshVS_Mesh::ComputeSelection ( const Handle(SelectMgr_Selection)& theSelec
       if( myWholeMeshOwner.IsNull() )
        myWholeMeshOwner = new SelectMgr_EntityOwner( this );
       
-      switch( mySelectionMethod )
+      if (mySelectionMethod == MeshVS_MSM_BOX)
       {
-      case MeshVS_MSM_BOX:
-        {
-          Bnd_Box box;
-          TColStd_MapIteratorOfPackedMapOfInteger anIterN( anAllNodesMap );
-          for( ; anIterN.More(); anIterN.Next() )
-         {
-            if( myDataSource->GetGeom( anIterN.Key(), Standard_False, aCoords, NbNodes, aType ) ) {
-              box.Add (gp_Pnt (aCoords(1), aCoords(2), aCoords(3)));
-            }
-         }
-          if (!box.IsVoid())
-            theSelection->Add (new Select3D_SensitiveBox (myWholeMeshOwner, box));
-        }
-        break;
-
-      case MeshVS_MSM_NODES:
-        {
-          TColStd_MapIteratorOfPackedMapOfInteger anIterN( anAllNodesMap );
-          for( ; anIterN.More(); anIterN.Next() )
-            if( myDataSource->GetGeom( anIterN.Key(), Standard_False, aCoords, NbNodes, aType ) &&
-                IsSelectableNode( anIterN.Key() ) )
-              theSelection->Add( new Select3D_SensitivePoint( myWholeMeshOwner, gp_Pnt ( aCoords(1), aCoords(2), aCoords(3) ) ) );
-        }
-        break;
-
-      case MeshVS_MSM_PRECISE:
-        {
-          Handle( Select3D_SensitiveEntity ) anEnt;
-          TColStd_MapIteratorOfPackedMapOfInteger anIterMV( anAllElementsMap );
-
-          TColStd_PackedMapOfInteger aSharedNodes;
-          for( ; anIterMV.More(); anIterMV.Next() )
-          {
-            Standard_Integer aKey = anIterMV.Key();
-
-            if( IsSelectableElem( aKey ) && 
-                myDataSource->GetGeomType( aKey, Standard_True, aType ) && 
-                aType==MeshVS_ET_Face )
-            {
-              myDataSource->GetGeom ( aKey, Standard_True, aCoords, NbNodes, aType );
-              if( NbNodes==0 )
-                continue;
-
-              MeshVS_Buffer aNodesBuf (NbNodes*sizeof(Standard_Integer));
-              TColStd_Array1OfInteger aElemNodes(aNodesBuf, 1, NbNodes);
-              if ( !myDataSource->GetNodesByElement ( aKey, aElemNodes, NbNodes ) )
-                continue;
-
-              TColgp_Array1OfPnt Points( 1, NbNodes );
-              for ( Standard_Integer i=1; i<=NbNodes; i++ )
-              {
-                Points (i) = gp_Pnt ( aCoords (3*i-2), aCoords (3*i-1), aCoords (3*i) );
-                aSharedNodes.Add( aElemNodes( i ) );
-              }
-
-              anEnt = new Select3D_SensitiveFace( myWholeMeshOwner, Points, Select3D_TOS_INTERIOR);
-              theSelection->Add( anEnt );
-            }
-          }
-          for( anIterMV.Initialize( anAllElementsMap ); anIterMV.More(); anIterMV.Next() )
-          {
-            Standard_Integer aKey = anIterMV.Key();
-
-            if( IsSelectableElem( aKey ) && 
-                myDataSource->GetGeomType( aKey, Standard_True, aType ) && 
-                aType==MeshVS_ET_Link )
-            {
-              myDataSource->GetGeom ( aKey, Standard_True, aCoords, NbNodes, aType );
-              if( NbNodes==0 )
-                continue;
-
-              MeshVS_Buffer aNodesBuf (NbNodes*sizeof(Standard_Integer));
-              TColStd_Array1OfInteger aElemNodes(aNodesBuf, 1, NbNodes);
-              if ( !myDataSource->GetNodesByElement ( aKey, aElemNodes, NbNodes ) )
-                continue;
-
-              TColgp_Array1OfPnt Points( 1, NbNodes );
-              Standard_Boolean all_shared = Standard_True;
-              for ( Standard_Integer i=1; i<=NbNodes; i++ )
-              {
-                Points (i) = gp_Pnt ( aCoords (3*i-2), aCoords (3*i-1), aCoords (3*i) );
-                all_shared = all_shared && aSharedNodes.Contains( aElemNodes( i ) );
-                aSharedNodes.Add( aElemNodes( i ) );
-              }
-
-              if( !all_shared )
-              {
-                anEnt = new Select3D_SensitiveSegment( myWholeMeshOwner, Points.Value( 1 ), Points.Value( 2 ) );
-                theSelection->Add( anEnt );
-              }
-            }
-          }
-          for( anIterMV.Initialize( anAllNodesMap ); anIterMV.More(); anIterMV.Next() )
-          {
-            Standard_Integer aKey = anIterMV.Key();
-            if( IsSelectableElem( aKey ) && 
-                myDataSource->GetGeom ( aKey, Standard_False, aCoords, NbNodes, aType ) && 
-                !aSharedNodes.Contains( aKey ) )
-            {
-              anEnt = new Select3D_SensitivePoint( myWholeMeshOwner, gp_Pnt ( aCoords(1), aCoords(2), aCoords(3) ) ) ;
-              theSelection->Add( anEnt );
-            }
-          }
-        }
-        break;
+        Bnd_Box aBndBox;
+        BoundingBox (aBndBox);
+        if (!aBndBox.IsVoid())
+          theSelection->Add (new Select3D_SensitiveBox (myWholeMeshOwner, aBndBox));
+      }
+      else
+      {
+        theSelection->Add (new MeshVS_CommonSensitiveEntity (myWholeMeshOwner, this, mySelectionMethod));
       }
       break;
 
@@ -602,6 +507,8 @@ void MeshVS_Mesh::ComputeSelection ( const Handle(SelectMgr_Selection)& theSelec
     }
   }
 
+  StdSelect_BRepSelectionTool::PreBuildBVH (theSelection);
+
   if ( ShowComputeSelectionTime )
   {
     Standard_Real sec, cpu;
index 480978e77c522b53cacdb163a50f120c4ad130ec..7b52fcf5f0dacfecb73998979443280eb75bf483 100644 (file)
@@ -69,6 +69,12 @@ public:
                                      Standard_Integer theSensType,
                                      Standard_Real& theDepth) = 0;
 
+  //! Returns true if selecting volume is overlapped by planar convex polygon, which points
+  //! are stored in theArrayOfPts, taking into account sensitivity type theSensType
+  virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPts,
+                                     Standard_Integer theSensType,
+                                     Standard_Real& theDepth) = 0;
+
   //! Returns true if selecting volume is overlapped by line segment with start point at thePt1
   //! and end point at thePt2
   virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1,
index a59c6dabd3e0a47c2eccfab87bff70a7c45993af..ca1ed54f443c45a17e075a3a0f82d068c6014792 100644 (file)
@@ -141,7 +141,7 @@ Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePnt*/)
 //            may be considered of interior part or boundary line defined
 //            by segments depending on given sensitivity type
 //=======================================================================
-Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const Handle(TColgp_HArray1OfPnt)& /*theArrayOfPnts*/,
+Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const TColgp_Array1OfPnt& /*theArrayOfPnts*/,
                                                   Select3D_TypeOfSensitivity /*theSensType*/,
                                                   Standard_Real& /*theDepth*/)
 {
index 048e473d597c1ed802820f3716185bf9949ab023..5fe211a53a1291ad23178933e793c54f5ab87d23 100644 (file)
@@ -118,9 +118,9 @@ public:
   //! SAT intersection test between defined volume and given ordered set of points,
   //! representing line segments. The test may be considered of interior part or
   //! boundary line defined by segments depending on given sensitivity type
-  virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
-                                     Select3D_TypeOfSensitivity theSensType,
-                                     Standard_Real& theDepth);
+  Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
+                                                     Select3D_TypeOfSensitivity theSensType,
+                                                     Standard_Real& theDepth);
 
   //! Checks if line segment overlaps selecting frustum
   virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
index b72d6a310d50224ee846bfcb8587c0ccf4608f4f..7b5c2eb7195b39031d68ac1d451099fbc70938ec 100644 (file)
@@ -76,8 +76,8 @@ protected:
                                const gp_Pnt& thePnt2);
 
   //! SAT intersection test between frustum given and planar convex polygon represented as ordered point set
-  Standard_Boolean hasOverlap (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
-                               gp_Vec& theNormal);
+  Standard_EXPORT Standard_Boolean hasOverlap (const TColgp_Array1OfPnt& theArrayOfPnts,
+                                               gp_Vec& theNormal);
 
   //! SAT intersection test between defined volume and given triangle
   Standard_Boolean hasOverlap (const gp_Pnt& thePnt1,
index cc7e134c95bcfb1c740c3cdcce910967ae86f1b2..1562d3e04e630fa1c489087298119c39a57f190d 100644 (file)
@@ -308,15 +308,15 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& theStartPnt,
 //            polygon represented as ordered point set
 // =======================================================================
 template <int N>
-Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
+Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const TColgp_Array1OfPnt& theArrayOfPnts,
                                                    gp_Vec& theNormal)
 {
-  Standard_Integer aStartIdx = theArrayOfPnts->Lower();
-  Standard_Integer anEndIdx = theArrayOfPnts->Upper();
+  Standard_Integer aStartIdx = theArrayOfPnts.Lower();
+  Standard_Integer anEndIdx = theArrayOfPnts.Upper();
 
-  const gp_XYZ& aPnt1 = theArrayOfPnts->Value (aStartIdx).XYZ();
-  const gp_XYZ& aPnt2 = theArrayOfPnts->Value (aStartIdx + 1).XYZ();
-  const gp_XYZ& aPnt3 = theArrayOfPnts->Value (aStartIdx + 2).XYZ();
+  const gp_XYZ& aPnt1 = theArrayOfPnts.Value (aStartIdx).XYZ();
+  const gp_XYZ& aPnt2 = theArrayOfPnts.Value (aStartIdx + 1).XYZ();
+  const gp_XYZ& aPnt3 = theArrayOfPnts.Value (aStartIdx + 2).XYZ();
   const gp_XYZ aVec1 = aPnt1 - aPnt2;
   const gp_XYZ aVec2 = aPnt3 - aPnt2;
   theNormal = aVec2.Crossed (aVec1);
@@ -347,7 +347,7 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const Handle(TColgp_HArray1Of
     const gp_XYZ& aPlane = myPlanes[aPlaneIdx].XYZ();
     for (Standard_Integer aPntIter = aStartIdx; aPntIter <= anEndIdx; ++aPntIter)
     {
-      Standard_Real aProjection = aPlane.Dot (theArrayOfPnts->Value (aPntIter).XYZ());
+      Standard_Real aProjection = aPlane.Dot (theArrayOfPnts.Value (aPntIter).XYZ());
       aMaxPolyg = Max (aMaxPolyg, aProjection);
       aMinPolyg = Min (aMinPolyg, aProjection);
     }
@@ -361,10 +361,10 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const Handle(TColgp_HArray1Of
   }
 
   Standard_Integer aDirectionsNb = myIsOrthographic ? 4 : 6;
-  for (Standard_Integer aPntsIter = 0, aLastIdx = anEndIdx - aStartIdx, aLen = theArrayOfPnts->Length(); aPntsIter <= aLastIdx; ++aPntsIter)
+  for (Standard_Integer aPntsIter = 0, aLastIdx = anEndIdx - aStartIdx, aLen = theArrayOfPnts.Length(); aPntsIter <= aLastIdx; ++aPntsIter)
   {
-    const gp_XYZ aSegmDir = theArrayOfPnts->Value ((aPntsIter + 1) % aLen + aStartIdx).XYZ()
-      - theArrayOfPnts->Value (aPntsIter + aStartIdx).XYZ();
+    const gp_XYZ aSegmDir = theArrayOfPnts.Value ((aPntsIter + 1) % aLen + aStartIdx).XYZ()
+      - theArrayOfPnts.Value (aPntsIter + aStartIdx).XYZ();
     for (Standard_Integer aVolDir = 0; aVolDir < aDirectionsNb; ++aVolDir)
     {
       Standard_Real aMaxPolyg = RealFirst();
@@ -375,7 +375,7 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const Handle(TColgp_HArray1Of
 
       for (Standard_Integer aPntIter = aStartIdx; aPntIter <= anEndIdx; ++aPntIter)
       {
-        Standard_Real aProjection = aTestDir.Dot (theArrayOfPnts->Value (aPntIter).XYZ());
+        Standard_Real aProjection = aTestDir.Dot (theArrayOfPnts.Value (aPntIter).XYZ());
         aMaxPolyg = Max (aMaxPolyg, aProjection);
         aMinPolyg = Min (aMinPolyg, aProjection);
       }
index bc8a4ade107df61e63254aa7874ee612c89ebe1a..db869874f47c1ccac1b27a552f2286deeccd80cc 100644 (file)
@@ -478,7 +478,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
 //            may be considered of interior part or boundary line defined
 //            by segments depending on given sensitivity type
 // =======================================================================
-Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
+Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
                                                          Select3D_TypeOfSensitivity theSensType,
                                                          Standard_Real& theDepth)
 {
@@ -486,15 +486,12 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const Handle(TColgp_HAr
   {
     Standard_Integer aMatchingSegmentsNb = -1;
     theDepth = DBL_MAX;
-    Standard_Integer aLower = theArrayOfPnts->Lower();
-    Standard_Integer anUpper = theArrayOfPnts->Upper();
-
+    const Standard_Integer aLower  = theArrayOfPnts.Lower();
+    const Standard_Integer anUpper = theArrayOfPnts.Upper();
     for (Standard_Integer aPntIter = aLower; aPntIter <= anUpper; ++aPntIter)
     {
-      const gp_Pnt& aStartPnt = theArrayOfPnts->Value (aPntIter);
-      const gp_Pnt& aEndPnt = aPntIter == anUpper ? theArrayOfPnts->Value (aLower)
-        : theArrayOfPnts->Value (aPntIter + 1);
-
+      const gp_Pnt& aStartPnt = theArrayOfPnts.Value (aPntIter);
+      const gp_Pnt& aEndPnt   = theArrayOfPnts.Value (aPntIter == anUpper ? aLower : (aPntIter + 1));
       if (hasOverlap (aStartPnt, aEndPnt))
       {
         aMatchingSegmentsNb++;
@@ -514,7 +511,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const Handle(TColgp_HAr
       return Standard_False;
 
     segmentPlaneIntersection (aPolyNorm,
-                              theArrayOfPnts->Value (theArrayOfPnts->Lower()),
+                              theArrayOfPnts.Value (theArrayOfPnts.Lower()),
                               theDepth);
   }
 
@@ -536,11 +533,8 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
 {
   if (theSensType == Select3D_TOS_BOUNDARY)
   {
-    Handle(TColgp_HArray1OfPnt) aPntsArray = new TColgp_HArray1OfPnt(1, 4);
-    aPntsArray->SetValue (1, thePnt1);
-    aPntsArray->SetValue (2, thePnt2);
-    aPntsArray->SetValue (3, thePnt3);
-    aPntsArray->SetValue (4, thePnt1);
+    const gp_Pnt aPntsArrayBuf[4] = { thePnt1, thePnt2, thePnt3, thePnt1 };
+    const TColgp_Array1OfPnt aPntsArray (aPntsArrayBuf[0], 1, 4);
     return Overlaps (aPntsArray, Select3D_TOS_BOUNDARY, theDepth);
   }
   else if (theSensType == Select3D_TOS_INTERIOR)
index 5570f4db44db810742de3516ef44965bf6925cc7..d3b2041a7a3f253159896edf178de6e762f1f99c 100644 (file)
@@ -76,9 +76,9 @@ public:
   //! SAT intersection test between defined volume and given ordered set of points,
   //! representing line segments. The test may be considered of interior part or
   //! boundary line defined by segments depending on given sensitivity type
-  virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
-                                     Select3D_TypeOfSensitivity theSensType,
-                                     Standard_Real& theDepth) Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
+                                                     Select3D_TypeOfSensitivity theSensType,
+                                                     Standard_Real& theDepth) Standard_OVERRIDE;
 
   //! Checks if line segment overlaps selecting frustum
   virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
index 64d538a538010b934d1326fe8bdbe627b43b24f5..35baa83091171c9f9ac3d4de5f94f138032a5b7a 100644 (file)
@@ -253,6 +253,25 @@ Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const Handle(TColgp
   if (myActiveSelectionType == Unknown)
     return Standard_False;
 
+  return mySelectingVolumes[myActiveSelectionType / 2]->Overlaps (theArrayOfPnts->Array1(),
+                                                                  (Select3D_TypeOfSensitivity)theSensType,
+                                                                  theDepth);
+}
+
+//=======================================================================
+// function : Overlaps
+// purpose  : SAT intersection test between defined volume and given
+//            ordered set of points, representing line segments. The test
+//            may be considered of interior part or boundary line defined
+//            by segments depending on given sensitivity type
+//=======================================================================
+Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
+                                                             Standard_Integer theSensType,
+                                                             Standard_Real& theDepth)
+{
+  if (myActiveSelectionType == Unknown)
+    return Standard_False;
+
   return mySelectingVolumes[myActiveSelectionType / 2]->Overlaps (theArrayOfPnts,
                                                                   (Select3D_TypeOfSensitivity)theSensType,
                                                                   theDepth);
index a14ba9137f8527eaa2ffce42ef840850b5ddaaa0..d0686c87b2a2bee60321dd2bdd575c523c9595a5 100644 (file)
@@ -109,6 +109,13 @@ public:
                                                      Standard_Integer theSensType,
                                                      Standard_Real& theDepth) Standard_OVERRIDE;
 
+  //! SAT intersection test between defined volume and given ordered set of points,
+  //! representing line segments. The test may be considered of interior part or
+  //! boundary line defined by segments depending on given sensitivity type
+  Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPts,
+                                                     Standard_Integer theSensType,
+                                                     Standard_Real& theDepth) Standard_OVERRIDE;
+
   //! Checks if line segment overlaps selecting frustum
   Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
                                                      const gp_Pnt& thePnt2,
index a815a484f7cc125dfa2bf7c4bb78c93d7c388b2d..bcbb9983797ecc8a36295ca738cb22cece2cbddd 100644 (file)
@@ -208,20 +208,18 @@ Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt,
 //            may be considered of interior part or boundary line defined
 //            by segments depending on given sensitivity type
 // =======================================================================
-Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
+Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
                                                         Select3D_TypeOfSensitivity theSensType,
                                                         Standard_Real& /*theDepth*/)
 {
   if (theSensType == Select3D_TOS_BOUNDARY)
   {
-    Standard_Integer aLower = theArrayOfPnts->Lower();
-    Standard_Integer anUpper = theArrayOfPnts->Upper();
-
+    const Standard_Integer aLower  = theArrayOfPnts.Lower();
+    const Standard_Integer anUpper = theArrayOfPnts.Upper();
     for (Standard_Integer aPtIdx = aLower; aPtIdx <= anUpper; ++aPtIdx)
     {
-      const gp_Pnt& aStartPt = theArrayOfPnts->Value (aPtIdx);
-      const gp_Pnt& aEndPt = aPtIdx == anUpper ? theArrayOfPnts->Value (aLower) : theArrayOfPnts->Value (aPtIdx + 1);
-
+      const gp_Pnt& aStartPt = theArrayOfPnts.Value (aPtIdx);
+      const gp_Pnt& aEndPt   = theArrayOfPnts.Value (aPtIdx == anUpper ? aLower : (aPtIdx + 1));
       if (!hasOverlap (aStartPt, aEndPt))
       {
         return Standard_False;
@@ -263,11 +261,9 @@ Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt1,
 {
   if (theSensType == Select3D_TOS_BOUNDARY)
   {
-    Handle(TColgp_HArray1OfPnt) aPtsArray = new TColgp_HArray1OfPnt(1, 4);
-    aPtsArray->SetValue (1, thePnt1);
-    aPtsArray->SetValue (2, thePnt2);
-    aPtsArray->SetValue (3, thePnt3);
-    return Overlaps (aPtsArray, Select3D_TOS_BOUNDARY, theDepth);
+    const gp_Pnt aPntsArrayBuf[3] = { thePnt1, thePnt2, thePnt3 };
+    const TColgp_Array1OfPnt aPntsArray (aPntsArrayBuf[0], 1, 3);
+    return Overlaps (aPntsArray, Select3D_TOS_BOUNDARY, theDepth);
   }
   else if (theSensType == Select3D_TOS_INTERIOR)
   {
index e9ced7eb677447becbe082355a7b95ea74609685..322501451b6f7917a7749813b9e7947de051ef36 100644 (file)
@@ -63,9 +63,9 @@ public:
   //! SAT intersection test between defined volume and given ordered set of points,
   //! representing line segments. The test may be considered of interior part or
   //! boundary line defined by segments depending on given sensitivity type
-  virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
-                                     Select3D_TypeOfSensitivity theSensType,
-                                     Standard_Real& theDepth) Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
+                                                     Select3D_TypeOfSensitivity theSensType,
+                                                     Standard_Real& theDepth) Standard_OVERRIDE;
 
   //! Checks if line segment overlaps selecting frustum
   virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
index dacf33badff3b87cf8d44945d674b45a2dac7830..f1ea2722509dcfe40eb9bf9f303fe740e455409e 100644 (file)
@@ -179,7 +179,7 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt,
 // function : Overlaps
 // purpose  :
 // =======================================================================
-Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
+Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const TColgp_Array1OfPnt& theArrayOfPts,
                                                            Select3D_TypeOfSensitivity theSensType,
                                                            Standard_Real& theDepth)
 {
index 6b7b97805c2d346d63a835f991770dca9ca11cb6..2a7e02bdbeadb8906a4872c64d980fc054ae58b9 100644 (file)
@@ -62,9 +62,9 @@ public:
   virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt,
                                      Standard_Real& theDepth) Standard_OVERRIDE;
 
-  virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
-                                     Select3D_TypeOfSensitivity theSensType,
-                                     Standard_Real& theDepth) Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
+                                                     Select3D_TypeOfSensitivity theSensType,
+                                                     Standard_Real& theDepth) Standard_OVERRIDE;
 
   virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
                                      const gp_Pnt& thePnt2,
index b4a381b0b7fed3748c596d2b3f3055bf95d72a38..d788dd5d0fde974660d2277caf5067407807d3f2 100644 (file)
@@ -152,9 +152,8 @@ is
        -- computed for the faces which have none. If it is false,
        -- sensitive entities on these faces will be calculated.
 
-    preBuildBVH (myclass;
-                 theSelection : Selection from SelectMgr)
-        is private;
+    PreBuildBVH (myclass;
+                 theSelection : Selection from SelectMgr);
         ---Level: Internal
         ---Purpose: Traverses the selection given and pre-builds BVH trees for heavyweight
         -- sensitive entities containing more than BVH_PRIMITIVE_LIMIT (defined in .cxx file)
index 96e1d6370a44f8caad82ae252cbd65bbbf619e11..0e58ae07742653fe16d0db8f5e30f7a3d0575be1 100644 (file)
 #define BVH_PRIMITIVE_LIMIT 800000
 
 //==================================================
-// function: preBuildBVH
+// function: PreBuildBVH
 // purpose : Pre-builds BVH tree for heavyweight
 //           sensitive entities with sub-elements
 //           amount more than BVH_PRIMITIVE_LIMIT
 //==================================================
-void StdSelect_BRepSelectionTool::preBuildBVH (const Handle(SelectMgr_Selection)& theSelection)
+void StdSelect_BRepSelectionTool::PreBuildBVH (const Handle(SelectMgr_Selection)& theSelection)
 {
   for (theSelection->Init(); theSelection->More(); theSelection->Next())
   {
@@ -193,7 +193,7 @@ void StdSelect_BRepSelectionTool
     anOwner->Set (theSelectableObj);
   }
 
-  preBuildBVH (theSelection);
+  PreBuildBVH (theSelection);
 }
 
 //==================================================