]> OCCT Git - occt-copy.git/commitdiff
0025076: Hidden overloaded virtual functions
authorabv <abv@opencascade.com>
Tue, 29 Dec 2015 04:07:17 +0000 (07:07 +0300)
committerabv <abv@opencascade.com>
Fri, 8 Jan 2016 17:05:10 +0000 (20:05 +0300)
Implementation of virtual functions is made more consistent in places where warning was issued:

- Missing implementation of virtual method Closed() added in classes inheriting Intf_Polygon2d
- Empty implementation of virtual method Read() accepting stream is moved from PCDM_RetrievalDriver to StdLDrivers_DocumentRetrievalDriver
- Method BRepFill::Delete() is renamed to DeleteProfile() to avoid confusion with method Delete() inherited from MMgt_TShared
- Virtual method AIS_Dimenaion::ComputePlane() is removed from base class; each dimension defines and uses its own method with the same name (but different arguments)
- Inherited virtual method Dump() with single argument in class XCAFDoc_ShapeTool is now defined as short-cut to own method Dump(), also calling parent's one
- Inherited virtual method BoundingBox(void) is made visible in AIS_Shape
- Inherited virtual method Box(void) is made visible in classes inheriting BVH_PrimitiveSet

20 files changed:
src/AIS/AIS_AngleDimension.hxx
src/AIS/AIS_DiameterDimension.hxx
src/AIS/AIS_Dimension.hxx
src/AIS/AIS_RadiusDimension.hxx
src/AIS/AIS_Shape.hxx
src/BRepExtrema/BRepExtrema_TriangleSet.hxx
src/BRepFill/BRepFill_PipeShell.cxx
src/BRepFill/BRepFill_PipeShell.hxx
src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx
src/Geom2dInt/Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx
src/HLRBRep/HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx
src/PCDM/PCDM_RetrievalDriver.cxx
src/PCDM/PCDM_RetrievalDriver.hxx
src/Select3D/Select3D_BVHPrimitiveContent.hxx
src/SelectMgr/SelectMgr_SelectableObjectSet.hxx
src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx
src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx
src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.hxx
src/XCAFDoc/XCAFDoc_ShapeTool.cxx
src/XCAFDoc/XCAFDoc_ShapeTool.hxx

index 3e2278c27e512ebb818584dda98e924dd6dc647c..bc1b7b5682ab5f9c13713cf9c75c391deb7074be 100755 (executable)
@@ -289,7 +289,7 @@ protected:
 
 protected:
 
-  Standard_EXPORT virtual void ComputePlane() Standard_OVERRIDE;
+  Standard_EXPORT virtual void ComputePlane();
 
   //! Checks if the plane includes three angle points to build dimension.
   Standard_EXPORT virtual Standard_Boolean CheckPlane (const gp_Pln& thePlane) const Standard_OVERRIDE;
index 6c8dcac05085a0f03c2211bc50121ce56b845db4..0217edb23b9fe07d82ae7a87eae7dddad1dd0f5b 100644 (file)
@@ -143,7 +143,7 @@ protected:
   //! 2) The plane should inclide th ecircle center to be valid.
   Standard_EXPORT virtual void ComputeAnchorPoint();
 
-  Standard_EXPORT virtual void ComputePlane() Standard_OVERRIDE;
+  Standard_EXPORT virtual void ComputePlane();
 
   //! Checks if the center of the circle is on the plane.
   Standard_EXPORT virtual Standard_Boolean CheckPlane (const gp_Pln& thePlane) const Standard_OVERRIDE;
index 15c6f00c6c42c3ead380c9506a3831fdd3745593..bc70fc43ccf024e3a12a22fce4204f7a9f93d5a3 100755 (executable)
@@ -549,10 +549,6 @@ protected: //! @name Static auxilliary methods for geometry extraction
 
 protected: //! @name Behavior to implement
 
-  //! Override this method to compute automatically dimension plane
-  //! in which the dimension presentation is built.
-  virtual void ComputePlane() { }
-
   //! Override this method to check if user-defined plane
   //! is valid for the dimension geometry.
   //! @param thePlane [in] the working plane for positioning every
index 913aa08ba584867f11f7b768a2c176e6c2593674..1cfbe9f70ea3a6c3275535e230c7f928c09e7f1e 100644 (file)
@@ -122,7 +122,7 @@ public:
 
 protected:
 
