diff --git a/src/AIS/AIS_AttributeFilter.cxx b/src/AIS/AIS_AttributeFilter.cxx index 29b1652983..f889abbc46 100644 --- a/src/AIS/AIS_AttributeFilter.cxx +++ b/src/AIS/AIS_AttributeFilter.cxx @@ -39,25 +39,16 @@ hasW(Standard_True){} Standard_Boolean AIS_AttributeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& anObj) const { - if (Handle(AIS_InteractiveObject)::DownCast(anObj->Selectable()).IsNull()) return Standard_False; + Handle(AIS_InteractiveObject) aSelectable (Handle(AIS_InteractiveObject)::DownCast (anObj->Selectable())); + if (aSelectable.IsNull()) + return Standard_False; + Standard_Boolean okstat = Standard_True; - -//#ifndef OCCT_DEBUG - Handle(SelectMgr_SelectableObject) aSelectable = anObj->Selectable() ; - if( hasC && Handle(AIS_InteractiveObject)::DownCast (aSelectable)->HasColor() ) -//#else -// if(hasC && ((Handle(AIS_InteractiveObject)&) anObj->Selectable())->HasColor()) -//#endif + if( hasC && aSelectable->HasColor() ) okstat = (myCol == Handle(AIS_InteractiveObject)::DownCast (anObj)->Color()); -//#ifndef OCCT_DEBUG - aSelectable = anObj->Selectable() ; - if( hasW && Handle(AIS_InteractiveObject)::DownCast (aSelectable)->HasWidth() ) -//#else -// if(hasW && ((Handle(AIS_InteractiveObject)&) anObj->Selectable())->HasWidth()) -//#endif + if( hasW && aSelectable->HasWidth() ) okstat = (myWid == Handle(AIS_InteractiveObject)::DownCast (anObj)->Width()) && okstat; return okstat; - } diff --git a/src/AIS/AIS_BadEdgeFilter.cxx b/src/AIS/AIS_BadEdgeFilter.cxx index 80f78bb6d4..a13b4301b7 100644 --- a/src/AIS/AIS_BadEdgeFilter.cxx +++ b/src/AIS/AIS_BadEdgeFilter.cxx @@ -51,13 +51,14 @@ Standard_Boolean AIS_BadEdgeFilter::ActsOn(const TopAbs_ShapeEnum aType) const Standard_Boolean AIS_BadEdgeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& EO) const { - if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull()) - return Standard_True; - if (myContour==0) return Standard_True; - const TopoDS_Shape& aShape = Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape(); + Handle(StdSelect_BRepOwner) aBO (Handle(StdSelect_BRepOwner)::DownCast(EO)); + if (aBO.IsNull()) + return Standard_True; + + const TopoDS_Shape& aShape = aBO->Shape(); if (myBadEdges.IsBound(myContour)) { TopTools_ListIteratorOfListOfShape it(myBadEdges.Find(myContour)); diff --git a/src/AIS/AIS_C0RegularityFilter.cxx b/src/AIS/AIS_C0RegularityFilter.cxx index 85c91dc190..e0a85e0bb5 100644 --- a/src/AIS/AIS_C0RegularityFilter.cxx +++ b/src/AIS/AIS_C0RegularityFilter.cxx @@ -78,10 +78,11 @@ Standard_Boolean AIS_C0RegularityFilter::ActsOn(const TopAbs_ShapeEnum aType) co Standard_Boolean AIS_C0RegularityFilter::IsOk(const Handle(SelectMgr_EntityOwner)& EO) const { - if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull()) + Handle(StdSelect_BRepOwner) aBO (Handle(StdSelect_BRepOwner)::DownCast(EO)); + if (aBO.IsNull()) return Standard_False; - const TopoDS_Shape& aShape = Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape(); + const TopoDS_Shape& aShape = aBO->Shape(); if(aShape.ShapeType()!= TopAbs_EDGE) return Standard_False; diff --git a/src/AIS/AIS_GraphicTool.cxx b/src/AIS/AIS_GraphicTool.cxx index 8e2fc6e80f..7a3354b796 100644 --- a/src/AIS/AIS_GraphicTool.cxx +++ b/src/AIS/AIS_GraphicTool.cxx @@ -49,10 +49,10 @@ static Handle(Prs3d_LineAspect) GetLineAspect(const Handle(Prs3d_Drawer)& Dr, return Dr->VectorAspect(); break; case AIS_TOA_UIso: - return Dr->UIsoAspect(); + return Handle(Prs3d_LineAspect) (Dr->UIsoAspect()); break; case AIS_TOA_VIso: - return Dr->VIsoAspect(); + return Handle(Prs3d_LineAspect) (Dr->VIsoAspect()); break; case AIS_TOA_Free: return Dr->FreeBoundaryAspect(); diff --git a/src/AIS/AIS_LocalContext_1.cxx b/src/AIS/AIS_LocalContext_1.cxx index 140a845d92..8262ddfbdb 100644 --- a/src/AIS/AIS_LocalContext_1.cxx +++ b/src/AIS/AIS_LocalContext_1.cxx @@ -1307,8 +1307,8 @@ void AIS_LocalContext::ClearSensitive(const Handle(V3d_View)& aviou) //======================================================================= Standard_Boolean AIS_LocalContext::IsShape(const Standard_Integer Index) const { - - if(Handle(StdSelect_BRepOwner)::DownCast(myMapOfOwner->FindKey(Index)).IsNull()) + Handle(SelectMgr_EntityOwner) aEO (myMapOfOwner->FindKey(Index)); + if (aEO.IsNull() || ! aEO->IsKind(STANDARD_TYPE(StdSelect_BRepOwner))) return Standard_False; return ComesFromDecomposition(Index); diff --git a/src/AIS/AIS_Trihedron.cxx b/src/AIS/AIS_Trihedron.cxx index bbfe3761d8..34682dbd0e 100644 --- a/src/AIS/AIS_Trihedron.cxx +++ b/src/AIS/AIS_Trihedron.cxx @@ -130,7 +130,7 @@ void AIS_Trihedron::SetSize(const Standard_Real aValue) myDrawer->DatumAspect()->SetAxisLength(aValue,aValue,aValue); for(Standard_Integer i=4;i<=6;i++) - (*((Handle(AIS_Plane)*)&myShapes[i]))->SetSize(aValue); + Handle(AIS_Plane)::DownCast (myShapes[i])->SetSize(aValue); Update(); UpdateSelection(); diff --git a/src/AIS/AIS_TypeFilter.cxx b/src/AIS/AIS_TypeFilter.cxx index 74715cd7fa..a537006187 100644 --- a/src/AIS/AIS_TypeFilter.cxx +++ b/src/AIS/AIS_TypeFilter.cxx @@ -25,9 +25,6 @@ myKind(TheKind){} Standard_Boolean AIS_TypeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& anObj) const { - if(Handle(AIS_InteractiveObject)::DownCast(anObj->Selectable()).IsNull()) - return Standard_False; - Handle(AIS_InteractiveObject) anObject = Handle(AIS_InteractiveObject)::DownCast (anObj->Selectable()); return ! anObject.IsNull() && anObject->Type()== myKind; diff --git a/src/Adaptor3d/Adaptor3d_TopolTool.hxx b/src/Adaptor3d/Adaptor3d_TopolTool.hxx index da92a6226f..aa172beb4e 100644 --- a/src/Adaptor3d/Adaptor3d_TopolTool.hxx +++ b/src/Adaptor3d/Adaptor3d_TopolTool.hxx @@ -17,18 +17,12 @@ #ifndef _Adaptor3d_TopolTool_HeaderFile #define _Adaptor3d_TopolTool_HeaderFile -#include -#include - -#include -#include #include -#include -#include #include #include #include -#include +#include + class Adaptor2d_HLine2d; class Adaptor3d_HVertex; class Adaptor3d_HSurface; diff --git a/src/AppDef/AppDef_MultiPointConstraint.cxx b/src/AppDef/AppDef_MultiPointConstraint.cxx index be5005da25..27c47a0059 100644 --- a/src/AppDef/AppDef_MultiPointConstraint.cxx +++ b/src/AppDef/AppDef_MultiPointConstraint.cxx @@ -27,14 +27,6 @@ #include #include -#define tabTang Handle(TColgp_HArray1OfVec)::DownCast (ttabTang) -#define tabCurv Handle(TColgp_HArray1OfVec)::DownCast (ttabCurv) -#define tabTang2d Handle(TColgp_HArray1OfVec2d)::DownCast (ttabTang2d) -#define tabCurv2d Handle(TColgp_HArray1OfVec2d)::DownCast (ttabCurv2d) - - - - AppDef_MultiPointConstraint::AppDef_MultiPointConstraint() {} @@ -84,14 +76,9 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint (tabCur2d.Length() != tabP2d.Length())) { Standard_ConstructionError::Raise(); } - Handle(TColgp_HArray1OfVec) T3d = - new TColgp_HArray1OfVec(1, tabVec.Length()); - ttabTang = T3d; - - Handle(TColgp_HArray1OfVec2d) T2d = - new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); - ttabTang2d = T2d; + tabTang = new TColgp_HArray1OfVec(1, tabVec.Length()); + tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); Standard_Integer i, Lower = tabVec.Lower(); for (i = 1; i <= tabVec.Length(); i++) { @@ -102,13 +89,8 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint tabTang2d->SetValue(i, tabVec2d.Value(Lower+i-1)); } - Handle(TColgp_HArray1OfVec) C3d = - new TColgp_HArray1OfVec(1, tabCur.Length()); - ttabCurv = C3d; - - Handle(TColgp_HArray1OfVec2d) C2d = - new TColgp_HArray1OfVec2d(1, tabCur2d.Length()); - ttabCurv2d = C2d; + tabCurv = new TColgp_HArray1OfVec(1, tabCur.Length()); + tabCurv2d = new TColgp_HArray1OfVec2d(1, tabCur2d.Length()); Lower = tabCur.Lower(); for (i = 1; i <= tabVec.Length(); i++) { @@ -121,27 +103,21 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint } - AppDef_MultiPointConstraint::AppDef_MultiPointConstraint (const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfPnt2d& tabP2d, const TColgp_Array1OfVec& tabVec, const TColgp_Array1OfVec2d& tabVec2d): - AppParCurves_MultiPoint(tabP, tabP2d) { + AppParCurves_MultiPoint(tabP, tabP2d) +{ if ((tabP.Length() != tabVec.Length()) || (tabP2d.Length() != tabVec2d.Length())) { Standard_ConstructionError::Raise(); } - - Handle(TColgp_HArray1OfVec) T3d = - new TColgp_HArray1OfVec(1, tabVec.Length()); - ttabTang = T3d; - - Handle(TColgp_HArray1OfVec2d) T2d = - new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); - ttabTang2d = T2d; + tabTang = new TColgp_HArray1OfVec(1, tabVec.Length()); + tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); Standard_Integer i, Lower = tabVec.Lower(); for (i = 1; i <= tabVec.Length(); i++) { @@ -163,9 +139,8 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint ( if (tabP.Length() != tabVec.Length()) { Standard_ConstructionError::Raise(); } - Handle(TColgp_HArray1OfVec) T3d = - new TColgp_HArray1OfVec(1, tabVec.Length()); - ttabTang = T3d; + + tabTang = new TColgp_HArray1OfVec(1, tabVec.Length()); Standard_Integer i, Lower = tabVec.Lower(); for (i = 1; i <= tabVec.Length(); i++) { @@ -184,19 +159,14 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint (tabP.Length() != tabCur.Length())) { Standard_ConstructionError::Raise(); } - Handle(TColgp_HArray1OfVec) T3d = - new TColgp_HArray1OfVec(1, tabVec.Length()); - ttabTang = T3d; + tabTang = new TColgp_HArray1OfVec(1, tabVec.Length()); Standard_Integer i, Lower = tabVec.Lower(); for (i = 1; i <= tabVec.Length(); i++) { tabTang->SetValue(i, tabVec.Value(Lower+i-1)); } - Handle(TColgp_HArray1OfVec) C3d = - new TColgp_HArray1OfVec(1, tabCur.Length()); - ttabCurv = C3d; - + tabCurv = new TColgp_HArray1OfVec(1, tabCur.Length()); Lower = tabCur.Lower(); for (i = 1; i <= tabCur.Length(); i++) { tabCurv->SetValue(i, tabCur.Value(Lower+i-1)); @@ -215,10 +185,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint Standard_ConstructionError::Raise(); } - Handle(TColgp_HArray1OfVec2d) T2d = - new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); - ttabTang2d = T2d; - + tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); Standard_Integer i, Lower = tabVec2d.Lower(); for (i = 1; i <= tabVec2d.Length(); i++) { tabTang2d->SetValue(i, tabVec2d.Value(Lower+i-1)); @@ -238,19 +205,14 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint (tabCur2d.Length() != tabP2d.Length())) { Standard_ConstructionError::Raise(); } - Handle(TColgp_HArray1OfVec2d) T2d = - new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); - ttabTang2d = T2d; - + + tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); Standard_Integer i, Lower = tabVec2d.Lower(); for (i = 1; i <= tabVec2d.Length(); i++) { tabTang2d->SetValue(i, tabVec2d.Value(Lower+i-1)); } - Handle(TColgp_HArray1OfVec2d) C2d = - new TColgp_HArray1OfVec2d(1, tabCur2d.Length()); - ttabCurv2d = C2d; - + tabCurv2d = new TColgp_HArray1OfVec2d(1, tabCur2d.Length()); Lower = tabCur2d.Lower(); for (i = 1; i <= tabCur2d.Length(); i++) { tabCurv2d->SetValue(i, tabCur2d.Value(Lower+i-1)); diff --git a/src/AppDef/AppDef_MultiPointConstraint.hxx b/src/AppDef/AppDef_MultiPointConstraint.hxx index 12333778fa..838b98b104 100644 --- a/src/AppDef/AppDef_MultiPointConstraint.hxx +++ b/src/AppDef/AppDef_MultiPointConstraint.hxx @@ -22,21 +22,17 @@ #include #include -#include #include #include -#include -#include -#include -#include -class MMgt_TShared; +#include +#include + class Standard_OutOfRange; class Standard_ConstructionError; class Standard_DimensionError; class gp_Vec; class gp_Vec2d; - //! Describes a MultiPointConstraint used in a //! Multiline. MultiPointConstraints are composed //! of several two or three-dimensional points. @@ -181,31 +177,11 @@ public: //! Is used to redefine the operator <<. Standard_EXPORT virtual void Dump (Standard_OStream& o) const Standard_OVERRIDE; - - - -protected: - - - - - private: - - - - Handle(MMgt_TShared) ttabTang; - Handle(MMgt_TShared) ttabCurv; - Handle(MMgt_TShared) ttabTang2d; - Handle(MMgt_TShared) ttabCurv2d; - - + Handle(TColgp_HArray1OfVec) tabTang; + Handle(TColgp_HArray1OfVec) tabCurv; + Handle(TColgp_HArray1OfVec2d) tabTang2d; + Handle(TColgp_HArray1OfVec2d) tabCurv2d; }; - - - - - - #endif // _AppDef_MultiPointConstraint_HeaderFile diff --git a/src/BOPTools/BOPTools_AlgoTools2D_1.cxx b/src/BOPTools/BOPTools_AlgoTools2D_1.cxx index 52359fa6f1..0e713e5475 100644 --- a/src/BOPTools/BOPTools_AlgoTools2D_1.cxx +++ b/src/BOPTools/BOPTools_AlgoTools2D_1.cxx @@ -250,7 +250,7 @@ Standard_Boolean IsToReverse(const TopoDS_Edge& aEold, const TopoDS_Edge& aEnew, const Handle(IntTools_Context)& aCtx) { - Standard_Boolean bRet, bFlag, bIsDegenerated; + Standard_Boolean bRet, bIsDegenerated; Standard_Real aTnew, aTold, aScPr, aTa, aTb, aT1, aT2; gp_Vec aVold, aVnew, aVE, aVS; gp_Pnt aP; @@ -275,7 +275,7 @@ Standard_Boolean IsToReverse(const TopoDS_Edge& aEold, aCnew->D1(aTnew, aP, aVnew); aVnew.Normalize(); // - bFlag=aCtx->ProjectPointOnEdge(aP, aEold, aTold); + aCtx->ProjectPointOnEdge(aP, aEold, aTold); aCold->D1(aTold, aP, aVold); aVold.Normalize(); // diff --git a/src/BRep/BRep_Builder.hxx b/src/BRep/BRep_Builder.hxx index 46eb9c7c8b..2deef68951 100644 --- a/src/BRep/BRep_Builder.hxx +++ b/src/BRep/BRep_Builder.hxx @@ -22,9 +22,14 @@ #include #include -#include -#include +#include +#include +#include #include +#include +#include +#include + class Standard_NullObject; class Standard_DomainError; class TopoDS_Face; diff --git a/src/BRepFeat/BRepFeat_MakePrism.cxx b/src/BRepFeat/BRepFeat_MakePrism.cxx index 5b658f7655..80c8233398 100644 --- a/src/BRepFeat/BRepFeat_MakePrism.cxx +++ b/src/BRepFeat/BRepFeat_MakePrism.cxx @@ -1226,8 +1226,7 @@ static Handle(Geom_Curve) TestCurve(const TopoDS_Shape& Base, //purpose : face SameDomaine or not //======================================================================= -Standard_Boolean ToFuse(const TopoDS_Face& F1, - const TopoDS_Face& F2) +static Standard_Boolean ToFuse (const TopoDS_Face& F1, const TopoDS_Face& F2) { if (F1.IsNull() || F2.IsNull()) { return Standard_False; @@ -1262,11 +1261,15 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1, Standard_Boolean ValRet = Standard_False; if (typS1 == STANDARD_TYPE(Geom_Plane)) { - S1 = BRep_Tool::Surface(F1); // to apply the location. - S2 = BRep_Tool::Surface(F2); gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln()); gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln()); + // apply locations + if (! loc1.IsIdentity()) + pl1.Transform (loc1.Transformation()); + if (! loc2.IsIdentity()) + pl2.Transform (loc2.Transformation()); + if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) { ValRet = Standard_True; } diff --git a/src/BRepFill/BRepFill_OffsetWire.cxx b/src/BRepFill/BRepFill_OffsetWire.cxx index 465f214855..18acc6fc50 100644 --- a/src/BRepFill/BRepFill_OffsetWire.cxx +++ b/src/BRepFill/BRepFill_OffsetWire.cxx @@ -1274,7 +1274,7 @@ void BRepFill_OffsetWire::UpdateDetromp (BRepFill_DataMapOfOrientedShapeListOfSh Standard_Real U1,U2; TopoDS_Vertex V1,V2; - Handle(Geom2d_Curve) Bis = Bisec.Value(); + Handle(Geom2d_Curve) Bis (Bisec.Value()); U1 = Bis->FirstParameter(); diff --git a/src/BRepMAT2d/BRepMAT2d_BisectingLocus.cxx b/src/BRepMAT2d/BRepMAT2d_BisectingLocus.cxx index 1934b0971c..03397e6165 100644 --- a/src/BRepMAT2d/BRepMAT2d_BisectingLocus.cxx +++ b/src/BRepMAT2d/BRepMAT2d_BisectingLocus.cxx @@ -276,7 +276,7 @@ const { Reverse = Standard_False; - Handle(Geom2d_Curve) Bis = theTool.GeomBis(anArc->GeomIndex()).Value(); + Handle(Geom2d_Curve) Bis (theTool.GeomBis(anArc->GeomIndex()).Value()); if (Bis->FirstParameter() <= -Precision::Infinite()) { Reverse = Standard_True; diff --git a/src/BRepOffset/BRepOffset_Offset.cxx b/src/BRepOffset/BRepOffset_Offset.cxx index 3e4d157dec..db104453e1 100644 --- a/src/BRepOffset/BRepOffset_Offset.cxx +++ b/src/BRepOffset/BRepOffset_Offset.cxx @@ -621,9 +621,9 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face, Standard_Real length = Pfirst.Distance(Pint1); if (OffsetOutside) { - TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); - GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1, - Standard_True, Standard_False); + Handle(Geom_BoundedSurface) aSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); + GeomLib::ExtendSurfByLength (aSurf, length, 1, Standard_True, Standard_False); + TheSurf = aSurf; Standard_Real u1, u2, v1, v2; TheSurf->Bounds( u1, u2, v1, v2 ); MinApex = TheSurf->Value( u1, vf1 ); @@ -660,9 +660,9 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face, Standard_Real length = Pfirst.Distance(Pint1); if (OffsetOutside) { - TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); - GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1, - Standard_True, Standard_True); + Handle(Geom_BoundedSurface) aSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); + GeomLib::ExtendSurfByLength(aSurf, length, 1, Standard_True, Standard_True); + TheSurf = aSurf; Standard_Real u1, u2, v1, v2; TheSurf->Bounds( u1, u2, v1, v2 ); MaxApex = TheSurf->Value( u2, vf1 ); @@ -699,9 +699,9 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face, Standard_Real length = Pfirst.Distance(Pint1); if (OffsetOutside) { - TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); - GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1, - Standard_False, Standard_False); + Handle(Geom_BoundedSurface) aSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); + GeomLib::ExtendSurfByLength(aSurf, length, 1, Standard_False, Standard_False); + TheSurf = aSurf; Standard_Real u1, u2, v1, v2; TheSurf->Bounds( u1, u2, v1, v2 ); MinApex = TheSurf->Value( uf1, v1 ); @@ -740,9 +740,9 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face, Standard_Real length = Pfirst.Distance(Pint1); if (OffsetOutside) { - TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); - GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1, - Standard_False, Standard_True); + Handle(Geom_BoundedSurface) aSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); + GeomLib::ExtendSurfByLength(aSurf, length, 1, Standard_False, Standard_True); + TheSurf = aSurf; Standard_Real u1, u2, v1, v2; TheSurf->Bounds( u1, u2, v1, v2 ); MaxApex = TheSurf->Value( uf1, v2 ); diff --git a/src/BRepOffset/BRepOffset_Tool.cxx b/src/BRepOffset/BRepOffset_Tool.cxx index da01e4f47c..80d2836a3f 100644 --- a/src/BRepOffset/BRepOffset_Tool.cxx +++ b/src/BRepOffset/BRepOffset_Tool.cxx @@ -2900,21 +2900,22 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S, IsV2degen = Standard_True; } } - S = new Geom_RectangularTrimmedSurface( S, u1, u2, v1, v2 ); + Handle(Geom_BoundedSurface) aSurf = new Geom_RectangularTrimmedSurface( S, u1, u2, v1, v2 ); if (enlargeU) { if (enlargeUfirst) - GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_False ); + GeomLib::ExtendSurfByLength (aSurf, du, 1, Standard_True, Standard_False); if (enlargeUlast) - GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_True ); + GeomLib::ExtendSurfByLength (aSurf, du, 1, Standard_True, Standard_True); } if (enlargeV) { if (enlargeVfirst) - GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_False ); + GeomLib::ExtendSurfByLength (aSurf, dv, 1, Standard_False, Standard_False); if (enlargeVlast) - GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_True ); + GeomLib::ExtendSurfByLength (aSurf, dv, 1, Standard_False, Standard_True); } + S = aSurf; S->Bounds( U1, U2, V1, V2 ); SurfaceChange = Standard_True; } @@ -2967,20 +2968,22 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S, } } + Handle(Geom_BoundedSurface) aSurf = Handle(Geom_BoundedSurface)::DownCast (S); if (enlargeU) { if (enlargeUfirst && uf1-u1 < duf) - GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_False ); + GeomLib::ExtendSurfByLength (aSurf, du, 1, Standard_True, Standard_False); if (enlargeUlast && u2-uf2 < duf) - GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_True ); + GeomLib::ExtendSurfByLength (aSurf, du, 1, Standard_True, Standard_True); } if (enlargeV) { if (enlargeVfirst && vf1-v1 < dvf) - GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_False ); + GeomLib::ExtendSurfByLength (aSurf, dv, 1, Standard_False, Standard_False); if (enlargeVlast && v2-vf2 < dvf) - GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_True ); + GeomLib::ExtendSurfByLength (aSurf, dv, 1, Standard_False, Standard_True); } + S = aSurf; S->Bounds( U1, U2, V1, V2 ); SurfaceChange = Standard_True; diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx index cd8ef74b45..7ae59c3270 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx @@ -978,7 +978,7 @@ void BRepOffsetAPI_MiddlePath::Build() { cout< #include -#include -#include -#include -#include - #include diff --git a/src/DrawTrSurf/DrawTrSurf.hxx b/src/DrawTrSurf/DrawTrSurf.hxx index 61227a9e18..7056f79d1c 100644 --- a/src/DrawTrSurf/DrawTrSurf.hxx +++ b/src/DrawTrSurf/DrawTrSurf.hxx @@ -21,13 +21,13 @@ #include #include -#include -#include #include +#include +#include +#include + class gp_Pnt; class gp_Pnt2d; -class Geom_Geometry; -class Geom2d_Curve; class Poly_Triangulation; class Poly_Polygon3D; class Poly_Polygon2D; @@ -36,7 +36,6 @@ class Geom_BezierCurve; class Geom_BSplineCurve; class Geom2d_BezierCurve; class Geom2d_BSplineCurve; -class Geom_Surface; class Geom_BezierSurface; class Geom_BSplineSurface; class DrawTrSurf_Drawable; diff --git a/src/GCPnts/GCPnts_AbscissaPoint.gxx b/src/GCPnts/GCPnts_AbscissaPoint.gxx index 1e6e778cc9..f9d2989594 100644 --- a/src/GCPnts/GCPnts_AbscissaPoint.gxx +++ b/src/GCPnts/GCPnts_AbscissaPoint.gxx @@ -89,7 +89,7 @@ static void Compute(CPnts_AbscissaPoint& theComputer, return; } - Standard_Real Ratio; + Standard_Real Ratio = 1.; GCPnts_AbscissaType Type = computeType(C,Ratio); switch (Type) { diff --git a/src/Geom/Geom_Conic.cxx b/src/Geom/Geom_Conic.cxx index 5a884023db..3de92f23d6 100644 --- a/src/Geom/Geom_Conic.cxx +++ b/src/Geom/Geom_Conic.cxx @@ -25,7 +25,6 @@ #include typedef Geom_Conic Conic; -typedef Handle(Geom_Conic) Handle(Conic); typedef gp_Ax1 Ax1; typedef gp_Ax2 Ax2; typedef gp_Pnt Pnt; diff --git a/src/Geom/Geom_Surface.hxx b/src/Geom/Geom_Surface.hxx index fac5801a4d..898c9a5a76 100644 --- a/src/Geom/Geom_Surface.hxx +++ b/src/Geom/Geom_Surface.hxx @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include @@ -31,7 +31,6 @@ class Geom_UndefinedDerivative; class Geom_UndefinedValue; class gp_Trsf; class gp_GTrsf2d; -class Geom_Curve; class gp_Pnt; class gp_Vec; diff --git a/src/Geom2d/Geom2d_Conic.cxx b/src/Geom2d/Geom2d_Conic.cxx index eb1850b257..bfd0e68664 100644 --- a/src/Geom2d/Geom2d_Conic.cxx +++ b/src/Geom2d/Geom2d_Conic.cxx @@ -25,18 +25,12 @@ #include typedef Geom2d_Conic Conic; -typedef Handle(Geom2d_Conic) Handle(Conic); typedef gp_Ax2d Ax2d; typedef gp_Dir2d Dir2d; typedef gp_Pnt2d Pnt2d; typedef gp_Vec2d Vec2d; - - - - - //======================================================================= //function : SetAxis //purpose : diff --git a/src/Geom2dToIGES/Geom2dToIGES_Geom2dCurve.cxx b/src/Geom2dToIGES/Geom2dToIGES_Geom2dCurve.cxx index a0392bd42a..34122da84d 100644 --- a/src/Geom2dToIGES/Geom2dToIGES_Geom2dCurve.cxx +++ b/src/Geom2dToIGES/Geom2dToIGES_Geom2dCurve.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/src/GeomAPI/GeomAPI.hxx b/src/GeomAPI/GeomAPI.hxx index 1db4b7acc0..5f3d8c475d 100644 --- a/src/GeomAPI/GeomAPI.hxx +++ b/src/GeomAPI/GeomAPI.hxx @@ -21,8 +21,9 @@ #include #include -class Geom2d_Curve; -class Geom_Curve; +#include +#include + class gp_Pln; class GeomAPI_ProjectPointOnCurve; class GeomAPI_ProjectPointOnSurf; diff --git a/src/GeomFill/GeomFill_CoonsAlgPatch.cxx b/src/GeomFill/GeomFill_CoonsAlgPatch.cxx index 32d2a36a40..74ddba6c54 100644 --- a/src/GeomFill/GeomFill_CoonsAlgPatch.cxx +++ b/src/GeomFill/GeomFill_CoonsAlgPatch.cxx @@ -36,12 +36,16 @@ GeomFill_CoonsAlgPatch::GeomFill_CoonsAlgPatch { bound[0] = B1; bound[1] = B2; bound[2] = B3; bound[3] = B4; Standard_Real deb0, deb1, fin0, fin1; + B2->Bounds(deb1,fin1); - a[0] = new Law_Linear(); - (*((Handle(Law_Linear)*) &a[0]))->Set(deb1,1.,fin1,0.); + Handle(Law_Linear) aLaw0 = new Law_Linear(); + aLaw0->Set (deb1, 1., fin1, 0.); + a[0] = aLaw0; + B1->Bounds(deb0,fin0); - a[1] = new Law_Linear(); - (*((Handle(Law_Linear)*) &a[1]))->Set(deb0,0.,fin0,1.); + Handle(Law_Linear) aLaw1 = new Law_Linear(); + aLaw1->Set (deb0, 0., fin0, 1.); + a[1] = aLaw1; gp_XYZ temp; temp = B4->Value(deb1).XYZ().Added(B1->Value(deb0).XYZ()); diff --git a/src/GeomLib/GeomLib_Tool.cxx b/src/GeomLib/GeomLib_Tool.cxx index bbb3ded9a3..2049a723bf 100644 --- a/src/GeomLib/GeomLib_Tool.cxx +++ b/src/GeomLib/GeomLib_Tool.cxx @@ -81,8 +81,6 @@ // the proximity of point to curve or surface. It is clear that this tolerance // value can't be too high to be not in conflict with previous rule. static const Standard_Real MAXTOLERANCEGEOM = 1.e-4; -static const Standard_Real MAXTOLERANCEPARM = 1.e-3; -static const Standard_Real UNKNOWNVALUE = 1.e+100; static const Standard_Real PARTOLERANCE = 1.e-9; //======================================================================= diff --git a/src/GeomPlate/GeomPlate_CurveConstraint.cxx b/src/GeomPlate/GeomPlate_CurveConstraint.cxx index 47214d981a..0e3fae5355 100644 --- a/src/GeomPlate/GeomPlate_CurveConstraint.cxx +++ b/src/GeomPlate/GeomPlate_CurveConstraint.cxx @@ -312,7 +312,7 @@ void GeomPlate_CurveConstraint :: SetProjectedCurve (const Handle(Adaptor2d_HCur //--------------------------------------------------------- Handle(Adaptor3d_HCurve) GeomPlate_CurveConstraint :: Curve3d () const { if (my3dCurve.IsNull()) - return myFrontiere; + return Handle(Adaptor3d_HCurve) (myFrontiere); else return my3dCurve; } diff --git a/src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx b/src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx index 45ec10e1dd..e0ab5b6dae 100644 --- a/src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx +++ b/src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx @@ -134,6 +134,6 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d const Handle(StepGeom_Axis2Placement3d) & GeomToStep_MakeAxis2Placement3d::Value() const { - StdFail_NotDone_Raise_if(!done == Standard_True,""); + StdFail_NotDone_Raise_if(!done,""); return theAxis2Placement3d; } diff --git a/src/GeometryTest/GeometryTest_ConstraintCommands.cxx b/src/GeometryTest/GeometryTest_ConstraintCommands.cxx index f53022a648..cf647cc280 100644 --- a/src/GeometryTest/GeometryTest_ConstraintCommands.cxx +++ b/src/GeometryTest/GeometryTest_ConstraintCommands.cxx @@ -753,7 +753,7 @@ static Standard_Integer gcarc (Draw_Interpretor& di,Standard_Integer n, const ch if (!strcmp(a[2], "seg")) { if (DrawTrSurf::GetPoint(a[3], P1)) { if (DrawTrSurf::GetPoint(a[4], P2)) { - Handle(Geom_Curve) theline = GC_MakeSegment(P1,P2).Value(); + Handle(Geom_Curve) theline (GC_MakeSegment(P1,P2).Value()); DrawTrSurf::Set(a[1], theline); return 1; } @@ -767,12 +767,12 @@ static Standard_Integer gcarc (Draw_Interpretor& di,Standard_Integer n, const ch if (n>6) { DrawTrSurf::GetPoint(a[6], P4); gp_Vec V1 = gp_Vec(P2,P3); - Handle(Geom_Curve)thearc = GC_MakeArcOfCircle(P1,V1,P4).Value(); + Handle(Geom_Curve)thearc (GC_MakeArcOfCircle(P1,V1,P4).Value()); DrawTrSurf::Set(a[1], thearc); return 1; } else { - Handle(Geom_Curve)thearc = GC_MakeArcOfCircle(P1,P2,P3).Value(); + Handle(Geom_Curve)thearc (GC_MakeArcOfCircle(P1,P2,P3).Value()); DrawTrSurf::Set(a[1], thearc); return 1; } diff --git a/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx b/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx index 5337f2cd99..174c2c0e17 100644 --- a/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx +++ b/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx @@ -644,8 +644,8 @@ static Standard_Integer convbz(Draw_Interpretor& di, Standard_Real Tol = Precision::Confusion(); NbU = Draw::Atoi(a[2]); - if ( (Handle(Geom_Curve):: - DownCast(DrawTrSurf::Get(a[3]))).IsNull()) { + Handle(Geom_Curve) aCurve (Handle(Geom_Curve)::DownCast(DrawTrSurf::Get(a[3]))); + if (aCurve.IsNull()) { // Cas Surfacique NbV = Draw::Atoi(a[3]); if (n<4+NbU*NbV) { diff --git a/src/Graphic3d/Graphic3d_Group.hxx b/src/Graphic3d/Graphic3d_Group.hxx index 13d1aaf9de..7e48241564 100644 --- a/src/Graphic3d/Graphic3d_Group.hxx +++ b/src/Graphic3d/Graphic3d_Group.hxx @@ -28,6 +28,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -42,13 +46,10 @@ #include #include #include + +class Graphic3d_Structure; class Graphic3d_GroupDefinitionError; class Standard_OutOfRange; -class Graphic3d_Structure; -class Graphic3d_AspectLine3d; -class Graphic3d_AspectFillArea3d; -class Graphic3d_AspectText3d; -class Graphic3d_AspectMarker3d; class TCollection_ExtendedString; class Graphic3d_ArrayOfPrimitives; class gp_Ax2; @@ -90,7 +91,7 @@ class Graphic3d_Group : public MMgt_TShared public: - + //! Supress all primitives and attributes of . //! To clear group without update in Graphic3d_StructureManager //! pass Standard_False as . This @@ -99,68 +100,68 @@ public: //! already released (pointers are used here to avoid handle //! cross-reference); Standard_EXPORT virtual void Clear (const Standard_Boolean theUpdateStructureMgr = Standard_True); - + Standard_EXPORT virtual void UpdateAspectLine (const Standard_Boolean theIsGlobal) = 0; - + Standard_EXPORT virtual void UpdateAspectFace (const Standard_Boolean theIsGlobal) = 0; - + Standard_EXPORT virtual void UpdateAspectMarker (const Standard_Boolean theIsGlobal) = 0; - + Standard_EXPORT virtual void UpdateAspectText (const Standard_Boolean theIsGlobal) = 0; - + //! Supress the group in the structure. Standard_EXPORT void Destroy(); ~Graphic3d_Group() { Destroy(); } - + //! Supress the group in the structure. //! Warning: No more graphic operations in after this call. //! Modifies the current modelling transform persistence (pan, zoom or rotate) //! Get the current modelling transform persistence (pan, zoom or rotate) Standard_EXPORT void Remove(); - + //! Modifies the context for all the line primitives //! of the group. Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX); - + //! Modifies the context for all the face primitives //! of the group. Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX); - + //! Modifies the context for all the text primitives //! of the group. Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX); - + //! Modifies the context for all the marker primitives //! of the group. Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX); - + //! Modifies the current context of the group to give //! another aspect for all the line primitives created //! after this call in the group. Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX); - + //! Modifies the current context of the group to give //! another aspect for all the face primitives created //! after this call in the group. Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX); - + //! Modifies the current context of the group to give //! another aspect for all the text primitives created //! after this call in the group. Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX); - + //! Modifies the current context of the group to give //! another aspect for all the marker primitives created //! after this call in the group. Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX); - + //! Sets the coordinates of the boundary box of the //! group . Standard_EXPORT void SetMinMaxValues (const Standard_Real XMin, const Standard_Real YMin, const Standard_Real ZMin, const Standard_Real XMax, const Standard_Real YMax, const Standard_Real ZMax); - + //! Creates the string at position . //! The 3D point of attachment is projected. The text is //! written in the plane of projection. @@ -172,7 +173,7 @@ public: //! AAngle : Orientation of the text //! (with respect to the horizontal). Standard_EXPORT virtual void Text (const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True); - + //! Creates the string at position . //! The 3D point of attachment is projected. The text is //! written in the plane of projection. @@ -187,7 +188,7 @@ public: //! AHta : HTA_LEFT //! AVta : VTA_BOTTOM Standard_EXPORT void Text (const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax = Standard_True); - + //! Creates the string at position . //! The 3D point of attachment is projected. The text is //! written in the plane of projection. @@ -199,7 +200,7 @@ public: //! AAngle : Orientation of the text //! (with respect to the horizontal). Standard_EXPORT void Text (const TCollection_ExtendedString& AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True); - + //! Creates the string at position . //! The 3D point of attachment is projected. The text is //! written in the plane of projection. @@ -214,63 +215,63 @@ public: //! AHta : HTA_LEFT //! AVta : VTA_BOTTOM Standard_EXPORT void Text (const TCollection_ExtendedString& AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax = Standard_True); - + //! Adds an array of primitives for display Standard_EXPORT virtual void AddPrimitiveArray (const Graphic3d_TypeOfPrimitiveArray theType, const Handle(Graphic3d_IndexBuffer)& theIndices, const Handle(Graphic3d_Buffer)& theAttribs, const Handle(Graphic3d_BoundBuffer)& theBounds, const Standard_Boolean theToEvalMinMax = Standard_True); - + //! Adds an array of primitives for display Standard_EXPORT void AddPrimitiveArray (const Handle(Graphic3d_ArrayOfPrimitives)& thePrim, const Standard_Boolean theToEvalMinMax = Standard_True); - + //! Creates a primitive array with single marker using AddPrimitiveArray(). Standard_EXPORT void Marker (const Graphic3d_Vertex& thePoint, const Standard_Boolean theToEvalMinMax = Standard_True); - + //! Creates a UserDraw primitive using obsolete API. Standard_EXPORT virtual void UserDraw (const Standard_Address theObject, const Standard_Boolean theToEvalMinMax = Standard_True, const Standard_Boolean theContainsFacet = Standard_False); - + //! sets the stencil test to theIsEnabled state; Standard_EXPORT virtual void SetStencilTestOptions (const Standard_Boolean theIsEnabled) = 0; - + //! sets the flipping to theIsEnabled state. Standard_EXPORT virtual void SetFlippingOptions (const Standard_Boolean theIsEnabled, const gp_Ax2& theRefPlane) = 0; - + //! Returns TRUE if aspect is set for the group. Standard_EXPORT Standard_Boolean IsGroupPrimitivesAspectSet (const Graphic3d_GroupAspect theAspect) const; - + //! Returns the context of all the primitives of the group. Standard_EXPORT void GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF) const; - + //! Returns the last inserted context in the group //! foreach kind of primitives. Standard_EXPORT void PrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF) const; - + //! Returns Standard_True if the group contains //! Polygons, Triangles or Quadrangles. Standard_EXPORT Standard_Boolean ContainsFacet() const; - + //! Returns Standard_True if the group is deleted. //! is deleted after the call Remove (me) or the //! associated structure is deleted. Standard_EXPORT Standard_Boolean IsDeleted() const; - + //! Returns Standard_True if the group is empty. Standard_EXPORT Standard_Boolean IsEmpty() const; - + //! Returns the coordinates of the boundary box of the //! group . Standard_EXPORT void MinMaxValues (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const; - + //! Returns boundary box of the group without transformation applied, Standard_EXPORT const Graphic3d_BndBox4f& BoundingBox() const; - + //! Returns non-const boundary box of the group without transformation applied, Standard_EXPORT Graphic3d_BndBox4f& ChangeBoundingBox(); - + //! Returns the structure containing the group . Standard_EXPORT Handle(Graphic3d_Structure) Structure() const; - + //! Changes property shown that primitive arrays within this group form closed volume (do no contain open shells). Standard_EXPORT void SetClosed (const Standard_Boolean theIsClosed); - + //! Return true if primitive arrays within this graphic group form closed volume (do no contain open shells). Standard_EXPORT Standard_Boolean IsClosed() const; @@ -281,7 +282,7 @@ friend class Graphic3d_Structure; protected: - + //! Creates a group in the structure . Standard_EXPORT Graphic3d_Group(const Handle(Graphic3d_Structure)& theStructure); @@ -297,10 +298,10 @@ protected: private: - + //! Returns the extreme coordinates found in the group. Standard_EXPORT void MinMaxCoord (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const; - + //! Calls the Update method of the StructureManager which //! contains the associated Structure of the Group . Standard_EXPORT void Update() const; diff --git a/src/Graphic3d/Graphic3d_MaterialAspect.cxx b/src/Graphic3d/Graphic3d_MaterialAspect.cxx index 96b9b72c9f..627e66bb48 100644 --- a/src/Graphic3d/Graphic3d_MaterialAspect.cxx +++ b/src/Graphic3d/Graphic3d_MaterialAspect.cxx @@ -128,7 +128,7 @@ void Graphic3d_MaterialAspect::Init (const Graphic3d_NameOfMaterial theName) myBSDF.Le = Graphic3d_Vec3 (static_cast (myDiffuseColor.Red()), static_cast (myDiffuseColor.Green()), static_cast (myDiffuseColor.Blue())); - myBSDF.Fresnel == Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.3f, 0.3f, 0.3f)); + myBSDF.Fresnel = Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.3f, 0.3f, 0.3f)); break; case Graphic3d_NOM_METALIZED: myShininess = Standard_ShortReal (0.13); @@ -368,7 +368,7 @@ void Graphic3d_MaterialAspect::Init (const Graphic3d_NameOfMaterial theName) myBSDF.Kr = Graphic3d_Vec3 (0.207843f, 0.207843f, 0.207843f); myBSDF.Le = Graphic3d_Vec3 (0.0f, 1.0f, 0.46f); - myBSDF.Fresnel == Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.3f, 0.3f, 0.3f)); + myBSDF.Fresnel = Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.3f, 0.3f, 0.3f)); break; case Graphic3d_NOM_OBSIDIAN: myMaterialType = Graphic3d_MATERIAL_PHYSIC; diff --git a/src/IGESBasic/IGESBasic_Group.cxx b/src/IGESBasic/IGESBasic_Group.cxx index 98a90b3c77..152d43acc2 100644 --- a/src/IGESBasic/IGESBasic_Group.cxx +++ b/src/IGESBasic/IGESBasic_Group.cxx @@ -108,9 +108,10 @@ IGESBasic_Group::IGESBasic_Group () { InitTypeAndForm(402,1); } (const Standard_Integer Index) const { return theEntities->Value(Index); } - Handle(Standard_Transient) IGESBasic_Group::Value - (const Standard_Integer Index) const - { return theEntities->Value(Index); } +Handle(Standard_Transient) IGESBasic_Group::Value (const Standard_Integer Index) const +{ + return Handle(Standard_Transient) (theEntities->Value(Index)); +} void IGESBasic_Group::SetValue (const Standard_Integer Index, const Handle(IGESData_IGESEntity)& ent) diff --git a/src/IGESBasic/IGESBasic_SubfigureDef.cxx b/src/IGESBasic/IGESBasic_SubfigureDef.cxx index cac62a7754..19f6b9d0a9 100644 --- a/src/IGESBasic/IGESBasic_SubfigureDef.cxx +++ b/src/IGESBasic/IGESBasic_SubfigureDef.cxx @@ -61,8 +61,7 @@ IGESBasic_SubfigureDef::IGESBasic_SubfigureDef () { } return theAssocEntities->Value(Index); } - Handle(Standard_Transient) IGESBasic_SubfigureDef::Value - (const Standard_Integer Index) const +Handle(Standard_Transient) IGESBasic_SubfigureDef::Value (const Standard_Integer Index) const { - return theAssocEntities->Value(Index); + return Handle(Standard_Transient) (theAssocEntities->Value(Index)); } diff --git a/src/IGESData/IGESData_FileProtocol.cxx b/src/IGESData/IGESData_FileProtocol.cxx index 686afd87a4..74b5671333 100644 --- a/src/IGESData/IGESData_FileProtocol.cxx +++ b/src/IGESData/IGESData_FileProtocol.cxx @@ -41,7 +41,7 @@ IGESData_FileProtocol::IGESData_FileProtocol () { } (const Standard_Integer num) const { Handle(IGESData_Protocol) res; - if (num == 1) return theresource; + if (num == 1) return Handle(Interface_Protocol) (theresource); else if (!thenext.IsNull()) return thenext->Resource(num-1); return res; // Null } diff --git a/src/IGESDraw/IGESDraw_ToolViewsVisible.cxx b/src/IGESDraw/IGESDraw_ToolViewsVisible.cxx index 2f3724ce74..d235fcd84d 100644 --- a/src/IGESDraw/IGESDraw_ToolViewsVisible.cxx +++ b/src/IGESDraw/IGESDraw_ToolViewsVisible.cxx @@ -207,7 +207,7 @@ void IGESDraw_ToolViewsVisible::OwnCheck { Standard_Integer res = 0; Standard_Integer nb = ent->NbDisplayedEntities(); - Handle(IGESData_ViewKindEntity) entcomp = ent; + Handle(IGESData_ViewKindEntity) entcomp (ent); for (Standard_Integer i = 1; i <= nb; i ++) { Handle(IGESData_IGESEntity) displayed = ent->DisplayedEntity(i); if (entcomp != displayed->View()) res ++; @@ -246,7 +246,7 @@ Standard_Boolean IGESDraw_ToolViewsVisible::OwnCorrect // Les entites affichees doivent referencer . Elles ont priorite. Standard_Boolean res = Standard_False; Standard_Integer nb = ent->NbDisplayedEntities(); - Handle(IGESData_ViewKindEntity) entcomp = ent; + Handle(IGESData_ViewKindEntity) entcomp (ent); for (Standard_Integer i = 1; i <= nb; i ++) { Handle(IGESData_IGESEntity) displayed = ent->DisplayedEntity(i); if (entcomp != displayed->View()) res = Standard_True; diff --git a/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.cxx b/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.cxx index 0d4c3fc85f..c9ebce1287 100644 --- a/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.cxx +++ b/src/IGESDraw/IGESDraw_ToolViewsVisibleWithAttr.cxx @@ -314,7 +314,7 @@ void IGESDraw_ToolViewsVisibleWithAttr::OwnCheck if (ent->LineFontValue(i) != 0 && ent->IsFontDefinition(i)) ach->AddFail ("At least one Line Font Definition Mismatch (both Value and Entity"); } - Handle(IGESData_ViewKindEntity) entcomp = ent; + Handle(IGESData_ViewKindEntity) entcomp (ent); Standard_Integer res = 0; nb = ent->NbDisplayedEntities(); for (i = 1; i <= nb; i ++) { @@ -387,7 +387,7 @@ Standard_Boolean IGESDraw_ToolViewsVisibleWithAttr::OwnCorrect // Les entites affichees doivent referencer . Elles ont priorite. Standard_Boolean res = Standard_False; Standard_Integer nb = ent->NbDisplayedEntities(); - Handle(IGESData_ViewKindEntity) entcomp = ent; + Handle(IGESData_ViewKindEntity) entcomp (ent); for (Standard_Integer i = 1; i <= nb; i ++) { Handle(IGESData_IGESEntity) displayed = ent->DisplayedEntity(i); if (entcomp != displayed->View()) res = Standard_True; diff --git a/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx b/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx index b9e7530019..f35ad6b985 100644 --- a/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx +++ b/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx @@ -2567,7 +2567,7 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1, Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False; Standard_Boolean isForce = Standard_False; - if((aWLFindStatus[i] == WLFStatus_Absent)) + if (aWLFindStatus[i] == WLFStatus_Absent) { if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D)) { diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx index 69748c6898..77709c3a8f 100644 --- a/src/IntTools/IntTools_FaceFace.cxx +++ b/src/IntTools/IntTools_FaceFace.cxx @@ -821,8 +821,8 @@ Standard_Real IntTools_FaceFace::ComputeTolerance() } } } + } } - } // return aDMax; } @@ -2178,30 +2178,6 @@ Standard_Real IntTools_FaceFace::ComputeTolerance() 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; diff --git a/src/LDOM/LDOMBasicString.hxx b/src/LDOM/LDOMBasicString.hxx index feaaa7e603..6a08d0fdc1 100644 --- a/src/LDOM/LDOMBasicString.hxx +++ b/src/LDOM/LDOMBasicString.hxx @@ -21,6 +21,7 @@ #include #include +class LDOM_MemManager; class LDOM_NullPtr; class TCollection_AsciiString; class TCollection_ExtendedString; diff --git a/src/LocOpe/LocOpe_WiresOnShape.cxx b/src/LocOpe/LocOpe_WiresOnShape.cxx index ea8a555335..4493fc8d76 100644 --- a/src/LocOpe/LocOpe_WiresOnShape.cxx +++ b/src/LocOpe/LocOpe_WiresOnShape.cxx @@ -594,7 +594,7 @@ void PutPCurve(const TopoDS_Edge& Edg, Handle(Standard_Type) styp = S->DynamicType(); if (styp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { - S = (*((Handle(Geom_RectangularTrimmedSurface)*)&(S)))->BasisSurface(); + S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface(); styp = S->DynamicType(); } @@ -823,7 +823,7 @@ void PutPCurves(const TopoDS_Edge& Efrom, S = BRep_Tool::Surface(Fac, LocFac); styp = S->DynamicType(); if (styp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { - S = (*((Handle(Geom_RectangularTrimmedSurface)*)&(S)))->BasisSurface(); + S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface(); styp = S->DynamicType(); } if (styp == STANDARD_TYPE(Geom_Plane)) { @@ -1031,7 +1031,7 @@ void PutPCurves(const TopoDS_Edge& Efrom, S = BRep_Tool::Surface(Fac); styp = S->DynamicType(); if (styp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { - S = (*((Handle(Geom_RectangularTrimmedSurface)*)&(S)))->BasisSurface(); + S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface(); styp = S->DynamicType(); } diff --git a/src/Message/Message_Algorithm.hxx b/src/Message/Message_Algorithm.hxx index ecb93e3095..10b7f459bb 100644 --- a/src/Message/Message_Algorithm.hxx +++ b/src/Message/Message_Algorithm.hxx @@ -21,15 +21,18 @@ #include #include -#include #include #include #include #include #include #include +#include +#include #include #include +#include + class Message_Messenger; class TCollection_AsciiString; class TCollection_HAsciiString; diff --git a/src/Message/Message_Msg.hxx b/src/Message/Message_Msg.hxx index 36225547fc..7529a33efe 100644 --- a/src/Message/Message_Msg.hxx +++ b/src/Message/Message_Msg.hxx @@ -20,12 +20,10 @@ #include #include -#include +#include +#include #include -#include -#include -#include -#include + class TCollection_ExtendedString; class TCollection_AsciiString; class TCollection_HAsciiString; diff --git a/src/OpenGl/OpenGl_PrimitiveArray.cxx b/src/OpenGl/OpenGl_PrimitiveArray.cxx index ccf176ca7e..d6a89a8506 100644 --- a/src/OpenGl/OpenGl_PrimitiveArray.cxx +++ b/src/OpenGl/OpenGl_PrimitiveArray.cxx @@ -29,17 +29,6 @@ namespace { - //! Convert index data type from size - inline GLenum toGlIndexType (const Standard_Integer theStride) - { - switch (theStride) - { - case 2: return GL_UNSIGNED_SHORT; - case 4: return GL_UNSIGNED_INT; - default: return GL_NONE; - } - } - //! Convert data type to GL info inline GLenum toGlDataType (const Graphic3d_TypeOfData theType, GLint& theNbComp) diff --git a/src/OpenGl/OpenGl_Structure.hxx b/src/OpenGl/OpenGl_Structure.hxx index a9b9dd9764..827694512f 100644 --- a/src/OpenGl/OpenGl_Structure.hxx +++ b/src/OpenGl/OpenGl_Structure.hxx @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/src/OpenGl/OpenGl_VertexBufferCompat.cxx b/src/OpenGl/OpenGl_VertexBufferCompat.cxx index 8d820e53d7..f81d2cd206 100644 --- a/src/OpenGl/OpenGl_VertexBufferCompat.cxx +++ b/src/OpenGl/OpenGl_VertexBufferCompat.cxx @@ -84,54 +84,6 @@ void OpenGl_VertexBufferCompat::Unbind (const Handle(OpenGl_Context)& ) const // } -//! Convert GL type to Graphic3d enumeration -static inline bool toGraphic3dDataType (const GLuint theNbComponents, - const GLenum theGlType, - Graphic3d_TypeOfData& theType) -{ - switch (theGlType) - { - case GL_UNSIGNED_BYTE: - { - if (theNbComponents == 4) - { - theType = Graphic3d_TOD_VEC4UB; - return true; - } - return false; - } - case GL_UNSIGNED_SHORT: - { - if (theNbComponents == 1) - { - theType = Graphic3d_TOD_USHORT; - return true; - } - return false; - } - case GL_UNSIGNED_INT: - { - if (theNbComponents == 1) - { - theType = Graphic3d_TOD_UINT; - return true; - } - return false; - } - case GL_FLOAT: - { - switch (theNbComponents) - { - case 2: theType = Graphic3d_TOD_VEC2; return true; - case 3: theType = Graphic3d_TOD_VEC3; return true; - case 4: theType = Graphic3d_TOD_VEC4; return true; - } - return false; - } - } - return false; -} - // ======================================================================= // function : initLink // purpose : diff --git a/src/OpenGl/OpenGl_View.cxx b/src/OpenGl/OpenGl_View.cxx index e687f242b6..f602c2014f 100644 --- a/src/OpenGl/OpenGl_View.cxx +++ b/src/OpenGl/OpenGl_View.cxx @@ -35,18 +35,9 @@ namespace { - static const Tmatrix3 myDefaultMatrix = { { 1.F, 0.F, 0.F, 0.F }, { 0.F, 1.F, 0.F, 0.F }, { 0.F, 0.F, 1.F, 0.F }, { 0.F, 0.F, 0.F, 1.F } }; static const OPENGL_ZCLIP myDefaultZClip = { { Standard_True, 0.F }, { Standard_True, 1.F } }; - static const OPENGL_FOG myDefaultFog = { Standard_False, 0.F, 1.F, { { 0.F, 0.F, 0.F, 1.F } } }; static const TEL_TRANSFORM_PERSISTENCE myDefaultTransPers = { 0, 0.F, 0.F, 0.F }; - static const GLdouble THE_IDENTITY_MATRIX[4][4] = - { - {1.0, 0.0, 0.0, 0.0}, - {0.0, 1.0, 0.0, 0.0}, - {0.0, 0.0, 1.0, 0.0}, - {0.0, 0.0, 0.0, 1.0} - }; } /*----------------------------------------------------------------------*/ diff --git a/src/OpenGl/OpenGl_Workspace.cxx b/src/OpenGl/OpenGl_Workspace.cxx index d2619f9f6f..daaace8e6b 100644 --- a/src/OpenGl/OpenGl_Workspace.cxx +++ b/src/OpenGl/OpenGl_Workspace.cxx @@ -221,6 +221,17 @@ OpenGl_Workspace::OpenGl_Workspace (const Handle(OpenGl_GraphicDriver)& theDrive myFrontCulling.ChangeEdge() = 0; } +// ======================================================================= +// function : SetActiveView +// purpose : +// ======================================================================= +void OpenGl_Workspace::SetActiveView (const Handle(OpenGl_View)& theView, + const Standard_Integer theViewId) +{ + myView = theView; + myViewId = theViewId; +} + // ======================================================================= // function : SetImmediateModeDrawToFront // purpose : diff --git a/src/OpenGl/OpenGl_Workspace.hxx b/src/OpenGl/OpenGl_Workspace.hxx index aa1bca9249..2de1dfeebd 100644 --- a/src/OpenGl/OpenGl_Workspace.hxx +++ b/src/OpenGl/OpenGl_Workspace.hxx @@ -63,6 +63,7 @@ class OpenGl_FrameBuffer; class OpenGl_Structure; class OpenGl_TriangleSet; class OpenGl_Element; +class OpenGl_View; class Image_PixMap; //! OpenGL material definition @@ -148,11 +149,7 @@ public: virtual ~OpenGl_Workspace(); void SetActiveView (const Handle(OpenGl_View)& theView, - const Standard_Integer theViewId) - { - myView = theView; - myViewId = theViewId; - } + const Standard_Integer theViewId); const Handle(OpenGl_View)& ActiveView() const { return myView; } diff --git a/src/Prs3d/Prs3d_LineAspect.hxx b/src/Prs3d/Prs3d_LineAspect.hxx index ba2f5e9b71..acfeab1fc4 100644 --- a/src/Prs3d/Prs3d_LineAspect.hxx +++ b/src/Prs3d/Prs3d_LineAspect.hxx @@ -23,8 +23,8 @@ #include #include #include -#include -class Graphic3d_AspectLine3d; +#include + class Quantity_Color; diff --git a/src/Prs3d/Prs3d_Text.hxx b/src/Prs3d/Prs3d_Text.hxx index faa77fa85c..193b366710 100644 --- a/src/Prs3d/Prs3d_Text.hxx +++ b/src/Prs3d/Prs3d_Text.hxx @@ -23,11 +23,11 @@ #include #include +#include + class Prs3d_Presentation; class TCollection_ExtendedString; class gp_Pnt; -class Prs3d_TextAspect; - //! A framework to define the display of texts. class Prs3d_Text : public Prs3d_Root diff --git a/src/QABugs/QABugs_13.cxx b/src/QABugs/QABugs_13.cxx index 89258d5bc2..81a236f49e 100644 --- a/src/QABugs/QABugs_13.cxx +++ b/src/QABugs/QABugs_13.cxx @@ -159,10 +159,7 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc, // endPoint, // origin.Location(), // Standard_True).Value(); - Handle(Geom_Curve) SpineCurve = GC_MakeArcOfCircle(circle, - 0.0, - bend_angle, - Standard_True).Value(); + Handle(Geom_Curve) SpineCurve (GC_MakeArcOfCircle (circle, 0.0, bend_angle, Standard_True).Value()); // SUPPORT: // - Use correct formula for scaling laws @@ -500,10 +497,7 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con BRepBuilderAPI_MakeFace mkFace; - Handle(Geom_Curve) SpineCurve = GC_MakeArcOfCircle(circle, - endPoint, - origin.Location(), - Standard_True).Value(); + Handle(Geom_Curve) SpineCurve (GC_MakeArcOfCircle (circle, endPoint, origin.Location(), Standard_True).Value()); Handle(Law_Linear) myLaw = new Law_Linear(); Handle(Law_Linear) myLaw2 = new Law_Linear(); diff --git a/src/QABugs/QABugs_19.cxx b/src/QABugs/QABugs_19.cxx index 2c856b93e7..35dd54732f 100644 --- a/src/QABugs/QABugs_19.cxx +++ b/src/QABugs/QABugs_19.cxx @@ -202,7 +202,7 @@ static Standard_Integer OCC22980 (Draw_Interpretor& di, Standard_Integer /*argc* static Standard_Integer OCC23595 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char** /*argv*/) { - const Handle(TDocStd_Application)& anApp = XCAFApp_Application::GetApplication(); + Handle(TDocStd_Application) anApp = XCAFApp_Application::GetApplication(); Handle(TDocStd_Document) aDoc; anApp->NewDocument ("XmlXCAF", aDoc); QCOMPARE (!aDoc.IsNull(), Standard_True); diff --git a/src/QANCollection/QANCollection_Handle.cxx b/src/QANCollection/QANCollection_Handle.cxx index 0ed5aecb80..c38466893e 100644 --- a/src/QANCollection/QANCollection_Handle.cxx +++ b/src/QANCollection/QANCollection_Handle.cxx @@ -33,10 +33,6 @@ #include #include -#if defined(__GNUC__) && __cplusplus < 201103L -#include -#endif - // auxiliary macro to check and report status #define CHECK(di,ok,what) di << "Checking " << what << (ok ? ": OK\n" : ": Error\n") @@ -393,7 +389,7 @@ static Standard_Integer QAHandleInc (Draw_Interpretor& theDI, } Handle(Standard_Transient) aHandle = new Standard_Transient(); - std::tr1::shared_ptr aSharePtr (new Standard_Transient()); + std::shared_ptr aSharePtr (new Standard_Transient()); theDI << "Time of creating and destroying " << aNbIters << " smart pointers to the same object, per item, ns:"; { { @@ -409,7 +405,7 @@ static Standard_Integer QAHandleInc (Draw_Interpretor& theDI, { QATimer aTimer (theDI, "\nsC++ shared_ptr: ", QATimer::ns, aNbIters); { - std::vector< std::tr1::shared_ptr > aSharePointers (aNbIters); + std::vector< std::shared_ptr > aSharePointers (aNbIters); for (Standard_Integer anIter = 0; anIter < aNbIters; ++anIter) { aSharePointers[anIter] = aSharePtr; @@ -461,14 +457,14 @@ namespace template static void doShareCast (Draw_Interpretor& theDI, const Standard_Integer theNbIters, - const std::tr1::shared_ptr& theSharePtr) + const std::shared_ptr& theSharePtr) { - std::vector< std::tr1::shared_ptr > aSharePointers (theNbIters); + std::vector< std::shared_ptr > aSharePointers (theNbIters); { QATimer aTimer (theDI, " ", QATimer::ns, theNbIters); for (Standard_Integer anIter = 0; anIter < theNbIters; ++anIter) { - aSharePointers[anIter] = std::tr1::dynamic_pointer_cast (theSharePtr); + aSharePointers[anIter] = std::dynamic_pointer_cast (theSharePtr); } } } @@ -524,7 +520,7 @@ namespace } theDI << "\nC++ dynamic_pointer_cast: "; { - std::tr1::shared_ptr aPtr ((typename TAs::element_type* )theInst.Clone()); + std::shared_ptr aPtr ((typename TAs::element_type* )theInst.Clone()); QA_TEST_CAST10(0, doShareCast); QA_TEST_CAST10(1, doShareCast); QA_TEST_CAST10(2, doShareCast); diff --git a/src/QANCollection/QANCollection_Stl.cxx b/src/QANCollection/QANCollection_Stl.cxx index adf58d19e6..e36a5afa6c 100644 --- a/src/QANCollection/QANCollection_Stl.cxx +++ b/src/QANCollection/QANCollection_Stl.cxx @@ -489,6 +489,7 @@ void TestForwardIterator () typename CollectionType::const_iterator::value_type ct = *cit; ct = *cit; + (void)ct; // *cit2 = ct; // *(cit2.operator-> ()) = t; diff --git a/src/STEPConstruct/STEPConstruct_Assembly.cxx b/src/STEPConstruct/STEPConstruct_Assembly.cxx index 6b8aa05b69..08be352c67 100644 --- a/src/STEPConstruct/STEPConstruct_Assembly.cxx +++ b/src/STEPConstruct/STEPConstruct_Assembly.cxx @@ -143,7 +143,7 @@ void STEPConstruct_Assembly::MakeRelationship () Handle(Standard_Transient) STEPConstruct_Assembly::ItemValue () const { - if (theval.IsNull()) return thesr; + if (theval.IsNull()) return Handle(Standard_Transient) (thesr); return theval; } diff --git a/src/STEPConstruct/STEPConstruct_ContextTool.cxx b/src/STEPConstruct/STEPConstruct_ContextTool.cxx index 068af0f90e..6f22ac6b4e 100644 --- a/src/STEPConstruct/STEPConstruct_ContextTool.cxx +++ b/src/STEPConstruct/STEPConstruct_ContextTool.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/src/Standard/Standard.hxx b/src/Standard/Standard.hxx index 3440d77200..998e3ea368 100644 --- a/src/Standard/Standard.hxx +++ b/src/Standard/Standard.hxx @@ -17,10 +17,7 @@ #ifndef _Standard_HeaderFile #define _Standard_HeaderFile -#include #include -#include - #include #include #include @@ -49,7 +46,7 @@ public: //! Deallocates memory blocks //! @param thePtr - previously allocated memory block to be freed Standard_EXPORT static void Free (const Standard_Address thePtr); - + //! Template version of function Free(), nullifies the argument pointer //! @param thePtr - previously allocated memory block to be freed template @@ -74,7 +71,7 @@ public: //! Deallocates memory blocks //! @param thePtrAligned the memory block previously allocated with AllocateAligned() Standard_EXPORT static void FreeAligned (const Standard_Address thePtrAligned); - + //! Template version of function FreeAligned(), nullifies the argument pointer //! @param thePtrAligned the memory block previously allocated with AllocateAligned() template diff --git a/src/StdSelect/StdSelect_EdgeFilter.cxx b/src/StdSelect/StdSelect_EdgeFilter.cxx index 44c402a962..60378e6391 100644 --- a/src/StdSelect/StdSelect_EdgeFilter.cxx +++ b/src/StdSelect/StdSelect_EdgeFilter.cxx @@ -65,9 +65,11 @@ StdSelect_TypeOfEdge StdSelect_EdgeFilter::Type() const //================================================== Standard_Boolean StdSelect_EdgeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& EO) const { - if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull()) return Standard_False; - - const TopoDS_Shape& sh = Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape(); + Handle(StdSelect_BRepOwner) aBO (Handle(StdSelect_BRepOwner)::DownCast(EO)); + if (aBO.IsNull()) + return Standard_False; + + const TopoDS_Shape& sh = aBO->Shape(); if(sh.ShapeType()!= TopAbs_EDGE) return Standard_False; switch(mytype){ diff --git a/src/StdSelect/StdSelect_FaceFilter.cxx b/src/StdSelect/StdSelect_FaceFilter.cxx index b9164ba087..62134f67d4 100644 --- a/src/StdSelect/StdSelect_FaceFilter.cxx +++ b/src/StdSelect/StdSelect_FaceFilter.cxx @@ -53,9 +53,14 @@ StdSelect_TypeOfFace StdSelect_FaceFilter::Type() const Standard_Boolean StdSelect_FaceFilter:: IsOk(const Handle(SelectMgr_EntityOwner)& EO) const { - if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull()) return Standard_False; - const TopoDS_Shape& anobj= Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape(); - if(anobj.ShapeType()!= TopAbs_FACE)return Standard_False; + Handle(StdSelect_BRepOwner) aBO (Handle(StdSelect_BRepOwner)::DownCast(EO)); + if (aBO.IsNull()) + return Standard_False; + + const TopoDS_Shape& anobj = aBO->Shape(); + if(anobj.ShapeType()!= TopAbs_FACE) + return Standard_False; + switch(mytype) { case StdSelect_AnyFace: return Standard_True; diff --git a/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx b/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx index 4dfe23a7af..3563ed7d41 100644 --- a/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx +++ b/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx @@ -103,7 +103,7 @@ Standard_Boolean StepToTopoDS_GeometricTool::IsSeamCurve const Handle(StepShape_Edge)& StepEdge, const Handle(StepShape_EdgeLoop)& EdgeLoop) { - if (!Handle(StepGeom_SeamCurve)::DownCast(SurfCurve).IsNull()) + if (SurfCurve->IsKind(STANDARD_TYPE(StepGeom_SeamCurve))) return Standard_True; if (SurfCurve->NbAssociatedGeometry() != 2) return Standard_False; diff --git a/src/TDataXtd/TDataXtd_Constraint.cxx b/src/TDataXtd/TDataXtd_Constraint.cxx index 09d1e99732..32122528bb 100644 --- a/src/TDataXtd/TDataXtd_Constraint.cxx +++ b/src/TDataXtd/TDataXtd_Constraint.cxx @@ -202,10 +202,7 @@ TDataXtd_Constraint::TDataXtd_Constraint() void TDataXtd_Constraint::SetPlane(const Handle(TNaming_NamedShape)& plane) { // OCC2932 correction - Handle(TNaming_NamedShape) aPlane = - Handle(TNaming_NamedShape)::DownCast(myPlane); - if (aPlane.IsNull() == Standard_False && plane.IsNull() == Standard_False) - if ( aPlane -> Get() == plane->Get()) + if (! myPlane.IsNull() && ! plane.IsNull() && myPlane->Get() == plane->Get()) return; Backup(); @@ -218,7 +215,7 @@ void TDataXtd_Constraint::SetPlane(const Handle(TNaming_NamedShape)& plane) //======================================================================= const Handle(TNaming_NamedShape)& TDataXtd_Constraint::GetPlane() const { - return Handle(TNaming_NamedShape)::DownCast (myPlane); + return myPlane; } //======================================================================= diff --git a/src/TDataXtd/TDataXtd_Constraint.hxx b/src/TDataXtd/TDataXtd_Constraint.hxx index dcc789c427..1f23d66974 100644 --- a/src/TDataXtd/TDataXtd_Constraint.hxx +++ b/src/TDataXtd/TDataXtd_Constraint.hxx @@ -25,6 +25,7 @@ #include #include #include + class TDataStd_Real; class TDF_Attribute; class Standard_GUID; @@ -207,18 +208,10 @@ private: TDataXtd_ConstraintEnum myType; Handle(TDataStd_Real) myValue; Handle(TDF_Attribute) myGeometries[4]; - Handle(TDF_Attribute) myPlane; + Handle(TNaming_NamedShape) myPlane; Standard_Boolean myIsReversed; Standard_Boolean myIsInverted; Standard_Boolean myIsVerified; - - }; - - - - - - #endif // _TDataXtd_Constraint_HeaderFile diff --git a/src/TDocStd/TDocStd_MultiTransactionManager.cxx b/src/TDocStd/TDocStd_MultiTransactionManager.cxx index 437ea17a76..cf1fbe71b0 100644 --- a/src/TDocStd/TDocStd_MultiTransactionManager.cxx +++ b/src/TDocStd/TDocStd_MultiTransactionManager.cxx @@ -194,7 +194,7 @@ void TDocStd_MultiTransactionManager::DumpTransaction(Standard_OStream& anOS) co else anOS << "There are " << myDocuments.Length() << " documents ( "; for(i = 1; i <= myDocuments.Length(); i++) { - Handle(Standard_Transient) aDoc = myDocuments.Value(i); + Handle(Standard_Transient) aDoc (myDocuments.Value(i)); anOS << "\"" << aDoc.get(); anOS << "\" "; } diff --git a/src/V3d/V3d_LayerMgr.cxx b/src/V3d/V3d_LayerMgr.cxx index 7eec4e0b4f..e7e1a102e5 100644 --- a/src/V3d/V3d_LayerMgr.cxx +++ b/src/V3d/V3d_LayerMgr.cxx @@ -81,7 +81,7 @@ Handle(Aspect_ColorScale) V3d_LayerMgr::ColorScale() const that->myColorScaleLayerItem = new V3d_ColorScaleLayerItem( that->myColorScale ); } - return myColorScale; + return Handle(Aspect_ColorScale) (myColorScale); } Standard_Boolean V3d_LayerMgr::Begin() diff --git a/src/V3d/V3d_Viewer_4.cxx b/src/V3d/V3d_Viewer_4.cxx index 16f2a674e2..ebf9d41a7f 100644 --- a/src/V3d/V3d_Viewer_4.cxx +++ b/src/V3d/V3d_Viewer_4.cxx @@ -39,10 +39,10 @@ Handle(Aspect_Grid) V3d_Viewer::Grid() const { switch (myGridType) { - case Aspect_GT_Circular: return myCGrid; - case Aspect_GT_Rectangular: return myRGrid; + case Aspect_GT_Circular: return Handle(Aspect_Grid) (myCGrid); + case Aspect_GT_Rectangular: return Handle(Aspect_Grid) (myRGrid); } - return myRGrid; + return Handle(Aspect_Grid) (myRGrid); } // ======================================================================= diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index 095acb9c89..aac3b95325 100644 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -2810,7 +2810,7 @@ inline void bndPresentation (Draw_Interpretor& theDI, } case BndAction_Show: { - Handle(Graphic3d_Structure) aPrs = thePrs->Presentation(); + Handle(Graphic3d_Structure) aPrs (thePrs->Presentation()); aPrs->CStructure()->HighlightColor.r = 0.988235f; aPrs->CStructure()->HighlightColor.g = 0.988235f; aPrs->CStructure()->HighlightColor.b = 0.988235f; @@ -5267,8 +5267,11 @@ static Standard_Integer VLoadSelection (Draw_Interpretor& /*theDi*/, { const TCollection_AsciiString& aName = aNamesOfIO.Value (anIter); - const Handle(AIS_InteractiveObject)& aShape = GetMapOfAIS().IsBound2 (aName) ? - Handle(AIS_InteractiveObject)::DownCast (GetMapOfAIS().Find2 (aName)) : GetAISShapeFromName (aName.ToCString()); + Handle(AIS_InteractiveObject) aShape; + if (GetMapOfAIS().IsBound2 (aName)) + aShape = Handle(AIS_InteractiveObject)::DownCast (GetMapOfAIS().Find2 (aName)); + else + aShape = GetAISShapeFromName (aName.ToCString()); if (!aShape.IsNull()) { diff --git a/src/ViewerTest/ViewerTest_RelationCommands.cxx b/src/ViewerTest/ViewerTest_RelationCommands.cxx index 5c36252a2c..8c191afac8 100644 --- a/src/ViewerTest/ViewerTest_RelationCommands.cxx +++ b/src/ViewerTest/ViewerTest_RelationCommands.cxx @@ -814,7 +814,6 @@ static int VDiameterDimBuilder(Draw_Interpretor& di, Standard_Integer argc, cons { // Declarations Standard_Integer aCurrentIndex; - Standard_Real aRadius; // Verification if (argc != 2) @@ -867,9 +866,6 @@ static int VDiameterDimBuilder(Draw_Interpretor& di, Standard_Integer argc, cons return 1; } - gp_Circ aCircle = aCurve.Circle(); - aRadius = 2.0 * aCircle.Radius(); - // Construction of the diameter dimension. TheAISContext()->CloseLocalContext (aCurrentIndex); Handle (AIS_DiameterDimension) aDiamDim= new AIS_DiameterDimension (aShape); @@ -1741,7 +1737,6 @@ static int VRadiusDimBuilder(Draw_Interpretor& di, Standard_Integer argc, const { // Declarations Standard_Integer aCurrentIndex; - Standard_Real aRadius; TopoDS_Edge anEdge; // Verification if (argc != 2) @@ -1808,12 +1803,6 @@ static int VRadiusDimBuilder(Draw_Interpretor& di, Standard_Integer argc, const di << argv[0] << " error: the edge is not a circular one." << "\n"; return 1; } - else - { - gp_Circ aCircle = aCurve.Circle(); - aRadius = aCircle.Radius(); - aRadius = Round (aRadius * 10.0) / 10.0; - } // Close the context TheAISContext()->CloseLocalContext (aCurrentIndex); @@ -2616,7 +2605,6 @@ static int VMoveDim (Draw_Interpretor& theDi, Standard_Integer theArgNum, const Handle(AIS_InteractiveObject) aPickedObj; gp_Pnt aPoint (gp::Origin()); - Standard_Integer aCurrentIndex = 0; Standard_Integer aMaxPickNum = 5; // Find object @@ -2650,7 +2638,6 @@ static int VMoveDim (Draw_Interpretor& theDi, Standard_Integer theArgNum, const // Open local context and get its index for recovery. TheAISContext()->OpenLocalContext(); - aCurrentIndex = TheAISContext()->IndexOfCurrentLocal(); // Loop that will be handle picking. Standard_Integer anArgNum = 5; diff --git a/src/VrmlData/VrmlData_ShapeConvert.cxx b/src/VrmlData/VrmlData_ShapeConvert.cxx index a399e11d56..0f29c5462b 100644 --- a/src/VrmlData/VrmlData_ShapeConvert.cxx +++ b/src/VrmlData/VrmlData_ShapeConvert.cxx @@ -375,7 +375,7 @@ Handle(VrmlData_Geometry) VrmlData_ShapeConvert::triToIndexedFaceSet new VrmlData_Normal (myScene, 0L, nNodes, arrVec); myScene.AddNode (aNormalNode, Standard_False); aFaceSet->SetNormals (aNormalNode); - return aFaceSet; + return Handle(VrmlData_Geometry) (aFaceSet); } Poly_Connect PC(theTri); @@ -449,7 +449,7 @@ Handle(VrmlData_Geometry) VrmlData_ShapeConvert::triToIndexedFaceSet } } - return aFaceSet; + return Handle(VrmlData_Geometry) (aFaceSet); } //======================================================================= @@ -492,7 +492,7 @@ Handle(VrmlData_Geometry) VrmlData_ShapeConvert::polToIndexedLineSet myScene.AddNode (aCoordNode, Standard_False); aLineSet->SetCoordinates (aCoordNode); - return aLineSet; + return Handle(VrmlData_Geometry) (aLineSet); } //======================================================================= diff --git a/src/XSControl/XSControl_WorkSession.cxx b/src/XSControl/XSControl_WorkSession.cxx index 2a240214c0..7d620f1a92 100644 --- a/src/XSControl/XSControl_WorkSession.cxx +++ b/src/XSControl/XSControl_WorkSession.cxx @@ -639,7 +639,7 @@ void XSControl_WorkSession::ClearBinders() Handle(Transfer_Binder) bnd = FP->MapItem ( i ); if(!bnd.IsNull()) aSeqBnd.Append(bnd); - Handle(Standard_Transient) ash = FP->Mapped(i); + Handle(Standard_Transient) ash (FP->Mapped(i)); aSeqShapes.Append(ash); } //removing finder process containing result of translation.