From 201c22081b41d7388415832bb65124396c41797d Mon Sep 17 00:00:00 2001 From: abv Date: Tue, 29 Dec 2015 07:07:17 +0300 Subject: [PATCH] 0025076: Hidden overloaded virtual functions 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 --- src/AIS/AIS_AngleDimension.hxx | 2 +- src/AIS/AIS_DiameterDimension.hxx | 2 +- src/AIS/AIS_Dimension.hxx | 4 ---- src/AIS/AIS_RadiusDimension.hxx | 2 +- src/AIS/AIS_Shape.hxx | 4 ++++ src/BRepExtrema/BRepExtrema_TriangleSet.hxx | 3 +++ src/BRepFill/BRepFill_PipeShell.cxx | 4 ++-- src/BRepFill/BRepFill_PipeShell.hxx | 2 +- src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx | 2 +- ...t_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx | 3 +++ ...p_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx | 3 +++ src/PCDM/PCDM_RetrievalDriver.cxx | 12 ------------ src/PCDM/PCDM_RetrievalDriver.hxx | 5 ----- src/Select3D/Select3D_BVHPrimitiveContent.hxx | 3 +++ src/SelectMgr/SelectMgr_SelectableObjectSet.hxx | 3 +++ src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx | 3 +++ .../StdLDrivers_DocumentRetrievalDriver.cxx | 14 ++++++++++++++ .../StdLDrivers_DocumentRetrievalDriver.hxx | 6 ++++++ src/XCAFDoc/XCAFDoc_ShapeTool.cxx | 15 ++++++++++++++- src/XCAFDoc/XCAFDoc_ShapeTool.hxx | 6 ++++-- 20 files changed, 67 insertions(+), 31 deletions(-) diff --git a/src/AIS/AIS_AngleDimension.hxx b/src/AIS/AIS_AngleDimension.hxx index 3e2278c27e..bc1b7b5682 100755 --- a/src/AIS/AIS_AngleDimension.hxx +++ b/src/AIS/AIS_AngleDimension.hxx @@ -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; diff --git a/src/AIS/AIS_DiameterDimension.hxx b/src/AIS/AIS_DiameterDimension.hxx index 6c8dcac050..0217edb23b 100644 --- a/src/AIS/AIS_DiameterDimension.hxx +++ b/src/AIS/AIS_DiameterDimension.hxx @@ -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; diff --git a/src/AIS/AIS_Dimension.hxx b/src/AIS/AIS_Dimension.hxx index 15c6f00c6c..bc70fc43cc 100755 --- a/src/AIS/AIS_Dimension.hxx +++ b/src/AIS/AIS_Dimension.hxx @@ -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 diff --git a/src/AIS/AIS_RadiusDimension.hxx b/src/AIS/AIS_RadiusDimension.hxx index 913aa08ba5..1cfbe9f70e 100644 --- a/src/AIS/AIS_RadiusDimension.hxx +++ b/src/AIS/AIS_RadiusDimension.hxx @@ -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; diff --git a/src/AIS/AIS_Shape.hxx b/src/AIS/AIS_Shape.hxx index 9fdf9212a4..0c355e265b 100644 --- a/src/AIS/AIS_Shape.hxx +++ b/src/AIS/AIS_Shape.hxx @@ -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; diff --git a/src/BRepExtrema/BRepExtrema_TriangleSet.hxx b/src/BRepExtrema/BRepExtrema_TriangleSet.hxx index 22e0832539..a8b073f821 100644 --- a/src/BRepExtrema/BRepExtrema_TriangleSet.hxx +++ b/src/BRepExtrema/BRepExtrema_TriangleSet.hxx @@ -44,6 +44,9 @@ public: //! @name methods implementing BVH set interface //! Returns AABB of the given triangle. BVH_Box 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; diff --git a/src/BRepFill/BRepFill_PipeShell.cxx b/src/BRepFill/BRepFill_PipeShell.cxx index 8592178b07..553664d64d 100644 --- a/src/BRepFill/BRepFill_PipeShell.cxx +++ b/src/BRepFill/BRepFill_PipeShell.cxx @@ -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); diff --git a/src/BRepFill/BRepFill_PipeShell.hxx b/src/BRepFill/BRepFill_PipeShell.hxx index 6c784a2936..342f013200 100644 --- a/src/BRepFill/BRepFill_PipeShell.hxx +++ b/src/BRepFill/BRepFill_PipeShell.hxx @@ -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 is ready to build the shape //! return False if do not have section definition diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx index 3345818004..35ef49057d 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx @@ -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); } diff --git a/src/Geom2dInt/Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx b/src/Geom2dInt/Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx index 09aa5abf8b..8dcaffc205 100644 --- a/src/Geom2dInt/Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx @@ -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; diff --git a/src/HLRBRep/HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx b/src/HLRBRep/HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx index c9f1cc5d3b..76d98d16ed 100644 --- a/src/HLRBRep/HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx @@ -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; diff --git a/src/PCDM/PCDM_RetrievalDriver.cxx b/src/PCDM/PCDM_RetrievalDriver.cxx index 15edbd5653..5f5c413f9e 100644 --- a/src/PCDM/PCDM_RetrievalDriver.cxx +++ b/src/PCDM/PCDM_RetrievalDriver.cxx @@ -37,18 +37,6 @@ 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);} diff --git a/src/PCDM/PCDM_RetrievalDriver.hxx b/src/PCDM/PCDM_RetrievalDriver.hxx index 9cdf056a1b..09d898bccd 100644 --- a/src/PCDM/PCDM_RetrievalDriver.hxx +++ b/src/PCDM/PCDM_RetrievalDriver.hxx @@ -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; diff --git a/src/Select3D/Select3D_BVHPrimitiveContent.hxx b/src/Select3D/Select3D_BVHPrimitiveContent.hxx index 2296f44860..14b3a5e342 100644 --- a/src/Select3D/Select3D_BVHPrimitiveContent.hxx +++ b/src/Select3D/Select3D_BVHPrimitiveContent.hxx @@ -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, diff --git a/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx b/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx index 210edfdb32..22784edc41 100644 --- a/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx +++ b/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx @@ -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, diff --git a/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx b/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx index e170848a27..40a0ec9fd9 100644 --- a/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx +++ b/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx @@ -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, diff --git a/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx b/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx index d93e00d1c5..05ce4ef2c3 100644 --- a/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx +++ b/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -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 diff --git a/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.hxx b/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.hxx index 4661fdd58d..c5af92acff 100644 --- a/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.hxx +++ b/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.hxx @@ -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: diff --git a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx index 3a1d416bef..7949f6580c 100644 --- a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx +++ b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx @@ -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< type of shape found on label //! and the entry of , with tabs before. //! If , print also TShape and Location addresses