1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-16 10:54:53 +03:00

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
This commit is contained in:
abv 2015-12-29 07:07:17 +03:00
parent e6f550da99
commit 201c22081b
20 changed files with 67 additions and 31 deletions

View File

@ -289,7 +289,7 @@ protected:
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. //! Checks if the plane includes three angle points to build dimension.
Standard_EXPORT virtual Standard_Boolean CheckPlane (const gp_Pln& thePlane) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean CheckPlane (const gp_Pln& thePlane) const Standard_OVERRIDE;

View File

@ -143,7 +143,7 @@ protected:
//! 2) The plane should inclide th ecircle center to be valid. //! 2) The plane should inclide th ecircle center to be valid.
Standard_EXPORT virtual void ComputeAnchorPoint(); 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. //! Checks if the center of the circle is on the plane.
Standard_EXPORT virtual Standard_Boolean CheckPlane (const gp_Pln& thePlane) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean CheckPlane (const gp_Pln& thePlane) const Standard_OVERRIDE;

View File

@ -549,10 +549,6 @@ protected: //! @name Static auxilliary methods for geometry extraction
protected: //! @name Behavior to implement 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 //! Override this method to check if user-defined plane
//! is valid for the dimension geometry. //! is valid for the dimension geometry.
//! @param thePlane [in] the working plane for positioning every //! @param thePlane [in] the working plane for positioning every

View File

@ -122,7 +122,7 @@ public:
protected: 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. //! 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; Standard_EXPORT virtual Standard_Boolean CheckPlane (const gp_Pln& thePlane) const Standard_OVERRIDE;

View File

@ -205,6 +205,10 @@ public:
//! compound topological shapes for presentation. //! compound topological shapes for presentation.
Standard_EXPORT virtual const Bnd_Box& BoundingBox(); 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 //! Returns the NameOfColor attributes of the shape accordingly to
//! the current facing model; //! the current facing model;
Standard_EXPORT virtual Quantity_NameOfColor Color() const Standard_OVERRIDE; Standard_EXPORT virtual Quantity_NameOfColor Color() const Standard_OVERRIDE;

View File

@ -44,6 +44,9 @@ public: //! @name methods implementing BVH set interface
//! Returns AABB of the given triangle. //! Returns AABB of the given triangle.
BVH_Box<Standard_Real, 3> Box (const Standard_Integer theIndex) const Standard_OVERRIDE; 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<Standard_Real, 3>::Box;
//! Returns centroid position along specified axis. //! Returns centroid position along specified axis.
Standard_Real Center (const Standard_Integer theIndex, const Standard_Integer theAxis) const Standard_OVERRIDE; Standard_Real Center (const Standard_Integer theIndex, const Standard_Integer theAxis) const Standard_OVERRIDE;

View File

