]> OCCT Git - occt-copy.git/commitdiff
0031322: Visualization, Select3D_SensitiveEntity - method NbSubElements() should...
authornds <nds@opencascade.com>
Thu, 30 Jan 2020 07:47:55 +0000 (10:47 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 30 Jan 2020 15:58:32 +0000 (18:58 +0300)
Set constant state for the method NbSubElement to be able to call it from other constant methods (e.g. DumpJson of Select3D_SensitiveEntity).

31 files changed:
dox/dev_guides/upgrade/upgrade.md
src/MeshVS/MeshVS_CommonSensitiveEntity.cxx
src/MeshVS/MeshVS_CommonSensitiveEntity.hxx
src/MeshVS/MeshVS_DummySensitiveEntity.cxx
src/MeshVS/MeshVS_DummySensitiveEntity.hxx
src/MeshVS/MeshVS_SensitiveMesh.cxx
src/MeshVS/MeshVS_SensitiveMesh.hxx
src/MeshVS/MeshVS_SensitivePolyhedron.cxx
src/MeshVS/MeshVS_SensitivePolyhedron.hxx
src/MeshVS/MeshVS_SensitiveQuad.hxx
src/Select3D/Select3D_InteriorSensitivePointSet.cxx
src/Select3D/Select3D_InteriorSensitivePointSet.hxx
src/Select3D/Select3D_SensitiveBox.cxx
src/Select3D/Select3D_SensitiveBox.hxx
src/Select3D/Select3D_SensitiveEntity.hxx
src/Select3D/Select3D_SensitiveFace.cxx
src/Select3D/Select3D_SensitiveFace.hxx
src/Select3D/Select3D_SensitiveGroup.cxx
src/Select3D/Select3D_SensitiveGroup.hxx
src/Select3D/Select3D_SensitivePoint.cxx
src/Select3D/Select3D_SensitivePoint.hxx
src/Select3D/Select3D_SensitivePoly.cxx
src/Select3D/Select3D_SensitivePoly.hxx
src/Select3D/Select3D_SensitivePrimitiveArray.hxx
src/Select3D/Select3D_SensitiveSegment.cxx
src/Select3D/Select3D_SensitiveSegment.hxx
src/Select3D/Select3D_SensitiveTriangle.hxx
src/Select3D/Select3D_SensitiveTriangulation.cxx
src/Select3D/Select3D_SensitiveTriangulation.hxx
src/Select3D/Select3D_SensitiveWire.cxx
src/Select3D/Select3D_SensitiveWire.hxx

index 35df92f7561122611cd4659cff7885b855f3e693..2ee0ba2615c68808e3ee4dc04ef8895dd8bb2521 100644 (file)
@@ -1888,3 +1888,7 @@ Unexpected const-ness of Aspect_Window::DoResize() method has been removed, so t
 @subsection upgrade_750_rename Renaming of types
 
 Enumeration BRepOffset_Type is renamed to ChFiDS_TypeOfConcavity.
+
+@subsection upgrade_750_sensitiveEntity Select3D_SensitiveEntity interface change
+
+The method Select3D_SensitiveEntity::NbSubElements() has been changed to be constant. Select3D_SensitiveEntity subclasses at application level should be updated accordingly.
index c0165fc44f2e19afa6116efa3a23c51fc1e4b777..01ea125b7e35ceaa2c8bc2a36c5348f2225aa453 100644 (file)
@@ -118,7 +118,7 @@ MeshVS_CommonSensitiveEntity::~MeshVS_CommonSensitiveEntity()
 //function : NbSubElements
 //purpose  :
 //=======================================================================
-Standard_Integer MeshVS_CommonSensitiveEntity::NbSubElements()
+Standard_Integer MeshVS_CommonSensitiveEntity::NbSubElements() const
 {
   return myItemIndexes.Size();
 }
index fd87f9e08f8962f568feb646a2200b163731c9c7..21dca5ea0bee9e3e2e01b280607e9b55d78bff37 100644 (file)
@@ -36,7 +36,7 @@ public:
   Standard_EXPORT virtual ~MeshVS_CommonSensitiveEntity();
 
   //! Number of elements.
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   //! Returns the amount of sub-entities of the complex entity
   Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE;
index b02f25a99a2f76edc08d9f4e3b103cd3954c6307..ed8b9749e9121066e729476e21c1efcdce71bb8b 100644 (file)
@@ -29,7 +29,7 @@ MeshVS_DummySensitiveEntity::MeshVS_DummySensitiveEntity (const Handle(SelectMgr
 // Function : NbSubElements
 // Purpose  :
 //================================================================
-Standard_Integer MeshVS_DummySensitiveEntity::NbSubElements()
+Standard_Integer MeshVS_DummySensitiveEntity::NbSubElements() const
 {
   return -1;
 }
index 729cad77a9ab9f395289cd888e54ae4116e503c3..049e5f41bd0bf81ed77c88b79a5e2130e71cd3c7 100644 (file)
@@ -36,7 +36,7 @@ public:
   Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
                                                     SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
 
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
 
index 3feb84de21133050ae8aad516983f3ed629c7b51..b5bfed934ab7e7e5a6f57d10a85901ac2cd80c61 100644 (file)
@@ -77,7 +77,7 @@ Handle(Select3D_SensitiveEntity) MeshVS_SensitiveMesh::GetConnected()
 // function : NbSubElements
 // purpose  : Returns the amount of mesh nodes
 //=======================================================================
-Standard_Integer MeshVS_SensitiveMesh::NbSubElements()
+Standard_Integer MeshVS_SensitiveMesh::NbSubElements() const
 {
   Handle(MeshVS_MeshOwner) anOwner = Handle(MeshVS_MeshOwner)::DownCast (OwnerId());
   if (anOwner.IsNull())
index c24ec2aedd4f8812296c71b14022cbc5167cc8b5..3bedd055706b14e8bcf598d72dc4b9502c95e92d 100644 (file)
@@ -48,7 +48,7 @@ public:
   }
 
   //! Returns the amount of mesh nodes
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   //! Returns bounding box of mesh
   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
index f367406f2da06d38ba1b21f42da20a83b9710789..d64f3224497f2ea7d5707681382c0f94644717f9 100644 (file)
@@ -104,7 +104,7 @@ Standard_Boolean MeshVS_SensitivePolyhedron::Matches (SelectBasics_SelectingVolu
 // function : NbSubElements
 // purpose  : Returns the amount of nodes of polyhedron
 //=======================================================================
-Standard_Integer MeshVS_SensitivePolyhedron::NbSubElements()
+Standard_Integer MeshVS_SensitivePolyhedron::NbSubElements() const
 {
   return myNodes->Length();
 }
index 0aac9ccd0c506c6366defd4b7f6a9c9392a805cc..2283b6d1ebc110533eed89937ae62d309db3d6b8 100644 (file)
@@ -55,7 +55,7 @@ public:
                                                     SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
 
   //! Returns the amount of nodes of polyhedron
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
 
index 07cbf3d7c0c292460b5486de2a76a6deb7ca25e0..d4306f669371d418fc6e0b9fead9b43f08048c45 100644 (file)
@@ -38,7 +38,7 @@ public:
                                         const gp_Pnt& thePnt4);
 
   //! Returns the amount of sub-entities in sensitive
-  virtual Standard_Integer NbSubElements() Standard_OVERRIDE
+  virtual Standard_Integer NbSubElements() const Standard_OVERRIDE
   {
     return 1;
   };
index bc7d0a9edf7ff7cb8799e03f8aad9a7221703e15..80640779bdc028b994473b25c93a3166a70ce564 100644 (file)
@@ -319,7 +319,7 @@ gp_Pnt Select3D_InteriorSensitivePointSet::CenterOfGeometry() const
 // function : NbSubElements
 // purpose  : Returns the amount of points in set
 //=======================================================================
-Standard_Integer Select3D_InteriorSensitivePointSet::NbSubElements()
+Standard_Integer Select3D_InteriorSensitivePointSet::NbSubElements() const
 {
   return myPlanarPolygons.Length();
 }
index b9c7d658f2e03f742629e7b03f7dd820aee5bc6b..614fce9ca0e840a571ba6bd0780b8efb9bc387a6 100644 (file)
@@ -68,7 +68,7 @@ public:
   Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
 
   //! Returns the amount of points in set
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   DEFINE_STANDARD_RTTIEXT(Select3D_InteriorSensitivePointSet,Select3D_SensitiveSet)
 
index d5f169599bfd7acf2dd893f0f146f722c8dce970..989e127fe20128c4713820ed6bf9e1011ba87849 100644 (file)
@@ -59,7 +59,7 @@ Select3D_SensitiveBox::Select3D_SensitiveBox (const Handle(SelectMgr_EntityOwner
 // function : NbSubElements
 // purpose  : Returns the amount of sub-entities in sensitive
 //=======================================================================
-Standard_Integer Select3D_SensitiveBox::NbSubElements()
+Standard_Integer Select3D_SensitiveBox::NbSubElements() const
 {
   return 1;
 }
index 06f91d02c67f86e96687c8ee08abdf1542652939..c2a578d5ed1650094c0d02bbedd0811b39a9a84a 100644 (file)
@@ -45,7 +45,7 @@ public:
                                          const Standard_Real theZMax);
 
   //! Returns the amount of sub-entities in sensitive
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
 
index 506acd516690ac56866e26f80488f9922302548b..b19cd5dfca1f8c0223964952501f1d5f3b560572 100644 (file)
@@ -70,7 +70,7 @@ public:
   //! Returns the number of sub-entities or elements in sensitive entity.
   //! Is used to determine if entity is complex and needs to pre-build BVH at the creation of sensitive entity step
   //! or is light-weighted so the tree can be build on demand with unnoticeable delay.
-  virtual Standard_Integer NbSubElements() = 0;
+  virtual Standard_Integer NbSubElements() const = 0;
 
   //! Returns bounding box of a sensitive with transformation applied
   virtual Select3D_BndBox3d BoundingBox() = 0;
index 0ae25aed5b640e8794748c5cdd5363b4c93901ad..710a6546a07a799b9aff3724eaa4e3875e7a89dc 100644 (file)
@@ -139,7 +139,7 @@ gp_Pnt Select3D_SensitiveFace::CenterOfGeometry() const
 // purpose  : Returns the amount of sub-entities (points or planar convex
 //            polygons)
 //=======================================================================
-Standard_Integer Select3D_SensitiveFace::NbSubElements()
+Standard_Integer Select3D_SensitiveFace::NbSubElements() const
 {
   return myFacePoints->NbSubElements();
 }
index 5567c9f07a2815522d3e71a1240a86855ad57366..b4075425ec805f27ace09af56e1c60ca397c4304 100644 (file)
@@ -71,7 +71,7 @@ public:
   Standard_EXPORT virtual void BVH() Standard_OVERRIDE;
 
   //! Returns the amount of sub-entities (points or planar convex polygons)
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
 private:
 
index d01499d6c3f29ab2c3eb4799e187bc739ad4c6e6..85fce6b7cecf212b9ce21f59daa6634d7f3334c8 100644 (file)
@@ -164,7 +164,7 @@ void Select3D_SensitiveGroup::Clear()
 // function : NbSubElements
 // purpose  : Returns the amount of sub-entities
 //=======================================================================
-Standard_Integer Select3D_SensitiveGroup::NbSubElements()
+Standard_Integer Select3D_SensitiveGroup::NbSubElements() const
 {
   return myEntities.Size();
 }
index 37efcf6cb0727041a3aa87cd302cbeac872b438b..a2194af278ef64df8f3c134e79dbfa624876fbeb 100644 (file)
@@ -113,7 +113,7 @@ public:
                                                     SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
 
   //! Returns the amount of sub-entities
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
 
index 39bca11760e908d2148e66007e106ec2168d2a6c..a486c7560ceaf33dbd8e411952687c4a80ddc0f5 100644 (file)
@@ -81,7 +81,7 @@ Select3D_BndBox3d Select3D_SensitivePoint::BoundingBox()
 // function : NbSubElements
 // purpose  : Returns the amount of sub-entities in sensitive
 //=======================================================================
-Standard_Integer Select3D_SensitivePoint::NbSubElements()
+Standard_Integer Select3D_SensitivePoint::NbSubElements() const
 {
   return 1;
 }
index a8c6e8c249d6d97904699b5fb5f927b74494c6df..8a451b0cda3ad4f61192034b293be3623b6cd04e 100644 (file)
@@ -31,7 +31,7 @@ public:
   Standard_EXPORT Select3D_SensitivePoint (const Handle(SelectMgr_EntityOwner)& theOwnerId, const gp_Pnt& thePoint);
 
   //! Returns the amount of sub-entities in sensitive
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
 
index 61a02bf94bed4a1ecb0f1e02a0d94ab641b090a1..df133efa752e0c6ced2b075751c2f24724eeecec 100644 (file)
@@ -284,7 +284,7 @@ Standard_Real Select3D_SensitivePoly::distanceToCOG (SelectBasics_SelectingVolum
 // Function: NbSubElements
 // Purpose : Returns the amount of segments in poly
 //==================================================
-Standard_Integer Select3D_SensitivePoly::NbSubElements()
+Standard_Integer Select3D_SensitivePoly::NbSubElements() const
 {
   return myPolyg.Size();
 }
index e530093d114d9f9b2fa6a86a12214d751353017c..a035d9b4e12fb321311785192b240cde3e0369d1 100644 (file)
@@ -56,7 +56,7 @@ public:
                                           const Standard_Integer theNbPnts = 6);
 
   //! Returns the amount of segments in poly
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   //! Returns the 3D points of the array used at construction time.
   void Points3D (Handle(TColgp_HArray1OfPnt)& theHArrayOfPnt)
index f579d7dc7a51320baa10d4cedd39586c928f13e6..ebeb913b0d26fbfc98e8b51725548480fe8c3ed4 100644 (file)
@@ -209,7 +209,7 @@ public:
   Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE;
 
   //! Returns the amount of nodes in triangulation
-  virtual Standard_Integer NbSubElements() Standard_OVERRIDE
+  virtual Standard_Integer NbSubElements() const Standard_OVERRIDE
   {
     return !myGroups.IsNull() ? myGroups->Size() : myBvhIndices.NbElements;
   }
index 8d51376315a9d9bd7da7523c246c8761f62fd7de..b43b271e532fd19ab79149a3527ce292527f156b 100644 (file)
@@ -98,7 +98,7 @@ Select3D_BndBox3d Select3D_SensitiveSegment::BoundingBox()
 // function : NbSubElements
 // purpose  : Returns the amount of points
 //=======================================================================
-Standard_Integer Select3D_SensitiveSegment::NbSubElements()
+Standard_Integer Select3D_SensitiveSegment::NbSubElements() const
 {
   return 2;
 }
index 3aefcca48fa254aa9e300bb12a2affdc283dfc77..81dfe78ffd5ca9cc34f89a145640e609adafcece 100644 (file)
@@ -46,7 +46,7 @@ public:
   const gp_Pnt& EndPoint() const { return myEnd; }
 
   //! Returns the amount of points
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
 
index a9e04da0302ba2719a33efc8eb4f21b54fdc09d5..bfcd84848f91764bc14c94325096d7895ec6ce44 100644 (file)
@@ -63,7 +63,7 @@ public:
   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
 
   //! Returns the amount of points
-  virtual Standard_Integer NbSubElements() Standard_OVERRIDE { return 3; }
+  virtual Standard_Integer NbSubElements() const Standard_OVERRIDE { return 3; }
 
   virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE { return myCentroid; }
 
index 859019a73935d0c4f872818db6947bd02b611955..284ad200fd7f4a538d026703d67514d3855d0d2e 100644 (file)
@@ -421,7 +421,7 @@ gp_Pnt Select3D_SensitiveTriangulation::CenterOfGeometry() const
 // function : NbSubElements
 // purpose  : Returns the amount of nodes in triangulation
 //=======================================================================
-Standard_Integer Select3D_SensitiveTriangulation::NbSubElements()
+Standard_Integer Select3D_SensitiveTriangulation::NbSubElements() const
 {
   return myTriangul->Nodes().Length();
 }
index 2d384f344d5c39e8ac524eab29c68a114e9e1b70..7232978926d9afbda3c38b4dd7383bd223038f12 100644 (file)
@@ -55,7 +55,7 @@ public:
                                                    const Standard_Boolean theIsInterior);
 
   //! Returns the amount of nodes in triangulation
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
 
index 6f0128b3e5434b880a6d080e94cbe01f6944e166..f902f0318b6e5a2b29020e72dabae853c9bf0d86 100644 (file)
@@ -54,7 +54,7 @@ void Select3D_SensitiveWire::Add (const Handle(Select3D_SensitiveEntity)& theSen
 // function : NbSubElements
 // purpose  : Returns the amount of sub-entities
 //=======================================================================
-Standard_Integer Select3D_SensitiveWire::NbSubElements()
+Standard_Integer Select3D_SensitiveWire::NbSubElements() const
 {
   return myEntities.Length();
 }
index 3b4f76e95a4cc3e03689a31180f5407de54e2700..539330f54d37f8a18638bc7959e0cce7d0b355ad 100644 (file)
@@ -33,7 +33,7 @@ public:
   Standard_EXPORT void Add (const Handle(Select3D_SensitiveEntity)& theSensitive);
 
   //! Returns the amount of sub-entities
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;