-  Standard_EXPORT virtual void ComputePlane() Standard_OVERRIDE;
+  Standard_EXPORT virtual void ComputePlane();
 
   //! Checks if anchor point and the center of the circle are on the plane.
   Standard_EXPORT virtual Standard_Boolean CheckPlane (const gp_Pln& thePlane) const Standard_OVERRIDE;
index 9fdf9212a46af9fa8e8f4dad18af9acbdb67704f..0c355e265bda5fbbb75c57f696f3b8728fcbe17d 100644 (file)
@@ -205,6 +205,10 @@ public:
   //! compound topological shapes for presentation.
   Standard_EXPORT virtual const Bnd_Box& BoundingBox();
   
+  //! AIS_InteractiveObject defines another virtual method BoundingBox,
+  //! which is not the same as above; keep it visible.
+  using AIS_InteractiveObject::BoundingBox;
+
   //! Returns the NameOfColor attributes of the shape accordingly to
   //! the current facing model;
   Standard_EXPORT virtual Quantity_NameOfColor Color() const Standard_OVERRIDE;
index 22e08325396d12f7345c28445a17ec5a1f66c895..8a5a06595106a3fc694f7e03be44792bc3e1dce1 100644 (file)
@@ -44,6 +44,9 @@ public: //! @name methods implementing BVH set interface
   //! Returns AABB of the given triangle.
   BVH_Box<Standard_Real, 3> Box (const Standard_Integer theIndex) const Standard_OVERRIDE;
 
+  //! Make inherited method Box() visible to avoid CLang warning
+  using BVH_PrimitiveSet::Box;
+
   //! Returns centroid position along specified axis.
   Standard_Real Center (const Standard_Integer theIndex, const Standard_Integer theAxis) const Standard_OVERRIDE;
 