@ -473,7 +473,7 @@ void BRepFill_PipeShell::SetForceApproxC1(const Standard_Boolean ForceApproxC1)
const Standard_Boolean WithContact, const Standard_Boolean WithContact,
const Standard_Boolean WithCorrection) const Standard_Boolean WithCorrection)
{ {
Delete(Profile); // No duplication DeleteProfile(Profile); // No duplication
if (myIsAutomaticLaw) if (myIsAutomaticLaw)
{ {
mySeq.Clear(); mySeq.Clear();
@ -582,7 +582,7 @@ void BRepFill_PipeShell::SetForceApproxC1(const Standard_Boolean ForceApproxC1)
//function : Delete //function : Delete
//purpose : Delete a section //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); Standard_Boolean isVertex = (Profile.ShapeType() == TopAbs_VERTEX);

View 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); 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. //! 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 //! Say if <me> is ready to build the shape
//! return False if <me> do not have section definition //! return False if <me> do not have section definition

View File

@ -153,7 +153,7 @@ BRepOffsetAPI_MakePipeShell::BRepOffsetAPI_MakePipeShell(const TopoDS_Wire& Spin
void BRepOffsetAPI_MakePipeShell::Delete( const TopoDS_Shape& Profile) void BRepOffsetAPI_MakePipeShell::Delete( const TopoDS_Shape& Profile)
{ {
myPipe->Delete(Profile); myPipe->DeleteProfile(Profile);
} }

View File

@ -60,6 +60,9 @@ public:
void Closed (const Standard_Boolean clos); 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. //! Give the number of Segments in the polyline.
virtual Standard_Integer NbSegments() const Standard_OVERRIDE; virtual Standard_Integer NbSegments() const Standard_OVERRIDE;

View File

@ -60,6 +60,9 @@ public:
void Closed (const Standard_Boolean clos); 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. //! Give the number of Segments in the polyline.
virtual Standard_Integer NbSegments() const Standard_OVERRIDE; virtual Standard_Integer NbSegments() const Standard_OVERRIDE;

View File

@ -37,18 +37,6 @@
IMPLEMENT_STANDARD_RTTIEXT(PCDM_RetrievalDriver,PCDM_Reader) 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) void PCDM_RetrievalDriver::References(const TCollection_ExtendedString& aFileName, PCDM_SequenceOfReference& theReferences, const Handle(CDM_MessageDriver)& theMsgDriver)
{ PCDM_ReadWriter::Reader(aFileName)->ReadReferences(aFileName, theReferences, theMsgDriver);} { PCDM_ReadWriter::Reader(aFileName)->ReadReferences(aFileName, theReferences, theMsgDriver);}

View File

@ -45,11 +45,6 @@ public:
const TCollection_ExtendedString& theFileName, const TCollection_ExtendedString& theFileName,
const Handle(CDM_MessageDriver)& theMsgDriver); 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 void SetFormat (const TCollection_ExtendedString& aformat);
Standard_EXPORT TCollection_ExtendedString GetFormat() const; Standard_EXPORT TCollection_ExtendedString GetFormat() const;

View File

@ -38,6 +38,9 @@ public:
//! Returns bounding box of sensitive with index theIdx //! Returns bounding box of sensitive with index theIdx
Standard_EXPORT virtual Select3D_BndBox3d Box (const Standard_Integer theIdx) const Standard_OVERRIDE; 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<Standard_Real, 3>::Box;
//! Returns center of sensitive with index theIdx in the set along the //! Returns center of sensitive with index theIdx in the set along the
//! given axis theAxis //! given axis theAxis
Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIdx, Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIdx,

View File

@ -49,6 +49,9 @@ public:
//! Returns bounding box of object with index theIndex //! Returns bounding box of object with index theIndex
Standard_EXPORT virtual Select3D_BndBox3d Box (const Standard_Integer theIndex) const Standard_OVERRIDE; 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<Standard_Real, 3>::Box;
//! Returns center of object with index theIndex in the set //! Returns center of object with index theIndex in the set
//! along the given axis theAxis //! along the given axis theAxis
Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIndex, Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIndex,

View File

@ -53,6 +53,9 @@ public:
//! Returns bounding box of entity with index theIdx //! Returns bounding box of entity with index theIdx
Standard_EXPORT virtual Select3D_BndBox3d Box (const Standard_Integer theIndex) const Standard_OVERRIDE; 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<Standard_Real, 3>::Box;
//! Returns geometry center of sensitive entity index theIdx //! Returns geometry center of sensitive entity index theIdx
//! along the given axis theAxis //! along the given axis theAxis
Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIndex, Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIndex,

View File

@ -30,6 +30,7 @@
#include <PCDM_ReadWriter.hxx> #include <PCDM_ReadWriter.hxx>
#include <Standard_ErrorHandler.hxx> #include <Standard_ErrorHandler.hxx>
#include <Standard_NotImplemented.hxx>
#include <NCollection_Array1.hxx> #include <NCollection_Array1.hxx>
#include <TDocStd_Document.hxx> #include <TDocStd_Document.hxx>
@ -245,6 +246,19 @@ void StdLDrivers_DocumentRetrievalDriver::Read (const TCollection_ExtendedString
theNewDocument->SetComments (hData.Comments()); 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 //function : RaiseOnStorageError
//purpose : Update the reader status and raise an exception //purpose : Update the reader status and raise an exception

View File

@ -31,6 +31,12 @@ public:
const Handle(CDM_Document)& theNewDocument, const Handle(CDM_Document)& theNewDocument,
const Handle(CDM_Application)& theApplication) Standard_OVERRIDE; 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) DEFINE_STANDARD_RTTIEXT (StdLDrivers_DocumentRetrievalDriver, PCDM_RetrievalDriver)
private: private:

View File

@ -1282,7 +1282,7 @@ static void DumpAssembly(Standard_OStream& theDumpLog,
//purpose : //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; Standard_Integer level = 0;
// TopTools_SequenceOfShape SeqShapes; // TopTools_SequenceOfShape SeqShapes;
@ -1302,6 +1302,19 @@ void XCAFDoc_ShapeTool::Dump(Standard_OStream& theDumpLog, const Standard_Boolea
DumpShape(theDumpLog, SeqLabels.Value(i), level, deep); DumpShape(theDumpLog, SeqLabels.Value(i), level, deep);
theDumpLog<<endl; 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;
} }
//======================================================================= //=======================================================================

View File

@ -322,8 +322,10 @@ public:
//! returns the label under which shapes are stored //! returns the label under which shapes are stored
Standard_EXPORT TDF_Label BaseLabel() const; 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 //! Print to ostream <theDumpLog> type of shape found on <L> label
//! and the entry of <L>, with <level> tabs before. //! and the entry of <L>, with <level> tabs before.
//! If <deep>, print also TShape and Location addresses //! If <deep>, print also TShape and Location addresses