0024023: Revamp the OCCT Handle -- downcast (automatic)
[occt.git] / src / TopOpeBRepDS / TopOpeBRepDS_GapTool.cxx
index f0c0fa9..0bce0f8 100644 (file)
@@ -219,7 +219,7 @@ Standard_Boolean TopOpeBRepDS_GapTool::ParameterOnEdge(const Handle(TopOpeBRepDS
     if (myInterToShape.IsBound(I)) {
       const TopoDS_Shape& S = myInterToShape(I);
       if (S.IsSame(E)) {
-       U = (*((Handle(TopOpeBRepDS_CurvePointInterference)*)&I))->Parameter();
+       U = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (I)->Parameter();
        return 1;
       }
     }
@@ -229,7 +229,7 @@ Standard_Boolean TopOpeBRepDS_GapTool::ParameterOnEdge(const Handle(TopOpeBRepDS
       if (myInterToShape.IsBound(II)) {
        const TopoDS_Shape& S = myInterToShape(II);
        if (S.IsSame(E)) {
-         U = (*((Handle(TopOpeBRepDS_CurvePointInterference)*)&II))->Parameter();
+         U = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (II)->Parameter();
          return 1;
        }       
       }
@@ -251,7 +251,7 @@ void TopOpeBRepDS_GapTool::SetParameterOnEdge(const Handle(TopOpeBRepDS_Interfer
     if (myInterToShape.IsBound(I)) {
       const TopoDS_Shape& S = myInterToShape(I);
       if (S.IsSame(E)) {
-       (*((Handle(TopOpeBRepDS_CurvePointInterference)*)&I))->Parameter(U);
+       Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (I)->Parameter(U);
       }
     }
     const TopOpeBRepDS_ListOfInterference& LI = myGToI(I->Geometry());
@@ -260,7 +260,7 @@ void TopOpeBRepDS_GapTool::SetParameterOnEdge(const Handle(TopOpeBRepDS_Interfer
       if (myInterToShape.IsBound(II)) {
        const TopoDS_Shape& S = myInterToShape(II);
        if (S.IsSame(E)) {
-         (*((Handle(TopOpeBRepDS_CurvePointInterference)*)&II))->Parameter(U);
+         Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (II)->Parameter(U);
        }       
       }
     }