index 8592178b07324f6dfed680789a62e2aba8272d9d..553664d64d565dbc515cab914bd85598b00d2bbb 100644 (file)
@@ -473,7 +473,7 @@ void BRepFill_PipeShell::SetForceApproxC1(const Standard_Boolean ForceApproxC1)
                              const Standard_Boolean WithContact,
                              const Standard_Boolean WithCorrection) 
 {
- Delete(Profile); // No duplication
+ DeleteProfile(Profile); // No duplication
  if (myIsAutomaticLaw)
  {
    mySeq.Clear();
@@ -582,7 +582,7 @@ void BRepFill_PipeShell::SetForceApproxC1(const Standard_Boolean ForceApproxC1)
 //function : Delete
 //purpose  : Delete a section
 //=======================================================================
- void BRepFill_PipeShell::Delete(const TopoDS_Shape&  Profile)
+ void BRepFill_PipeShell::DeleteProfile(const TopoDS_Shape&  Profile)
 {
   Standard_Boolean isVertex = (Profile.ShapeType() == TopAbs_VERTEX);
 
index 6c784a2936f848612e226509d1791fda154f0ef8..342f013200979d8192af755cbb905d1996e8f2c9 100644 (file)
@@ -146,7 +146,7 @@ public:
   Standard_EXPORT void SetLaw (const TopoDS_Shape& Profile, const Handle(Law_Function)& L, const TopoDS_Vertex& Location, const Standard_Boolean WithContact = Standard_False, const Standard_Boolean WithCorrection = Standard_False);
   
   //! Delete an section.
-  Standard_EXPORT void Delete (const TopoDS_Shape& Profile);
+  Standard_EXPORT void DeleteProfile (const TopoDS_Shape& Profile);
   
   //! Say if <me> is ready to build the shape
   //! return False if <me> do not have section definition
index 33458180043add2682ef7ded55a5afe66cc23fce..35ef49057de9a5b3ebf8fc6fe4568e1ede5a10da 100644 (file)
@@ -153,7 +153,7 @@ BRepOffsetAPI_MakePipeShell::BRepOffsetAPI_MakePipeShell(const TopoDS_Wire& Spin
 
 void BRepOffsetAPI_MakePipeShell::Delete( const TopoDS_Shape& Profile)
 {
-  myPipe->Delete(Profile);
+  myPipe->DeleteProfile(Profile);
 }
 
 
index 09aa5abf8bb043c845c25c716c890e5443ebc2c2..8dcaffc205d1a541f594f7d76b86c6879e3b1ea8 100644 (file)
@@ -60,6 +60,9 @@ public:
   
     void Closed (const Standard_Boolean clos);
   
+  //! Returns True if the polyline is closed.
+    virtual Standard_Boolean Closed () const Standard_OVERRIDE { return ClosedPolygon; }
+  
   //! Give the number of Segments in the polyline.
     virtual Standard_Integer NbSegments() const Standard_OVERRIDE;
   
index c9f1cc5d3b08c5c45ab8fd4bc2884da97fb54eca..76d98d16ed1153c5691cf4d06364adede92602b1 100644 (file)
@@ -60,6 +60,9 @@ public:
   
     void Closed (const Standard_Boolean clos);
   
+  //! Returns True if the polyline is closed.
+    virtual Standard_Boolean Closed () const Standard_OVERRIDE { return ClosedPolygon; }
+  
   //! Give the number of Segments in the polyline.
     virtual Standard_Integer NbSegments() const Standard_OVERRIDE;
   
index 15edbd5653a68e0ccfd88801295986faab08293b..5f5c413f9e59805e59d0cb44dccd39a71028e14a 100644 (file)
 
 IMPLEMENT_STANDARD_RTTIEXT(PCDM_RetrievalDriver,PCDM_Reader)
 
-//=======================================================================
-//function : Read
-//purpose  : 
-//=======================================================================
-void PCDM_RetrievalDriver::Read(Standard_IStream&               /*theIStream*/,
-                                const Handle(Storage_Data)&     /*theStorageData*/,
-                                const Handle(CDM_Document)&     /*theDoc*/,
-                                const Handle(CDM_Application)&  /*theApplication*/)
-{
-  
-}
-
 void PCDM_RetrievalDriver::References(const TCollection_ExtendedString& aFileName, PCDM_SequenceOfReference& theReferences, const Handle(CDM_MessageDriver)& theMsgDriver)
   { PCDM_ReadWriter::Reader(aFileName)->ReadReferences(aFileName, theReferences, theMsgDriver);}
 
index 9cdf056a1b98155375db2a7e8f569475e7b4a6fb..09d898bccdce51494444bc1ed196eee2b8df1f6a 100644 (file)
@@ -45,11 +45,6 @@ public:
     const TCollection_ExtendedString& theFileName,
     const Handle(CDM_MessageDriver)&  theMsgDriver);
 
-  Standard_EXPORT virtual void Read (Standard_IStream&              theIStream,
-                                     const Handle(Storage_Data)&    theStorageData,
-                                     const Handle(CDM_Document)&    theDoc,
-                                     const Handle(CDM_Application)& theApplication) Standard_OVERRIDE;
-
   Standard_EXPORT void SetFormat (const TCollection_ExtendedString& aformat);
 
   Standard_EXPORT TCollection_ExtendedString GetFormat() const;
index 2296f4486001894d44d2c6068b2799d7d4c36b09..8aeef9d9baff30e58fb1746af784626637f15dc5 100644 (file)
@@ -38,6 +38,9 @@ public:
   //! Returns bounding box of sensitive with index theIdx
   Standard_EXPORT virtual Select3D_BndBox3d Box (const Standard_Integer theIdx) const Standard_OVERRIDE;
 
+  //! Make inherited method Box() visible to avoid CLang warning
+  using BVH_PrimitiveSet::Box;
+
   //! Returns center of sensitive with index theIdx in the set along the
   //! given axis theAxis
   Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIdx,
index 210edfdb32b87c8f596c43186d6dab4300d2a7ba..da4648ab0ff93e055c0408ce8bc21d2bd2edeedd 100644 (file)
@@ -49,6 +49,9 @@ public:
   //! Returns bounding box of object with index theIndex
   Standard_EXPORT virtual Select3D_BndBox3d Box (const Standard_Integer theIndex) const Standard_OVERRIDE;
 
+  //! Make inherited method Box() visible to avoid CLang warning
+  using BVH_PrimitiveSet::Box;
+
   //! Returns center of object with index theIndex in the set
   //! along the given axis theAxis
   Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIndex,
index e170848a273352ada2968b979d749f34fc683e59..a5fbd8109140c7a4bf8367d389ca9a0e699d2b1f 100644 (file)
@@ -53,6 +53,9 @@ public:
   //! Returns bounding box of entity with index theIdx
   Standard_EXPORT virtual Select3D_BndBox3d Box (const Standard_Integer theIndex) const Standard_OVERRIDE;
 
+  //! Make inherited method Box() visible to avoid CLang warning
+  using BVH_PrimitiveSet::Box;
+
   //! Returns geometry center of sensitive entity index theIdx
   //! along the given axis theAxis
   Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIndex,
index d93e00d1c5e59082bf46e06ca8d92f74d2ce2f6d..05ce4ef2c35716b00dc4b02ce14667afccc11b54 100644 (file)
@@ -30,6 +30,7 @@
 #include <PCDM_ReadWriter.hxx>
 
 #include <Standard_ErrorHandler.hxx>
+#include <Standard_NotImplemented.hxx>
 #include <NCollection_Array1.hxx>
 #include <TDocStd_Document.hxx>
 
@@ -245,6 +246,19 @@ void StdLDrivers_DocumentRetrievalDriver::Read (const TCollection_ExtendedString
   theNewDocument->SetComments (hData.Comments());
 }
 
+//=======================================================================
+//function : Read
+//purpose  : not implemented
+//=======================================================================
+
+void StdLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&               /*theIStream*/,
+                                                const Handle(Storage_Data)&     /*theStorageData*/,
+                                                const Handle(CDM_Document)&     /*theDoc*/,
+                                                const Handle(CDM_Application)&  /*theApplication*/)
+{
+  Standard_NotImplemented::Raise ("Reading from stream is not supported by StdLDrivers_DocumentRetrievalDriver");
+}
+
 //=======================================================================
 //function : RaiseOnStorageError
 //purpose  : Update the reader status and raise an exception
index 4661fdd58d33bdc1b89657e0f61dfbacd8cc4cdc..c5af92acffa5459d30c7651e3be60b2d595c7614 100644 (file)
@@ -31,6 +31,12 @@ public:
                                      const Handle(CDM_Document)&       theNewDocument,
                                      const Handle(CDM_Application)&    theApplication) Standard_OVERRIDE;
 
+  //! Override pure virtual method (raises exception Standard_NotImplemented) 
+  Standard_EXPORT virtual void Read (Standard_IStream&              theIStream,
+                                     const Handle(Storage_Data)&    theStorageData,
+                                     const Handle(CDM_Document)&    theDoc,
+                                     const Handle(CDM_Application)& theApplication) Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTIEXT (StdLDrivers_DocumentRetrievalDriver, PCDM_RetrievalDriver)
 
 private:
index 3a1d416befcbd9d56500f97382fdebab570bdf7c..7949f6580cead67d59c2acd8bd1ed7d7ae86c705 100644 (file)
@@ -1282,7 +1282,7 @@ static void DumpAssembly(Standard_OStream& theDumpLog,
 //purpose  : 
 //=======================================================================
 
-void XCAFDoc_ShapeTool::Dump(Standard_OStream& theDumpLog, const Standard_Boolean deep) const
+Standard_OStream& XCAFDoc_ShapeTool::Dump(Standard_OStream& theDumpLog, const Standard_Boolean deep) const
 {
   Standard_Integer level = 0;
 //   TopTools_SequenceOfShape SeqShapes;
@@ -1302,6 +1302,19 @@ void XCAFDoc_ShapeTool::Dump(Standard_OStream& theDumpLog, const Standard_Boolea
     DumpShape(theDumpLog, SeqLabels.Value(i), level, deep);
     theDumpLog<<endl;
   }
+  return theDumpLog;
+}
+
+//=======================================================================
+//function : Dump
+//purpose  : override
+//=======================================================================
+
+Standard_OStream& XCAFDoc_ShapeTool::Dump(Standard_OStream& theDumpLog) const
+{
+  TDF_Attribute::Dump (theDumpLog);
+  Dump (theDumpLog, Standard_False);
+  return theDumpLog;
 }
 
 //=======================================================================
index 2df9b87c943fb1387866985c1711165701d9e9eb..c1f7c9dc6b9f8d91d6716c2a84094451bed728d5 100644 (file)
@@ -322,8 +322,10 @@ public:
   //! returns the label under which shapes are stored
   Standard_EXPORT TDF_Label BaseLabel() const;
   
-  Standard_EXPORT void Dump (Standard_OStream& theDumpLog, const Standard_Boolean deep = Standard_False) const;
-  
+  Standard_EXPORT Standard_OStream& Dump (Standard_OStream& theDumpLog, const Standard_Boolean deep) const;
+
+  Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& theDumpLog) const Standard_OVERRIDE;
+
   //! Print to ostream <theDumpLog> type of shape found on <L> label
   //! and the entry of <L>, with <level> tabs before.
   //! If <deep>, print also TShape and Location addresses