diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller.hxx b/src/BOPAlgo/BOPAlgo_PaveFiller.hxx index da0e91c063..e3d4ad109e 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller.hxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller.hxx @@ -139,9 +139,9 @@ protected: Standard_EXPORT void FillShrunkData (const TopAbs_ShapeEnum theType1, const TopAbs_ShapeEnum theType2); - Standard_EXPORT Standard_Integer PerformVerticesEE (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, BOPCol_BaseAllocator& theAllocator); + Standard_EXPORT Standard_Integer PerformVerticesEE (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, const BOPCol_BaseAllocator& theAllocator); - Standard_EXPORT Standard_Integer PerformVerticesEF (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, BOPCol_BaseAllocator& theAllocator); + Standard_EXPORT Standard_Integer PerformVerticesEF (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, const BOPCol_BaseAllocator& theAllocator); Standard_EXPORT Standard_Boolean CheckFacePaves (const TopoDS_Vertex& theVnew, const BOPCol_MapOfInteger& theMIF); @@ -172,7 +172,7 @@ protected: //! Treatment of section edges. - Standard_EXPORT Standard_Integer PostTreatFF (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB, BOPCol_DataMapOfShapeInteger& theMVI, BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDMExEdges, BOPCol_DataMapOfIntegerInteger& theDMI, BOPCol_BaseAllocator& theAllocator); + Standard_EXPORT Standard_Integer PostTreatFF (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB, BOPCol_DataMapOfShapeInteger& theMVI, BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDMExEdges, BOPCol_DataMapOfIntegerInteger& theDMI, const BOPCol_BaseAllocator& theAllocator); Standard_EXPORT void FindPaveBlocks (const Standard_Integer theV, const Standard_Integer theF, BOPDS_ListOfPaveBlock& theLPB); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx index d5d7e2b51f..e87967449b 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx @@ -576,7 +576,7 @@ void BOPAlgo_PaveFiller::PerformEE() //======================================================================= Standard_Integer BOPAlgo_PaveFiller::PerformVerticesEE (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, - Handle(NCollection_BaseAllocator)& theAllocator) + const Handle(NCollection_BaseAllocator)& theAllocator) { Standard_Integer aNbV, iRet; // diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx index 3f622cbeea..5c99402318 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx @@ -423,7 +423,7 @@ void BOPAlgo_PaveFiller::PerformEF() //======================================================================= Standard_Integer BOPAlgo_PaveFiller::PerformVerticesEF (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, - Handle(NCollection_BaseAllocator)& theAllocator) + const Handle(NCollection_BaseAllocator)& theAllocator) { Standard_Integer aNbV, iRet; // diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index 521d51c271..ce8ffb26c7 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -609,7 +609,7 @@ Standard_Integer BOPAlgo_PaveFiller::PostTreatFF BOPCol_DataMapOfShapeInteger& aMVI, BOPDS_DataMapOfPaveBlockListOfPaveBlock& aDMExEdges, BOPCol_DataMapOfIntegerInteger& aDMI, - Handle(NCollection_BaseAllocator)& theAllocator) + const Handle(NCollection_BaseAllocator)& theAllocator) { Standard_Integer iRet, aNbS; // diff --git a/src/BOPAlgo/BOPAlgo_Tools.cxx b/src/BOPAlgo/BOPAlgo_Tools.cxx index d9488de143..7d3b5cc7fa 100644 --- a/src/BOPAlgo/BOPAlgo_Tools.cxx +++ b/src/BOPAlgo/BOPAlgo_Tools.cxx @@ -28,7 +28,7 @@ //======================================================================= void BOPAlgo_Tools::MakeBlocksCnx(const BOPCol_IndexedDataMapOfIntegerListOfInteger& aMILI, BOPCol_DataMapOfIntegerListOfInteger& aMBlocks, - Handle(NCollection_BaseAllocator)& aAllocator) + const Handle(NCollection_BaseAllocator)& aAllocator) { Standard_Integer aNbV, nV, aNbVS, nVP, nVx, aNbVP, aNbEC, k, i, j; BOPCol_ListIteratorOfListOfInteger aItLI; @@ -110,7 +110,7 @@ void BOPAlgo_Tools::FillMap(const Standard_Integer n1, const Standard_Integer n2, BOPCol_IndexedDataMapOfIntegerListOfInteger& aMILI, - Handle(NCollection_BaseAllocator)& aAllocator) + const Handle(NCollection_BaseAllocator)& aAllocator) { if (aMILI.Contains(n1)) { BOPCol_ListOfInteger& aLI=aMILI.ChangeFromKey(n1); @@ -138,7 +138,7 @@ void BOPAlgo_Tools::FillMap(const Handle(BOPDS_PaveBlock)& aPB1, const Handle(BOPDS_PaveBlock)& aPB2, BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& aMPBLPB, - Handle(NCollection_BaseAllocator)& aAllocator) + const Handle(NCollection_BaseAllocator)& aAllocator) { if (aMPBLPB.Contains(aPB1)) { BOPDS_ListOfPaveBlock& aLPB=aMPBLPB.ChangeFromKey(aPB1); @@ -166,7 +166,7 @@ void BOPAlgo_Tools::FillMap(const Handle(BOPDS_PaveBlock)& aPB, const Standard_Integer nF, BOPDS_IndexedDataMapOfPaveBlockListOfInteger& aMPBLI, - Handle(NCollection_BaseAllocator)& aAllocator) + const Handle(NCollection_BaseAllocator)& aAllocator) { if (aMPBLI.Contains(aPB)) { BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFromKey(aPB); @@ -184,7 +184,7 @@ //======================================================================= void BOPAlgo_Tools::MakeBlocks(const BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& aMILI, BOPDS_DataMapOfIntegerListOfPaveBlock& aMBlocks, - Handle(NCollection_BaseAllocator)& aAllocator) + const Handle(NCollection_BaseAllocator)& aAllocator) { Standard_Integer aNbV, aNbVS, aNbVP, aNbEC, k, i, j; BOPDS_ListIteratorOfListOfPaveBlock aItLI; @@ -264,7 +264,7 @@ //purpose : //======================================================================= void BOPAlgo_Tools::PerformCommonBlocks(BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& aMPBLPB, - Handle(NCollection_BaseAllocator)& aAllocator, + const Handle(NCollection_BaseAllocator)& aAllocator, BOPDS_PDS& pDS) { Standard_Integer aNbCB; @@ -307,7 +307,7 @@ //purpose : //======================================================================= void BOPAlgo_Tools::PerformCommonBlocks(const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& aMPBLI, - Handle(NCollection_BaseAllocator)& ,//aAllocator + const Handle(NCollection_BaseAllocator)& ,//aAllocator BOPDS_PDS& pDS) { Standard_Integer nF, i, aNb; diff --git a/src/BOPAlgo/BOPAlgo_Tools.hxx b/src/BOPAlgo/BOPAlgo_Tools.hxx index 2e91942d81..47c4cb67ed 100644 --- a/src/BOPAlgo/BOPAlgo_Tools.hxx +++ b/src/BOPAlgo/BOPAlgo_Tools.hxx @@ -27,10 +27,9 @@ #include #include #include + class BOPDS_PaveBlock; - - class BOPAlgo_Tools { public: @@ -38,41 +37,20 @@ public: DEFINE_STANDARD_ALLOC - Standard_EXPORT static void MakeBlocksCnx (const BOPCol_IndexedDataMapOfIntegerListOfInteger& theMILI, BOPCol_DataMapOfIntegerListOfInteger& theMBlocks, BOPCol_BaseAllocator& theAllocator); + Standard_EXPORT static void MakeBlocksCnx (const BOPCol_IndexedDataMapOfIntegerListOfInteger& theMILI, BOPCol_DataMapOfIntegerListOfInteger& theMBlocks, const BOPCol_BaseAllocator& theAllocator); - Standard_EXPORT static void MakeBlocks (const BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& theMILI, BOPDS_DataMapOfIntegerListOfPaveBlock& theMBlocks, BOPCol_BaseAllocator& theAllocator); + Standard_EXPORT static void MakeBlocks (const BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& theMILI, BOPDS_DataMapOfIntegerListOfPaveBlock& theMBlocks, const BOPCol_BaseAllocator& theAllocator); - Standard_EXPORT static void PerformCommonBlocks (BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& theMBlocks, BOPCol_BaseAllocator& theAllocator, BOPDS_PDS& pDS); + Standard_EXPORT static void PerformCommonBlocks (BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& theMBlocks, const BOPCol_BaseAllocator& theAllocator, BOPDS_PDS& pDS); - Standard_EXPORT static void FillMap (const Standard_Integer tneN1, const Standard_Integer tneN2, BOPCol_IndexedDataMapOfIntegerListOfInteger& theMILI, BOPCol_BaseAllocator& theAllocator); + Standard_EXPORT static void FillMap (const Standard_Integer tneN1, const Standard_Integer tneN2, BOPCol_IndexedDataMapOfIntegerListOfInteger& theMILI, const BOPCol_BaseAllocator& theAllocator); - Standard_EXPORT static void FillMap (const Handle(BOPDS_PaveBlock)& tnePB1, const Handle(BOPDS_PaveBlock)& tnePB2, BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& theMILI, BOPCol_BaseAllocator& theAllocator); + Standard_EXPORT static void FillMap (const Handle(BOPDS_PaveBlock)& tnePB1, const Handle(BOPDS_PaveBlock)& tnePB2, BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& theMILI, const BOPCol_BaseAllocator& theAllocator); - Standard_EXPORT static void FillMap (const Handle(BOPDS_PaveBlock)& tnePB1, const Standard_Integer tneF, BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theMILI, BOPCol_BaseAllocator& theAllocator); + Standard_EXPORT static void FillMap (const Handle(BOPDS_PaveBlock)& tnePB1, const Standard_Integer tneF, BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theMILI, const BOPCol_BaseAllocator& theAllocator); - Standard_EXPORT static void PerformCommonBlocks (const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theMBlocks, BOPCol_BaseAllocator& theAllocator, BOPDS_PDS& pDS); - - - - -protected: - - - - - -private: - - - - + Standard_EXPORT static void PerformCommonBlocks (const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theMBlocks, const BOPCol_BaseAllocator& theAllocator, BOPDS_PDS& pDS); }; - - - - - - #endif // _BOPAlgo_Tools_HeaderFile diff --git a/src/BOPDS/BOPDS_DS.cxx b/src/BOPDS/BOPDS_DS.cxx index f58fd6211e..fcae9ea309 100644 --- a/src/BOPDS/BOPDS_DS.cxx +++ b/src/BOPDS/BOPDS_DS.cxx @@ -661,7 +661,7 @@ void BOPDS_DS::Init() void BOPDS_DS::InitShape (const Standard_Integer aI, const TopoDS_Shape& aS, - Handle(NCollection_BaseAllocator)& theAllocator, + const Handle(NCollection_BaseAllocator)& theAllocator, BOPCol_DataMapOfShapeInteger& aMSI) { Standard_Integer aIx; diff --git a/src/BOPDS/BOPDS_DS.hxx b/src/BOPDS/BOPDS_DS.hxx index bf7fa2e621..e88e6ac828 100644 --- a/src/BOPDS/BOPDS_DS.hxx +++ b/src/BOPDS/BOPDS_DS.hxx @@ -463,7 +463,7 @@ protected: //! Initializes the state of face with index theIndex Standard_EXPORT void InitFaceInfo (const Standard_Integer theIndex); - Standard_EXPORT void InitShape (const Standard_Integer theIndex, const TopoDS_Shape& theS, BOPCol_BaseAllocator& theAllocator, BOPCol_DataMapOfShapeInteger& theMSI); + Standard_EXPORT void InitShape (const Standard_Integer theIndex, const TopoDS_Shape& theS, const BOPCol_BaseAllocator& theAllocator, BOPCol_DataMapOfShapeInteger& theMSI); Standard_EXPORT Standard_Boolean CheckCoincidence (const Handle(BOPDS_PaveBlock)& thePB1, const Handle(BOPDS_PaveBlock)& thePB2); diff --git a/src/BRepBlend/BRepBlend_AppSurface.cxx b/src/BRepBlend/BRepBlend_AppSurface.cxx index ceb3a9607f..9126000071 100644 --- a/src/BRepBlend/BRepBlend_AppSurface.cxx +++ b/src/BRepBlend/BRepBlend_AppSurface.cxx @@ -27,7 +27,7 @@ #include BRepBlend_AppSurface::BRepBlend_AppSurface( - Handle(Approx_SweepFunction)& Func, + const Handle(Approx_SweepFunction)& Func, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol3d, diff --git a/src/BRepBlend/BRepBlend_AppSurface.hxx b/src/BRepBlend/BRepBlend_AppSurface.hxx index 555c52aa02..d2f547d917 100644 --- a/src/BRepBlend/BRepBlend_AppSurface.hxx +++ b/src/BRepBlend/BRepBlend_AppSurface.hxx @@ -54,7 +54,7 @@ public: //! approximated with an tolerance given by the //! resolution on support surfaces, but if this //! tolerance is too large Tol2d is used. - Standard_EXPORT BRepBlend_AppSurface(Handle(Approx_SweepFunction)& Funct, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Real TolAngular, const GeomAbs_Shape Continuity = GeomAbs_C0, const Standard_Integer Degmax = 11, const Standard_Integer Segmax = 50); + Standard_EXPORT BRepBlend_AppSurface(const Handle(Approx_SweepFunction)& Funct, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Real TolAngular, const GeomAbs_Shape Continuity = GeomAbs_C0, const Standard_Integer Degmax = 11, const Standard_Integer Segmax = 50); Standard_Boolean IsDone() const; diff --git a/src/BRepMAT2d/BRepMAT2d_Explorer.cxx b/src/BRepMAT2d/BRepMAT2d_Explorer.cxx index bf4763f33a..ca8d20f397 100644 --- a/src/BRepMAT2d/BRepMAT2d_Explorer.cxx +++ b/src/BRepMAT2d/BRepMAT2d_Explorer.cxx @@ -62,8 +62,8 @@ static TopoDS_Edge MakeEdge(const Handle(Geom2d_Curve) &theCurve, // Modified by Sergey KHROMOV - Thu Dec 5 10:38:16 2002 End // static GeomAbs_CurveType GetCurveType(const Handle(Geom2d_Curve)& theC2d); -static void AdjustCurveEnd(Handle(Geom2d_BoundedCurve)& theC2d, const gp_Pnt2d theP, - const Standard_Boolean isFirst); +static Handle(Geom2d_TrimmedCurve) AdjustCurveEnd (const Handle(Geom2d_BoundedCurve)& theC2d, + const gp_Pnt2d theP, const Standard_Boolean isFirst); // //======================================================================= //function : BRepMAT2d_Explorer @@ -202,7 +202,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine, // if(TCCurr <= TCPrev) { - AdjustCurveEnd(CT2d, aPLast, Standard_True); + CT2d = AdjustCurveEnd (CT2d, aPLast, Standard_True); // Creation of new edge. TopoDS_Edge aNewEdge; TopoDS_Vertex aVf = TopExp::FirstVertex(anEdge); @@ -220,7 +220,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine, else { gp_Pnt2d aP = CT2d->Value(CT2d->FirstParameter()); - AdjustCurveEnd(CPrev, aP, Standard_False); + CPrev = AdjustCurveEnd(CPrev, aP, Standard_False); theCurves.ChangeValue(currentContour).ChangeValue(aNbC) = CPrev; //Change previous edge TopoDS_Edge aNewEdge; @@ -260,7 +260,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine, // if(TCCurr <= TCPrev) { - AdjustCurveEnd(aFirstCurve, aPLast, Standard_True); + aFirstCurve = AdjustCurveEnd(aFirstCurve, aPLast, Standard_True); theCurves.ChangeValue(currentContour).ChangeValue(1) = aFirstCurve; // Creation of new edge. TopoDS_Edge aNewEdge; @@ -279,7 +279,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine, else { gp_Pnt2d aP = aFirstCurve->Value(aFirstCurve->FirstParameter()); - AdjustCurveEnd(CPrev, aP, Standard_False); + CPrev = AdjustCurveEnd(CPrev, aP, Standard_False); theCurves.ChangeValue(currentContour).ChangeValue(aNbC) = CPrev; //Change previous edge TopoDS_Edge aNewEdge; @@ -607,8 +607,8 @@ GeomAbs_CurveType GetCurveType(const Handle(Geom2d_Curve)& theC2d) //function : AdjustCurveEnd //purpose : //======================================================================= -void AdjustCurveEnd(Handle(Geom2d_BoundedCurve)& theC2d, const gp_Pnt2d theP, - const Standard_Boolean isFirst) +Handle(Geom2d_TrimmedCurve) AdjustCurveEnd (const Handle(Geom2d_BoundedCurve)& theC2d, + const gp_Pnt2d theP, const Standard_Boolean isFirst) { GeomAbs_CurveType aType = GetCurveType(theC2d); if(aType == GeomAbs_Line) @@ -617,12 +617,12 @@ void AdjustCurveEnd(Handle(Geom2d_BoundedCurve)& theC2d, const gp_Pnt2d theP, if(isFirst) { gp_Pnt2d aP = theC2d->Value(theC2d->LastParameter()); - theC2d = GCE2d_MakeSegment(theP, aP).Value(); + return GCE2d_MakeSegment(theP, aP); } else { gp_Pnt2d aP = theC2d->Value(theC2d->FirstParameter()); - theC2d = GCE2d_MakeSegment(aP, theP).Value(); + return GCE2d_MakeSegment(aP, theP); } } else @@ -633,13 +633,13 @@ void AdjustCurveEnd(Handle(Geom2d_BoundedCurve)& theC2d, const gp_Pnt2d theP, if(isFirst) { BCurve->SetPole(1, theP); - theC2d = new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(), + return new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(), BCurve->LastParameter()); } else { BCurve->SetPole(BCurve->NbPoles(), theP); - theC2d = new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(), + return new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(), BCurve->LastParameter()); } } diff --git a/src/ChFi3d/ChFi3d_Builder_0.cxx b/src/ChFi3d/ChFi3d_Builder_0.cxx index 040b295d10..ee64130482 100644 --- a/src/ChFi3d/ChFi3d_Builder_0.cxx +++ b/src/ChFi3d/ChFi3d_Builder_0.cxx @@ -4185,8 +4185,9 @@ Standard_EXPORT Bout = PDeb.Translated(-20*rabdist * VrefDeb); Standard_Boolean goodext = 0; for(Standard_Integer icont = 3; icont>=1 && !goodext; icont--) { - newc = BSpline; - GeomLib::ExtendCurveToPoint( newc, Bout, icont, Standard_False); + Handle(Geom_BoundedCurve) anExtCurve = BSpline; + GeomLib::ExtendCurveToPoint (anExtCurve, Bout, icont, Standard_False); + newc = Handle(Geom_BSplineCurve)::DownCast (anExtCurve); gacurve.Load(newc); GCPnts_AbscissaPoint GCP(gacurve,-rabdist,Wrefdeb,WF); if(GCP.IsDone()) { @@ -4210,8 +4211,9 @@ Standard_EXPORT Bout = PFin.Translated(20*rabdist * VrefFin); Standard_Boolean goodext = 0; for(Standard_Integer icont = 3; icont>=1 && !goodext; icont--) { - newc = BSpline; - GeomLib::ExtendCurveToPoint( newc, Bout, icont, Standard_True); + Handle(Geom_BoundedCurve) anExtCurve = BSpline; + GeomLib::ExtendCurveToPoint (anExtCurve, Bout, icont, Standard_True); + newc = Handle(Geom_BSplineCurve)::DownCast (anExtCurve); gacurve.Load(newc); GCPnts_AbscissaPoint GCP(gacurve,rabdist,Wreffin,WL); if(GCP.IsDone()) { @@ -4338,7 +4340,9 @@ Standard_EXPORT adjust = Standard_True; } if(adjust) { - GeomLib::AdjustExtremity(BSpline, PDeb, PFin, VrefDeb, VrefFin); + Handle(Geom_BoundedCurve) anExtCurve = BSpline; + GeomLib::AdjustExtremity(anExtCurve, PDeb, PFin, VrefDeb, VrefFin); + BSpline = Handle(Geom_BSplineCurve)::DownCast (anExtCurve); } } diff --git a/src/ChFi3d/ChFi3d_Builder_6.cxx b/src/ChFi3d/ChFi3d_Builder_6.cxx index c41659d765..8728a198d3 100644 --- a/src/ChFi3d/ChFi3d_Builder_6.cxx +++ b/src/ChFi3d/ChFi3d_Builder_6.cxx @@ -692,10 +692,13 @@ Standard_Boolean ChFi3d_Builder::StoreData(Handle(ChFiDS_SurfData)& Data, Standard_Real length1,length2; length1=Data->FirstExtensionValue(); length2=Data->LastExtensionValue(); + + Handle(Geom_BoundedSurface) aBndSurf = Surf; if (length1 > Precision::Confusion()) - GeomLib::ExtendSurfByLength(Surf,length1,1,Standard_False,Standard_False); + GeomLib::ExtendSurfByLength(aBndSurf,length1,1,Standard_False,Standard_False); if (length2 > Precision::Confusion()) - GeomLib::ExtendSurfByLength(Surf,length2,1,Standard_False,Standard_True); + GeomLib::ExtendSurfByLength(aBndSurf,length2,1,Standard_False,Standard_True); + Surf = Handle(Geom_BSplineSurface)::DownCast (aBndSurf); //Correction of surface on extremities if (length1 <= Precision::Confusion()) diff --git a/src/ChFi3d/ChFi3d_Builder_C1.cxx b/src/ChFi3d/ChFi3d_Builder_C1.cxx index 7e45e48422..3273d66224 100644 --- a/src/ChFi3d/ChFi3d_Builder_C1.cxx +++ b/src/ChFi3d/ChFi3d_Builder_C1.cxx @@ -187,9 +187,9 @@ static Standard_Real recadre(const Standard_Real p, // parameter in FaceInterference. //======================================================================= -static Standard_Boolean Update(Handle(Adaptor3d_HSurface)& fb, - Handle(Adaptor2d_HCurve2d)& pcfb, - Handle(Adaptor3d_HSurface)& surf, +static Standard_Boolean Update(const Handle(Adaptor3d_HSurface)& fb, + const Handle(Adaptor2d_HCurve2d)& pcfb, + const Handle(Adaptor3d_HSurface)& surf, ChFiDS_FaceInterference& fi, ChFiDS_CommonPoint& cp, gp_Pnt2d& p2dbout, @@ -229,8 +229,8 @@ static Standard_Boolean Update(Handle(Adaptor3d_HSurface)& fb, // and //======================================================================= -static Standard_Boolean Update(Handle(Adaptor3d_HSurface)& fb, - Handle(Adaptor3d_HCurve)& ct, +static Standard_Boolean Update(const Handle(Adaptor3d_HSurface)& fb, + const Handle(Adaptor3d_HCurve)& ct, ChFiDS_FaceInterference& fi, ChFiDS_CommonPoint& cp, gp_Pnt2d& p2dbout, @@ -356,9 +356,9 @@ static Standard_Boolean IntersUpdateOnSame(Handle(GeomAdaptor_HSurface)& HGs, // face at end. //======================================================================= -static Standard_Boolean Update(Handle(Adaptor3d_HSurface)& face, - Handle(Adaptor2d_HCurve2d)& edonface, - Handle(Adaptor3d_HSurface)& surf, +static Standard_Boolean Update(const Handle(Adaptor3d_HSurface)& face, + const Handle(Adaptor2d_HCurve2d)& edonface, + const Handle(Adaptor3d_HSurface)& surf, ChFiDS_FaceInterference& fi, ChFiDS_CommonPoint& cp, const Standard_Boolean isfirst) @@ -424,42 +424,25 @@ static void ChFi3d_ExtendSurface (Handle(Geom_Surface) & S , Standard_Integer & prol ) { if (prol) return; - Handle(Geom_BSplineSurface) S1; - Handle(Geom_BezierSurface) S2; + + prol = (S->IsKind (STANDARD_TYPE(Geom_BSplineSurface)) ? 1 : + S->IsKind (STANDARD_TYPE(Geom_BezierSurface)) ? 2 : 0); + if ( ! prol ) + return; + Standard_Real length,umin,umax,vmin,vmax; gp_Pnt P1,P2; S->Bounds(umin,umax,vmin,vmax); S->D0(umin,vmin,P1); S->D0(umax,vmax,P2); length=P1.Distance(P2); - prol=0; - S1=Handle(Geom_BSplineSurface)::DownCast(S); - S2=Handle(Geom_BezierSurface)::DownCast(S); - if (!S1.IsNull()) { - GeomLib::ExtendSurfByLength(S1,length,1,Standard_False, - Standard_True); - GeomLib::ExtendSurfByLength(S1,length,1,Standard_True, - Standard_True); - GeomLib::ExtendSurfByLength(S1,length,1,Standard_False, - Standard_False); - GeomLib::ExtendSurfByLength(S1,length,1,Standard_True, - Standard_False); - S=S1; - prol=1; - } - if (!S2.IsNull()) { - GeomLib::ExtendSurfByLength(S2,length,1,Standard_False, - Standard_True); - GeomLib::ExtendSurfByLength(S2,length,1,Standard_True, - Standard_True); - GeomLib::ExtendSurfByLength(S2,length,1,Standard_False, - Standard_False); - GeomLib::ExtendSurfByLength(S2,length,1,Standard_True, - Standard_False); - S=S2; - prol=2; - } + Handle(Geom_BoundedSurface) aBS = Handle(Geom_BoundedSurface)::DownCast(S); + GeomLib::ExtendSurfByLength (aBS, length, 1, Standard_False, Standard_True); + GeomLib::ExtendSurfByLength (aBS, length, 1, Standard_True, Standard_True); + GeomLib::ExtendSurfByLength (aBS, length, 1, Standard_False, Standard_False); + GeomLib::ExtendSurfByLength (aBS, length, 1, Standard_True, Standard_False); + S = aBS; } //======================================================================= @@ -467,7 +450,7 @@ static void ChFi3d_ExtendSurface (Handle(Geom_Surface) & S , //purpose : calculate the 2d of the curve Ct on face Face //======================================================================= -static void ComputeCurve2d (Handle(Geom_Curve )& Ct, +static void ComputeCurve2d (const Handle(Geom_Curve )& Ct, TopoDS_Face & Face, Handle(Geom2d_Curve) & C2d) { @@ -2267,8 +2250,8 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) inters.Perform(HC, HGs); if ( !prolface[nn] && ( !inters.IsDone() || (inters.NbPoints()==0) )) { // extend surface of conge - Handle(Geom_BSplineSurface) S1= - Handle(Geom_BSplineSurface)::DownCast(DStr.Surface(Fd->Surf()).Surface()); + Handle(Geom_BoundedSurface) S1= + Handle(Geom_BoundedSurface)::DownCast(DStr.Surface(Fd->Surf()).Surface()); if (!S1.IsNull()) { Standard_Real length = 0.5 * Max(Fi1Length,Fi2Length); GeomLib::ExtendSurfByLength(S1,length,1,Standard_False,!isfirst); diff --git a/src/GeomInt/GeomInt_IntSS_1.cxx b/src/GeomInt/GeomInt_IntSS_1.cxx index 4a9d2d146e..91832c5e04 100644 --- a/src/GeomInt/GeomInt_IntSS_1.cxx +++ b/src/GeomInt/GeomInt_IntSS_1.cxx @@ -136,7 +136,7 @@ static static void AdjustUPeriodic (const Handle(Geom_Surface)& aS, - Handle(Geom2d_Curve)& aC2D); + const Handle(Geom2d_Curve)& aC2D); static void GetQuadric(const Handle(GeomAdaptor_HSurface)& HS1, IntSurf_Quadric& quad1); @@ -1000,30 +1000,6 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, case IntPatch_Restriction: { - GeomAbs_SurfaceType typS1 = myHS1->Surface().GetType(); - GeomAbs_SurfaceType typS2 = myHS2->Surface().GetType(); - Standard_Boolean isAnalS1 = Standard_False; - switch (typS1) - { - case GeomAbs_Plane: - case GeomAbs_Cylinder: - case GeomAbs_Sphere: - case GeomAbs_Cone: - case GeomAbs_Torus: isAnalS1 = Standard_True; break; - default: break; - } - - Standard_Integer isAnalS2 = Standard_False; - switch (typS2) - { - case GeomAbs_Plane: - case GeomAbs_Cylinder: - case GeomAbs_Sphere: - case GeomAbs_Cone: - case GeomAbs_Torus: isAnalS2 = Standard_True; break; - default: break; - } - Handle(IntPatch_RLine) RL = Handle(IntPatch_RLine)::DownCast(L); Handle(Geom_Curve) aC3d; @@ -1111,7 +1087,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, //function : AdjustUPeriodic //purpose : //======================================================================= - void AdjustUPeriodic (const Handle(Geom_Surface)& aS, Handle(Geom2d_Curve)& aC2D) + static void AdjustUPeriodic (const Handle(Geom_Surface)& aS, const Handle(Geom2d_Curve)& aC2D) { if (aC2D.IsNull() || !aS->IsUPeriodic()) return; @@ -1155,7 +1131,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, //function : GetQuadric //purpose : //======================================================================= - void GetQuadric(const Handle(GeomAdaptor_HSurface)& HS1, IntSurf_Quadric& quad1) + static void GetQuadric(const Handle(GeomAdaptor_HSurface)& HS1, IntSurf_Quadric& quad1) { switch (HS1->Surface().GetType()) { diff --git a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx index 4d88123f27..6cd1bc7c22 100644 --- a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx +++ b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx @@ -2240,7 +2240,7 @@ static Standard_Boolean AddVertices(Handle(IntSurf_LineOn2S)& Line, } -static void PutIntVertices(Handle(IntPatch_Line)& Line, +static void PutIntVertices(const Handle(IntPatch_Line)& Line, Handle(IntSurf_LineOn2S)& Result, Standard_Boolean ,//IsReversed, Handle(IntSurf_LineOn2S)& Vertices, diff --git a/src/IntPatch/IntPatch_RstInt.cxx b/src/IntPatch/IntPatch_RstInt.cxx index d24f7dfe5f..846102528f 100644 --- a/src/IntPatch/IntPatch_RstInt.cxx +++ b/src/IntPatch/IntPatch_RstInt.cxx @@ -441,7 +441,7 @@ static Standard_Boolean IsSegment2dSmall(const IntPatch_Polygo& Pol, //purpose : //======================================================================= -void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L, +void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L, const Handle(Adaptor3d_HSurface)& Surf, const Handle(Adaptor3d_TopolTool)& Domain, const Handle(Adaptor3d_HSurface)& OtherSurf, diff --git a/src/IntPatch/IntPatch_RstInt.hxx b/src/IntPatch/IntPatch_RstInt.hxx index fef85cd244..64b994d0a7 100644 --- a/src/IntPatch/IntPatch_RstInt.hxx +++ b/src/IntPatch/IntPatch_RstInt.hxx @@ -38,29 +38,9 @@ public: DEFINE_STANDARD_ALLOC - Standard_EXPORT static void PutVertexOnLine (Handle(IntPatch_Line)& L, const Handle(Adaptor3d_HSurface)& Surf, const Handle(Adaptor3d_TopolTool)& Domain, const Handle(Adaptor3d_HSurface)& OtherSurf, const Standard_Boolean OnFirst, const Standard_Real Tol, const Standard_Boolean hasBeenAdded = Standard_False); - - - - -protected: - - - - - -private: - - - - + Standard_EXPORT static void PutVertexOnLine (const Handle(IntPatch_Line)& L, const Handle(Adaptor3d_HSurface)& Surf, const Handle(Adaptor3d_TopolTool)& Domain, const Handle(Adaptor3d_HSurface)& OtherSurf, const Standard_Boolean OnFirst, const Standard_Real Tol, const Standard_Boolean hasBeenAdded = Standard_False); }; - - - - - #endif // _IntPatch_RstInt_HeaderFile diff --git a/src/MAT2d/MAT2d_Tool2d.cxx b/src/MAT2d/MAT2d_Tool2d.cxx index 9ada7c90a9..90c287a0b1 100644 --- a/src/MAT2d/MAT2d_Tool2d.cxx +++ b/src/MAT2d/MAT2d_Tool2d.cxx @@ -96,7 +96,7 @@ static Standard_Boolean AreNeighbours(const Standard_Integer IEdge1, const Standard_Integer IEdge2, const Standard_Integer NbEdge); -static void SetTrim(Bisector_Bisec& Bis , Handle(Geom2d_Curve)& Line1); +static void SetTrim(Bisector_Bisec& Bis, const Handle(Geom2d_Curve)& Line1); static Standard_Boolean CheckEnds (const Handle(Geom2d_Geometry)& Elt , const gp_Pnt2d& PCom , const Standard_Real Distance, @@ -1241,7 +1241,7 @@ Standard_Boolean AreNeighbours(const Standard_Integer IEdge1, //function : SetTrim //purpose : //========================================================================== -void SetTrim(Bisector_Bisec& Bis, Handle(Geom2d_Curve)& Line1) +static void SetTrim(Bisector_Bisec& Bis, const Handle(Geom2d_Curve)& Line1) { Geom2dInt_GInter Intersect; Standard_Real Distance; diff --git a/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx b/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx index 0cccf33447..f15ff36e98 100644 --- a/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx +++ b/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx @@ -841,7 +841,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::NewCurve(const TopoDS_Edge& E, //purpose : //======================================================================= -Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(Handle(Geom_Curve)& aCurve, +Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(const Handle(Geom_Curve)& aCurve, Handle(Geom_Curve)& C, const Standard_Boolean IsConvert, const Standard_Real First, @@ -1149,7 +1149,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::NewCurve2d(const TopoDS_Edge& E //purpose : //======================================================================= -Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(Handle(Geom2d_Curve)& aCurve, +Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(const Handle(Geom2d_Curve)& aCurve, Handle(Geom2d_Curve)& C, const Standard_Boolean IsConvert, const Standard_Real First, diff --git a/src/ShapeCustom/ShapeCustom_BSplineRestriction.hxx b/src/ShapeCustom/ShapeCustom_BSplineRestriction.hxx index a8a1b44d9e..7431098239 100644 --- a/src/ShapeCustom/ShapeCustom_BSplineRestriction.hxx +++ b/src/ShapeCustom/ShapeCustom_BSplineRestriction.hxx @@ -103,12 +103,12 @@ public: //! Returns Standard_True if the curve has been modified. //! if flag IsOf equals Standard_True Offset curves are aproximated to Offset //! if Standard_False to BSpline - Standard_EXPORT Standard_Boolean ConvertCurve (Handle(Geom_Curve)& aCurve, Handle(Geom_Curve)& C, const Standard_Boolean IsConvert, const Standard_Real First, const Standard_Real Last, Standard_Real& TolCur, const Standard_Boolean IsOf = Standard_True); + Standard_EXPORT Standard_Boolean ConvertCurve (const Handle(Geom_Curve)& aCurve, Handle(Geom_Curve)& C, const Standard_Boolean IsConvert, const Standard_Real First, const Standard_Real Last, Standard_Real& TolCur, const Standard_Boolean IsOf = Standard_True); //! Returns Standard_True if the pcurve has been modified. //! if flag IsOf equals Standard_True Offset pcurves are aproximated to Offset //! if Standard_False to BSpline - Standard_EXPORT Standard_Boolean ConvertCurve2d (Handle(Geom2d_Curve)& aCurve, Handle(Geom2d_Curve)& C, const Standard_Boolean IsConvert, const Standard_Real First, const Standard_Real Last, Standard_Real& TolCur, const Standard_Boolean IsOf = Standard_True); + Standard_EXPORT Standard_Boolean ConvertCurve2d (const Handle(Geom2d_Curve)& aCurve, Handle(Geom2d_Curve)& C, const Standard_Boolean IsConvert, const Standard_Real First, const Standard_Real Last, Standard_Real& TolCur, const Standard_Boolean IsOf = Standard_True); //! Sets tolerance of aproximation for curve3d and surface void SetTol3d (const Standard_Real Tol3d); diff --git a/src/TDataStd/TDataStd_Expression.cxx b/src/TDataStd/TDataStd_Expression.cxx index 9601413ed3..6804c2deda 100644 --- a/src/TDataStd/TDataStd_Expression.cxx +++ b/src/TDataStd/TDataStd_Expression.cxx @@ -151,9 +151,10 @@ void TDataStd_Expression::Paste(const Handle(TDF_Attribute)& Into, { Handle(TDataStd_Expression) EXPR = Handle(TDataStd_Expression)::DownCast (Into); EXPR->SetExpression(myExpression); - Handle(TDataStd_Variable) V1,V2; + Handle(TDataStd_Variable) V1; for (TDF_ListIteratorOfAttributeList it (myVariables); it.More(); it.Next()) { V1 = Handle(TDataStd_Variable)::DownCast(it.Value()); + Handle(TDF_Attribute) V2; RT->HasRelocation (V1,V2); EXPR->GetVariables().Append(V2); } diff --git a/src/TDataStd/TDataStd_Relation.cxx b/src/TDataStd/TDataStd_Relation.cxx index 534defb80d..8b0203f3bb 100644 --- a/src/TDataStd/TDataStd_Relation.cxx +++ b/src/TDataStd/TDataStd_Relation.cxx @@ -151,9 +151,10 @@ void TDataStd_Relation::Paste(const Handle(TDF_Attribute)& Into, { Handle(TDataStd_Relation) REL = Handle(TDataStd_Relation)::DownCast (Into); REL->SetRelation(myRelation); - Handle(TDataStd_Variable) V1,V2; + Handle(TDataStd_Variable) V1; for (TDF_ListIteratorOfAttributeList it (myVariables); it.More(); it.Next()) { V1 = Handle(TDataStd_Variable)::DownCast(it.Value()); + Handle(TDF_Attribute) V2; RT->HasRelocation (V1,V2); REL->GetVariables().Append(V2); }