]> OCCT Git - occt-copy.git/commitdiff
0024023: Revamp the OCCT Handle -- downcast (automatic)
authorabv <abv@opencascade.com>
Thu, 2 Jul 2015 13:41:05 +0000 (16:41 +0300)
committerabv <abv@opencascade.com>
Sat, 11 Jul 2015 09:08:05 +0000 (12:08 +0300)
Automatic update by command "occt_upgrade . -downcast"

C-style cast of Handle to that of derived type (now illegal) is replaced by call to DownCast()
Const reference local variables of Handle type initialized by result of DownCast are replaced by normal variables.

158 files changed:
src/AIS/AIS.cxx
src/AIS/AIS_AttributeFilter.cxx
src/AIS/AIS_BadEdgeFilter.cxx
src/AIS/AIS_C0RegularityFilter.cxx
src/AIS/AIS_ConcentricRelation.cxx
src/AIS/AIS_EqualDistanceRelation.cxx
src/AIS/AIS_IdenticRelation.cxx
src/AIS/AIS_InteractiveContext.cxx
src/AIS/AIS_InteractiveContext_1.cxx
src/AIS/AIS_InteractiveObject.cxx
src/AIS/AIS_LengthDimension.cxx
src/AIS/AIS_LocalContext.cxx
src/AIS/AIS_LocalContext_1.cxx
src/AIS/AIS_MidPointRelation.cxx
src/AIS/AIS_ParallelRelation.cxx
src/AIS/AIS_PerpendicularRelation.cxx
src/AIS/AIS_Plane.cxx
src/AIS/AIS_Relation.cxx
src/AIS/AIS_Selection.cxx
src/AIS/AIS_SymmetricRelation.cxx
src/AIS/AIS_TangentRelation.cxx
src/AIS/AIS_TypeFilter.cxx
src/AppDef/AppDef_MultiPointConstraint.cxx
src/AppDef/AppDef_Variational.cxx
src/AppParCurves/AppParCurves_MultiPoint.cxx
src/BOPTest/BOPTest_LowCommands.cxx
src/BOPTools/BOPTools_AlgoTools2D.cxx
src/BOPTools/BOPTools_AlgoTools_1.cxx
src/BRep/BRep_Tool.cxx
src/BRepCheck/BRepCheck_Edge.cxx
src/BRepCheck/BRepCheck_Vertex.cxx
src/BRepFeat/BRepFeat_MakeDPrism.cxx
src/BRepFeat/BRepFeat_MakePrism.cxx
src/BRepFeat/BRepFeat_MakeRevol.cxx
src/BRepFill/BRepFill_Pipe.cxx
src/BRepFill/BRepFill_Sweep.cxx
src/BRepGProp/BRepGProp_EdgeTool.cxx
src/BRepGProp/BRepGProp_Face.cxx
src/BRepLib/BRepLib.cxx
src/BRepLib/BRepLib_FuseEdges.cxx
src/BRepMAT2d/BRepMAT2d_Explorer.cxx
src/BRepOffset/BRepOffset_Inter2d.cxx
src/BRepOffset/BRepOffset_Offset.cxx
src/BRepOffset/BRepOffset_Tool.cxx
src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx
src/BRepTest/BRepTest_MatCommands.cxx
src/BinMDF/BinMDF_ADriverTable.cxx
src/Bisector/Bisector_BisecAna.cxx
src/BndLib/BndLib_Add3dCurve.cxx
src/ChFi3d/ChFi3d_Builder_0.cxx
src/DNaming/DNaming.cxx
src/DrawDim/DrawDim_PlanarAngle.cxx
src/FEmTool/FEmTool_Curve.cxx
src/Geom/Geom_OsculatingSurface.cxx
src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx
src/GeomAdaptor/GeomAdaptor_Curve.cxx
src/GeomAdaptor/GeomAdaptor_Surface.cxx
src/GeomConvert/GeomConvert_1.cxx
src/GeomFill/GeomFill_BoundWithSurf.cxx
src/GeomFill/GeomFill_ConstrainedFilling.cxx
src/GeomFill/GeomFill_Profiler.cxx
src/GeomFill/GeomFill_SimpleBound.cxx
src/GeomFill/GeomFill_Sweep.cxx
src/GeomInt/GeomInt_LineConstructor.cxx
src/GeomLib/GeomLib.cxx
src/GeometryTest/GeometryTest_CurveCommands.cxx
src/HLRBRep/HLRBRep.cxx
src/IntPatch/IntPatch_ImpImpIntersection_0.gxx
src/IntPatch/IntPatch_ImpImpIntersection_4.gxx
src/IntPatch/IntPatch_ImpPrmIntersection.cxx
src/IntPatch/IntPatch_Intersection.cxx
src/IntPatch/IntPatch_LineConstructor.cxx
src/IntPatch/IntPatch_PrmPrmIntersection.cxx
src/IntPatch/IntPatch_RstInt.cxx
src/IntTools/IntTools_EdgeEdge.cxx
src/IntTools/IntTools_FaceFace.cxx
src/LocOpe/LocOpe_FindEdges.cxx
src/LocOpe/LocOpe_Generator.cxx
src/LocOpe/LocOpe_Spliter.cxx
src/LocOpe/LocOpe_WiresOnShape.cxx
src/PCDM/PCDM.cxx
src/PCDM/PCDM_RetrievalDriver.cxx
src/Prs3d/Prs3d_ShapeTool.cxx
src/PrsMgr/PrsMgr_Presentation.cxx
src/QABugs/QABugs_1.cxx
src/QABugs/QABugs_16.cxx
src/RWStepAP214/RWStepAP214_GeneralModule.cxx
src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx
src/SelectMgr/SelectMgr_SelectionManager.cxx
src/SelectMgr/SelectMgr_SensitiveEntitySet.cxx
src/SelectMgr/SelectMgr_ViewerSelector.cxx
src/ShapeAnalysis/ShapeAnalysis_Curve.cxx
src/StdSelect/StdSelect_BRepSelectionTool.cxx
src/StdSelect/StdSelect_EdgeFilter.cxx
src/StdSelect/StdSelect_FaceFilter.cxx
src/StdSelect/StdSelect_ViewerSelector3d.cxx
src/StepToGeom/StepToGeom_MakeBoundedCurve.cxx
src/StepToGeom/StepToGeom_MakeBoundedCurve2d.cxx
src/StepToGeom/StepToGeom_MakeBoundedSurface.cxx
src/StepToGeom/StepToGeom_MakeConic.cxx
src/StepToGeom/StepToGeom_MakeConic2d.cxx
src/StepToGeom/StepToGeom_MakeCurve.cxx
src/StepToGeom/StepToGeom_MakeCurve2d.cxx
src/StepToGeom/StepToGeom_MakeElementarySurface.cxx
src/StepToGeom/StepToGeom_MakeSurface.cxx
src/StepToGeom/StepToGeom_MakeSweptSurface.cxx
src/TDF/TDF_ClosureTool.cxx
src/TDF/TDF_CopyTool.cxx
src/TDataStd/TDataStd_ByteArray.cxx
src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx
src/TDataStd/TDataStd_DeltaOnModificationOfExtStringArray.cxx
src/TDataStd/TDataStd_DeltaOnModificationOfIntArray.cxx
src/TDataStd/TDataStd_DeltaOnModificationOfIntPackedMap.cxx
src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx
src/TDataStd/TDataStd_ExtStringArray.cxx
src/TDataStd/TDataStd_IntPackedMap.cxx
src/TDataStd/TDataStd_IntegerArray.cxx
src/TDataStd/TDataStd_RealArray.cxx
src/TDataXtd/TDataXtd_Constraint.cxx
src/TDataXtd/TDataXtd_Geometry.cxx
src/TDocStd/TDocStd_XLink.cxx
src/TNaming/TNaming_DeltaOnModification.cxx
src/TNaming/TNaming_NamedShape.cxx
src/TNaming/TNaming_Selector.cxx
src/TNaming/TNaming_Tool.cxx
src/TNaming/TNaming_Translator.cxx
src/TPrsStd/TPrsStd_ConstraintTools.cxx
src/TopOpeBRep/TopOpeBRep_LineInter.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON2d.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_EdgeBuilder.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_KPart.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_Tools_1.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx
src/TopOpeBRepDS/TopOpeBRepDS_Check.cxx
src/TopOpeBRepDS/TopOpeBRepDS_Curve.cxx
src/TopOpeBRepDS/TopOpeBRepDS_Dumper.cxx
src/TopOpeBRepDS/TopOpeBRepDS_EIR.cxx
src/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx
src/TopOpeBRepDS/TopOpeBRepDS_FIR.cxx
src/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx
src/TopOpeBRepDS/TopOpeBRepDS_GapFiller.cxx
src/TopOpeBRepDS/TopOpeBRepDS_GapTool.cxx
src/TopOpeBRepDS/TopOpeBRepDS_InterferenceTool.cxx
src/TopOpeBRepDS/TopOpeBRepDS_PointIterator.cxx
src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx
src/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx
src/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx
src/Units/Units_UnitsDictionary.cxx
src/Units/Units_UnitsSystem.cxx
src/V3d/V3d_View_4.cxx
src/ViewerTest/ViewerTest.cxx
src/ViewerTest/ViewerTest_ObjectCommands.cxx
src/Visual3d/Visual3d_ViewManager.cxx

index a5d3ed2013e41663443c78fe0f705285845f6185..7bd61b999587a2dabda9712394776fae3f4aa03f 100644 (file)
@@ -188,30 +188,30 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge&  theEdge,
   if (!anEdgeLoc.IsIdentity())
   {
     Handle(Geom_Geometry) aGeometry = theCurve->Transformed (anEdgeLoc.Transformation());
-    theCurve = (Handle(Geom_Curve)&) aGeometry;
+    theCurve = Handle(Geom_Curve)::DownCast (aGeometry);
   }
 
   if (theCurve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve)))
   {
-    theCurve = ((Handle(Geom_TrimmedCurve)&) theCurve)->BasisCurve();
+    theCurve = Handle(Geom_TrimmedCurve)::DownCast (theCurve)->BasisCurve();
   }
 
   if (theCurve->IsInstance (STANDARD_TYPE (Geom_Line)))
   {
-    Handle(Geom_Line) aLine = (Handle(Geom_Line)&) theCurve;
+    Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast (theCurve);
     theFirstPnt = ElCLib::Value (aFirst, aLine->Lin());
     theLastPnt = ElCLib::Value (aLast, aLine->Lin());
   }
   else if (theCurve->IsInstance (STANDARD_TYPE (Geom_Circle)))
   {
-    Handle(Geom_Circle) aCirc = (Handle(Geom_Circle)&) theCurve;
+    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast (theCurve);
 
     theFirstPnt = ElCLib::Value (aFirst, aCirc->Circ());
     theLastPnt = ElCLib::Value (aLast, aCirc->Circ());
   }
   else if (theCurve->IsInstance (STANDARD_TYPE (Geom_Ellipse)))
   {
-    Handle(Geom_Ellipse) anEllipse = (Handle(Geom_Ellipse)&) theCurve;
+    Handle(Geom_Ellipse) anEllipse = Handle(Geom_Ellipse)::DownCast (theCurve);
     theFirstPnt = ElCLib::Value (aFirst, anEllipse->Elips());
     theLastPnt = ElCLib::Value (aLast, anEllipse->Elips());
   }
@@ -252,7 +252,7 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge,
 
   if (theCurve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve)))
   {
-    theCurve = ((Handle(Geom_TrimmedCurve)&) theCurve)->BasisCurve();
+    theCurve = Handle(Geom_TrimmedCurve)::DownCast (theCurve)->BasisCurve();
   }
 
   if (!theIsInfinite)
@@ -306,19 +306,19 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge,
   theIsOnPlane = Standard_True;
   if (theExtCurve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve)))
   {
-    theExtCurve = ((Handle(Geom_TrimmedCurve)&) theExtCurve)->BasisCurve();
+    theExtCurve = Handle(Geom_TrimmedCurve)::DownCast (theExtCurve)->BasisCurve();
   }
 
   if (theExtCurve->IsInstance (STANDARD_TYPE (Geom_Line)))
   {
-    Handle(Geom_Line) aLine = (Handle(Geom_Line)&) theExtCurve;
+    Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast (theExtCurve);
     theIsOnPlane = thePlane->Pln().Contains (aLine->Lin(),
                                              Precision::Confusion(),
                                              Precision::Angular());
   }
   else if (theExtCurve->IsInstance (STANDARD_TYPE (Geom_Circle)))
   {
-    Handle(Geom_Circle) aCircle = (Handle(Geom_Circle)&) theExtCurve;
+    Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast (theExtCurve);
 
     gp_Ax3 aCircPos (aCircle->Position());
     theIsOnPlane = aCircPos.IsCoplanar (thePlane->Pln().Position(),
@@ -337,7 +337,7 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge,
 
   if (theCurve->IsInstance (STANDARD_TYPE (Geom_Line)))
   {
-    Handle(Geom_Line) aLine = (Handle(Geom_Line)&) theCurve;
+    Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast (theCurve);
     if (!theIsInfinite)
     {
       theFirstPnt = ElCLib::Value (aFirst, aLine->Lin());
@@ -346,14 +346,14 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge,
   }
   else if (theCurve->IsInstance (STANDARD_TYPE (Geom_Circle)))
   {
-    Handle(Geom_Circle) aCirc = (Handle(Geom_Circle)&) theCurve;
+    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast (theCurve);
 
     theFirstPnt = ElCLib::Value (aFirst, aCirc->Circ());
     theLastPnt = ElCLib::Value (aLast, aCirc->Circ());
   }
   else if (theCurve->IsInstance (STANDARD_TYPE (Geom_Ellipse)))
     {
-      Handle(Geom_Ellipse) anEllipse = (Handle(Geom_Ellipse)&) theCurve;
+      Handle(Geom_Ellipse) anEllipse = Handle(Geom_Ellipse)::DownCast (theCurve);
 
       theFirstPnt = ElCLib::Value (aFirst, anEllipse->Elips());
       theLastPnt = ElCLib::Value (aLast, anEllipse->Elips());
@@ -404,13 +404,13 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
   if (!aFirstEdgeLoc.IsIdentity())
   {
     Handle(Geom_Geometry) aGeomGeometry = theFirstCurve->Transformed (aFirstEdgeLoc.Transformation());
-    theFirstCurve = (Handle(Geom_Curve)&) aGeomGeometry;
+    theFirstCurve = Handle(Geom_Curve)::DownCast (aGeomGeometry);
   }
     
   if (!aSecondEdgeLoc.IsIdentity())
   {
     Handle(Geom_Geometry) aGeomGeometry = theSecondCurve->Transformed (aSecondEdgeLoc.Transformation());
-    theSecondCurve = (Handle(Geom_Curve)&) aGeomGeometry;
+    theSecondCurve = Handle(Geom_Curve)::DownCast (aGeomGeometry);
   }
 
   theFirstCurve = GeomProjLib::ProjectOnPlane (theFirstCurve, thePlane,
@@ -425,24 +425,24 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
 
   if (theFirstCurve->IsInstance (STANDARD_TYPE(Geom_TrimmedCurve)))
   {
-    theFirstCurve = ((Handle(Geom_TrimmedCurve)&) theFirstCurve)->BasisCurve();
+    theFirstCurve = Handle(Geom_TrimmedCurve)::DownCast (theFirstCurve)->BasisCurve();
   }
     
   if (theSecondCurve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve)))
   {
-    theSecondCurve = ((Handle(Geom_TrimmedCurve)&) theSecondCurve)->BasisCurve();
+    theSecondCurve = Handle(Geom_TrimmedCurve)::DownCast (theSecondCurve)->BasisCurve();
   }
 
   if (theFirstCurve->IsInstance(STANDARD_TYPE(Geom_Line)))
   {
-    Handle(Geom_Line) aLine = (Handle(Geom_Line)&) theFirstCurve;
+    Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast (theFirstCurve);
 
     theFirstPnt1 = ElCLib::Value (aFirst1, aLine->Lin());
     theLastPnt1 = ElCLib::Value (aLast1, aLine->Lin());
   }
   else if (theFirstCurve->IsInstance(STANDARD_TYPE(Geom_Circle)))
   {
-    Handle(Geom_Circle) aCirc = (Handle(Geom_Circle)&) theFirstCurve;
+    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast (theFirstCurve);
       
     theFirstPnt1 = ElCLib::Value (aFirst1, aCirc->Circ());
     theLastPnt1 = ElCLib::Value (aLast1, aCirc->Circ());
@@ -454,14 +454,14 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
 
   if (theSecondCurve->IsInstance (STANDARD_TYPE (Geom_Line)))
 {
-    Handle(Geom_Line) aLine = (Handle(Geom_Line)&) theSecondCurve;
+    Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast (theSecondCurve);
 
     theFirstPnt2 = ElCLib::Value (aFirst2, aLine->Lin());
     theLastPnt2 = ElCLib::Value (aLast2, aLine->Lin());
   }
   else if (theSecondCurve->IsInstance (STANDARD_TYPE (Geom_Circle)))
   {
-    Handle(Geom_Circle) aCirc = (Handle(Geom_Circle)&) theSecondCurve;
+    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast (theSecondCurve);
 
     theFirstPnt2 = ElCLib::Value (aFirst2, aCirc->Circ());
     theLastPnt2 = ElCLib::Value (aLast2, aCirc->Circ());
@@ -505,8 +505,8 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
   {
       if (theFirstCurve->DynamicType() == theSecondCurve->DynamicType())
       {
-          gp_Lin aLin1 = ((Handle(Geom_Line)&) theFirstCurve)->Lin();
-          gp_Lin aLin2 = ((Handle(Geom_Line)&) theSecondCurve)->Lin();
+          gp_Lin aLin1 = Handle(Geom_Line)::DownCast (theFirstCurve)->Lin();
+          gp_Lin aLin2 = Handle(Geom_Line)::DownCast (theSecondCurve)->Lin();
 
           if (theIsInfinite1)
           {
@@ -597,11 +597,11 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
 
   if (theFirstCurve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve)))
   {
-    theFirstCurve = ((Handle(Geom_TrimmedCurve)&) theFirstCurve)->BasisCurve();
+    theFirstCurve = Handle(Geom_TrimmedCurve)::DownCast (theFirstCurve)->BasisCurve();
   }
   if (theSecondCurve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve)))
   {
-    theSecondCurve = ((Handle(Geom_TrimmedCurve)&) theSecondCurve)->BasisCurve();
+    theSecondCurve = Handle(Geom_TrimmedCurve)::DownCast (theSecondCurve)->BasisCurve();
   }
 
   aFirst1 = aFirstAdaptor.FirstParameter();
@@ -646,8 +646,8 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
   {
     if (theFirstCurve->DynamicType() == theSecondCurve->DynamicType())
     {
-      gp_Lin aLin1 = ((Handle(Geom_Line)&) theFirstCurve)->Lin();
-      gp_Lin aLin2 = ((Handle(Geom_Line)&) theSecondCurve)->Lin();
+      gp_Lin aLin1 = Handle(Geom_Line)::DownCast (theFirstCurve)->Lin();
+      gp_Lin aLin2 = Handle(Geom_Line)::DownCast (theSecondCurve)->Lin();
 
       if (theExtIndex == 1)
       {
@@ -735,7 +735,7 @@ Standard_Boolean AIS::ComputeGeomCurve (Handle(Geom_Curve)& aCurve,
     aCurve = aGeomCurve;
     if (aCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
     {
-      aCurve = ((Handle(Geom_TrimmedCurve)&) aCurve)->BasisCurve();
+      aCurve = Handle(Geom_TrimmedCurve)::DownCast (aCurve)->BasisCurve();
     }
     if (! Precision::IsInfinite(first1) && ! Precision::IsInfinite(last1))
     {
@@ -1426,8 +1426,8 @@ void AIS::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresen
   // Calculate  presentation of the edge
   if (ProjCurve->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
     // CLE
-    // const Handle(Geom_Line) & gl = (Handle(Geom_Line)&) ProjCurve;
-    Handle(Geom_Line) gl = (Handle(Geom_Line)&) ProjCurve;
+    // Handle(Geom_Line) gl (Handle(Geom_Line)::DownCast (ProjCurve));
+    Handle(Geom_Line) gl = Handle(Geom_Line)::DownCast (ProjCurve);
     // ENDCLE
     if ( !isInfinite) {
       pf = ElCLib::Parameter(gl->Lin(),FirstP);
@@ -1442,8 +1442,8 @@ void AIS::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresen
   }
   else if (ProjCurve->IsInstance(STANDARD_TYPE(Geom_Circle)) ) {
     // CLE
-    // const Handle(Geom_Circle) & gc = (Handle(Geom_Circle)&) ProjCurve;
-    Handle(Geom_Circle) gc = (Handle(Geom_Circle)&) ProjCurve;
+    // Handle(Geom_Circle) gc (Handle(Geom_Circle)::DownCast (ProjCurve));
+    Handle(Geom_Circle) gc = Handle(Geom_Circle)::DownCast (ProjCurve);
     // ENDCLE
     pf = ElCLib::Parameter(gc->Circ(),FirstP);
     pl = ElCLib::Parameter(gc->Circ(),LastP);
index a5eed56b3d8c8bb4b9740763d385d43b1815a08c..78b5b9dd6e58b09e700496425afc1a2d43639da0 100644 (file)
@@ -43,19 +43,19 @@ Standard_Boolean AIS_AttributeFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
 
 //#ifndef OCCT_DEBUG
   Handle(SelectMgr_SelectableObject) aSelectable = anObj->Selectable() ;
-  if( hasC && ((Handle(AIS_InteractiveObject)&) aSelectable)->HasColor() )
+  if( hasC && Handle(AIS_InteractiveObject)::DownCast (aSelectable)->HasColor() )
 //#else
 //  if(hasC && ((Handle(AIS_InteractiveObject)&) anObj->Selectable())->HasColor())
 //#endif
-    okstat =  (myCol == ((Handle(AIS_InteractiveObject)&) anObj)->Color());
+    okstat =  (myCol == Handle(AIS_InteractiveObject)::DownCast (anObj)->Color());
 
 //#ifndef OCCT_DEBUG
   aSelectable = anObj->Selectable() ;
-  if( hasW && ((Handle(AIS_InteractiveObject)&) aSelectable)->HasWidth() )
+  if( hasW && Handle(AIS_InteractiveObject)::DownCast (aSelectable)->HasWidth() )
 //#else
 //  if(hasW && ((Handle(AIS_InteractiveObject)&) anObj->Selectable())->HasWidth())
 //#endif
-    okstat =  (myWid == ((Handle(AIS_InteractiveObject)&) anObj)->Width()) && okstat;
+    okstat =  (myWid == Handle(AIS_InteractiveObject)::DownCast (anObj)->Width()) && okstat;
 
   return okstat;
   
index a8cfd10273fdb65ddedf82421f9ef6146cbefae5..0a0b2fc9012f66c0d1d89d028511025ade00f1df 100644 (file)
@@ -59,7 +59,7 @@ Standard_Boolean AIS_BadEdgeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& EO
   if (myContour==0)
     return Standard_True;
 
-  const TopoDS_Shape& aShape = ((Handle(StdSelect_BRepOwner)&)EO)->Shape();
+  const TopoDS_Shape& aShape = Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape();
 
   if (myBadEdges.IsBound(myContour)) {
     TopTools_ListIteratorOfListOfShape it(myBadEdges.Find(myContour));
index f22155d390ba49163cfd9b5e7244a25d488c8cfb..8e2562f4592c19cb8ed77e95b0981e3ed52ad65b 100644 (file)
@@ -80,7 +80,7 @@ Standard_Boolean AIS_C0RegularityFilter::IsOk(const Handle(SelectMgr_EntityOwner
   if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull())
     return Standard_False;
 
-  const TopoDS_Shape& aShape = ((Handle(StdSelect_BRepOwner)&)EO)->Shape();
+  const TopoDS_Shape& aShape = Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape();
 
   if(aShape.ShapeType()!= TopAbs_EDGE)
     return Standard_False;
index f209345691b6d19b20c0b84573fdee858c63592d..ee87e19aabc3205b5b50d3f4c7718120a22d6e5e 100644 (file)
@@ -118,7 +118,7 @@ void AIS_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_Pres
   gp_Pnt P;
   AIS::ComputeGeometry(V,P, myPlane, isOnPlanVertex);
 
-  const Handle(Geom_Circle)& CIRCLE = (Handle(Geom_Circle)&) C;
+  Handle(Geom_Circle) CIRCLE (Handle(Geom_Circle)::DownCast (C));
   myCenter = CIRCLE->Location();
   myRad = Min(CIRCLE->Radius()/5.,15.);
   gp_Dir vec(p1.XYZ() - myCenter.XYZ() );
@@ -180,8 +180,8 @@ void AIS_ConcentricRelation::ComputeTwoEdgesConcentric(const Handle(Prs3d_Presen
     return;
   }
   
-  const Handle(Geom_Circle)& gcirc1 = (Handle(Geom_Circle)&) geom1;
-  const Handle(Geom_Circle)& gcirc2 = (Handle(Geom_Circle)&) geom2;
+  Handle(Geom_Circle) gcirc1 (Handle(Geom_Circle)::DownCast (geom1));
+  Handle(Geom_Circle) gcirc2 (Handle(Geom_Circle)::DownCast (geom2));
   
   myCenter = gcirc1->Location();
   
index e4c7bcca5101ed7c763e19bf51899840522d1abe..a72181fd481778c880ab4668d96f02ab10617f0e 100644 (file)
@@ -401,8 +401,8 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
   
   if (cu1.GetType() == GeomAbs_Line && cu2.GetType() == GeomAbs_Line) 
     {
-      const Handle(Geom_Line)& geom_lin1 = (Handle(Geom_Line)&) geom1;
-      const Handle(Geom_Line)& geom_lin2 = (Handle(Geom_Line)&) geom2;
+      Handle(Geom_Line) geom_lin1 (Handle(Geom_Line)::DownCast (geom1));
+      Handle(Geom_Line) geom_lin2 (Handle(Geom_Line)::DownCast (geom2));
       const gp_Lin& l1 = geom_lin1->Lin();
       const gp_Lin& l2 = geom_lin2->Lin();
       
@@ -494,8 +494,8 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
 }
   if (cu1.GetType() == GeomAbs_Circle && cu2.GetType() == GeomAbs_Circle){
     //Get first and last points of circles
-    const Handle(Geom_Circle)& aCir1 = Handle(Geom_Circle)::DownCast(geom1);
-    const Handle(Geom_Circle)& aCir2 = Handle(Geom_Circle)::DownCast(geom2);
+    Handle(Geom_Circle) aCir1 (Handle(Geom_Circle)::DownCast(geom1));
+    Handle(Geom_Circle) aCir2 (Handle(Geom_Circle)::DownCast(geom2));
     gp_Circ aCirc1 = aCir1->Circ();
     gp_Circ aCirc2 = aCir2->Circ();
 
@@ -725,7 +725,7 @@ void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs
 
   if ( aCurve->IsInstance(STANDARD_TYPE(Geom_Line)) ) 
     {
-  const Handle(Geom_Line)& geom_lin = (Handle(Geom_Line)&) aCurve;
+  Handle(Geom_Line) geom_lin (Handle(Geom_Line)::DownCast (aCurve));
   const gp_Lin& l = geom_lin->Lin();
 
   // computation of Val
index 6031f37205c3f30e34b128e8f8e6d1108c60a08f..3b6cbccc6e57b446681a438d7093b384271db3c8 100644 (file)
@@ -420,7 +420,7 @@ void AIS_IdenticRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aS
 
          if ( isCircle ) // case of Circles
            {
-             Handle(Geom_Circle) thecirc = (Handle(Geom_Circle)&) curv1;
+             Handle(Geom_Circle) thecirc = Handle(Geom_Circle)::DownCast (curv1);
              Standard_Real udeb = ElCLib::Parameter(thecirc->Circ(),myFAttach);
              Standard_Real ufin = ElCLib::Parameter(thecirc->Circ(),mySAttach);
              Handle(Geom_TrimmedCurve) thecu = new Geom_TrimmedCurve(thecirc,udeb,ufin);
@@ -433,7 +433,7 @@ void AIS_IdenticRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aS
            }
          else if ( curv1->IsInstance(STANDARD_TYPE(Geom_Ellipse)) ) // case of ellipses
            {
-             Handle(Geom_Ellipse) theEll = (Handle(Geom_Ellipse)&) curv1;
+             Handle(Geom_Ellipse) theEll = Handle(Geom_Ellipse)::DownCast (curv1);
 
              Standard_Real udeb = ElCLib::Parameter(theEll->Elips(),myFAttach);
              Standard_Real ufin = ElCLib::Parameter(theEll->Elips(),mySAttach);
@@ -510,9 +510,9 @@ void AIS_IdenticRelation::ComputeTwoEdgesPresentation(const Handle(Prs3d_Present
   if ( curv1->IsInstance(STANDARD_TYPE(Geom_Line)) && curv2->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
     // we take the line curv1 like support
     Handle(Geom_Line) thelin;
-    if (isInfinite1 && !isInfinite2) thelin = (Handle(Geom_Line)&) curv2;
-    else if (!isInfinite1 && isInfinite2) thelin = (Handle(Geom_Line)&) curv1;
-    else thelin = (Handle(Geom_Line)&) curv1;
+    if (isInfinite1 && !isInfinite2) thelin = Handle(Geom_Line)::DownCast (curv2);
+    else if (!isInfinite1 && isInfinite2) thelin = Handle(Geom_Line)::DownCast (curv1);
+    else thelin = Handle(Geom_Line)::DownCast (curv1);
     ComputeTwoLinesPresentation(aPrs, thelin, firstp1, lastp1, firstp2, lastp2, isInfinite1, isInfinite2);
   }
 
@@ -520,7 +520,7 @@ void AIS_IdenticRelation::ComputeTwoEdgesPresentation(const Handle(Prs3d_Present
   else if ( curv1->IsInstance(STANDARD_TYPE(Geom_Circle)) && curv2->IsInstance(STANDARD_TYPE(Geom_Circle)) ) {
     //gp_Pnt curpos;
     isCircle = Standard_True; // useful for ComputeSelection
-    const Handle(Geom_Circle)& thecirc = (Handle(Geom_Circle)&) curv1;
+    Handle(Geom_Circle) thecirc (Handle(Geom_Circle)::DownCast (curv1));
     ComputeTwoCirclesPresentation(aPrs, thecirc, firstp1, lastp1, firstp2, lastp2);
   }
 
@@ -528,7 +528,7 @@ void AIS_IdenticRelation::ComputeTwoEdgesPresentation(const Handle(Prs3d_Present
   //  Treatement of the case of ellipses
   else if ( curv1->IsInstance(STANDARD_TYPE(Geom_Ellipse)) && curv2->IsInstance(STANDARD_TYPE(Geom_Ellipse)) )
       {
-       const Handle(Geom_Ellipse)& theEll = (Handle(Geom_Ellipse)&) curv1;
+       Handle(Geom_Ellipse) theEll (Handle(Geom_Ellipse)::DownCast (curv1));
        ComputeTwoEllipsesPresentation(aPrs, theEll, firstp1, lastp1, firstp2, lastp2);
       }
   // jfa 10/10/2000 end
@@ -1477,7 +1477,7 @@ void AIS_IdenticRelation::ComputeTwoVerticesPresentation(const Handle(Prs3d_Pres
       TColStd_ListIteratorOfListOfTransient it(Users());
       if (it.More())
        {
-         const Handle(AIS_Shape)& USER = Handle(AIS_Shape)::DownCast(it.Value());
+         Handle(AIS_Shape) USER (Handle(AIS_Shape)::DownCast(it.Value()));
          if (!USER.IsNull())
            {
              const TopoDS_Shape& SH =USER->Shape();
@@ -1576,19 +1576,19 @@ Standard_Boolean AIS_IdenticRelation::ComputeDirection(const TopoDS_Wire& aWire,
 
     gp_Dir d1, d2;
     if ( curv1->IsInstance(STANDARD_TYPE(Geom_Circle)) ) {
-      d1 = ComputeCircleDirection((Handle(Geom_Circle)&) curv1, VERT);
+      d1 = ComputeCircleDirection(Handle(Geom_Circle)::DownCast (curv1), VERT);
     }
     else if (curv1->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
-      d1 = ComputeLineDirection((Handle(Geom_Line)&) curv1, firstp1);
+      d1 = ComputeLineDirection(Handle(Geom_Line)::DownCast (curv1), firstp1);
     }
     else 
       return Standard_False;
     
     if ( curv2->IsInstance(STANDARD_TYPE(Geom_Circle)) ) {
-      d2 = ComputeCircleDirection( (Handle(Geom_Circle)&) curv2, VERT);
+      d2 = ComputeCircleDirection( Handle(Geom_Circle)::DownCast (curv2), VERT);
     }
     else if (curv2->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
-      d2 =ComputeLineDirection( (Handle(Geom_Line)&) curv2, firstp2);
+      d2 =ComputeLineDirection( Handle(Geom_Line)::DownCast (curv2), firstp2);
     }
     else 
       return Standard_False;
@@ -1613,10 +1613,10 @@ Standard_Boolean AIS_IdenticRelation::ComputeDirection(const TopoDS_Wire& aWire,
     if ( !AIS::ComputeGeometry(VEdge, curv1, firstp1, lastp1) )
       return Standard_False; 
     if ( curv1->IsInstance(STANDARD_TYPE(Geom_Circle)) ) {
-      dF = ComputeCircleDirection( (Handle(Geom_Circle)&) curv1, VERT);
+      dF = ComputeCircleDirection( Handle(Geom_Circle)::DownCast (curv1), VERT);
     }
     else if (curv1->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
-      dF = ComputeLineDirection( (Handle(Geom_Line)&) curv1, firstp1);
+      dF = ComputeLineDirection( Handle(Geom_Line)::DownCast (curv1), firstp1);
     }
     else
       return Standard_False;
@@ -1704,16 +1704,16 @@ void AIS_IdenticRelation::ComputeOneEdgeOVertexPresentation(const Handle(Prs3d_P
     // we take the median of the edges connected to vertices
     gp_Dir myDir;
     if ( aCurve->IsKind(STANDARD_TYPE(Geom_Line))) {
-      myDir = ((Handle(Geom_Line)&) aCurve)->Lin().Direction();
+      myDir = Handle(Geom_Line)::DownCast (aCurve)->Lin().Direction();
       myDir.Cross(myPlane->Pln().Axis().Direction());
     }
     else if (aCurve->IsKind(STANDARD_TYPE(Geom_Circle))) {
-      Handle(Geom_Circle) CIR = (Handle(Geom_Circle)&) aCurve;
+      Handle(Geom_Circle) CIR = Handle(Geom_Circle)::DownCast (aCurve);
       myDir.SetXYZ(myFAttach.XYZ() - CIR->Location().XYZ());
     }
     // jfa 10/10/2000
     else if (aCurve->IsKind(STANDARD_TYPE(Geom_Ellipse))) {
-      Handle(Geom_Ellipse) CIR = (Handle(Geom_Ellipse)&) aCurve;
+      Handle(Geom_Ellipse) CIR = Handle(Geom_Ellipse)::DownCast (aCurve);
       myDir.SetXYZ(myFAttach.XYZ() - CIR->Location().XYZ());
     }
     // jfa 10/10/2000 end
@@ -1735,7 +1735,7 @@ void AIS_IdenticRelation::ComputeOneEdgeOVertexPresentation(const Handle(Prs3d_P
                                  curpos);
   if (myExtShape != 0) {
     if (!extCurv.IsNull()) { // the edge is not in the WP
-     ComputeProjEdgePresentation(aPrs,E,(Handle(Geom_Line)&) aCurve,ptonedge1,ptonedge2);
+     ComputeProjEdgePresentation(aPrs,E,Handle(Geom_Line)::DownCast (aCurve),ptonedge1,ptonedge2);
     }
   }
 }
index 111128118836e719612ab09a1ffaa4ff55b5a015..ff0cad77a02bd02823fdf955d83a1ca0de34a1cc 100644 (file)
@@ -213,7 +213,7 @@ void AIS_InteractiveContext::DisplayedObjects (AIS_ListOfInteractive& theListOfI
   for (TColStd_MapIteratorOfMapOfTransient aDispMapIter (aDispMap); aDispMapIter.More(); aDispMapIter.Next())
   {
     const Handle(Standard_Transient)& aTransient = aDispMapIter.Key();
-    anObj = *((Handle(AIS_InteractiveObject)* )&aTransient);
+    anObj = Handle(AIS_InteractiveObject)::DownCast (aTransient);
     theListOfIO.Append (anObj);
   }
 }
@@ -2821,15 +2821,13 @@ void AIS_InteractiveContext::Disconnect (const Handle(AIS_InteractiveObject)& th
 {
   if (theAssembly->IsInstance ("AIS_MultipleConnectedInteractive"))
   {
-    const Handle(AIS_MultipleConnectedInteractive)& theObj =
-      Handle(AIS_MultipleConnectedInteractive)::DownCast (theAssembly);
+    Handle(AIS_MultipleConnectedInteractive) theObj (Handle(AIS_MultipleConnectedInteractive)::DownCast (theAssembly));
     theObj->Disconnect (theObjToDisconnect);
     mgrSelector->Remove (theObjToDisconnect);
   }
   else if (theAssembly->IsInstance ("AIS_ConnectedInteractive") && theObjToDisconnect.IsNull())
   {
-    const Handle(AIS_ConnectedInteractive)& theObj =
-      Handle(AIS_ConnectedInteractive)::DownCast (theAssembly);
+    Handle(AIS_ConnectedInteractive) theObj (Handle(AIS_ConnectedInteractive)::DownCast (theAssembly));
     theObj->Disconnect();
     mgrSelector->Remove (theObj);
   }
@@ -2855,8 +2853,7 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
   AIS_MapOfObjectOwners anObjectOwnerMap;
   for (aSelection->Init(); aSelection->More(); aSelection->Next())
   {
-    const Handle(AIS_InteractiveObject)& anObj =
-      Handle(AIS_InteractiveObject)::DownCast (aSelection->Value());
+    Handle(AIS_InteractiveObject) anObj (Handle(AIS_InteractiveObject)::DownCast (aSelection->Value()));
     if (!anObj.IsNull())
     {
       if (anObj->IsInfinite())
@@ -2868,8 +2865,7 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
     }
     else
     {
-      const Handle(SelectMgr_EntityOwner)& anOwner =
-        Handle(SelectMgr_EntityOwner)::DownCast (aSelection->Value());
+      Handle(SelectMgr_EntityOwner) anOwner (Handle(SelectMgr_EntityOwner)::DownCast (aSelection->Value()));
       if (anOwner.IsNull())
         continue;
 
index 3e583dd1d00b2a5469e64f1321a212335919ec18..4b7b25e24c63b03f739c9d48aab45f7a15c4deab 100644 (file)
@@ -541,7 +541,7 @@ void AIS_InteractiveContext::SetCurrentObject(const Handle(AIS_InteractiveObject
     sel->Init();
     while (sel->More()) {
       TR = sel->Value();
-      IO = *((Handle(AIS_InteractiveObject)*)&TR);
+      IO = Handle(AIS_InteractiveObject)::DownCast (TR);
       Unhilight(IO,Standard_False);
       IO->State(0);
       sel->Next();
@@ -675,7 +675,7 @@ void AIS_InteractiveContext::NextCurrent()
 Handle(AIS_InteractiveObject) AIS_InteractiveContext::Current() const 
 {
   Handle(Standard_Transient) TR = AIS_Selection::Selection(myCurrentName.ToCString())->Value();
-  Handle(AIS_InteractiveObject) IO = *((Handle(AIS_InteractiveObject)*)&TR);
+  Handle(AIS_InteractiveObject) IO = Handle(AIS_InteractiveObject)::DownCast (TR);
   return IO;
 }
 
@@ -718,7 +718,7 @@ void AIS_InteractiveContext::HilightCurrents(const Standard_Boolean updateviewer
   sel->Init();
   while (sel->More()) {
     TR = sel->Value();
-    IO = *((Handle(AIS_InteractiveObject)*)&TR);
+    IO = Handle(AIS_InteractiveObject)::DownCast (TR);
     HilightWithColor(IO,mySelectionColor,Standard_False);
     sel->Next();
   }
@@ -740,7 +740,7 @@ void AIS_InteractiveContext::UnhilightCurrents(const Standard_Boolean updateview
   sel->Init();
   while (sel->More()) {
     TR = sel->Value();
-    IO = *((Handle(AIS_InteractiveObject)*)&TR);
+    IO = Handle(AIS_InteractiveObject)::DownCast (TR);
     Unhilight(IO,Standard_False);
     sel->Next();
   }
@@ -762,7 +762,7 @@ void AIS_InteractiveContext::ClearCurrents(const Standard_Boolean updateviewer)
   Handle(AIS_InteractiveObject) IO;
   for(S->Init();S->More();S->Next()){
     Tr = S->Value();
-    IO = (*((Handle(AIS_InteractiveObject)*)&Tr));
+    IO = Handle(AIS_InteractiveObject)::DownCast (Tr);
     IO->State(0);
     Unhilight(IO,Standard_False);
   }
@@ -787,7 +787,7 @@ void AIS_InteractiveContext::HilightSelected(const Standard_Boolean updateviewer
     sel->Init();
     while (sel->More()) {
       TR = sel->Value();
-      IO = *((Handle(AIS_InteractiveObject)*)&TR);
+      IO = Handle(AIS_InteractiveObject)::DownCast (TR);
       HilightWithColor(IO,mySelectionColor,Standard_False);
       sel->Next();
     }
@@ -815,7 +815,7 @@ void AIS_InteractiveContext::UnhilightSelected(const Standard_Boolean updateview
     sel->Init();
     while (sel->More()) {
       TR = sel->Value();
-      IO = *((Handle(AIS_InteractiveObject)*)&TR);
+      IO = Handle(AIS_InteractiveObject)::DownCast (TR);
       Unhilight(IO,Standard_False);
       sel->Next();
     }
@@ -1055,7 +1055,7 @@ Handle(AIS_InteractiveObject) AIS_InteractiveContext::SelectedInteractive() cons
     if (AIS_Selection::Selection(myCurrentName.ToCString())->Extent() == 0)
       return NULL;
     Handle(Standard_Transient) TR  =AIS_Selection::Selection(myCurrentName.ToCString())->Value();
-    Handle(AIS_InteractiveObject) IO = *((Handle(AIS_InteractiveObject)*)&TR);
+    Handle(AIS_InteractiveObject) IO = Handle(AIS_InteractiveObject)::DownCast (TR);
     return IO;}
   
   return  myLocalContexts(myCurLocalIndex)->SelectedInteractive();
index 0b52a52843ee26860b6a26bda658e5628b9e5464..65a284be13e9d67b69de7ab5683a3c4a24cad86f 100644 (file)
@@ -633,7 +633,7 @@ void AIS_InteractiveObject::BoundingBox (Bnd_Box& theBndBox)
     {
       for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (Children()); aPrsIter.More(); aPrsIter.Next())
       {
-        const Handle(AIS_InteractiveObject)& aChild = Handle(AIS_InteractiveObject)::DownCast (aPrsIter.Value());
+        Handle(AIS_InteractiveObject) aChild (Handle(AIS_InteractiveObject)::DownCast (aPrsIter.Value()));
         if (aChild.IsNull())
         {
           continue;
index 005f9d5a772bed6d13f56071efa5c7e4ce9ee7d2..ac481c09d2f28854ba002cf69fc7d1d5180ebc5c 100755 (executable)
@@ -411,7 +411,7 @@ Standard_Boolean AIS_LengthDimension::InitEdgeVertexLength (const TopoDS_Edge& t
 
   myFirstPoint = BRep_Tool::Pnt (theVertex);
 
-  const Handle(Geom_Line)& aGeomLine = (Handle(Geom_Line)&) aCurve;
+  Handle(Geom_Line) aGeomLine (Handle(Geom_Line)::DownCast (aCurve));
   const gp_Lin& aLin = aGeomLine->Lin();
 
   // Get direction of edge to build plane automatically.
index 1b77cfd0d8f1708e839e21ecdfbb83649918c41e..b9f6b74a0b9de2676796de4f60fa67a131a6072b 100644 (file)
@@ -620,7 +620,7 @@ void AIS_LocalContext::Terminate (const Standard_Boolean theToUpdate)
   Handle(Standard_Transient) Tr;
   for(S->Init();S->More();S->Next()){
     Tr = S->Value();
-    (*((Handle(SelectMgr_EntityOwner)*)&Tr))->SetSelected (Standard_False);
+    Handle(SelectMgr_EntityOwner)::DownCast (Tr)->SetSelected (Standard_False);
   }
 
       
index 4b3ad35bf0870f1bce9aa05b7a38bd90404a69db..2d57d5667817f923f5479f64e24681c1ef4121dd 100644 (file)
@@ -533,11 +533,11 @@ void AIS_LocalContext::HilightPicked(const Standard_Boolean updateviewer)
        Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(Ownr);
        if(BROwnr.IsNull() || !BROwnr->ComesFromDecomposition()){
          Handle(SelectMgr_SelectableObject) SO  = Ownr->Selectable();
-         IO = *((Handle(AIS_InteractiveObject)*)&SO);
+         IO = Handle(AIS_InteractiveObject)::DownCast (SO);
        }
       }
       Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
-      Standard_Integer HM = GetHiMod(*((Handle(AIS_InteractiveObject)*)&SO));
+      Standard_Integer HM = GetHiMod(Handle(AIS_InteractiveObject)::DownCast (SO));
       if ( Ownr->IsAutoHilight() )
         Ownr->HilightWithColor(PM,myCTX->SelectionColor(),HM);
       else if ( aMap.IsBound (SO) )
@@ -585,7 +585,7 @@ void AIS_LocalContext::UnhilightPicked (const Standard_Boolean updateviewer)
       Standard_Integer HM(0);
       if(Ownr->HasSelectable()){
        Handle(SelectMgr_SelectableObject) SO  = Ownr->Selectable();
-       Handle(AIS_InteractiveObject) IO = *((Handle(AIS_InteractiveObject)*)&SO);
+       Handle(AIS_InteractiveObject) IO = Handle(AIS_InteractiveObject)::DownCast (SO);
         anObjMap.Add (IO);
 
         HM = GetHiMod(IO);
@@ -667,7 +667,7 @@ HasShape() const
 {
   Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value();
   if( Tr.IsNull() ) return Standard_False;
-  Handle(SelectMgr_EntityOwner) EO = *((Handle(SelectMgr_EntityOwner)*)&Tr);
+  Handle(SelectMgr_EntityOwner) EO = Handle(SelectMgr_EntityOwner)::DownCast (Tr);
   Handle(StdSelect_BRepOwner) BRO = Handle(StdSelect_BRepOwner)::DownCast(EO);
   if(BRO.IsNull()) return Standard_False;
   Standard_Boolean hasshape = BRO->HasShape();
@@ -704,7 +704,7 @@ Standard_Boolean AIS_LocalContext::HasSelectedShape() const
 TopoDS_Shape AIS_LocalContext::SelectedShape() const 
 {
   Handle(Standard_Transient) aTr = AIS_Selection::CurrentSelection()->Value();
-  Handle(SelectMgr_EntityOwner) anEO = *((Handle(SelectMgr_EntityOwner)*)&aTr);
+  Handle(SelectMgr_EntityOwner) anEO = Handle(SelectMgr_EntityOwner)::DownCast (aTr);
   Handle(StdSelect_BRepOwner) aBRO = Handle(StdSelect_BRepOwner)::DownCast(anEO);
   if( aBRO.IsNull() ) 
   {
@@ -724,11 +724,11 @@ SelectedInteractive() const
   Handle(AIS_InteractiveObject) IO;
   Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value();
   if( !Tr.IsNull() ) {
-    Handle(SelectMgr_EntityOwner) EO = *((Handle(SelectMgr_EntityOwner)*)&Tr);
+    Handle(SelectMgr_EntityOwner) EO = Handle(SelectMgr_EntityOwner)::DownCast (Tr);
     Handle(SelectMgr_SelectableObject) SO;
     if(EO->HasSelectable()){
       SO = EO->Selectable();
-      IO = *((Handle(AIS_InteractiveObject)*)&SO);
+      IO = Handle(AIS_InteractiveObject)::DownCast (SO);
     }
   }
   return IO;
@@ -743,7 +743,7 @@ SelectedOwner() const
   Handle(SelectMgr_EntityOwner) EO;
   Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value();
   if( !Tr.IsNull() )
-       EO = *((Handle(SelectMgr_EntityOwner)*)&Tr);
+       EO = Handle(SelectMgr_EntityOwner)::DownCast (Tr);
   return EO;
 }
 
@@ -1016,7 +1016,7 @@ void AIS_LocalContext::SetSelected(const Handle(AIS_InteractiveObject)& anIObj,
       SIOBJ->Init();
       if(SIOBJ->More()){
         Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->BaseSensitive()->OwnerId();
-       EO = *((Handle(SelectMgr_EntityOwner)*)&BO);
+       EO = Handle(SelectMgr_EntityOwner)::DownCast (BO);
       }
     }
     if(EO.IsNull()) 
@@ -1054,7 +1054,7 @@ void AIS_LocalContext::AddOrRemoveSelected(const Handle(AIS_InteractiveObject)&
       SIOBJ->Init();
       if(SIOBJ->More()){
         Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->BaseSensitive()->OwnerId();
-       EO = *((Handle(SelectMgr_EntityOwner)*)&BO);
+       EO = Handle(SelectMgr_EntityOwner)::DownCast (BO);
       }
     }
     if(EO.IsNull())
@@ -1242,7 +1242,7 @@ AIS_LocalContext::DetectedInteractive() const
   Handle(AIS_InteractiveObject) Iobj;
   if(IsValidIndex(mylastindex)){
     Handle(SelectMgr_SelectableObject) SO = myMapOfOwner->FindKey(mylastindex)->Selectable();
-    Iobj = *((Handle(AIS_InteractiveObject)*) &SO);
+    Iobj = Handle(AIS_InteractiveObject)::DownCast (SO);
   }
   return Iobj;
 }
@@ -1420,7 +1420,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromIO
   for(; anIter.More(); anIter.Next()){
     const Handle(Standard_Transient)& Tr = anIter.Value();
     if(!Tr.IsNull()){
-      EO = *((Handle(SelectMgr_EntityOwner)*)&Tr);
+      EO = Handle(SelectMgr_EntityOwner)::DownCast (Tr);
       if(EO->HasSelectable()){
        Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(EO);
        if(BROwnr.IsNull() || !BROwnr->ComesFromDecomposition()){
index f17c0cfad3784b6001bd075c76bd42513dc9fccb..89eac2cd9f9d4abe55f50f7b11ee55df56940ef6 100644 (file)
@@ -212,7 +212,7 @@ void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a
       else if ( curv->IsInstance(STANDARD_TYPE(Geom_Circle)) ) // case of circle
        {
          // segment on circle
-         Handle(Geom_Circle) thecirc = (Handle(Geom_Circle)&) curv;
+         Handle(Geom_Circle) thecirc = Handle(Geom_Circle)::DownCast (curv);
          Standard_Real udeb = ElCLib::Parameter(thecirc->Circ(),myFirstPnt1);
          Standard_Real ufin = ElCLib::Parameter(thecirc->Circ(),myFirstPnt2);
          Handle(Geom_TrimmedCurve) thecu = new Geom_TrimmedCurve(thecirc,udeb,ufin);
@@ -223,7 +223,7 @@ void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a
       else if ( curv->IsInstance(STANDARD_TYPE(Geom_Ellipse)) ) // case of ellipse
        {
          // segment on ellipse
-         Handle(Geom_Ellipse) theEll = (Handle(Geom_Ellipse)&) curv;
+         Handle(Geom_Ellipse) theEll = Handle(Geom_Ellipse)::DownCast (curv);
          Standard_Real udeb = ElCLib::Parameter(theEll->Elips(),myFirstPnt1);
          Standard_Real ufin = ElCLib::Parameter(theEll->Elips(),myFirstPnt2);
          Handle(Geom_TrimmedCurve) thecu = new Geom_TrimmedCurve(theEll,udeb,ufin);
@@ -247,7 +247,7 @@ void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a
       else if ( curv->IsInstance(STANDARD_TYPE(Geom_Circle)) ) // case of circle
        {
          // segment on circle
-         Handle(Geom_Circle) thecirc = (Handle(Geom_Circle)&) curv;
+         Handle(Geom_Circle) thecirc = Handle(Geom_Circle)::DownCast (curv);
          Standard_Real udeb = ElCLib::Parameter(thecirc->Circ(),mySecondPnt1);
          Standard_Real ufin = ElCLib::Parameter(thecirc->Circ(),mySecondPnt2);
          Handle(Geom_TrimmedCurve) thecu = new Geom_TrimmedCurve(thecirc,udeb,ufin);
@@ -258,7 +258,7 @@ void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a
       else if ( curv->IsInstance(STANDARD_TYPE(Geom_Ellipse)) ) // case of ellipse
        {
          // segment on ellipse
-         Handle(Geom_Ellipse) theEll = (Handle(Geom_Ellipse)&) curv;
+         Handle(Geom_Ellipse) theEll = Handle(Geom_Ellipse)::DownCast (curv);
          Standard_Real udeb = ElCLib::Parameter(theEll->Elips(),mySecondPnt1);
          Standard_Real ufin = ElCLib::Parameter(theEll->Elips(),mySecondPnt2);
          Handle(Geom_TrimmedCurve) thecu = new Geom_TrimmedCurve(theEll,udeb,ufin);
@@ -302,7 +302,7 @@ void AIS_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation)&
       if ( !isInfinite ) ComputePointsOnLine(ptat1,ptat2,first);
       else
        {
-         const gp_Lin& line = ((Handle(Geom_Line)&) geom)->Lin();
+         const gp_Lin& line = Handle(Geom_Line)::DownCast (geom)->Lin();
          ComputePointsOnLine(line,first);
        }
       if ( first ) DsgPrs_MidPointPresentation::Add(aprs,myDrawer,ax,myMidPoint,myPosition,
@@ -312,7 +312,7 @@ void AIS_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation)&
     }
   else if ( geom->IsInstance(STANDARD_TYPE(Geom_Circle)) )
     {
-      const Handle(Geom_Circle)& geom_cir = (Handle(Geom_Circle)&) geom;
+      Handle(Geom_Circle) geom_cir (Handle(Geom_Circle)::DownCast (geom));
       gp_Circ circ (geom_cir->Circ());
       ComputePointsOnCirc(circ,ptat1,ptat2,first);
       if ( first ) DsgPrs_MidPointPresentation::Add(aprs,myDrawer,circ,myMidPoint,myPosition,
@@ -322,7 +322,7 @@ void AIS_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation)&
     }
   else if ( geom->IsInstance(STANDARD_TYPE(Geom_Ellipse)) )
     {
-      const Handle(Geom_Ellipse)& geom_ell = (Handle(Geom_Ellipse)&) geom;
+      Handle(Geom_Ellipse) geom_ell (Handle(Geom_Ellipse)::DownCast (geom));
       gp_Elips elips (geom_ell->Elips());
       ComputePointsOnElips(elips,ptat1,ptat2,first);
       if ( first ) DsgPrs_MidPointPresentation::Add(aprs,myDrawer,elips,myMidPoint,myPosition,
index 0a9fbe7fd07ac50cf251be04a3903d408f21ffd1..f1c60acb784af504091345b2f7a0d23a33164e8c 100644 (file)
@@ -248,7 +248,7 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
 
   if (geom1->IsInstance(STANDARD_TYPE(Geom_Ellipse)))
     {
-      const Handle(Geom_Ellipse)& geom_el1 = (Handle(Geom_Ellipse)&) geom1;
+      Handle(Geom_Ellipse) geom_el1 (Handle(Geom_Ellipse)::DownCast (geom1));
       // construct lines through focuses
       gp_Ax1 elAx = geom_el1->XAxis();
       l1 = gp_Lin(elAx);
@@ -260,14 +260,14 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
     }
   else if (geom1->IsInstance(STANDARD_TYPE(Geom_Line)))
     {
-      const Handle(Geom_Line)& geom_lin1 = (Handle(Geom_Line)&) geom1;
+      Handle(Geom_Line) geom_lin1 (Handle(Geom_Line)::DownCast (geom1));
       l1 = geom_lin1->Lin();
     }
   else return;
 
   if (geom2->IsInstance(STANDARD_TYPE(Geom_Ellipse)))
     {
-      const Handle(Geom_Ellipse)& geom_el2 = (Handle(Geom_Ellipse)&) geom2;
+      Handle(Geom_Ellipse) geom_el2 (Handle(Geom_Ellipse)::DownCast (geom2));
       // construct lines through focuses
       gp_Ax1 elAx = geom_el2->XAxis();
       l2 = gp_Lin(elAx);
@@ -279,7 +279,7 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
     }
   else if (geom2->IsInstance(STANDARD_TYPE(Geom_Line)))
     {
-      const Handle(Geom_Line)& geom_lin2 = (Handle(Geom_Line)&) geom2;
+      Handle(Geom_Line) geom_lin2 (Handle(Geom_Line)::DownCast (geom2));
       l2 = geom_lin2->Lin();
     }
   else return;
index d964b2f147f29df50605262ae5a75312152af609..b636bddc170f1206aee7b056f2ccac4572beb43c 100644 (file)
@@ -212,7 +212,7 @@ void AIS_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_
   Handle(Geom_Line) geom_lin2;
   if ( geom1->IsInstance(STANDARD_TYPE(Geom_Ellipse)) )
     {
-      const Handle(Geom_Ellipse)& geom_el = (Handle(Geom_Ellipse)&) geom1;
+      Handle(Geom_Ellipse) geom_el (Handle(Geom_Ellipse)::DownCast (geom1));
       // construct lines through focuses
       gp_Ax1 elAx = geom_el->XAxis();
       gp_Lin ll (elAx);
@@ -225,13 +225,13 @@ void AIS_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_
     }
   else if ( geom1->IsInstance(STANDARD_TYPE(Geom_Line)) )
     {
-      geom_lin1 = (Handle(Geom_Line)&) geom1;
+      geom_lin1 = Handle(Geom_Line)::DownCast (geom1);
     }
   else return;
 
   if (geom2->IsInstance(STANDARD_TYPE(Geom_Ellipse)))
     {
-      const Handle(Geom_Ellipse)& geom_el = (Handle(Geom_Ellipse)&) geom2;
+      Handle(Geom_Ellipse) geom_el (Handle(Geom_Ellipse)::DownCast (geom2));
       // construct lines through focuses
       gp_Ax1 elAx = geom_el->XAxis();
       gp_Lin ll (elAx);
@@ -244,7 +244,7 @@ void AIS_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_
     }
   else if ( geom2->IsInstance(STANDARD_TYPE(Geom_Line)) )
     {
-      geom_lin2 = (Handle(Geom_Line)&) geom2;
+      geom_lin2 = Handle(Geom_Line)::DownCast (geom2);
     }
   else return;
 
@@ -255,9 +255,9 @@ void AIS_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_
   
   // 2d lines => projection of 3d on current plane
   Handle(Geom2d_Curve) aGeom2dCurve = GeomAPI::To2d(geom_lin1,myPlane->Pln());
-  Handle(Geom2d_Line) lin1_2d = (Handle(Geom2d_Line)&) aGeom2dCurve ;
+  Handle(Geom2d_Line) lin1_2d = Handle(Geom2d_Line)::DownCast (aGeom2dCurve) ;
   aGeom2dCurve = GeomAPI::To2d(geom_lin2,myPlane->Pln());
-  Handle(Geom2d_Line) lin2_2d = (Handle(Geom2d_Line)&) aGeom2dCurve ;
+  Handle(Geom2d_Line) lin2_2d = Handle(Geom2d_Line)::DownCast (aGeom2dCurve) ;
   IntAna2d_AnaIntersection inter(lin1_2d->Lin2d(),lin2_2d->Lin2d());
   if (!inter.IsDone()) return;
   if (!inter.NbPoints()) return;
index a72c8f25709c406520099987e7ae7effbde5cf1b..ecadb66dd4e55a2fd1cf729da0a1ba2e07d97460 100644 (file)
@@ -251,7 +251,7 @@ void AIS_Plane::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
       {
         ComputeFrame();
         const Handle(Geom_Plane)& pl = myComponent;
-        const Handle(Geom_Plane)& thegoodpl = Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter));
+        Handle(Geom_Plane) thegoodpl (Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter)));
         GeomAdaptor_Surface surf(thegoodpl);
         StdPrs_Plane::Add(aPresentation,surf,myDrawer);
       }
@@ -531,8 +531,7 @@ void AIS_Plane::ComputeFrame()
     pl->D0 (U, V, myCenter);     
   }
   else {
-    const Handle(Geom_Plane)& thegoodpl = 
-      Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter));
+    Handle(Geom_Plane) thegoodpl (Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter)));
     ElSLib::Parameters(thegoodpl->Pln(),myPmin,U,V);
     
     U = 2.4*Abs(U);
index c8185d0af8ef6ae12b7d4af15ab97cf5a23d947c..2b771b4c728195c88697ea68ccf220ecad1c2370 100644 (file)
@@ -101,7 +101,7 @@ void AIS_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)&
 
   // Calcul de la presentation de l'edge
   if (ProjCurv->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
-    const Handle(Geom_Line) & gl = (Handle(Geom_Line)&) ProjCurv;
+    Handle(Geom_Line) gl (Handle(Geom_Line)::DownCast (ProjCurv));
     if ( !isInfinite) {
       pf = ElCLib::Parameter(gl->Lin(),FirstP);
       pl = ElCLib::Parameter(gl->Lin(),LastP);
@@ -114,7 +114,7 @@ void AIS_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)&
     }
   }
   else if (ProjCurv->IsInstance(STANDARD_TYPE(Geom_Circle)) ) {
-    const Handle(Geom_Circle) & gc = (Handle(Geom_Circle)&) ProjCurv;
+    Handle(Geom_Circle) gc (Handle(Geom_Circle)::DownCast (ProjCurv));
     pf = ElCLib::Parameter(gc->Circ(),FirstP);
     pl = ElCLib::Parameter(gc->Circ(),LastP);
     BRepBuilderAPI_MakeEdge MakEd(gc->Circ(),pf, pl);
index 0ea8f3af6f2a344ae5c90735a654aac662992a8a..cc0583a4476f575175006cf9cab67e467b19c0f2 100644 (file)
@@ -79,7 +79,7 @@ Handle(AIS_Selection) AIS_Selection::Selection(const Standard_CString aName)
 //  Standard_Boolean found(Standard_False);
   for(Standard_Integer I =1; I<= AIS_Sel_GetSelections().Length();I++){
     curobj = AIS_Sel_GetSelections().Value(I);
-    Sel = *((Handle(AIS_Selection)*)&curobj);
+    Sel = Handle(AIS_Selection)::DownCast (curobj);
     if(Sel->myName.IsEqual(aName))
       return Sel;
   }
@@ -274,7 +274,7 @@ Standard_Integer AIS_Selection::Index(const Standard_CString aName)
   Handle (Standard_Transient) curobj;
   for(Standard_Integer I =1; I<= AIS_Sel_GetSelections().Length();I++){
     curobj = AIS_Sel_GetSelections().Value(I);
-    if((*((Handle(AIS_Selection)*)&curobj))->myName.IsEqual(aName))
+    if(Handle(AIS_Selection)::DownCast (curobj)->myName.IsEqual(aName))
       return I;
   }
   return 0;
index 0f51dce1bbbb3237730713e1d02e6182cff8846b..b3eff3dff12727dcad8cf1651ac3c65665298b73 100644 (file)
@@ -241,7 +241,7 @@ void AIS_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection)&
 //    Handle(Geom_Circle) geom_circ1 = (Handle(Geom_Circle)&) BRep_Tool::Curve(TopoDS::Edge(myFShape),F,L);
 //JR/Hp
     Handle(Geom_Curve) aGeomCurve = BRep_Tool::Curve(TopoDS::Edge(myFShape),F,L);
-    Handle(Geom_Circle) geom_circ1 = (Handle(Geom_Circle)&) aGeomCurve ;
+    Handle(Geom_Circle) geom_circ1 = Handle(Geom_Circle)::DownCast (aGeomCurve) ;
 //    Handle(Geom_Circle) geom_circ1 = (const Handle(Geom_Circle)&) BRep_Tool::Curve(TopoDS::Edge(myFShape),F,L);
     gp_Circ circ1(geom_circ1->Circ());
     gp_Pnt OffsetPnt(myPosition.X(),myPosition.Y(),myPosition.Z());
@@ -417,13 +417,13 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta
   myAxisDirAttach = laxis.Direction();
 
   if(cu1.GetType() == GeomAbs_Line){
-    const Handle(Geom_Line)& geom_lin1 = (Handle(Geom_Line)&) geom1;
+    Handle(Geom_Line) geom_lin1 (Handle(Geom_Line)::DownCast (geom1));
     gp_Lin l1(geom_lin1->Lin());
     myFDirAttach = l1.Direction();
   }
   gp_Circ circ;
   if(cu1.GetType() == GeomAbs_Circle){
-    const Handle(Geom_Circle)& geom_cir1 = (Handle(Geom_Circle)&) geom1;
+    Handle(Geom_Circle) geom_cir1 (Handle(Geom_Circle)::DownCast (geom1));
     gp_Circ c(geom_cir1->Circ());
     circ = c;
   }
@@ -444,13 +444,13 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta
 */
   Standard_Boolean idem = Standard_False;
   if (isInfinite1 && isInfinite2) { // geom1 et geom2 sont des lignes
-    const gp_Lin& line2 = ((Handle(Geom_Line)&) geom2)->Lin();
+    const gp_Lin& line2 = Handle(Geom_Line)::DownCast (geom2)->Lin();
     if (myAutomaticPosition) {
-      myFAttach = ((Handle(Geom_Line)&) geom1)->Lin().Location();      
+      myFAttach = Handle(Geom_Line)::DownCast (geom1)->Lin().Location();      
       mySAttach = ElCLib::Value(ElCLib::Parameter(line2,myFAttach),line2);
     }
     else {
-      const gp_Lin& line1 = ((Handle(Geom_Line)&) geom1)->Lin();
+      const gp_Lin& line1 = Handle(Geom_Line)::DownCast (geom1)->Lin();
       myFAttach = ElCLib::Value(ElCLib::Parameter(line1,myPosition),line1);
       mySAttach = ElCLib::Value(ElCLib::Parameter(line2,myFAttach),line2);
     }
@@ -486,12 +486,12 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta
   }
   else if (isInfinite1) {// geom1 et geom2 sont des lignes
     mySAttach = ptat21;
-    const gp_Lin& line1 = ((Handle(Geom_Line)&) geom1)->Lin();
+    const gp_Lin& line1 = Handle(Geom_Line)::DownCast (geom1)->Lin();
     myFAttach = ElCLib::Value(ElCLib::Parameter(line1,mySAttach),line1);
   }
   else if (isInfinite2) {// geom1 et geom2 sont des lignes
     myFAttach = ptat11;
-    const gp_Lin& line2 = ((Handle(Geom_Line)&) geom2)->Lin();
+    const gp_Lin& line2 = Handle(Geom_Line)::DownCast (geom2)->Lin();
     mySAttach = ElCLib::Value(ElCLib::Parameter(line2,myFAttach),line2);
   }
 
@@ -505,7 +505,7 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta
   gp_Pnt PjFAttach = ElCLib::Value(ElCLib::Parameter(laxis,myFAttach),laxis); 
  
   if (PjFAttach.IsEqual(myFAttach,Precision::Confusion())){
-    const Handle(Geom_Line)& geom_lin2 = (Handle(Geom_Line)&) geom2;
+    Handle(Geom_Line) geom_lin2 (Handle(Geom_Line)::DownCast (geom2));
     gp_Lin l2(geom_lin2->Lin());
     myFDirAttach = l2.Direction();
     gp_Pnt PntTempo;
index e6565331aaf56b418d1d61b50a296181702ef35c..24c987b9ebc428f5b2ec5722242dc4b67d7891f5 100644 (file)
@@ -204,25 +204,25 @@ static Standard_Boolean ComputeTangencyPoint(const Handle(Geom_Curve)& GC1,
          gp_Vec aVector1,aVector2;
          if (GC1->IsInstance(STANDARD_TYPE(Geom_Circle)))
            {
-             const Handle(Geom_Circle)& circle = (Handle(Geom_Circle)&) GC1;
+             Handle(Geom_Circle) circle (Handle(Geom_Circle)::DownCast (GC1));
              Standard_Real par_inter = ElCLib::Parameter(circle->Circ(), P1);
              ElCLib::D1(par_inter,circle->Circ(),P1,aVector1);
            }
          else if (GC1->IsInstance(STANDARD_TYPE(Geom_Ellipse)))
            {
-             const Handle(Geom_Ellipse)& ellipse = (Handle(Geom_Ellipse)&) GC1;
+             Handle(Geom_Ellipse) ellipse (Handle(Geom_Ellipse)::DownCast (GC1));
              Standard_Real par_inter = ElCLib::Parameter(ellipse->Elips(), P1);
              ElCLib::D1(par_inter,ellipse->Elips(),P1,aVector1);
            }
          if (GC2->IsInstance(STANDARD_TYPE(Geom_Circle)))
            {
-             const Handle(Geom_Circle)& circle = (Handle(Geom_Circle)&) GC2;
+             Handle(Geom_Circle) circle (Handle(Geom_Circle)::DownCast (GC2));
              Standard_Real par_inter = ElCLib::Parameter(circle->Circ(), P2);
              ElCLib::D1(par_inter,circle->Circ(),P2,aVector2);
            }
          else if (GC2->IsInstance(STANDARD_TYPE(Geom_Ellipse)))
            {
-             const Handle(Geom_Ellipse)& ellipse = (Handle(Geom_Ellipse)&) GC2;
+             Handle(Geom_Ellipse) ellipse (Handle(Geom_Ellipse)::DownCast (GC2));
              Standard_Real par_inter = ElCLib::Parameter(ellipse->Elips(), P2);
              ElCLib::D1(par_inter,ellipse->Elips(),P2,aVector2);
            }
@@ -333,8 +333,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
     {
     case 12: // circle line      
        {
-       const Handle(Geom_Line)& line = (Handle(Geom_Line)&) copy1;
-       const Handle(Geom_Circle)& circle = (Handle(Geom_Circle)&) copy2;
+       Handle(Geom_Line) line (Handle(Geom_Line)::DownCast (copy1));
+       Handle(Geom_Circle) circle (Handle(Geom_Circle)::DownCast (copy2));
 
        if ( !found )
          {
@@ -355,8 +355,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
       break;
     case 21: // circle line
       {
-       const Handle(Geom_Circle)& circle = (Handle(Geom_Circle)&) copy1;
-       const Handle(Geom_Line)& line = (Handle(Geom_Line)&) copy2;
+       Handle(Geom_Circle) circle (Handle(Geom_Circle)::DownCast (copy1));
+       Handle(Geom_Line) line (Handle(Geom_Line)::DownCast (copy2));
       
        if (!found)
          {
@@ -378,8 +378,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
     // jfa 19/10/2000 begin
     case 13: // line ellipse
       {
-       const Handle(Geom_Line)& line = (Handle(Geom_Line)&) copy1;
-       const Handle(Geom_Ellipse)& ellipse = (Handle(Geom_Ellipse)&) copy2;
+       Handle(Geom_Line) line (Handle(Geom_Line)::DownCast (copy1));
+       Handle(Geom_Ellipse) ellipse (Handle(Geom_Ellipse)::DownCast (copy2));
 
        if (!found)
          {
@@ -399,8 +399,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
       break;
     case 31: // ellipse line
       {
-       const Handle(Geom_Ellipse)& ellipse = (Handle(Geom_Ellipse)&) copy1;
-       const Handle(Geom_Line)& line = (Handle(Geom_Line)&) copy2;
+       Handle(Geom_Ellipse) ellipse (Handle(Geom_Ellipse)::DownCast (copy1));
+       Handle(Geom_Line) line (Handle(Geom_Line)::DownCast (copy2));
       
        if (!found)
          {
@@ -420,8 +420,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
       break;
     case 22: // circle circle
       {
-       const Handle(Geom_Circle)& circle1 = (Handle(Geom_Circle)&) copy1;
-       const Handle(Geom_Circle)& circle2 = (Handle(Geom_Circle)&) copy2;
+       Handle(Geom_Circle) circle1 (Handle(Geom_Circle)::DownCast (copy1));
+       Handle(Geom_Circle) circle2 (Handle(Geom_Circle)::DownCast (copy2));
        Standard_Real R1 = circle1->Radius();
        Standard_Real R2 = circle2->Radius();
        myLength = Max(R1,R2)/5.0;
@@ -462,8 +462,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
       break;
     case 23: // circle ellipse
       {
-       const Handle(Geom_Circle)&  circle  = (Handle(Geom_Circle)&)  copy1;
-       const Handle(Geom_Ellipse)& ellipse = (Handle(Geom_Ellipse)&) copy2;
+       Handle(Geom_Circle) circle (Handle(Geom_Circle)::DownCast (copy1));
+       Handle(Geom_Ellipse) ellipse (Handle(Geom_Ellipse)::DownCast (copy2));
        Standard_Real R1 = circle->Radius();
        Standard_Real R2 = ellipse->MajorRadius();
        myLength = Max(R1,R2)/5.0;
@@ -492,8 +492,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
       break;
     case 32: // ellipse circle
       {
-       const Handle(Geom_Ellipse)& ellipse = (Handle(Geom_Ellipse)&) copy1;
-       const Handle(Geom_Circle)&  circle  = (Handle(Geom_Circle)&) copy2;
+       Handle(Geom_Ellipse) ellipse (Handle(Geom_Ellipse)::DownCast (copy1));
+       Handle(Geom_Circle) circle (Handle(Geom_Circle)::DownCast (copy2));
        Standard_Real R1 = ellipse->MajorRadius();
        Standard_Real R2 = circle->Radius();
        myLength = Max(R1,R2)/5.0;
@@ -522,8 +522,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
       break;
     case 33: // ellipse ellipse
       {
-       const Handle(Geom_Ellipse)& ellipse1 = (Handle(Geom_Ellipse)&) copy1;
-       const Handle(Geom_Ellipse)& ellipse2 = (Handle(Geom_Ellipse)&) copy2;
+       Handle(Geom_Ellipse) ellipse1 (Handle(Geom_Ellipse)::DownCast (copy1));
+       Handle(Geom_Ellipse) ellipse2 (Handle(Geom_Ellipse)::DownCast (copy2));
        Standard_Real R1 = ellipse1->MajorRadius();
        Standard_Real R2 = ellipse2->MajorRadius();
        myLength = Max(R1,R2)/5.0;
index deaedcf6e3f86fcbce0b2d75a5f4f8472a3430f1..1e4b16e5e4d5f97e6a7d7e85f16b91b5fc7a1e52 100644 (file)
@@ -27,7 +27,7 @@ Standard_Boolean AIS_TypeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& anObj
   
 //#ifndef OCCT_DEBUG
   Handle(SelectMgr_SelectableObject) aSelectableObject = anObj->Selectable() ;
-  return ((Handle(AIS_InteractiveObject)&) aSelectableObject)->Type()== myKind;
+  return Handle(AIS_InteractiveObject)::DownCast (aSelectableObject)->Type()== myKind;
 //#else
 //  return ((Handle(AIS_InteractiveObject)&)anObj->Selectable())->Type()== myKind;
 //#endif
index f397fcd12a124c651cc1937ec4a35bbcf13b12f7..90731d59ee3708a586fe85ecfd21f4523ca4d745 100644 (file)
 #include <TColgp_HArray1OfVec2d.hxx>
 
 
-#define tabTang (*(Handle(TColgp_HArray1OfVec)*)&ttabTang)
-#define tabCurv (*(Handle(TColgp_HArray1OfVec)*)&ttabCurv)
-#define tabTang2d (*(Handle(TColgp_HArray1OfVec2d)*)&ttabTang2d)
-#define tabCurv2d (*(Handle(TColgp_HArray1OfVec2d)*)&ttabCurv2d)
+#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)
 
 
 
index 25a3184baeb0043d32fe5d00977f60ef23c52ee1..0788f51ea555451a0b6c8e72891effad36ce2d6e 100644 (file)
@@ -2722,7 +2722,7 @@ void AppDef_Variational::AssemblingConstraints(const Handle(FEmTool_Curve)& Curv
   Standard_Real t, R1, R2;
 
   Handle(PLib_Base) myBase = Curve->Base();
-  Handle(PLib_HermitJacobi) myHermitJacobi = (*((Handle(PLib_HermitJacobi)*)&myBase));
+  Handle(PLib_HermitJacobi) myHermitJacobi = Handle(PLib_HermitJacobi)::DownCast (myBase);
   Standard_Integer Order = myHermitJacobi->NivConstr() + 1;
 
   Standard_Real UFirst, ULast, coeff, c0, mfact, mfact1;
index 96964b6679c63cf5e37f0d90cf7e1f7cea8d7580..f18aedd0c1a2b2ab992fe822c9600f7d54b01272 100644 (file)
@@ -18,8 +18,8 @@
 
 #include <Standard_OutOfRange.hxx>
 
-#define tabPoint   (*(Handle(TColgp_HArray1OfPnt)*)&ttabPoint)
-#define tabPoint2d (*(Handle(TColgp_HArray1OfPnt2d)*)&ttabPoint2d)
+#define tabPoint   Handle(TColgp_HArray1OfPnt)::DownCast (ttabPoint)
+#define tabPoint2d Handle(TColgp_HArray1OfPnt2d)::DownCast (ttabPoint2d)
 
 AppParCurves_MultiPoint::AppParCurves_MultiPoint() {}
 
index 205fe0587d5b49228b094455d153673d38da9da0..ff16fcd83de539f0620e2d8f197bfe4d942060bc 100644 (file)
@@ -302,7 +302,7 @@ Handle(Geom2d_Curve) CurveOnSurface(const TopoDS_Edge& E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsCurveOnSurface(S,l)) {
-      const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
+      Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
       GC->Range(First,Last);
       if (GC->IsCurveOnClosedSurface() && Eisreversed)
         return GC->PCurve2();
index c371bd7603093faf4bebe4dd37ef15281924a9dc..b951a201a3d5c4e6a2db05386b922478658ceb0f 100644 (file)
@@ -793,7 +793,7 @@ Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsCurveOnSurface(S,loc)) {
-      const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
+      Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
       GC->Range(First,Last);
       if (GC->IsCurveOnClosedSurface() && Eisreversed)
         return GC->PCurve2();
@@ -837,7 +837,7 @@ Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface
     if (!LC.IsIdentity()) {
       const gp_Trsf& T = LC.Transformation();
       Handle(Geom_Geometry) GPT = GP->Transformed(T);
-      Plane = *((Handle(Geom_Plane)*)&GPT);
+      Plane = Handle(Geom_Plane)::DownCast (GPT);
     }
     GeomAdaptor_Surface& GAS = HS->ChangeSurface();
     GAS.Load(Plane);
@@ -856,7 +856,7 @@ Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface
 
     if (pc->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
       Handle(Geom2d_TrimmedCurve) TC = 
-        (*((Handle(Geom2d_TrimmedCurve)*)&pc));
+        Handle(Geom2d_TrimmedCurve)::DownCast (pc);
       pc = TC->BasisCurve();
     }
     First = f; Last = l;
index 10efe77184fdd6e46fa05fb712ec0ea0b2441624..68b466921864bc42658fd93f45093e4bb04814fb 100644 (file)
@@ -491,7 +491,7 @@ void CheckEdge (const TopoDS_Edge& Ed,
           //
           aOrV=aV.Orientation();
           if (aOrV==TopAbs_FORWARD || aOrV==TopAbs_REVERSED) {
-            const Handle(BRep_GCurve)& aGC=*((Handle(BRep_GCurve)*)&aCR);
+            Handle(BRep_GCurve) aGC (Handle(BRep_GCurve)::DownCast (aCR));
             
             if (aOrV==TopAbs_FORWARD) {
               aPC=aC->Value(aGC->First());
@@ -725,8 +725,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape,
   }
   
   if (!myCref.IsNull()) {
-    const Handle(BRep_GCurve)& GCref = 
-      *((Handle(BRep_GCurve)*)&myCref);
+    Handle(BRep_GCurve) GCref (Handle(BRep_GCurve)::DownCast (myCref));
     Standard_Real First,Last;
     GCref->Range(First,Last);
     if (Last<=First) {
@@ -786,7 +785,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape,
       const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
       if (cr != myCref && cr->IsCurveOnSurface(Su,L)) {
         pcurvefound = Standard_True;
-        const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
+        Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
         Standard_Real f,l;
         GC->Range(f,l);
         if (SameRange && (f != First || l != Last)) {
index b20853c158a7925f39b5d298518adb36f339e26e..2db772b26bb3d2167df942d0f4f83088f4a27204 100644 (file)
@@ -93,7 +93,7 @@ Handle(Geom_Surface) BRep_Tool::Surface(const TopoDS_Face& F)
   Handle(Geom_Geometry) S1;
   if (!L.IsIdentity()) {
     S1 = S->Copy();
-    S = *((Handle(Geom_Surface)*)&S1);
+    S = Handle(Geom_Surface)::DownCast (S1);
     S->Transform(L.Transformation());
   }
   return S;
@@ -157,7 +157,7 @@ const Handle(Geom_Curve)&  BRep_Tool::Curve(const TopoDS_Edge& E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsCurve3D()) {
-      const Handle(BRep_Curve3D)& GC = *((Handle(BRep_Curve3D)*)&cr);
+      Handle(BRep_Curve3D) GC (Handle(BRep_Curve3D)::DownCast (cr));
       L = E.Location() * GC->Location();
       GC->Range(First,Last);
       return GC->Curve3D();
@@ -185,7 +185,7 @@ Handle(Geom_Curve)  BRep_Tool::Curve(const TopoDS_Edge& E,
     Handle(Geom_Geometry) C1;
     if ( !L.IsIdentity() ) {
       C1 = C->Copy();
-      C = *((Handle(Geom_Curve)*)&C1);
+      C = Handle(Geom_Curve)::DownCast (C1);
       C->Transform(L.Transformation());
     }
   }
@@ -236,7 +236,7 @@ const Handle(Poly_Polygon3D)& BRep_Tool::Polygon3D(const TopoDS_Edge& E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsPolygon3D()) {
-      const Handle(BRep_Polygon3D)& GC = *((Handle(BRep_Polygon3D)*)&cr);
+      Handle(BRep_Polygon3D) GC (Handle(BRep_Polygon3D)::DownCast (cr));
       L = E.Location() * GC->Location();
       return GC->Polygon3D();
     }
@@ -298,7 +298,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsCurveOnSurface(S,loc)) {
-      const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
+      Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
       GC->Range(First,Last);
       if (GC->IsCurveOnClosedSurface() && Eisreversed)
         return GC->PCurve2();
@@ -344,7 +344,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
     {
       const gp_Trsf& T = aCurveLocation.Transformation();
       Handle(Geom_Geometry) GC3d = C3d->Transformed(T);
-      C3d = *((Handle(Geom_Curve)*)&GC3d);
+      C3d = Handle(Geom_Curve)::DownCast (GC3d);
       f = C3d->TransformedParameter(f, T);
       l = C3d->TransformedParameter(l, T);
     }
@@ -365,7 +365,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
 
     if (pc->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
       Handle(Geom2d_TrimmedCurve) TC = 
-        (*((Handle(Geom2d_TrimmedCurve)*)&pc));
+        Handle(Geom2d_TrimmedCurve)::DownCast (pc);
       pc = TC->BasisCurve();
     }
 
@@ -394,7 +394,7 @@ void  BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsCurveOnSurface()) {
-      const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
+      Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
       C = GC->PCurve();
       S = GC->Surface();
       L = E.Location() * GC->Location();
@@ -432,7 +432,7 @@ void  BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsCurveOnSurface()) {
-      const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
+      Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
       i++;
       if (i > Index) break;
       if (i == Index) {
@@ -533,8 +533,7 @@ void BRep_Tool::PolygonOnSurface(const TopoDS_Edge&      E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsPolygonOnSurface()) {
-      const Handle(BRep_PolygonOnSurface)& PS = 
-        *((Handle(BRep_PolygonOnSurface)*)&cr);
+      Handle(BRep_PolygonOnSurface) PS (Handle(BRep_PolygonOnSurface)::DownCast (cr));
       P = PS->Polygon();
       S = PS->Surface();
       L = E.Location() * PS->Location();
@@ -568,8 +567,7 @@ void BRep_Tool::PolygonOnSurface(const TopoDS_Edge&      E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsPolygonOnSurface()) {
-      const Handle(BRep_PolygonOnSurface)& PS = 
-        *((Handle(BRep_PolygonOnSurface)*)&cr);
+      Handle(BRep_PolygonOnSurface) PS (Handle(BRep_PolygonOnSurface)::DownCast (cr));
       i++;
       if (i > Index) break;
       if (i == Index) {
@@ -640,8 +638,7 @@ BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge&                   E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsPolygonOnTriangulation()) {
-      const Handle(BRep_PolygonOnTriangulation)& PT = 
-        *((Handle(BRep_PolygonOnTriangulation)*)&cr);
+      Handle(BRep_PolygonOnTriangulation) PT (Handle(BRep_PolygonOnTriangulation)::DownCast (cr));
       P = PT->PolygonOnTriangulation();
       T = PT->Triangulation();
       L = E.Location() * PT->Location();
@@ -676,8 +673,7 @@ BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge&                   E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsPolygonOnTriangulation()) {
-      const Handle(BRep_PolygonOnTriangulation)& PT = 
-        *((Handle(BRep_PolygonOnTriangulation)*)&cr);
+      Handle(BRep_PolygonOnTriangulation) PT (Handle(BRep_PolygonOnTriangulation)::DownCast (cr));
       i++;
       if (i > Index) break;
       if (i == Index) {
@@ -830,7 +826,7 @@ void  BRep_Tool::Range(const TopoDS_Edge& E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsCurve3D()) {
-      const Handle(BRep_Curve3D)& CR = *((Handle(BRep_Curve3D)*)&cr);
+      Handle(BRep_Curve3D) CR (Handle(BRep_Curve3D)::DownCast (cr));
       if (!CR->Curve3D().IsNull()) {
         First = CR->First(); 
         Last = CR->Last();
@@ -838,7 +834,7 @@ void  BRep_Tool::Range(const TopoDS_Edge& E,
       }
     }
     else if (cr->IsCurveOnSurface()) {
-      const Handle(BRep_GCurve)& CR = *((Handle(BRep_GCurve)*)&cr);
+      Handle(BRep_GCurve) CR (Handle(BRep_GCurve)::DownCast (cr));
       First = CR->First(); 
       Last = CR->Last();
       break;
@@ -867,7 +863,7 @@ void  BRep_Tool::Range(const TopoDS_Edge& E,
   while (itcr.More()) {
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsCurveOnSurface(S,l)) {
-      (*((Handle(BRep_GCurve)*)&cr))->Range(First,Last);
+      Handle(BRep_GCurve)::DownCast (cr)->Range(First,Last);
       break;
     }
     itcr.Next();
@@ -915,9 +911,9 @@ void  BRep_Tool::UVPoints(const TopoDS_Edge& E,
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsCurveOnSurface(S,l)) {
       if (cr->IsCurveOnClosedSurface() && Eisreversed)
-        (*((Handle(BRep_CurveOnClosedSurface)*)&cr))->UVPoints2(PFirst,PLast);
+        Handle(BRep_CurveOnClosedSurface)::DownCast (cr)->UVPoints2(PFirst,PLast);
       else
-        (*((Handle(BRep_CurveOnSurface)*)&cr))->UVPoints(PFirst,PLast);
+        Handle(BRep_CurveOnSurface)::DownCast (cr)->UVPoints(PFirst,PLast);
       return;
     }
     itcr.Next();
@@ -1005,10 +1001,10 @@ void  BRep_Tool::SetUVPoints(const TopoDS_Edge& E,
     const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsCurveOnSurface(S,l)) {
       if (cr->IsCurveOnClosedSurface() && Eisreversed)
-        (*((Handle(BRep_CurveOnClosedSurface)*) &cr))->
+        Handle(BRep_CurveOnClosedSurface)::DownCast (cr)->
           SetUVPoints2(PFirst,PLast);
       else
-        (*((Handle(BRep_CurveOnSurface)*) &cr))->
+        Handle(BRep_CurveOnSurface)::DownCast (cr)->
           SetUVPoints(PFirst,PLast);
     }
     itcr.Next();
index e726349cfbfdabee8996965d97233cb0f43d74ea..a23283df9f05cef0930ce4b696f4dacbfa55df17 100644 (file)
@@ -175,7 +175,7 @@ void BRepCheck_Edge::Minimum()
     }
 
     if (!myCref.IsNull()) {
-      const Handle(BRep_GCurve)& GCref = *((Handle(BRep_GCurve)*)&myCref);
+      Handle(BRep_GCurve) GCref (Handle(BRep_GCurve)::DownCast (myCref));
       Standard_Real First,Last;
       GCref->Range(First,Last);
       if (Last<=First) {
@@ -285,7 +285,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
         const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
         if (cr != myCref && cr->IsCurveOnSurface(Su,L)) {
           pcurvefound = Standard_True;
-          const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
+          Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
           Standard_Real f,l;
           GC->Range(f,l);
           Standard_Real ff = f, ll = l;
@@ -601,8 +601,7 @@ BRepCheck_Status BRepCheck_Edge::
     }
 
     const Handle(BRep_CurveRepresentation) aCR = anITCR.Value();
-    const Handle(BRep_PolygonOnTriangulation)& aPT = 
-      Handle(BRep_PolygonOnTriangulation)::DownCast(aCR);
+    Handle(BRep_PolygonOnTriangulation) aPT (Handle(BRep_PolygonOnTriangulation)::DownCast(aCR));
 
     const TopLoc_Location aLL = theEdge.Location() * aPT->Location();
 
index d7a9cf72f3c11f773876767538ff33a1a07ad7c2..304ec00861e3e7317ec144355b9dc3741e7bfe4c 100644 (file)
@@ -174,7 +174,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
              itpr.Next();
            }
            if (orv == TopAbs_FORWARD || orv == TopAbs_REVERSED) {
-             const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
+             Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
              if (orv == TopAbs_FORWARD || multiple) {
                Controlp = C->Value(GC->First());
                Controlp.Transform(L.Transformation());
index 775d3e8488b9e9e6fe22e5dc5d35ad8f9094dbca..06f62bd8783333c5c3c468f703c492d8e44fdd82 100644 (file)
@@ -1336,12 +1336,12 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
   typS2 = S2->DynamicType();
 
   if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S1 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S1))->BasisSurface();
+    S1 =  Handle(Geom_RectangularTrimmedSurface)::DownCast (S1)->BasisSurface();
     typS1 = S1->DynamicType();
   }
 
   if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S2 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S2))->BasisSurface();
+    S2 =  Handle(Geom_RectangularTrimmedSurface)::DownCast (S2)->BasisSurface();
     typS2 = S2->DynamicType();
   }
 
@@ -1354,8 +1354,8 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
   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)*)&S1))->Pln());
-    gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln());
+    gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln());
+    gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln());
 
     if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) {
       ValRet = Standard_True;
index 99f237e6c0981a4efa0882df46a6479502a5170f..51382daa30c3bd15928f8ca11105534896264865 100644 (file)
@@ -1258,12 +1258,12 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
   typS2 = S2->DynamicType();
 
   if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S1 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S1))->BasisSurface();
+    S1 =  Handle(Geom_RectangularTrimmedSurface)::DownCast (S1)->BasisSurface();
     typS1 = S1->DynamicType();
   }
 
   if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S2 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S2))->BasisSurface();
+    S2 =  Handle(Geom_RectangularTrimmedSurface)::DownCast (S2)->BasisSurface();
     typS2 = S2->DynamicType();
   }
 
@@ -1276,8 +1276,8 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
   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)*)&S1))->Pln());
-    gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln());
+    gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln());
+    gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln());
 
     if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) {
       ValRet = Standard_True;
index b93279d07c5bec6ebbda30451e6866f014888715..39976e3d6734449f5ce046ef7a24da5eef3de273 100644 (file)
@@ -961,12 +961,12 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
   typS2 = S2->DynamicType();
 
   if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S1 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S1))->BasisSurface();
+    S1 =  Handle(Geom_RectangularTrimmedSurface)::DownCast (S1)->BasisSurface();
     typS1 = S1->DynamicType();
   }
 
   if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S2 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S2))->BasisSurface();
+    S2 =  Handle(Geom_RectangularTrimmedSurface)::DownCast (S2)->BasisSurface();
     typS2 = S2->DynamicType();
   }
 
@@ -979,8 +979,8 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
   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)*)&S1))->Pln());
-    gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln());
+    gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln());
+    gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln());
 
     if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) {
       ValRet = Standard_True;
index 3f17c637110f7f47ee9d79ab71694cca95b5af26..6dd7d4466d28918a9782189886a38246a2afedb9 100644 (file)
@@ -917,13 +917,13 @@ void BRepFill_Pipe::DefineRealSegmax()
             C->DynamicType() == STANDARD_TYPE(Geom_OffsetCurve))
        {
          if (C->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve))
-           C = (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve();
+           C = Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve();
          if (C->DynamicType() == STANDARD_TYPE(Geom_OffsetCurve))
-           C = (*((Handle(Geom_OffsetCurve)*)&C))->BasisCurve();
+           C = Handle(Geom_OffsetCurve)::DownCast (C)->BasisCurve();
        }
       if (C->DynamicType() == STANDARD_TYPE(Geom_BSplineCurve))
        {
-         const Handle(Geom_BSplineCurve)& BC = *((Handle(Geom_BSplineCurve)*)&C);
+         Handle(Geom_BSplineCurve) BC (Handle(Geom_BSplineCurve)::DownCast (C));
          Standard_Integer NbKnots = BC->NbKnots();
          Standard_Integer RealNbKnots = NbKnots;
          if (first > BC->FirstParameter())
index d35de2d78d364ba549129524d543ae60f2959c43..8f1674f3322b960746f0826feb90eb74522e47b6 100644 (file)
@@ -260,7 +260,7 @@ static Handle(Geom2d_Curve) Couture(const TopoDS_Edge& E,
   while (itcr.More()) {
     Handle(BRep_CurveRepresentation)& cr = itcr.Value();
     if (cr->IsCurveOnSurface(S,l)) {
-      Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
+      Handle(BRep_GCurve)& GC = Handle(BRep_GCurve)::DownCast (cr);
       if (GC->IsCurveOnClosedSurface() && Eisreversed) 
        return  GC->PCurve2();
       else
@@ -3379,7 +3379,7 @@ void BRepFill_Sweep::RebuildTopOrBottomEdge(const TopoDS_Edge& aNewEdge,
     const Handle(BRep_CurveRepresentation)& CurveRep = itrep.Value();
     if (CurveRep->IsCurveOnSurface())
     {
-      const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&CurveRep);
+      Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (CurveRep));
       Handle(Geom2d_Curve) aPCurve = GC->PCurve();
       Handle(Geom_Surface) aSurf = GC->Surface();
       TopLoc_Location aLoc = aNewEdge.Location() * GC->Location();
index 4d6280bd463ed5bd9b2189eed63b39be15d1fa5e..f243338f9ceb8221cc12ff6af0b8c3580919a823 100644 (file)
@@ -42,7 +42,7 @@ Standard_Integer  BRepGProp_EdgeTool::IntegrationOrder(const BRepAdaptor_Curve&
     {
     const GeomAdaptor_Curve& GAC = BAC.Curve();
     const Handle(Geom_Curve)& GC = GAC.Curve();
-    const Handle(Geom_BezierCurve)& GBZC = (*((Handle(Geom_BezierCurve)*)&GC));
+    Handle(Geom_BezierCurve) GBZC (Handle(Geom_BezierCurve)::DownCast (GC));
     Standard_Integer n = 2*(GBZC->NbPoles()) - 1;
     return n; 
     }
@@ -51,7 +51,7 @@ Standard_Integer  BRepGProp_EdgeTool::IntegrationOrder(const BRepAdaptor_Curve&
     {
     const GeomAdaptor_Curve& GAC = BAC.Curve();
     const Handle(Geom_Curve)& GC = GAC.Curve();
-    const Handle(Geom_BSplineCurve)& GBSC = (*((Handle(Geom_BSplineCurve)*)&GC));
+    Handle(Geom_BSplineCurve) GBSC (Handle(Geom_BSplineCurve)::DownCast (GC));
     Standard_Integer n = 2*(GBSC->NbPoles()) - 1;
     return n; 
     }
index d694054391ee0be572810f355613293b676a7899..a9486dcc76543b6bbc6c769cda220224feb38436 100644 (file)
@@ -617,7 +617,7 @@ void BRepGProp_Face::GetUKnots
       GeomAdaptor_Curve    aCurve;
       Handle(Geom_Surface) aSurf = mySurface.Surface().Surface();
 
-      aCurve.Load((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&aSurf))->BasisCurve());
+      aCurve.Load(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (aSurf)->BasisCurve());
       isCBSpline = aCurve.GetType() == GeomAbs_BSplineCurve;
     }
   }
@@ -643,7 +643,7 @@ void BRepGProp_Face::GetUKnots
       Handle(Geom_Surface)      aSurf = mySurface.Surface().Surface();
       Handle(Geom_BSplineCurve) aBSplCurve;
 
-      aCurve.Load((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&aSurf))->BasisCurve());
+      aCurve.Load(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (aSurf)->BasisCurve());
       aBSplCurve = aCurve.BSpline();
       aNbKnots   = aBSplCurve->NbKnots();
       aKnots     = new TColStd_HArray1OfReal(1, aNbKnots);
index bb2d97b2dfe3c4fb6b8d320a64c9696dfe024f6b..d9934bf3db20764535cf0676fb276fe1150fefc1 100644 (file)
@@ -976,7 +976,7 @@ void BRepLib::SameParameter(const TopoDS_Edge&  AnEdge,
   Handle(Standard_Type) TheType = C3d->DynamicType();
   if( TheType == STANDARD_TYPE(Geom_TrimmedCurve))
   {
-    const Handle(Geom_Curve)& gtC = (*((Handle(Geom_TrimmedCurve)*)&C3d))->BasisCurve();
+    Handle(Geom_Curve) gtC (Handle(Geom_TrimmedCurve)::DownCast (C3d)->BasisCurve());
     m_TrimmedPeriodical = gtC->IsPeriodic();
   }
   // modified by NIZHNY-OCC486  Tue Aug 27 17:15:17 2002 .
@@ -1323,7 +1323,7 @@ void  BRepLib::UpdateTolerances(const TopoDS_Shape& aShape,
         aB.SetVoid();
         BRepBndLib::Add(curf,aB);
         if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-          S = (*((Handle(Geom_RectangularTrimmedSurface)*)&S))->BasisSurface();
+          S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
         }
         GeomAdaptor_Surface AS(S);
         switch (AS.GetType()) {
@@ -1820,7 +1820,7 @@ void  BRepLib::SortFaces (const TopoDS_Shape& Sh,
     S = BRep_Tool::Surface(F, l);
     if (!S.IsNull()) {
       if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-        S = (*((Handle(Geom_RectangularTrimmedSurface)*)&S))->BasisSurface();
+        S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
       }
       GeomAdaptor_Surface AS(S);
       switch (AS.GetType()) {
@@ -1878,7 +1878,7 @@ void  BRepLib::ReverseSortFaces (const TopoDS_Shape& Sh,
     S = BRep_Tool::Surface(F, l);
     if (!S.IsNull()) {
       if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-        S = (*((Handle(Geom_RectangularTrimmedSurface)*)&S))->BasisSurface();
+        S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
       }
       GeomAdaptor_Surface AS(S);
       switch (AS.GetType()) {
index 00eb9299494c1baf7cfff144ae54316d823dc929..9bb7d4071d4f48a1067015cb9f925be69e4b3199 100644 (file)
@@ -161,7 +161,7 @@ static void BCSmoothing(Handle(Geom_BSplineCurve)& theC,
 static void MakeClosedCurve(Handle(Geom_Curve)& C, const gp_Pnt& PF, 
                            Standard_Real& f, Standard_Real& l)
 {
-  Handle(Geom_BSplineCurve) aBC = (*((Handle(Geom_BSplineCurve)*)&C));
+  Handle(Geom_BSplineCurve) aBC = Handle(Geom_BSplineCurve)::DownCast (C);
   GeomAbs_Shape aCont = aBC->Continuity();
   //Find new origin
   aBC->SetPeriodic();
@@ -462,7 +462,7 @@ void BRepLib_FuseEdges::BuildListResultEdges()
       // if the curve is trimmed we get the basis curve to fit the new vertices
       // otherwise the makeedge will fail.
       if (C->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) {
-       C = (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve();
+       C = Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve();
       }
 
       if(myConcatBSpl) {
@@ -776,7 +776,7 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
 
   if (!loc.IsIdentity()) {
     Handle(Geom_Geometry) GG1 = C1->Transformed(loc.Transformation());
-    C1 = *((Handle(Geom_Curve)*)&GG1);
+    C1 = Handle(Geom_Curve)::DownCast (GG1);
   }
   C2 = BRep_Tool::Curve(E2,loc,f2,l2);
   //modified by NIZNHY-PKV Mon Nov 15 16:24:38 1999
@@ -785,19 +785,19 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
 
   if (!loc.IsIdentity()) {
     Handle(Geom_Geometry) GG2 = C2->Transformed(loc.Transformation());
-    C2 = *((Handle(Geom_Curve)*)&GG2);
+    C2 = Handle(Geom_Curve)::DownCast (GG2);
   }
   
   typC1 = C1->DynamicType();
   typC2 = C2->DynamicType();
   
   if (typC1 == STANDARD_TYPE(Geom_TrimmedCurve)) {
-    C1 =  (*((Handle(Geom_TrimmedCurve)*)&C1))->BasisCurve();
+    C1 =  Handle(Geom_TrimmedCurve)::DownCast (C1)->BasisCurve();
     typC1 = C1->DynamicType();
   }
   
   if (typC2 == STANDARD_TYPE(Geom_TrimmedCurve)) {
-    C2 =  (*((Handle(Geom_TrimmedCurve)*)&C2))->BasisCurve();
+    C2 =  Handle(Geom_TrimmedCurve)::DownCast (C2)->BasisCurve();
     typC2 = C2->DynamicType();
   }
   
@@ -820,8 +820,8 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
   const Standard_Real tollin = Precision::Confusion();
   const Standard_Real tolang = Precision::Angular();
   if (typC1 == STANDARD_TYPE(Geom_Line)) {
-    gp_Lin li1( (*((Handle(Geom_Line)*)&C1))->Lin());
-    gp_Lin li2( (*((Handle(Geom_Line)*)&C2))->Lin());
+    gp_Lin li1( Handle(Geom_Line)::DownCast (C1)->Lin());
+    gp_Lin li2( Handle(Geom_Line)::DownCast (C2)->Lin());
     gp_Dir dir1(li1.Direction());
     gp_Dir dir2(li2.Direction());
 
@@ -840,8 +840,8 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
     return Standard_False;
   } 
   else if (typC1 == STANDARD_TYPE(Geom_Circle)) {
-    gp_Circ ci1 = (*((Handle(Geom_Circle)*)&C1))->Circ();
-    gp_Circ ci2 = (*((Handle(Geom_Circle)*)&C2))->Circ();
+    gp_Circ ci1 = Handle(Geom_Circle)::DownCast (C1)->Circ();
+    gp_Circ ci2 = Handle(Geom_Circle)::DownCast (C2)->Circ();
     if (Abs(ci1.Radius()-ci2.Radius()) <= tollin &&
        ci1.Location().SquareDistance(ci2.Location()) <= tollin*tollin &&
        ci1.Axis().IsParallel(ci2.Axis(),tolang) ) {
@@ -851,8 +851,8 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
     return Standard_False;
   }
   else if (typC1 == STANDARD_TYPE(Geom_Ellipse)) {
-    gp_Elips ci1 = (*((Handle(Geom_Ellipse)*)&C1))->Elips();
-    gp_Elips ci2 = (*((Handle(Geom_Ellipse)*)&C2))->Elips();
+    gp_Elips ci1 = Handle(Geom_Ellipse)::DownCast (C1)->Elips();
+    gp_Elips ci2 = Handle(Geom_Ellipse)::DownCast (C2)->Elips();
     
     if (Abs(ci1.MajorRadius()-ci2.MajorRadius()) <= tollin &&
        Abs(ci1.MinorRadius()-ci2.MinorRadius()) <= tollin &&
@@ -889,8 +889,8 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
       return Standard_False;
     }
 
-    Handle(Geom_BSplineCurve) B1 = *((Handle(Geom_BSplineCurve)*)&C1);
-    Handle(Geom_BSplineCurve) B2 = *((Handle(Geom_BSplineCurve)*)&C2);
+    Handle(Geom_BSplineCurve) B1 = Handle(Geom_BSplineCurve)::DownCast (C1);
+    Handle(Geom_BSplineCurve) B2 = Handle(Geom_BSplineCurve)::DownCast (C2);
    
     Standard_Integer nbpoles = B1->NbPoles();
     if (nbpoles != B2->NbPoles()) {
@@ -962,8 +962,8 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
       return Standard_False;
     }
 
-    Handle(Geom_BezierCurve) B1 = *((Handle(Geom_BezierCurve)*)&C1);
-    Handle(Geom_BezierCurve) B2 = *((Handle(Geom_BezierCurve)*)&C2);
+    Handle(Geom_BezierCurve) B1 = Handle(Geom_BezierCurve)::DownCast (C1);
+    Handle(Geom_BezierCurve) B2 = Handle(Geom_BezierCurve)::DownCast (C2);
     
     Standard_Integer nbpoles = B1->NbPoles();
     if (nbpoles != B2->NbPoles()) {
@@ -1114,16 +1114,16 @@ Standard_Boolean BRepLib_FuseEdges::UpdatePCurve(const TopoDS_Edge& theOldEdge,
        Handle(Geom2d_Curve) Curv2dR = BRep_Tool::CurveOnSurface(aFEdge,
                                                                 aFFace,cf,cl);
        if (Curv2d->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
-         Curv2d = (*((Handle(Geom2d_TrimmedCurve)*)&Curv2d))->BasisCurve();
+         Curv2d = Handle(Geom2d_TrimmedCurve)::DownCast (Curv2d)->BasisCurve();
        if (Curv2dR->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
-         Curv2dR = (*((Handle(Geom2d_TrimmedCurve)*)&Curv2dR))->BasisCurve();
+         Curv2dR = Handle(Geom2d_TrimmedCurve)::DownCast (Curv2dR)->BasisCurve();
 
        B.UpdateEdge (theNewEdge,Curv2d,Curv2dR,Surf,loc,BRep_Tool::Tolerance(theNewEdge));
       }
       else {
        // update the new edge 
        if (Curv2d->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
-         Curv2d = (*((Handle(Geom2d_TrimmedCurve)*)&Curv2d))->BasisCurve();
+         Curv2d = Handle(Geom2d_TrimmedCurve)::DownCast (Curv2d)->BasisCurve();
        Standard_Real f, l;
        f = Curv2d->FirstParameter();
        l = Curv2d->LastParameter();
index 42c38e040b15d2ca0f998090aea31f1a42e4c201..0f5ef89e417240039beb4cb52025ce23493be27f 100644 (file)
@@ -570,7 +570,7 @@ GeomAbs_CurveType GetCurveType(const Handle(Geom2d_Curve)& theC2d)
   GeomAbs_CurveType aTypeCurve = GeomAbs_OtherCurve;
   Handle(Standard_Type) TheType = theC2d->DynamicType();
   if ( TheType == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
-    TheType = (*((Handle(Geom2d_TrimmedCurve)*)&theC2d))->BasisCurve()->DynamicType();
+    TheType = Handle(Geom2d_TrimmedCurve)::DownCast (theC2d)->BasisCurve()->DynamicType();
   }
 
   if ( TheType ==  STANDARD_TYPE(Geom2d_Circle)) {
index ee39bcc952291b5b24d9c1fe01a8552a18ea15aa..7534583c33009419e841cdb999fff675eb8c93dc 100644 (file)
@@ -847,7 +847,7 @@ static Standard_Boolean ExtendPCurve(const Handle(Geom2d_Curve)& aPCurve,
 {
   NewPCurve = aPCurve;
   if (NewPCurve->IsInstance(STANDARD_TYPE(Geom2d_TrimmedCurve)))
-    NewPCurve = (*((Handle(Geom2d_TrimmedCurve)*)&NewPCurve))->BasisCurve();
+    NewPCurve = Handle(Geom2d_TrimmedCurve)::DownCast (NewPCurve)->BasisCurve();
   
   Standard_Real FirstPar = NewPCurve->FirstParameter();
   Standard_Real LastPar  = NewPCurve->LastParameter();
@@ -857,7 +857,7 @@ static Standard_Boolean ExtendPCurve(const Handle(Geom2d_Curve)& aPCurve,
     {
       if (NewPCurve->IsInstance(STANDARD_TYPE(Geom2d_BezierCurve)))
        {
-         Handle(Geom2d_BezierCurve) aBezier = *((Handle(Geom2d_BezierCurve)*)&NewPCurve);
+         Handle(Geom2d_BezierCurve) aBezier = Handle(Geom2d_BezierCurve)::DownCast (NewPCurve);
          if (aBezier->NbPoles() == 2)
            {
              TColgp_Array1OfPnt2d thePoles(1,2);
@@ -869,7 +869,7 @@ static Standard_Boolean ExtendPCurve(const Handle(Geom2d_Curve)& aPCurve,
        }
       else if (NewPCurve->IsInstance(STANDARD_TYPE(Geom2d_BSplineCurve)))
        {
-         Handle(Geom2d_BSplineCurve) aBSpline = *((Handle(Geom2d_BSplineCurve)*)&NewPCurve);
+         Handle(Geom2d_BSplineCurve) aBSpline = Handle(Geom2d_BSplineCurve)::DownCast (NewPCurve);
          if (aBSpline->NbKnots() == 2 && aBSpline->NbPoles() == 2)
            {
              TColgp_Array1OfPnt2d thePoles(1,2);
@@ -1190,7 +1190,7 @@ static void ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const Standard_Real
                  else if (MinSurf->IsInstance(STANDARD_TYPE(Geom_CylindricalSurface)) ||
                           MinSurf->IsInstance(STANDARD_TYPE(Geom_ConicalSurface)))
                    {
-                     Handle(Geom2d_Line) theLine = *((Handle(Geom2d_Line)*)&MinPC);
+                     Handle(Geom2d_Line) theLine = Handle(Geom2d_Line)::DownCast (MinPC);
                      gp_Dir2d LineDir = theLine->Direction();
                      if (LineDir.IsParallel( gp::DY2d(), Precision::Angular() ))
                        IsLine = Standard_True;
@@ -1251,13 +1251,13 @@ static void ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const Standard_Real
                        if (theCurve->IsInstance(STANDARD_TYPE(Geom2d_Line)) &&
                            theSurf->IsKind(STANDARD_TYPE(Geom_BoundedSurface)))
                          {
-                           gp_Dir2d theDir = (*((Handle(Geom2d_Line)*)&theCurve))->Direction();
+                           gp_Dir2d theDir = Handle(Geom2d_Line)::DownCast (theCurve)->Direction();
                            if (theDir.IsParallel(gp::DX2d(), Precision::Angular()) ||
                                theDir.IsParallel(gp::DY2d(), Precision::Angular()))
                              {
                                Standard_Real U1, U2, V1, V2;
                                theSurf->Bounds(U1, U2, V1, V2);
-                               gp_Pnt2d Origin = (*((Handle(Geom2d_Line)*)&theCurve))->Location();
+                               gp_Pnt2d Origin = Handle(Geom2d_Line)::DownCast (theCurve)->Location();
                                if (Abs(Origin.X()-U1) <= Precision::Confusion() ||
                                    Abs(Origin.X()-U2) <= Precision::Confusion() ||
                                    Abs(Origin.Y()-V1) <= Precision::Confusion() ||
index c5665831395f886971f1c1dccf82eae7d89ea184..ef738d20ab3d913f37b5a5ef0e4eabb323af02a9 100644 (file)
@@ -580,7 +580,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face&                  Face,
            }
          if (TheSurf->DynamicType() == STANDARD_TYPE(Geom_ConicalSurface))
            {
-             gp_Cone theCone = (*((Handle(Geom_ConicalSurface)*)&TheSurf))->Cone();
+             gp_Cone theCone = Handle(Geom_ConicalSurface)::DownCast (TheSurf)->Cone();
              gp_Pnt apex = theCone.Apex();
              Standard_Real Uapex, Vapex;
              ElSLib::Parameters( theCone, apex, Uapex, Vapex );
@@ -604,7 +604,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face&                  Face,
                 Handle(Geom_Curve) uiso = TheSurf->UIso( uf1 );
                 if (BRepOffset_Tool::Gabarit( uiso ) > TolApex)
                 {
-                  Handle(Geom_Surface) BasisSurf = (*((Handle(Geom_OffsetSurface)*)&TheSurf))->BasisSurface();
+                  Handle(Geom_Surface) BasisSurf = Handle(Geom_OffsetSurface)::DownCast (TheSurf)->BasisSurface();
                   gp_Pnt Papex, Pfirst, Pquart, Pmid;
                   Papex = BasisSurf->Value( uf1, vf1 );
                   Pfirst = TheSurf->Value( uf1, vf1 );
@@ -621,7 +621,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face&                  Face,
                   if (OffsetOutside)
                   {
                     TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
-                    GeomLib::ExtendSurfByLength(*((Handle(Geom_BoundedSurface)*)&TheSurf), length, 1,
+                    GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1,
                                                 Standard_True, Standard_False);
                     Standard_Real u1, u2, v1, v2;
                     TheSurf->Bounds( u1, u2, v1, v2 );
@@ -643,7 +643,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face&                  Face,
                 Handle(Geom_Curve) uiso = TheSurf->UIso( uf2 );
                 if (BRepOffset_Tool::Gabarit( uiso ) > TolApex)
                 {
-                  Handle(Geom_Surface) BasisSurf = (*((Handle(Geom_OffsetSurface)*)&TheSurf))->BasisSurface();
+                  Handle(Geom_Surface) BasisSurf = Handle(Geom_OffsetSurface)::DownCast (TheSurf)->BasisSurface();
                   gp_Pnt Papex, Pfirst, Pquart, Pmid;
                   Papex  = BasisSurf->Value( uf2, vf1 );
                   Pfirst = TheSurf->Value( uf2, vf1 );
@@ -660,7 +660,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face&                  Face,
                   if (OffsetOutside)
                   {
                     TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
-                    GeomLib::ExtendSurfByLength(*((Handle(Geom_BoundedSurface)*)&TheSurf), length, 1,
+                    GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1,
                                                 Standard_True, Standard_True);
                     Standard_Real u1, u2, v1, v2;
                     TheSurf->Bounds( u1, u2, v1, v2 );
@@ -682,7 +682,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face&                  Face,
                 Handle(Geom_Curve) viso = TheSurf->VIso( vf1 );
                 if (BRepOffset_Tool::Gabarit( viso ) > TolApex)
                 {
-                  Handle(Geom_Surface) BasisSurf = (*((Handle(Geom_OffsetSurface)*)&TheSurf))->BasisSurface();
+                  Handle(Geom_Surface) BasisSurf = Handle(Geom_OffsetSurface)::DownCast (TheSurf)->BasisSurface();
                   gp_Pnt Papex, Pfirst, Pquart, Pmid;
                   Papex = BasisSurf->Value( uf1, vf1 );
                   Pfirst = TheSurf->Value( uf1, vf1 );
@@ -699,7 +699,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face&                  Face,
                   if (OffsetOutside)
                   {
                     TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
-                    GeomLib::ExtendSurfByLength(*((Handle(Geom_BoundedSurface)*)&TheSurf), length, 1,
+                    GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1,
                                                 Standard_False, Standard_False);
                     Standard_Real u1, u2, v1, v2;
                     TheSurf->Bounds( u1, u2, v1, v2 );
@@ -723,7 +723,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face&                  Face,
                 Handle(Geom_Curve) viso = TheSurf->VIso( vf2 );
                 if (BRepOffset_Tool::Gabarit( viso ) > TolApex)
                 {
-                  Handle(Geom_Surface) BasisSurf = (*((Handle(Geom_OffsetSurface)*)&TheSurf))->BasisSurface();
+                  Handle(Geom_Surface) BasisSurf = Handle(Geom_OffsetSurface)::DownCast (TheSurf)->BasisSurface();
                   gp_Pnt Papex, Pfirst, Pquart, Pmid;
                   Papex = BasisSurf->Value( uf1, vf2 );
                   Pfirst = TheSurf->Value( uf1, vf2 );
@@ -740,7 +740,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face&                  Face,
                   if (OffsetOutside)
                   {
                     TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
-                    GeomLib::ExtendSurfByLength(*((Handle(Geom_BoundedSurface)*)&TheSurf), length, 1,
+                    GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1,
                                                 Standard_False, Standard_True);
                     Standard_Real u1, u2, v1, v2;
                     TheSurf->Bounds( u1, u2, v1, v2 );
index b84c773fe14c4423e8528dafc6472e34f032f522..c6bb537836a643f45b7942b083c836c957c5acfd 100644 (file)
@@ -253,7 +253,7 @@ static void PutInBounds (const TopoDS_Face&          F,
   Handle (Geom_Surface) S   = BRep_Tool::Surface(F,L);
 
   if (S->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
-    S = (*(Handle(Geom_RectangularTrimmedSurface)*)&S)->BasisSurface();
+    S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
   }
   //---------------
   // Recadre en U.
@@ -368,7 +368,7 @@ static void BuildPCurves (const TopoDS_Edge&  E,
   Handle( Geom_Surface ) theSurf = BRep_Tool::Surface( F );
   Handle( Standard_Type ) typS = theSurf->DynamicType();
   if (typS == STANDARD_TYPE(Geom_OffsetSurface))
-    typS = (*((Handle(Geom_OffsetSurface)*)&theSurf))->BasisSurface()->DynamicType();
+    typS = Handle(Geom_OffsetSurface)::DownCast (theSurf)->BasisSurface()->DynamicType();
   if (typS == STANDARD_TYPE(Geom_BezierSurface) || typS == STANDARD_TYPE(Geom_BSplineSurface))
     {
       gp_Pnt fpoint = AC.Value( AC.FirstParameter() );
@@ -902,18 +902,18 @@ static Standard_Boolean AreConnex(const TopoDS_Wire& W1,
       Standard_Real f, l;
       Handle(Geom_Curve) C1 = BRep_Tool::Curve( E1, f, l ); 
       if (C1->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
-       C1 = (*((Handle(Geom_TrimmedCurve)*)&C1))->BasisCurve();
+       C1 = Handle(Geom_TrimmedCurve)::DownCast (C1)->BasisCurve();
       
       Handle(Geom_Curve) C2 = BRep_Tool::Curve( E2, f, l );
       if (C2->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
-       C2 = (*((Handle(Geom_TrimmedCurve)*)&C2))->BasisCurve();
+       C2 = Handle(Geom_TrimmedCurve)::DownCast (C2)->BasisCurve();
 
       if (C1->IsInstance(STANDARD_TYPE(Geom_Line)) &&
          C2->IsInstance(STANDARD_TYPE(Geom_Line)))
        {
-         Handle(Geom_Line) L1 = *((Handle(Geom_Line)*) &C1);
+         Handle(Geom_Line) L1 = Handle(Geom_Line)::DownCast (C1);
          gp_Ax1 Axis1 = L1->Position();
-         Handle(Geom_Line) L2 = *((Handle(Geom_Line)*) &C2);
+         Handle(Geom_Line) L2 = Handle(Geom_Line)::DownCast (C2);
          gp_Ax1 Axis2 = L2->Position();
          if (! Axis1.IsParallel( Axis2, Precision::Angular() ))
            return Standard_False;
@@ -959,11 +959,11 @@ static Standard_Boolean BSplineEdges(const TopoDS_Edge& E1,
 
   Handle(Geom_Curve) C1 = BRep_Tool::Curve( E1, first1, last1 ); 
   if (C1->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
-    C1 = (*((Handle(Geom_TrimmedCurve)*)&C1))->BasisCurve();
+    C1 = Handle(Geom_TrimmedCurve)::DownCast (C1)->BasisCurve();
 
   Handle(Geom_Curve) C2 = BRep_Tool::Curve( E2, first2, last2 );
   if (C2->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
-    C2 = (*((Handle(Geom_TrimmedCurve)*)&C2))->BasisCurve();
+    C2 = Handle(Geom_TrimmedCurve)::DownCast (C2)->BasisCurve();
 
   if (!C1->IsInstance(STANDARD_TYPE(Geom_BSplineCurve)) ||
       !C2->IsInstance(STANDARD_TYPE(Geom_BSplineCurve)))
@@ -1082,11 +1082,11 @@ static Handle(Geom2d_Curve) ConcatPCurves(const TopoDS_Edge& E1,
 
   PCurve1 = BRep_Tool::CurveOnSurface( E1, F, first1, last1 );
   if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_TrimmedCurve)))
-    PCurve1 = (*((Handle(Geom2d_TrimmedCurve)*)&PCurve1))->BasisCurve();
+    PCurve1 = Handle(Geom2d_TrimmedCurve)::DownCast (PCurve1)->BasisCurve();
 
   PCurve2 = BRep_Tool::CurveOnSurface( E2, F, first2, last2 );
   if (PCurve2->IsInstance(STANDARD_TYPE(Geom2d_TrimmedCurve)))
-    PCurve2 = (*((Handle(Geom2d_TrimmedCurve)*)&PCurve2))->BasisCurve();
+    PCurve2 = Handle(Geom2d_TrimmedCurve)::DownCast (PCurve2)->BasisCurve();
       
   if (PCurve1 == PCurve2)
     {
@@ -1104,35 +1104,35 @@ static Handle(Geom2d_Curve) ConcatPCurves(const TopoDS_Edge& E1,
       P2 = PCurve2->Value( last2 );
       if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_Line)))
        {
-         Handle(Geom2d_Line) Lin1 = *((Handle(Geom2d_Line)*) &PCurve1);
+         Handle(Geom2d_Line) Lin1 = Handle(Geom2d_Line)::DownCast (PCurve1);
          gp_Lin2d theLin = Lin1->Lin2d();
          first2 = ElCLib::Parameter( theLin, P1 );
          last2  = ElCLib::Parameter( theLin, P2 );
        }
       else if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_Circle)))
        {
-         Handle(Geom2d_Circle) Circ1 = *((Handle(Geom2d_Circle)*) &PCurve1);
+         Handle(Geom2d_Circle) Circ1 = Handle(Geom2d_Circle)::DownCast (PCurve1);
          gp_Circ2d theCirc = Circ1->Circ2d();
          first2 = ElCLib::Parameter( theCirc, P1 );
          last2  = ElCLib::Parameter( theCirc, P2 );
        }
       else if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_Ellipse)))
        {
-         Handle(Geom2d_Ellipse) Ell1 = *((Handle(Geom2d_Ellipse)*) &PCurve1);
+         Handle(Geom2d_Ellipse) Ell1 = Handle(Geom2d_Ellipse)::DownCast (PCurve1);
          gp_Elips2d theElips = Ell1->Elips2d();
          first2 = ElCLib::Parameter( theElips, P1 );
          last2  = ElCLib::Parameter( theElips, P2 );
        }
       else if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_Parabola)))
        {
-         Handle(Geom2d_Parabola) Parab1 = *((Handle(Geom2d_Parabola)*) &PCurve1);
+         Handle(Geom2d_Parabola) Parab1 = Handle(Geom2d_Parabola)::DownCast (PCurve1);
          gp_Parab2d theParab = Parab1->Parab2d();
          first2 = ElCLib::Parameter( theParab, P1 );
          last2  = ElCLib::Parameter( theParab, P2 );
        }
       else if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_Hyperbola)))
        {
-         Handle(Geom2d_Hyperbola) Hypr1 = *((Handle(Geom2d_Hyperbola)*) &PCurve1);
+         Handle(Geom2d_Hyperbola) Hypr1 = Handle(Geom2d_Hyperbola)::DownCast (PCurve1);
          gp_Hypr2d theHypr = Hypr1->Hypr2d();
          first2 = ElCLib::Parameter( theHypr, P1 );
          last2  = ElCLib::Parameter( theHypr, P2 );
@@ -1187,11 +1187,11 @@ static TopoDS_Edge Glue(const TopoDS_Edge& E1,
 
   C1 = BRep_Tool::Curve( E1, first1, last1 ); 
   if (C1->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
-    C1 = (*((Handle(Geom_TrimmedCurve)*)&C1))->BasisCurve();
+    C1 = Handle(Geom_TrimmedCurve)::DownCast (C1)->BasisCurve();
 
   C2 = BRep_Tool::Curve( E2, first2, last2 );
   if (C2->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
-    C2 = (*((Handle(Geom_TrimmedCurve)*)&C2))->BasisCurve();
+    C2 = Handle(Geom_TrimmedCurve)::DownCast (C2)->BasisCurve();
 
   if (C1 == C2)
     {
@@ -1302,7 +1302,7 @@ static Standard_Boolean CheckIntersFF(const BOPDS_PDS& pDS,
 
   Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F1);
   if (aSurf->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
-    aSurf = (*((Handle(Geom_RectangularTrimmedSurface)*)&aSurf))->BasisSurface();
+    aSurf = Handle(Geom_RectangularTrimmedSurface)::DownCast (aSurf)->BasisSurface();
   if (aSurf->IsInstance(STANDARD_TYPE(Geom_Plane)))
     isPlane1 = Standard_True;
   else if (aSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface)))
@@ -1310,7 +1310,7 @@ static Standard_Boolean CheckIntersFF(const BOPDS_PDS& pDS,
 
   aSurf = BRep_Tool::Surface(F2);
   if (aSurf->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
-    aSurf = (*((Handle(Geom_RectangularTrimmedSurface)*)&aSurf))->BasisSurface();
+    aSurf = Handle(Geom_RectangularTrimmedSurface)::DownCast (aSurf)->BasisSurface();
   if (aSurf->IsInstance(STANDARD_TYPE(Geom_Plane)))
     isPlane2 = Standard_True;
   else if (aSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface)))
@@ -1708,7 +1708,7 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
 
   Handle(Geom_Surface) aSurf = BRep_Tool::Surface(cpF1);
   if (aSurf->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
-    aSurf = (*((Handle(Geom_RectangularTrimmedSurface)*)&aSurf))->BasisSurface();
+    aSurf = Handle(Geom_RectangularTrimmedSurface)::DownCast (aSurf)->BasisSurface();
   if (aSurf->IsInstance(STANDARD_TYPE(Geom_Plane)))
     addPCurve1 = Standard_False;
   else if (aSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface)))
@@ -1716,7 +1716,7 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
 
   aSurf = BRep_Tool::Surface(cpF2);
   if (aSurf->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
-    aSurf = (*((Handle(Geom_RectangularTrimmedSurface)*)&aSurf))->BasisSurface();
+    aSurf = Handle(Geom_RectangularTrimmedSurface)::DownCast (aSurf)->BasisSurface();
   if (aSurf->IsInstance(STANDARD_TYPE(Geom_Plane)))
     addPCurve2 = Standard_False;
   else if (aSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface)))
@@ -2027,14 +2027,14 @@ void BRepOffset_Tool::InterOrExtent(const TopoDS_Face& F1,
 
   if (S1->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
     Handle(Geom_RectangularTrimmedSurface) RTS ;
-    RTS = *((Handle(Geom_RectangularTrimmedSurface)*) &S1);
+    RTS = Handle(Geom_RectangularTrimmedSurface)::DownCast (S1);
     if (RTS->BasisSurface()->DynamicType() == STANDARD_TYPE(Geom_Plane)) {
       S1 = RTS->BasisSurface();
     }
   }
   if (S2->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
     Handle(Geom_RectangularTrimmedSurface) RTS ;
-    RTS = *((Handle(Geom_RectangularTrimmedSurface)*) &S2);
+    RTS = Handle(Geom_RectangularTrimmedSurface)::DownCast (S2);
     if (RTS->BasisSurface()->DynamicType() == STANDARD_TYPE(Geom_Plane)) {
       S2 = RTS->BasisSurface();
     }
@@ -2582,7 +2582,7 @@ static void MakeFace(const Handle(Geom_Surface)& S,
   Standard_Boolean IsSuclosed = S->IsUClosed(), IsSvclosed = S->IsVClosed();
   if (S->DynamicType() == STANDARD_TYPE(Geom_OffsetSurface))
     {
-      Handle(Geom_Surface) BasisSurf = (*((Handle(Geom_OffsetSurface)*)&S))->BasisSurface();
+      Handle(Geom_Surface) BasisSurf = Handle(Geom_OffsetSurface)::DownCast (S)->BasisSurface();
       IsSuclosed = BasisSurf->IsUClosed();
       IsSvclosed = BasisSurf->IsVClosed();
     }
@@ -2601,10 +2601,10 @@ static void MakeFace(const Handle(Geom_Surface)& S,
   Standard_Boolean vmindegen = isVminDegen, vmaxdegen = isVmaxDegen;
   Handle(Geom_Surface) theSurf = S;
   if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface))
-    theSurf = (*(Handle(Geom_RectangularTrimmedSurface)*)&S)->BasisSurface();
+    theSurf = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
   if (theSurf->DynamicType() == STANDARD_TYPE(Geom_ConicalSurface))
     {
-      Handle(Geom_ConicalSurface) ConicalS = *((Handle(Geom_ConicalSurface)*) &theSurf);
+      Handle(Geom_ConicalSurface) ConicalS = Handle(Geom_ConicalSurface)::DownCast (theSurf);
       gp_Cone theCone = ConicalS->Cone();
       gp_Pnt theApex = theCone.Apex();
       Standard_Real Uapex, Vapex;
@@ -2837,7 +2837,7 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
 
   Standard_Boolean SurfaceChange = Standard_False;
   if ( S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    Handle(Geom_Surface) BS = (*((Handle(Geom_RectangularTrimmedSurface)*)&S))->BasisSurface();
+    Handle(Geom_Surface) BS = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
     EnlargeGeometry(BS,U1,U2,V1,V2,IsV1degen,IsV2degen,
                    uf1,uf2,vf1,vf2,GlobalEnlargeU,GlobalEnlargeVfirst,GlobalEnlargeVlast);
     if (!GlobalEnlargeVfirst)
@@ -2845,14 +2845,14 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
     if (!GlobalEnlargeVlast)
       V2 = vf2;
     if (!GlobalEnlargeVfirst || !GlobalEnlargeVlast)
-      //(*((Handle(Geom_RectangularTrimmedSurface)*)&S))->SetTrim( U1, U2, V1, V2 );
+      //Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->SetTrim( U1, U2, V1, V2 );
       S = new Geom_RectangularTrimmedSurface( BS, U1, U2, V1, V2 );
     else
       S = BS;
     SurfaceChange = Standard_True;
   }
   else if (S->DynamicType() == STANDARD_TYPE(Geom_OffsetSurface)) {
-    Handle(Geom_Surface) Surf = (*((Handle(Geom_OffsetSurface)*)&S))->BasisSurface();
+    Handle(Geom_Surface) Surf = Handle(Geom_OffsetSurface)::DownCast (S)->BasisSurface();
     SurfaceChange = EnlargeGeometry(Surf,U1,U2,V1,V2,IsV1degen,IsV2degen,
                                    uf1,uf2,vf1,vf2,GlobalEnlargeU,GlobalEnlargeVfirst,GlobalEnlargeVlast);
     Handle(Geom_OffsetSurface)::DownCast(S)->SetBasisSurface(Surf);
@@ -2919,16 +2919,16 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
       if (enlargeU)
        {
          if (enlargeUfirst)
-           GeomLib::ExtendSurfByLength( *((Handle(Geom_BoundedSurface)*)&S), du, 1, Standard_True, Standard_False );
+           GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_False );
          if (enlargeUlast)
-           GeomLib::ExtendSurfByLength( *((Handle(Geom_BoundedSurface)*)&S), du, 1, Standard_True, Standard_True );
+           GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_True );
        }
       if (enlargeV)
        {
          if (enlargeVfirst)
-           GeomLib::ExtendSurfByLength( *((Handle(Geom_BoundedSurface)*)&S), dv, 1, Standard_False, Standard_False );
+           GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_False );
          if (enlargeVlast)
-           GeomLib::ExtendSurfByLength( *((Handle(Geom_BoundedSurface)*)&S), dv, 1, Standard_False, Standard_True );
+           GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_True );
        }
       S->Bounds( U1, U2, V1, V2 );
       SurfaceChange = Standard_True;
@@ -2985,16 +2985,16 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
       if (enlargeU)
        {
          if (enlargeUfirst && uf1-u1 < duf)
-           GeomLib::ExtendSurfByLength( *((Handle(Geom_BoundedSurface)*)&S), du, 1, Standard_True, Standard_False );
+           GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_False );
          if (enlargeUlast && u2-uf2 < duf)
-           GeomLib::ExtendSurfByLength( *((Handle(Geom_BoundedSurface)*)&S), du, 1, Standard_True, Standard_True );
+           GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_True );
        }
       if (enlargeV)
        {
          if (enlargeVfirst && vf1-v1 < dvf)
-           GeomLib::ExtendSurfByLength( *((Handle(Geom_BoundedSurface)*)&S), dv, 1, Standard_False, Standard_False );
+           GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_False );
          if (enlargeVlast && v2-vf2 < dvf)
-           GeomLib::ExtendSurfByLength( *((Handle(Geom_BoundedSurface)*)&S), dv, 1, Standard_False, Standard_True );
+           GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_True );
        }
 
       S->Bounds( U1, U2, V1, V2 );
@@ -3116,7 +3116,7 @@ void BRepOffset_Tool::CheckBounds(const TopoDS_Face& F,
 
   Handle(Geom_Surface) theSurf = BRep_Tool::Surface(F);
   if (theSurf->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface))
-    theSurf = (*((Handle(Geom_RectangularTrimmedSurface)*)&theSurf))->BasisSurface();
+    theSurf = Handle(Geom_RectangularTrimmedSurface)::DownCast (theSurf)->BasisSurface();
 
   if (theSurf->DynamicType() == STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion) ||
       theSurf->DynamicType() == STANDARD_TYPE(Geom_SurfaceOfRevolution) ||
@@ -3136,11 +3136,11 @@ void BRepOffset_Tool::CheckBounds(const TopoDS_Face& F,
                  Standard_Real fpar, lpar;
                  Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(anEdge, F, fpar, lpar);
                  if (aCurve->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
-                   aCurve = (*((Handle(Geom2d_TrimmedCurve)*)&aCurve))->BasisCurve();
+                   aCurve = Handle(Geom2d_TrimmedCurve)::DownCast (aCurve)->BasisCurve();
                  
                  Handle(Geom2d_Line) theLine;
                  if (aCurve->DynamicType() == STANDARD_TYPE(Geom2d_Line))
-                   theLine = *((Handle(Geom2d_Line)*)&aCurve);
+                   theLine = Handle(Geom2d_Line)::DownCast (aCurve);
                  else if (aCurve->DynamicType() == STANDARD_TYPE(Geom2d_BezierCurve) ||
                           aCurve->DynamicType() == STANDARD_TYPE(Geom2d_BSplineCurve))
                    {
@@ -3269,10 +3269,10 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
   //Special treatment for conical surfaces
   Handle(Geom_Surface) theSurf = S;
   if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface))
-    theSurf = (*(Handle(Geom_RectangularTrimmedSurface)*)&S)->BasisSurface();
+    theSurf = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
   if (theSurf->DynamicType() == STANDARD_TYPE(Geom_ConicalSurface))
     {
-      Handle(Geom_ConicalSurface) ConicalS = *((Handle(Geom_ConicalSurface)*) &theSurf);
+      Handle(Geom_ConicalSurface) ConicalS = Handle(Geom_ConicalSurface)::DownCast (theSurf);
       gp_Cone theCone = ConicalS->Cone();
       gp_Pnt theApex = theCone.Apex();
       Standard_Real Uapex, Vapex;
index 357e7d34e9cea62a09296353febd979196a2203e..06ac3b3e964b19c5f483fac8060d3c34f64dfdb6 100644 (file)
@@ -79,7 +79,7 @@ BRepOffsetAPI_DraftAngle::BRepOffsetAPI_DraftAngle (const TopoDS_Shape& S)
 void BRepOffsetAPI_DraftAngle::Clear ()
 {
   if (!myModification.IsNull()) {
-    (*((Handle(Draft_Modification)*)&myModification))->Clear();
+    Handle(Draft_Modification)::DownCast (myModification)->Clear();
   }
 }
 
@@ -94,7 +94,7 @@ void BRepOffsetAPI_DraftAngle::Init (const TopoDS_Shape& S)
   myInitialShape = S;
   NotDone();
   if (!myModification.IsNull()) {
-    (*((Handle(Draft_Modification)*)&myModification))->Init(S);   
+    Handle(Draft_Modification)::DownCast (myModification)->Init(S);   
   }
   else {
     myModification = new Draft_Modification(S);
@@ -117,7 +117,7 @@ void BRepOffsetAPI_DraftAngle::Add(const TopoDS_Face& F,
   if ( Abs(Angle) <= 1.e-04 ) 
     return;
   Standard_NullObject_Raise_if(myInitialShape.IsNull(),"");
-  (*((Handle(Draft_Modification)*)&myModification))->Add(F,D,Angle,Plane, Flag);
+  Handle(Draft_Modification)::DownCast (myModification)->Add(F,D,Angle,Plane, Flag);
 }
 
 
@@ -129,7 +129,7 @@ void BRepOffsetAPI_DraftAngle::Add(const TopoDS_Face& F,
 Standard_Boolean BRepOffsetAPI_DraftAngle::AddDone () const
 {
   Standard_NullObject_Raise_if(myInitialShape.IsNull(),"");
-  return (*((Handle(Draft_Modification)*)&myModification))
+  return Handle(Draft_Modification)::DownCast (myModification)
     ->ProblematicShape().IsNull();
 }
 
@@ -142,7 +142,7 @@ Standard_Boolean BRepOffsetAPI_DraftAngle::AddDone () const
 void BRepOffsetAPI_DraftAngle::Remove(const TopoDS_Face& F)
 {
   Standard_NullObject_Raise_if(myInitialShape.IsNull(),"");
-  (*((Handle(Draft_Modification)*)&myModification))->Remove(F);
+  Handle(Draft_Modification)::DownCast (myModification)->Remove(F);
 }
 
 
@@ -154,7 +154,7 @@ void BRepOffsetAPI_DraftAngle::Remove(const TopoDS_Face& F)
 const TopoDS_Shape& BRepOffsetAPI_DraftAngle::ProblematicShape () const
 {
   Standard_NullObject_Raise_if(myInitialShape.IsNull(),"");
-  return (*((Handle(Draft_Modification)*)&myModification))->ProblematicShape();
+  return Handle(Draft_Modification)::DownCast (myModification)->ProblematicShape();
 }
 
 
@@ -166,7 +166,7 @@ const TopoDS_Shape& BRepOffsetAPI_DraftAngle::ProblematicShape () const
 Draft_ErrorStatus BRepOffsetAPI_DraftAngle::Status () const
 {
   Standard_NullObject_Raise_if(myInitialShape.IsNull(),"");
-  return (*((Handle(Draft_Modification)*)&myModification))->Error();
+  return Handle(Draft_Modification)::DownCast (myModification)->Error();
 }
 
 
@@ -179,7 +179,7 @@ const TopTools_ListOfShape& BRepOffsetAPI_DraftAngle::ConnectedFaces
    (const TopoDS_Face& F) const
 {
   Standard_NullObject_Raise_if(myInitialShape.IsNull(),"");
-  return (*((Handle(Draft_Modification)*)&myModification))->ConnectedFaces(F);
+  return Handle(Draft_Modification)::DownCast (myModification)->ConnectedFaces(F);
 }
 
 
@@ -191,7 +191,7 @@ const TopTools_ListOfShape& BRepOffsetAPI_DraftAngle::ConnectedFaces
 const TopTools_ListOfShape& BRepOffsetAPI_DraftAngle::ModifiedFaces() const
 {
   Standard_NullObject_Raise_if(myInitialShape.IsNull(),"");
-  return (*((Handle(Draft_Modification)*)&myModification))->ModifiedFaces();
+  return Handle(Draft_Modification)::DownCast (myModification)->ModifiedFaces();
 }
 
 //=======================================================================
@@ -203,7 +203,7 @@ const TopTools_ListOfShape& BRepOffsetAPI_DraftAngle::Generated(const TopoDS_Sha
 {
   myGenerated.Clear();
   Standard_NullObject_Raise_if(myInitialShape.IsNull(),"");
-  Handle(Draft_Modification) DMod = (*((Handle(Draft_Modification)*)&myModification));
+  Handle(Draft_Modification) DMod = Handle(Draft_Modification)::DownCast (myModification);
 
   if (S.ShapeType() == TopAbs_FACE) {
     Handle(Geom_Surface) Surf;
@@ -227,7 +227,7 @@ const TopTools_ListOfShape& BRepOffsetAPI_DraftAngle::Modified(const TopoDS_Shap
 {
   myGenerated.Clear();
   Standard_NullObject_Raise_if(myInitialShape.IsNull(),"");
-  Handle(Draft_Modification) DMod = (*((Handle(Draft_Modification)*)&myModification));
+  Handle(Draft_Modification) DMod = Handle(Draft_Modification)::DownCast (myModification);
 
   if (S.ShapeType() == TopAbs_FACE) {
     Handle(Geom_Surface) Surf;
@@ -254,8 +254,8 @@ const TopTools_ListOfShape& BRepOffsetAPI_DraftAngle::Modified(const TopoDS_Shap
 
 void BRepOffsetAPI_DraftAngle::Build()
 {
-  (*((Handle(Draft_Modification)*)&myModification))->Perform();
-  if (!(*((Handle(Draft_Modification)*)&myModification))->IsDone()) {
+  Handle(Draft_Modification)::DownCast (myModification)->Perform();
+  if (!Handle(Draft_Modification)::DownCast (myModification)->IsDone()) {
     NotDone();
   }
   else {
index a18ba9a32695baa1430865172ebd4873c315b587..aef4d6c897d47af9f15a3b87e6b4c8e99d2aebdc 100644 (file)
@@ -70,17 +70,17 @@ static Standard_Boolean IsLinear(const TopoDS_Edge& anEdge,
   Standard_Real fpar, lpar;
   Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
   if (aCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
-    aCurve = ((Handle(Geom_TrimmedCurve)&) aCurve)->BasisCurve();
+    aCurve = Handle(Geom_TrimmedCurve)::DownCast (aCurve)->BasisCurve();
 
   gp_Pnt Pnt1, Pnt2;
   if (aCurve->IsKind(STANDARD_TYPE(Geom_Line)))
   {
-    aLine = ((Handle(Geom_Line)&) aCurve)->Lin();
+    aLine = Handle(Geom_Line)::DownCast (aCurve)->Lin();
     return Standard_True;
   }
   else if (aCurve->IsKind(STANDARD_TYPE(Geom_BezierCurve)))
   {
-    Handle(Geom_BezierCurve) theBezier = (Handle(Geom_BezierCurve)&) aCurve;
+    Handle(Geom_BezierCurve) theBezier = Handle(Geom_BezierCurve)::DownCast (aCurve);
     if (theBezier->NbPoles() == 2)
     {
       Pnt1 = theBezier->Pole(1);
@@ -91,7 +91,7 @@ static Standard_Boolean IsLinear(const TopoDS_Edge& anEdge,
   }
   else if (aCurve->IsKind(STANDARD_TYPE(Geom_BSplineCurve)))
   {
-    Handle(Geom_BSplineCurve) theBSpline = (Handle(Geom_BSplineCurve)&) aCurve;
+    Handle(Geom_BSplineCurve) theBSpline = Handle(Geom_BSplineCurve)::DownCast (aCurve);
     if (theBSpline->NbPoles() == 2)
     {
       Pnt1 = theBSpline->Pole(1);
@@ -838,7 +838,7 @@ void BRepOffsetAPI_MiddlePath::Build()
         Standard_Real fpar, lpar;
         Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
         if (aCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
-          aCurve = ((Handle(Geom_TrimmedCurve)&) aCurve)->BasisCurve();
+          aCurve = Handle(Geom_TrimmedCurve)::DownCast (aCurve)->BasisCurve();
         Pnt1 = aCurve->Value(fpar);
         Pnt2 = aCurve->Value(lpar);
         Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve);
index c8ae4e4095acfe93104c5c6dc6fc76c56fa548d9..11083e44eec0c6680f0da5669cfab7268630f3df 100644 (file)
@@ -199,10 +199,10 @@ void DrawCurve(const Handle(Geom2d_Curve)& aCurve,
   Draw_Color                 Couleur;
 
   if (type == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
-    curve = (*(Handle(Geom2d_TrimmedCurve)*)&aCurve)->BasisCurve();
+    curve = Handle(Geom2d_TrimmedCurve)::DownCast (aCurve)->BasisCurve();
     type = curve->DynamicType();    
     if (type == STANDARD_TYPE(Bisector_BisecAna)) {
-      curve =(*(Handle(Bisector_BisecAna)*)&curve)->Geom2dCurve(); 
+      curve =Handle(Bisector_BisecAna)::DownCast (curve)->Geom2dCurve(); 
       type = curve->DynamicType(); 
     }
     // PB of representation of semi_infinite curves.
index f59eb2ff09fbfe408b04f106c663e6dae1ff26d5..bd8511da059f0a3af248d2a581f17009b063eaf2 100644 (file)
@@ -54,8 +54,7 @@ void BinMDF_ADriverTable::AssignIds
   myMapId.Clear();
   Standard_Integer i;
   for (i=1; i <= theTypes.Extent(); i++) {
-    const Handle(Standard_Type)& aType =
-      Handle(Standard_Type)::DownCast (theTypes(i));
+    Handle(Standard_Type) aType (Handle(Standard_Type)::DownCast (theTypes(i)));
     if (myMap.IsBound (aType)) {
       myMapId.Bind (aType, i);
     }
index 7255407ca8a756dd11e197aec25c1085c125a28b..9bd55d4bbf7d5131717bdf40e36968f076ba4bd6 100644 (file)
@@ -822,7 +822,7 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve  ,
   Handle(Standard_Type) type = afirstcurve->DynamicType();
 
   if (type == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
-    curve = (*(Handle(Geom2d_TrimmedCurve)*)&afirstcurve)->BasisCurve();
+    curve = Handle(Geom2d_TrimmedCurve)::DownCast (afirstcurve)->BasisCurve();
   }
   else {
     curve = afirstcurve;
index 5940790d0a5722877a2008e9b77c3da735af6876..c5fb5849779522e1f552d1ddf9c90ed7f86a2baf 100644 (file)
@@ -137,7 +137,7 @@ void BndLib_Add3dCurve::Add( const Adaptor3d_Curve& C,
         Abs(Bs->LastParameter()  - U2) > Precision::Parametric(Tol)) {
 
        Handle(Geom_Geometry) G = Bs->Copy();
-       Handle(Geom_BSplineCurve)& Bsaux = (*((Handle(Geom_BSplineCurve)*)&G));
+       Handle(Geom_BSplineCurve)& Bsaux = Handle(Geom_BSplineCurve)::DownCast (G);
        Standard_Real u1 = U1, u2 = U2;
        //// modified by jgv, 24.10.01 for BUC61031 ////
        if (Bsaux->IsPeriodic())
index 6915f651f9fa9aee19811eb38dcf06fac4ef4b1b..445f22acf83309b242514ba1ed22dd99bba4e8c3 100644 (file)
@@ -1702,7 +1702,7 @@ void  ChFi3d_ComputeArete(const ChFiDS_CommonPoint&   P1,
       bs.Update(umin,vmin,umax,vmax);
       Standard_Boolean aIN = Standard_True;
       for(Standard_Integer ii = 1; ii <= 4 && aIN; ii++) {
-       if(bs.IsOut((*((Handle(Geom2d_BezierCurve)*) &Pcurv))->Pole(ii))) {
+       if(bs.IsOut(Handle(Geom2d_BezierCurve)::DownCast (Pcurv)->Pole(ii))) {
           aIN = Standard_False;
           TColgp_Array1OfPnt2d qoles(1,2);
           qoles(1)=UV1;
@@ -2009,8 +2009,7 @@ static void QueryAddVertexInEdge(TopOpeBRepDS_ListOfInterference& LI,
   TopOpeBRepDS_ListIteratorOfListOfInterference it(LI);
   for (; it.More(); it.Next() ) {
     const Handle(TopOpeBRepDS_Interference)& cur = it.Value();
-    const Handle(TopOpeBRepDS_CurvePointInterference)& cpi = 
-      Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(cur);
+    Handle(TopOpeBRepDS_CurvePointInterference) cpi (Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(cur));
     if(!cpi.IsNull()) {
       Standard_Integer newIV = cpi->Geometry();
       TopOpeBRepDS_Kind kv = cpi->GeometryType();
index 9a7d3e809e9deadc844a098db38e894b4c580ce7..93a8898c8a4b6e23905a50e0e5a1612f7ae26d25 100644 (file)
@@ -896,7 +896,7 @@ Standard_Boolean DNaming::ComputeSweepDir (const TopoDS_Shape& theShape,
     cout<<"Surface Dynamic TYPE = "<<s<<endl;
 #endif
     if (aSurf->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) 
-      aSurf = ((Handle(Geom_RectangularTrimmedSurface)&) aSurf)->BasisSurface();
+      aSurf = Handle(Geom_RectangularTrimmedSurface)::DownCast (aSurf)->BasisSurface();
     aPlane = Handle(Geom_Plane)::DownCast(aSurf);
   }
 
index adba0e3ab898eaefc0da03bbbcd6a3d80e52faa1..220796c2234abd5df2057682094d4944f9d34d22 100644 (file)
@@ -119,14 +119,14 @@ void DrawDim_PlanarAngle::DrawOn(Draw_Display& dis) const
   if (!curve1->IsKind(STANDARD_TYPE(Geom_Line)) || !curve2->IsKind(STANDARD_TYPE(Geom_Line))) return;
   Handle(Geom2d_Geometry) L1 = GeomAPI::To2d (curve1,plane);
   if (L1->IsInstance(STANDARD_TYPE(Geom2d_TrimmedCurve))) {
-    L1 = ((Handle(Geom2d_TrimmedCurve)&) L1)->BasisCurve();
+    L1 = Handle(Geom2d_TrimmedCurve)::DownCast (L1)->BasisCurve();
   }
-  gp_Lin2d l1 = ((Handle(Geom2d_Line)&) L1)->Lin2d();   
+  gp_Lin2d l1 = Handle(Geom2d_Line)::DownCast (L1)->Lin2d();   
   Handle(Geom2d_Geometry) L2 = GeomAPI::To2d (curve2,plane);
   if (L2->IsInstance(STANDARD_TYPE(Geom2d_TrimmedCurve))) {
-    L2 = ((Handle(Geom2d_TrimmedCurve)&) L2)->BasisCurve();
+    L2 = Handle(Geom2d_TrimmedCurve)::DownCast (L2)->BasisCurve();
   }
-  gp_Lin2d l2 = ((Handle(Geom2d_Line)&) L2)->Lin2d(); 
+  gp_Lin2d l2 = Handle(Geom2d_Line)::DownCast (L2)->Lin2d(); 
   //
   IntAna2d_AnaIntersection inter;
   inter.Perform(l1,l2);  
@@ -139,7 +139,7 @@ void DrawDim_PlanarAngle::DrawOn(Draw_Display& dis) const
 
   // retour au plan
   Handle(Geom_Curve) C = GeomAPI::To3d (new Geom2d_Circle(c),plane); 
-  gp_Circ circle = ((Handle(Geom_Circle)&) C)->Circ(); 
+  gp_Circ circle = Handle(Geom_Circle)::DownCast (C)->Circ(); 
   //
   Standard_Real p1=0., p2=0.;   
   angle =  Abs(angle);
index eb5510656523f613be2677e27911fef344466d13..a08d6b829823ae3c4c4df50c781bfe8be22a8dbd 100644 (file)
@@ -77,7 +77,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension,
 
   Standard_Real stenor = (myKnots->Value(IndexOfElement + 1) - myKnots->Value(IndexOfElement)) / 2.,
                 mfact;
-  Handle(PLib_HermitJacobi) myHermitJacobi = (*((Handle(PLib_HermitJacobi)*)&myBase));
+  Handle(PLib_HermitJacobi) myHermitJacobi = Handle(PLib_HermitJacobi)::DownCast (myBase);
 
   i1 = iBase;
   i2 = iBase + (myHermitJacobi->NivConstr() + 1) * myDimension;
@@ -117,7 +117,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension,
   Standard_Real stenor = 2. / (myKnots->Value(IndexOfElement + 1) - myKnots->Value(IndexOfElement)),
                 mfact;
 
-  Handle(PLib_HermitJacobi) myHermitJacobi = (*((Handle(PLib_HermitJacobi)*)&myBase));
+  Handle(PLib_HermitJacobi) myHermitJacobi = Handle(PLib_HermitJacobi)::DownCast (myBase);
 
   i2 = Coeffs.LowerRow();
   Standard_Integer i3 = i2 + myHermitJacobi->NivConstr() + 1;
@@ -417,7 +417,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension,
     (myBase->WorkDegree() + 1)*myDimension + 1;
   
   myBase->ReduceDegree(myDimension, deg, Tol, myCoeff.ChangeValue(Ptr), NewDegree, MaxError);
-  Handle(PLib_HermitJacobi) myHermitJacobi = (*((Handle(PLib_HermitJacobi)*)&myBase));
+  Handle(PLib_HermitJacobi) myHermitJacobi = Handle(PLib_HermitJacobi)::DownCast (myBase);
   
   NewDegree = Max(NewDegree, 2 * myHermitJacobi->NivConstr() + 1);
   
index a31398e1a863bb871f98ac2bad177d33abe30a59..48dd34369f17360984bc27d33034cddd3c20ab52 100644 (file)
@@ -339,7 +339,7 @@ Standard_Boolean Geom_OsculatingSurface::UOscSurf
     if (myBasisSurf->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) 
     {
       Handle(Geom_BSplineSurface) BSur = 
-        *((Handle(Geom_BSplineSurface)*)& myBasisSurf);
+        Handle(Geom_BSplineSurface)::DownCast (myBasisSurf);
       NbUK = BSur->NbUKnots();
       NbVK = BSur->NbVKnots();
       TColStd_Array1OfReal UKnots(1,NbUK);
@@ -398,7 +398,7 @@ Standard_Boolean Geom_OsculatingSurface::VOscSurf
     if (myBasisSurf->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) 
     {
       Handle(Geom_BSplineSurface) BSur = 
-        *((Handle(Geom_BSplineSurface)*)& myBasisSurf);
+        Handle(Geom_BSplineSurface)::DownCast (myBasisSurf);
       NbUK = BSur->NbUKnots();
       NbVK = BSur->NbVKnots();
       TColStd_Array1OfReal UKnots(1,NbUK);
index e1869eb2e50295e374dc8d7d410a795a694c11d9..f544e31e73912d8e0e165bbaed29c0c1f75e66aa 100644 (file)
@@ -53,7 +53,7 @@
 #include <Standard_NullObject.hxx>
 #include <Standard_NotImplemented.hxx>
 
-#define myBspl (*((Handle(Geom2d_BSplineCurve)*)&myCurve))
+#define myBspl Handle(Geom2d_BSplineCurve)::DownCast (myCurve)
 #define PosTol Precision::PConfusion()/2
 
 static const int maxDerivOrder = 3;
@@ -189,7 +189,7 @@ void Geom2dAdaptor_Curve::load(const Handle(Geom2d_Curve)& C,
 
     Handle(Standard_Type) TheType = C->DynamicType();
     if ( TheType == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
-      Load((*((Handle(Geom2d_TrimmedCurve)*)&C))->BasisCurve(),
+      Load(Handle(Geom2d_TrimmedCurve)::DownCast (C)->BasisCurve(),
           UFirst,ULast);
     }
     else if ( TheType ==  STANDARD_TYPE(Geom2d_Circle)) {
@@ -245,7 +245,7 @@ GeomAbs_Shape Geom2dAdaptor_Curve::Continuity() const
   }
   else if (myCurve->DynamicType() == STANDARD_TYPE(Geom2d_OffsetCurve)){
     GeomAbs_Shape S = 
-      (*((Handle(Geom2d_OffsetCurve)*)&myCurve))->GetBasisCurveContinuity(); 
+      Handle(Geom2d_OffsetCurve)::DownCast (myCurve)->GetBasisCurveContinuity(); 
     switch(S){
     case GeomAbs_CN: return GeomAbs_CN;
     case GeomAbs_C3: return GeomAbs_C2;
@@ -1002,23 +1002,23 @@ Standard_Real Geom2dAdaptor_Curve::Resolution(const Standard_Real Ruv) const {
   case GeomAbs_Line :
     return Ruv;
   case GeomAbs_Circle: {
-    Standard_Real R = (*((Handle(Geom2d_Circle)*)&myCurve))->Circ2d().Radius();
+    Standard_Real R = Handle(Geom2d_Circle)::DownCast (myCurve)->Circ2d().Radius();
     if ( R > Ruv/2.)
       return 2*ASin(Ruv/(2*R));
     else
       return 2*M_PI;
   }
   case GeomAbs_Ellipse: {
-    return Ruv / (*((Handle(Geom2d_Ellipse)*)&myCurve))->MajorRadius();
+    return Ruv / Handle(Geom2d_Ellipse)::DownCast (myCurve)->MajorRadius();
   }
   case GeomAbs_BezierCurve: {
     Standard_Real res;
-    (*((Handle(Geom2d_BezierCurve)*)&myCurve))->Resolution(Ruv,res);
+    Handle(Geom2d_BezierCurve)::DownCast (myCurve)->Resolution(Ruv,res);
     return res;
   }
   case GeomAbs_BSplineCurve: {
     Standard_Real res;
-    (*((Handle(Geom2d_BSplineCurve)*)&myCurve))->Resolution(Ruv,res);
+    Handle(Geom2d_BSplineCurve)::DownCast (myCurve)->Resolution(Ruv,res);
     return res;
   }
   default:
@@ -1040,7 +1040,7 @@ Standard_Real Geom2dAdaptor_Curve::Resolution(const Standard_Real Ruv) const {
 gp_Lin2d Geom2dAdaptor_Curve::Line() const 
 {
   Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Line, "");
-  return (*((Handle(Geom2d_Line)*)&myCurve))->Lin2d();
+  return Handle(Geom2d_Line)::DownCast (myCurve)->Lin2d();
 }
 
 //=======================================================================
@@ -1051,7 +1051,7 @@ gp_Lin2d Geom2dAdaptor_Curve::Line() const
 gp_Circ2d  Geom2dAdaptor_Curve::Circle() const 
 {
   Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Circle, "");
-  return (*((Handle(Geom2d_Circle)*)&myCurve))->Circ2d();
+  return Handle(Geom2d_Circle)::DownCast (myCurve)->Circ2d();
 }
 
 //=======================================================================
@@ -1062,7 +1062,7 @@ gp_Circ2d  Geom2dAdaptor_Curve::Circle() const
 gp_Elips2d Geom2dAdaptor_Curve::Ellipse() const 
 {
   Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Ellipse, "");
-  return (*((Handle(Geom2d_Ellipse)*)&myCurve))->Elips2d();
+  return Handle(Geom2d_Ellipse)::DownCast (myCurve)->Elips2d();
 }
 
 //=======================================================================
@@ -1073,7 +1073,7 @@ gp_Elips2d Geom2dAdaptor_Curve::Ellipse() const
 gp_Hypr2d Geom2dAdaptor_Curve::Hyperbola() const 
 {
   Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Hyperbola, "");
-  return (*((Handle(Geom2d_Hyperbola)*)&myCurve))->Hypr2d();
+  return Handle(Geom2d_Hyperbola)::DownCast (myCurve)->Hypr2d();
 }
 
 //=======================================================================
@@ -1084,7 +1084,7 @@ gp_Hypr2d Geom2dAdaptor_Curve::Hyperbola() const
 gp_Parab2d Geom2dAdaptor_Curve::Parabola() const 
 {
   Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Parabola, "");
-  return (*((Handle(Geom2d_Parabola)*)&myCurve))->Parab2d();
+  return Handle(Geom2d_Parabola)::DownCast (myCurve)->Parab2d();
 }
 
 //=======================================================================
@@ -1095,9 +1095,9 @@ gp_Parab2d Geom2dAdaptor_Curve::Parabola() const
 Standard_Integer Geom2dAdaptor_Curve::Degree() const
 {
   if (myTypeCurve == GeomAbs_BezierCurve)
-    return (*((Handle(Geom2d_BezierCurve)*)&myCurve))->Degree();
+    return Handle(Geom2d_BezierCurve)::DownCast (myCurve)->Degree();
   else if (myTypeCurve == GeomAbs_BSplineCurve)
-    return (*((Handle(Geom2d_BSplineCurve)*)&myCurve))->Degree();
+    return Handle(Geom2d_BSplineCurve)::DownCast (myCurve)->Degree();
   else
     Standard_NoSuchObject::Raise();
   // portage WNT 
@@ -1112,9 +1112,9 @@ Standard_Integer Geom2dAdaptor_Curve::Degree() const
 Standard_Boolean Geom2dAdaptor_Curve::IsRational() const {
   switch( myTypeCurve) {
   case GeomAbs_BSplineCurve:
-    return (*((Handle(Geom2d_BSplineCurve)*)&myCurve))->IsRational();
+    return Handle(Geom2d_BSplineCurve)::DownCast (myCurve)->IsRational();
   case GeomAbs_BezierCurve:
-    return (*((Handle(Geom2d_BezierCurve)*)&myCurve))->IsRational();
+    return Handle(Geom2d_BezierCurve)::DownCast (myCurve)->IsRational();
   default:
     return Standard_False;
   }
@@ -1128,9 +1128,9 @@ Standard_Boolean Geom2dAdaptor_Curve::IsRational() const {
 Standard_Integer Geom2dAdaptor_Curve::NbPoles() const
 {
   if (myTypeCurve == GeomAbs_BezierCurve)
-    return (*((Handle(Geom2d_BezierCurve)*)&myCurve))->NbPoles();
+    return Handle(Geom2d_BezierCurve)::DownCast (myCurve)->NbPoles();
   else if (myTypeCurve == GeomAbs_BSplineCurve)
-    return (*((Handle(Geom2d_BSplineCurve)*)&myCurve))->NbPoles();
+    return Handle(Geom2d_BSplineCurve)::DownCast (myCurve)->NbPoles();
   else
     Standard_NoSuchObject::Raise();
   // portage WNT 
@@ -1145,7 +1145,7 @@ Standard_Integer Geom2dAdaptor_Curve::NbPoles() const
 Standard_Integer Geom2dAdaptor_Curve::NbKnots() const {
   if ( myTypeCurve != GeomAbs_BSplineCurve)
     Standard_NoSuchObject::Raise("Geom2dAdaptor_Curve::NbKnots");
-  return (*((Handle(Geom2d_BSplineCurve)*)&myCurve))->NbKnots();
+  return Handle(Geom2d_BSplineCurve)::DownCast (myCurve)->NbKnots();
 
 }
 
@@ -1156,7 +1156,7 @@ Standard_Integer Geom2dAdaptor_Curve::NbKnots() const {
 
 Handle(Geom2d_BezierCurve) Geom2dAdaptor_Curve::Bezier() const 
 {
-  return *((Handle(Geom2d_BezierCurve)*)&myCurve);
+  return Handle(Geom2d_BezierCurve)::DownCast (myCurve);
 }
 
 //=======================================================================
@@ -1166,7 +1166,7 @@ Handle(Geom2d_BezierCurve) Geom2dAdaptor_Curve::Bezier() const
 
 Handle(Geom2d_BSplineCurve) Geom2dAdaptor_Curve::BSpline() const 
 {
-  return *((Handle(Geom2d_BSplineCurve)*)&myCurve);
+  return Handle(Geom2d_BSplineCurve)::DownCast (myCurve);
 }
 
 static Standard_Integer nbPoints(const Handle(Geom2d_Curve)& theCurve) 
@@ -1178,22 +1178,22 @@ static Standard_Integer nbPoints(const Handle(Geom2d_Curve)& theCurve)
     nbs = 2;
   else if(theCurve->IsKind(STANDARD_TYPE( Geom2d_BezierCurve))) 
   {
-    nbs = 3 + (*((Handle(Geom2d_BezierCurve)*)&theCurve))->NbPoles();
+    nbs = 3 + Handle(Geom2d_BezierCurve)::DownCast (theCurve)->NbPoles();
   }
   else if(theCurve->IsKind(STANDARD_TYPE( Geom2d_BSplineCurve))) { 
-    nbs =  (*((Handle(Geom2d_BSplineCurve)*)&theCurve))->NbKnots();
-    nbs*= (*((Handle(Geom2d_BSplineCurve)*)&theCurve))->Degree();
+    nbs =  Handle(Geom2d_BSplineCurve)::DownCast (theCurve)->NbKnots();
+    nbs*= Handle(Geom2d_BSplineCurve)::DownCast (theCurve)->Degree();
     if(nbs < 2.0) nbs=2;
   }
   else if (theCurve->IsKind(STANDARD_TYPE(Geom2d_OffsetCurve)))
   {
-    Handle(Geom2d_Curve) aCurve = (*((Handle(Geom2d_OffsetCurve)*)&theCurve))->BasisCurve();
+    Handle(Geom2d_Curve) aCurve = Handle(Geom2d_OffsetCurve)::DownCast (theCurve)->BasisCurve();
     return Max(nbs, nbPoints(aCurve));
   }
 
   else if (theCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
   {
-    Handle(Geom2d_Curve) aCurve = (*((Handle(Geom2d_TrimmedCurve)*)&theCurve))->BasisCurve();
+    Handle(Geom2d_Curve) aCurve = Handle(Geom2d_TrimmedCurve)::DownCast (theCurve)->BasisCurve();
     return Max(nbs, nbPoints(aCurve));
   }
   if(nbs>300)
index 5f9ea8d453d883ce4e187854092e2bfaa9f1c021..9757ac912c8f60e4096cf52d9846dbf8603db6bd 100644 (file)
@@ -51,7 +51,7 @@
 #include <Geom_OffsetCurve.hxx>
 #include <CSLib_Offset.hxx>
 
-#define myBspl (*((Handle(Geom_BSplineCurve)*)&myCurve))
+#define myBspl Handle(Geom_BSplineCurve)::DownCast (myCurve)
 #define PosTol Precision::PConfusion()/2
 
 static const int maxDerivOrder = 3;
@@ -146,7 +146,7 @@ void GeomAdaptor_Curve::load(const Handle(Geom_Curve)& C,
     
     const Handle(Standard_Type)& TheType = C->DynamicType();
     if ( TheType == STANDARD_TYPE(Geom_TrimmedCurve)) {
-      Load((*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve(),UFirst,ULast);
+      Load(Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve(),UFirst,ULast);
     }
     else if ( TheType ==  STANDARD_TYPE(Geom_Circle)) {
       myTypeCurve = GeomAbs_Circle;
@@ -201,7 +201,7 @@ GeomAbs_Shape GeomAdaptor_Curve::Continuity() const
   if (myCurve->IsKind(STANDARD_TYPE(Geom_OffsetCurve)))
   {
     const GeomAbs_Shape S =
-      (*((Handle(Geom_OffsetCurve)*)&myCurve))->GetBasisCurveContinuity();
+      Handle(Geom_OffsetCurve)::DownCast (myCurve)->GetBasisCurveContinuity();
     switch(S)
     {
       case GeomAbs_CN: return GeomAbs_CN;
@@ -322,7 +322,7 @@ Standard_Integer GeomAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const
     default: BaseS = GeomAbs_CN;
     }
     GeomAdaptor_Curve C
-      ((*((Handle(Geom_OffsetCurve)*)&myCurve))->BasisCurve());
+      (Handle(Geom_OffsetCurve)::DownCast (myCurve)->BasisCurve());
     // akm 05/04/02 (OCC278)  If our curve is trimmed we must recalculate 
     //                    the number of intervals obtained from the basis to
     //              vvv   reflect parameter bounds
@@ -460,7 +460,7 @@ void GeomAdaptor_Curve::Intervals(TColStd_Array1OfReal& T,
     default: BaseS = GeomAbs_CN;
     }
     GeomAdaptor_Curve C
-      ((*((Handle(Geom_OffsetCurve)*)&myCurve))->BasisCurve());
+      (Handle(Geom_OffsetCurve)::DownCast (myCurve)->BasisCurve());
     // akm 05/04/02 (OCC278)  If our curve is trimmed we must recalculate 
     //                    the array of intervals obtained from the basis to
     //              vvv   reflect parameter bounds
@@ -946,23 +946,23 @@ Standard_Real GeomAdaptor_Curve::Resolution(const Standard_Real R3D) const
   case GeomAbs_Line :
     return R3D;
   case GeomAbs_Circle: {
-    Standard_Real R = (*((Handle(Geom_Circle)*)&myCurve))->Circ().Radius();
+    Standard_Real R = Handle(Geom_Circle)::DownCast (myCurve)->Circ().Radius();
     if ( R > R3D/2. )
       return 2*ASin(R3D/(2*R));
     else
       return 2*M_PI;
   }
   case GeomAbs_Ellipse: {
-    return R3D / (*((Handle(Geom_Ellipse)*)&myCurve))->MajorRadius();
+    return R3D / Handle(Geom_Ellipse)::DownCast (myCurve)->MajorRadius();
   }
   case GeomAbs_BezierCurve: {
     Standard_Real res;
-    (*((Handle(Geom_BezierCurve)*)&myCurve))->Resolution(R3D,res);
+    Handle(Geom_BezierCurve)::DownCast (myCurve)->Resolution(R3D,res);
     return res;
   }
   case GeomAbs_BSplineCurve: {
     Standard_Real res;
-    (*((Handle(Geom_BSplineCurve)*)&myCurve))->Resolution(R3D,res);
+    Handle(Geom_BSplineCurve)::DownCast (myCurve)->Resolution(R3D,res);
     return res;
   }
   default:
@@ -984,7 +984,7 @@ Standard_Real GeomAdaptor_Curve::Resolution(const Standard_Real R3D) const
 gp_Lin GeomAdaptor_Curve::Line() const 
 {
   Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Line, "");
-  return (*((Handle(Geom_Line)*)&myCurve))->Lin();  
+  return Handle(Geom_Line)::DownCast (myCurve)->Lin();  
 }
 
 //=======================================================================
@@ -995,7 +995,7 @@ gp_Lin GeomAdaptor_Curve::Line() const
 gp_Circ  GeomAdaptor_Curve::Circle() const 
 {
   Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Circle, "");
-  return (*((Handle(Geom_Circle)*)&myCurve))->Circ();
+  return Handle(Geom_Circle)::DownCast (myCurve)->Circ();
 }
 
 //=======================================================================
@@ -1006,7 +1006,7 @@ gp_Circ  GeomAdaptor_Curve::Circle() const
 gp_Elips GeomAdaptor_Curve::Ellipse() const 
 {
   Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Ellipse, "");
-  return (*((Handle(Geom_Ellipse)*)&myCurve))->Elips();
+  return Handle(Geom_Ellipse)::DownCast (myCurve)->Elips();
 }
 
 //=======================================================================
@@ -1017,7 +1017,7 @@ gp_Elips GeomAdaptor_Curve::Ellipse() const
 gp_Hypr GeomAdaptor_Curve::Hyperbola() const 
 {
   Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Hyperbola, "");
-  return (*((Handle(Geom_Hyperbola)*)&myCurve))->Hypr();  
+  return Handle(Geom_Hyperbola)::DownCast (myCurve)->Hypr();  
 }
 
 //=======================================================================
@@ -1028,7 +1028,7 @@ gp_Hypr GeomAdaptor_Curve::Hyperbola() const
 gp_Parab GeomAdaptor_Curve::Parabola() const 
 {
   Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Parabola, "");
-  return (*((Handle(Geom_Parabola)*)&myCurve))->Parab();
+  return Handle(Geom_Parabola)::DownCast (myCurve)->Parab();
 }
 
 //=======================================================================
@@ -1039,9 +1039,9 @@ gp_Parab GeomAdaptor_Curve::Parabola() const
 Standard_Integer GeomAdaptor_Curve::Degree() const
 {
   if (myTypeCurve == GeomAbs_BezierCurve)
-    return (*((Handle(Geom_BezierCurve)*)&myCurve))->Degree();
+    return Handle(Geom_BezierCurve)::DownCast (myCurve)->Degree();
   else if (myTypeCurve == GeomAbs_BSplineCurve)
-    return (*((Handle(Geom_BSplineCurve)*)&myCurve))->Degree();
+    return Handle(Geom_BSplineCurve)::DownCast (myCurve)->Degree();
   else
     Standard_NoSuchObject::Raise();
   // portage WNT 
@@ -1056,9 +1056,9 @@ Standard_Integer GeomAdaptor_Curve::Degree() const
 Standard_Boolean GeomAdaptor_Curve::IsRational() const {
   switch( myTypeCurve) {
   case GeomAbs_BSplineCurve:
-    return (*((Handle(Geom_BSplineCurve)*)&myCurve))->IsRational();
+    return Handle(Geom_BSplineCurve)::DownCast (myCurve)->IsRational();
   case GeomAbs_BezierCurve:
-    return (*((Handle(Geom_BezierCurve)*)&myCurve))->IsRational();
+    return Handle(Geom_BezierCurve)::DownCast (myCurve)->IsRational();
   default:
     return Standard_False;
   }
@@ -1072,9 +1072,9 @@ Standard_Boolean GeomAdaptor_Curve::IsRational() const {
 Standard_Integer GeomAdaptor_Curve::NbPoles() const
 {
   if (myTypeCurve == GeomAbs_BezierCurve)
-    return (*((Handle(Geom_BezierCurve)*)&myCurve))->NbPoles();
+    return Handle(Geom_BezierCurve)::DownCast (myCurve)->NbPoles();
   else if (myTypeCurve == GeomAbs_BSplineCurve)
-    return (*((Handle(Geom_BSplineCurve)*)&myCurve))->NbPoles();
+    return Handle(Geom_BSplineCurve)::DownCast (myCurve)->NbPoles();
   else
     Standard_NoSuchObject::Raise();
   // portage WNT
@@ -1090,7 +1090,7 @@ Standard_Integer GeomAdaptor_Curve::NbKnots() const
 {
   if ( myTypeCurve != GeomAbs_BSplineCurve)
     Standard_NoSuchObject::Raise("GeomAdaptor_Curve::NbKnots");
-  return (*((Handle(Geom_BSplineCurve)*)&myCurve))->NbKnots();
+  return Handle(Geom_BSplineCurve)::DownCast (myCurve)->NbKnots();
 }
 
 //=======================================================================
@@ -1102,7 +1102,7 @@ Handle(Geom_BezierCurve) GeomAdaptor_Curve::Bezier() const
 {
  if ( myTypeCurve != GeomAbs_BezierCurve)
     Standard_NoSuchObject::Raise("GeomAdaptor_Curve::Bezier");
-  return *((Handle(Geom_BezierCurve)*)&myCurve);
+  return Handle(Geom_BezierCurve)::DownCast (myCurve);
 }
 
 //=======================================================================
@@ -1115,7 +1115,7 @@ Handle(Geom_BSplineCurve) GeomAdaptor_Curve::BSpline() const
  if ( myTypeCurve != GeomAbs_BSplineCurve)
     Standard_NoSuchObject::Raise("GeomAdaptor_Curve::BSpline");
 
-  return *((Handle(Geom_BSplineCurve)*)&myCurve);
+  return Handle(Geom_BSplineCurve)::DownCast (myCurve);
 }
 
 
index ee4e2d6cd7e3d9b4529aefc5d74262bc6eb24cc8..d5589956b815bb94cd61602e82dfbd451d29e440 100644 (file)
 #include <Standard_NoSuchObject.hxx>
 #include <Standard_NullObject.hxx>
 
-#define myBspl (*((Handle(Geom_BSplineSurface)*)&mySurface))
-#define myExtSurf (*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))
-#define myRevSurf (*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))
-#define myOffSurf (*((Handle(Geom_OffsetSurface)*)&mySurface))
+#define myBspl Handle(Geom_BSplineSurface)::DownCast (mySurface)
+#define myExtSurf Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)
+#define myRevSurf Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)
+#define myOffSurf Handle(Geom_OffsetSurface)::DownCast (mySurface)
 
 //=======================================================================
 //function : LocalContinuity
@@ -131,7 +131,7 @@ void GeomAdaptor_Surface::load(const Handle(Geom_Surface)& S,
     if ( TheType == STANDARD_TYPE(Geom_BezierSurface))
       mySurfaceType = GeomAbs_BezierSurface;
     else if (TheType == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-      Load((*((Handle(Geom_RectangularTrimmedSurface)*)&S))->BasisSurface(),
+      Load(Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface(),
            UFirst,ULast,VFirst,VLast);
     }
     else if ( TheType == STANDARD_TYPE(Geom_Plane))
@@ -150,7 +150,7 @@ void GeomAdaptor_Surface::load(const Handle(Geom_Surface)& S,
       mySurfaceType = GeomAbs_SurfaceOfExtrusion;
     else if ( TheType == STANDARD_TYPE(Geom_BSplineSurface)) {
       mySurfaceType = GeomAbs_BSplineSurface;
-      myBspl        = *((Handle(Geom_BSplineSurface)*)&mySurface);
+      myBspl        = Handle(Geom_BSplineSurface)::DownCast (mySurface);
       // Create cache for B-spline
       mySurfaceCache = new BSplSLib_Cache( 
         myBspl->UDegree(), myBspl->IsUPeriodic(), myBspl->UKnotSequence(), 
@@ -206,7 +206,7 @@ GeomAbs_Shape GeomAdaptor_Surface::UContinuity() const
     case GeomAbs_SurfaceOfExtrusion:
     {
       GeomAdaptor_Curve GC
-        ((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast);
+        (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
       return GC.Continuity();
     }
     case GeomAbs_OtherSurface: 
@@ -259,7 +259,7 @@ GeomAbs_Shape GeomAdaptor_Surface::VContinuity() const
     case GeomAbs_SurfaceOfRevolution:
     {
       GeomAdaptor_Curve GC
-        ((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myVFirst,myVLast);
+        (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myVFirst,myVLast);
       return GC.Continuity();
     }
     case GeomAbs_OtherSurface:
@@ -293,7 +293,7 @@ Standard_Integer GeomAdaptor_Surface::NbUIntervals(const GeomAbs_Shape S) const
          case GeomAbs_SurfaceOfExtrusion:
     {
       GeomAdaptor_Curve myBasisCurve
-        ((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast);
+        (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
          if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
         return myBasisCurve.NbIntervals(S);
       break;
@@ -311,7 +311,7 @@ Standard_Integer GeomAdaptor_Surface::NbUIntervals(const GeomAbs_Shape S) const
         case GeomAbs_C3:
         case GeomAbs_CN: break;
       }
-      GeomAdaptor_Surface Sur((*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface());
+      GeomAdaptor_Surface Sur(Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface());
       return Sur.NbUIntervals(BaseS);
     }
     case GeomAbs_Plane:
@@ -344,7 +344,7 @@ Standard_Integer GeomAdaptor_Surface::NbVIntervals(const GeomAbs_Shape S) const
          case GeomAbs_SurfaceOfRevolution:
     {
       GeomAdaptor_Curve myBasisCurve
-        ((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myVFirst,myVLast);
+        (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myVFirst,myVLast);
          if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
         return myBasisCurve.NbIntervals(S);
       break;
@@ -362,7 +362,7 @@ Standard_Integer GeomAdaptor_Surface::NbVIntervals(const GeomAbs_Shape S) const
         case GeomAbs_C3:
         case GeomAbs_CN: break;
       }
-      GeomAdaptor_Surface Sur((*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface());
+      GeomAdaptor_Surface Sur(Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface());
       return Sur.NbVIntervals(BaseS);
          }
     case GeomAbs_Plane:
@@ -399,7 +399,7 @@ void GeomAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
          case GeomAbs_SurfaceOfExtrusion:
     {
       GeomAdaptor_Curve myBasisCurve
-        ((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast);
+        (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
       if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
       {
         myNbUIntervals = myBasisCurve.NbIntervals(S);
@@ -420,7 +420,7 @@ void GeomAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
         case GeomAbs_C3:
         case GeomAbs_CN: break;
       }
-      GeomAdaptor_Surface Sur((*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface());
+      GeomAdaptor_Surface Sur(Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface());
       myNbUIntervals = Sur.NbUIntervals(BaseS);
       Sur.UIntervals(T, BaseS);
     }
@@ -460,7 +460,7 @@ void GeomAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
          case GeomAbs_SurfaceOfRevolution:
     {
       GeomAdaptor_Curve myBasisCurve
-        ((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myVFirst,myVLast);
+        (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myVFirst,myVLast);
       if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
       {
         myNbVIntervals = myBasisCurve.NbIntervals(S);
@@ -481,7 +481,7 @@ void GeomAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
         case GeomAbs_C3:
         case GeomAbs_CN: break;
       }
-      GeomAdaptor_Surface Sur((*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface());
+      GeomAdaptor_Surface Sur(Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface());
       myNbVIntervals = Sur.NbVIntervals(BaseS);
       Sur.VIntervals(T, BaseS);
     }
@@ -908,12 +908,12 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const
     case GeomAbs_SurfaceOfExtrusion:
     {
       GeomAdaptor_Curve myBasisCurve
-        ((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast);
+        (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
       return myBasisCurve.Resolution(R3d);
     }
        case GeomAbs_Torus:
     {
-      Handle(Geom_ToroidalSurface)& S = *((Handle(Geom_ToroidalSurface)*)&mySurface);
+      Handle(Geom_ToroidalSurface)& S = Handle(Geom_ToroidalSurface)::DownCast (mySurface);
       const Standard_Real R = S->MajorRadius() + S->MinorRadius();
       if(R>Precision::Confusion())
         Res = R3d/(2.*R);
@@ -921,7 +921,7 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const
     }
        case GeomAbs_Sphere:
     {
-      Handle(Geom_SphericalSurface)& S = *((Handle(Geom_SphericalSurface)*)&mySurface);
+      Handle(Geom_SphericalSurface)& S = Handle(Geom_SphericalSurface)::DownCast (mySurface);
       const Standard_Real R = S->Radius();
       if(R>Precision::Confusion())
         Res = R3d/(2.*R);
@@ -929,7 +929,7 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const
     }
        case GeomAbs_Cylinder:
     {
-      Handle(Geom_CylindricalSurface)& S = *((Handle(Geom_CylindricalSurface)*)&mySurface);
+      Handle(Geom_CylindricalSurface)& S = Handle(Geom_CylindricalSurface)::DownCast (mySurface);
       const Standard_Real R = S->Radius();
       if(R>Precision::Confusion())
         Res = R3d/(2.*R);
@@ -941,11 +941,11 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const
         // Pas vraiment borne => resolution inconnue
         return Precision::Parametric(R3d);
       }
-      Handle(Geom_ConicalSurface)& S = *((Handle(Geom_ConicalSurface)*)&mySurface);
+      Handle(Geom_ConicalSurface)& S = Handle(Geom_ConicalSurface)::DownCast (mySurface);
       Handle(Geom_Curve) C = S->VIso(myVLast);
-      const Standard_Real Rayon1 = (*((Handle(Geom_Circle)*)&C))->Radius();
+      const Standard_Real Rayon1 = Handle(Geom_Circle)::DownCast (C)->Radius();
       C = S->VIso(myVFirst);
-      const Standard_Real Rayon2 = (*((Handle(Geom_Circle)*)&C))->Radius();
+      const Standard_Real Rayon2 = Handle(Geom_Circle)::DownCast (C)->Radius();
          const Standard_Real R = (Rayon1 > Rayon2)? Rayon1 : Rayon2;
          return (R>Precision::Confusion()? (R3d / R) : 0.);
     }
@@ -956,18 +956,18 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const
        case GeomAbs_BezierSurface:
     {
       Standard_Real Ures,Vres;
-      (*((Handle(Geom_BezierSurface)*)&mySurface))->Resolution(R3d,Ures,Vres);
+      Handle(Geom_BezierSurface)::DownCast (mySurface)->Resolution(R3d,Ures,Vres);
       return Ures;
     }
        case GeomAbs_BSplineSurface:
     {
       Standard_Real Ures,Vres;
-      (*((Handle(Geom_BSplineSurface)*)&mySurface))->Resolution(R3d,Ures,Vres);
+      Handle(Geom_BSplineSurface)::DownCast (mySurface)->Resolution(R3d,Ures,Vres);
       return Ures;
     }
        case GeomAbs_OffsetSurface:
     {
-      Handle(Geom_Surface) base = (*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface();
+      Handle(Geom_Surface) base = Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface();
       GeomAdaptor_Surface gabase(base,myUFirst,myULast,myVFirst,myVLast);
       return gabase.UResolution(R3d);
     }
@@ -994,12 +994,12 @@ Standard_Real GeomAdaptor_Surface::VResolution(const Standard_Real R3d) const
     case GeomAbs_SurfaceOfRevolution:
     {
       GeomAdaptor_Curve myBasisCurve
-        ((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myUFirst,myULast);
+        (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
       return myBasisCurve.Resolution(R3d);
     }
        case GeomAbs_Torus:
     {
-      Handle(Geom_ToroidalSurface)& S = *((Handle(Geom_ToroidalSurface)*)&mySurface);
+      Handle(Geom_ToroidalSurface)& S = Handle(Geom_ToroidalSurface)::DownCast (mySurface);
       const Standard_Real R = S->MinorRadius();
       if(R>Precision::Confusion())
         Res = R3d/(2.*R);
@@ -1007,7 +1007,7 @@ Standard_Real GeomAdaptor_Surface::VResolution(const Standard_Real R3d) const
     }
        case GeomAbs_Sphere:
     {
-      Handle(Geom_SphericalSurface)& S = *((Handle(Geom_SphericalSurface)*)&mySurface);
+      Handle(Geom_SphericalSurface)& S = Handle(Geom_SphericalSurface)::DownCast (mySurface);
       const Standard_Real R = S->Radius();
       if(R>Precision::Confusion())
         Res = R3d/(2.*R);
@@ -1023,18 +1023,18 @@ Standard_Real GeomAdaptor_Surface::VResolution(const Standard_Real R3d) const
        case GeomAbs_BezierSurface:
     {
       Standard_Real Ures,Vres;
-      (*((Handle(Geom_BezierSurface)*)&mySurface))->Resolution(R3d,Ures,Vres);
+      Handle(Geom_BezierSurface)::DownCast (mySurface)->Resolution(R3d,Ures,Vres);
       return Vres;
     }
        case GeomAbs_BSplineSurface:
     {
       Standard_Real Ures,Vres;
-      (*((Handle(Geom_BSplineSurface)*)&mySurface))->Resolution(R3d,Ures,Vres);
+      Handle(Geom_BSplineSurface)::DownCast (mySurface)->Resolution(R3d,Ures,Vres);
       return Vres;
     }
        case GeomAbs_OffsetSurface:
     {
-      Handle(Geom_Surface) base = (*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface();
+      Handle(Geom_Surface) base = Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface();
       GeomAdaptor_Surface gabase(base,myUFirst,myULast,myVFirst,myVLast);
       return gabase.VResolution(R3d);
     }
@@ -1056,7 +1056,7 @@ gp_Pln GeomAdaptor_Surface::Plane() const
 {
   if (mySurfaceType != GeomAbs_Plane)
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Plane");
-  return (*((Handle(Geom_Plane)*)&mySurface))->Pln();
+  return Handle(Geom_Plane)::DownCast (mySurface)->Pln();
 }
 
 //=======================================================================
@@ -1068,7 +1068,7 @@ gp_Cylinder GeomAdaptor_Surface::Cylinder() const
 {
   if (mySurfaceType != GeomAbs_Cylinder)
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Cylinder");
-  return (*((Handle(Geom_CylindricalSurface)*)&mySurface))->Cylinder();
+  return Handle(Geom_CylindricalSurface)::DownCast (mySurface)->Cylinder();
 }
 
 //=======================================================================
@@ -1080,7 +1080,7 @@ gp_Cone GeomAdaptor_Surface::Cone() const
 {
   if (mySurfaceType != GeomAbs_Cone)
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Cone");
-  return (*((Handle(Geom_ConicalSurface)*)&mySurface))->Cone();
+  return Handle(Geom_ConicalSurface)::DownCast (mySurface)->Cone();
 }
 
 //=======================================================================
@@ -1092,7 +1092,7 @@ gp_Sphere GeomAdaptor_Surface::Sphere() const
 {
   if (mySurfaceType != GeomAbs_Sphere)
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Sphere");
-  return (*((Handle(Geom_SphericalSurface)*)&mySurface))->Sphere();
+  return Handle(Geom_SphericalSurface)::DownCast (mySurface)->Sphere();
 }
 
 //=======================================================================
@@ -1104,7 +1104,7 @@ gp_Torus GeomAdaptor_Surface::Torus() const
 {
   if (mySurfaceType != GeomAbs_Torus)
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Torus");
-  return (*((Handle(Geom_ToroidalSurface)*)&mySurface))->Torus(); 
+  return Handle(Geom_ToroidalSurface)::DownCast (mySurface)->Torus(); 
 }
 
 //=======================================================================
@@ -1115,13 +1115,13 @@ gp_Torus GeomAdaptor_Surface::Torus() const
 Standard_Integer GeomAdaptor_Surface::UDegree() const
 {
   if (mySurfaceType == GeomAbs_BSplineSurface)
-    return (*((Handle(Geom_BSplineSurface)*)&mySurface))->UDegree(); 
+    return Handle(Geom_BSplineSurface)::DownCast (mySurface)->UDegree(); 
   if ( mySurfaceType == GeomAbs_BezierSurface)
-    return (*((Handle(Geom_BezierSurface)*)&mySurface))->UDegree(); 
+    return Handle(Geom_BezierSurface)::DownCast (mySurface)->UDegree(); 
   if ( mySurfaceType == GeomAbs_SurfaceOfExtrusion)
   {
     GeomAdaptor_Curve myBasisCurve
-      ((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast);
+      (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
     return myBasisCurve.Degree();
   }
   Standard_NoSuchObject::Raise("GeomAdaptor_Surface::UDegree");
@@ -1136,13 +1136,13 @@ Standard_Integer GeomAdaptor_Surface::UDegree() const
 Standard_Integer GeomAdaptor_Surface::NbUPoles() const
 {
   if (mySurfaceType == GeomAbs_BSplineSurface)
-    return (*((Handle(Geom_BSplineSurface)*)&mySurface))->NbUPoles();
+    return Handle(Geom_BSplineSurface)::DownCast (mySurface)->NbUPoles();
   if ( mySurfaceType == GeomAbs_BezierSurface)
-    return (*((Handle(Geom_BezierSurface)*)&mySurface))->NbUPoles(); 
+    return Handle(Geom_BezierSurface)::DownCast (mySurface)->NbUPoles(); 
   if ( mySurfaceType == GeomAbs_SurfaceOfExtrusion)
   {
     GeomAdaptor_Curve myBasisCurve
-      ((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast);
+      (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
     return myBasisCurve.NbPoles();
   }
   Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbUPoles");
@@ -1157,13 +1157,13 @@ Standard_Integer GeomAdaptor_Surface::NbUPoles() const
 Standard_Integer GeomAdaptor_Surface::VDegree() const
 {
   if (mySurfaceType == GeomAbs_BSplineSurface)
-    return (*((Handle(Geom_BSplineSurface)*)&mySurface))->VDegree(); 
+    return Handle(Geom_BSplineSurface)::DownCast (mySurface)->VDegree(); 
   if ( mySurfaceType == GeomAbs_BezierSurface)
-    return (*((Handle(Geom_BezierSurface)*)&mySurface))->VDegree(); 
+    return Handle(Geom_BezierSurface)::DownCast (mySurface)->VDegree(); 
   if ( mySurfaceType == GeomAbs_SurfaceOfRevolution)
   {
     GeomAdaptor_Curve myBasisCurve
-      ((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myUFirst,myULast);
+      (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
     return myBasisCurve.Degree();
   }
   Standard_NoSuchObject::Raise("GeomAdaptor_Surface::VDegree");
@@ -1178,13 +1178,13 @@ Standard_Integer GeomAdaptor_Surface::VDegree() const
 Standard_Integer GeomAdaptor_Surface::NbVPoles() const
 {
   if (mySurfaceType == GeomAbs_BSplineSurface)
-    return (*((Handle(Geom_BSplineSurface)*)&mySurface))->NbVPoles(); 
+    return Handle(Geom_BSplineSurface)::DownCast (mySurface)->NbVPoles(); 
   if ( mySurfaceType == GeomAbs_BezierSurface)
-    return (*((Handle(Geom_BezierSurface)*)&mySurface))->NbVPoles(); 
+    return Handle(Geom_BezierSurface)::DownCast (mySurface)->NbVPoles(); 
   if ( mySurfaceType == GeomAbs_SurfaceOfRevolution)
   {
     GeomAdaptor_Curve myBasisCurve
-      ((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myUFirst,myULast);
+      (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
     return myBasisCurve.NbPoles();
   }
   Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbVPoles");
@@ -1199,11 +1199,11 @@ Standard_Integer GeomAdaptor_Surface::NbVPoles() const
 Standard_Integer GeomAdaptor_Surface::NbUKnots() const
 {
   if (mySurfaceType == GeomAbs_BSplineSurface)
-    return (*((Handle(Geom_BSplineSurface)*)&mySurface))->NbUKnots(); 
+    return Handle(Geom_BSplineSurface)::DownCast (mySurface)->NbUKnots(); 
   if ( mySurfaceType == GeomAbs_SurfaceOfExtrusion)
   {
     GeomAdaptor_Curve myBasisCurve
-      ((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast);
+      (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
     return myBasisCurve.NbKnots();
   }
   Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbUKnots");
@@ -1218,7 +1218,7 @@ Standard_Integer GeomAdaptor_Surface::NbUKnots() const
 Standard_Integer GeomAdaptor_Surface::NbVKnots() const 
 {
   if (mySurfaceType == GeomAbs_BSplineSurface)
-    return (*((Handle(Geom_BSplineSurface)*)&mySurface))->NbVKnots(); 
+    return Handle(Geom_BSplineSurface)::DownCast (mySurface)->NbVKnots(); 
   Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbVKnots");
   return 0;
 }
@@ -1230,9 +1230,9 @@ Standard_Integer GeomAdaptor_Surface::NbVKnots() const
 Standard_Boolean GeomAdaptor_Surface::IsURational() const
 {
   if (mySurfaceType == GeomAbs_BSplineSurface)
-    return (*((Handle(Geom_BSplineSurface)*)&mySurface))->IsURational(); 
+    return Handle(Geom_BSplineSurface)::DownCast (mySurface)->IsURational(); 
   if (mySurfaceType == GeomAbs_BezierSurface)
-    return (*((Handle(Geom_BezierSurface)*)&mySurface))->IsURational(); 
+    return Handle(Geom_BezierSurface)::DownCast (mySurface)->IsURational(); 
   return Standard_False;
 }
 
@@ -1244,9 +1244,9 @@ Standard_Boolean GeomAdaptor_Surface::IsURational() const
 Standard_Boolean GeomAdaptor_Surface::IsVRational() const
 {
   if (mySurfaceType == GeomAbs_BSplineSurface)
-    return (*((Handle(Geom_BSplineSurface)*)&mySurface))->IsVRational(); 
+    return Handle(Geom_BSplineSurface)::DownCast (mySurface)->IsVRational(); 
   if (mySurfaceType == GeomAbs_BezierSurface)
-    return (*((Handle(Geom_BezierSurface)*)&mySurface))->IsVRational(); 
+    return Handle(Geom_BezierSurface)::DownCast (mySurface)->IsVRational(); 
   return Standard_False;
 }
 
@@ -1259,7 +1259,7 @@ Handle(Geom_BezierSurface) GeomAdaptor_Surface::Bezier() const
 {
   if (mySurfaceType != GeomAbs_BezierSurface)
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Bezier");
-  return *((Handle(Geom_BezierSurface)*)&mySurface);
+  return Handle(Geom_BezierSurface)::DownCast (mySurface);
 }
 
 //=======================================================================
@@ -1271,7 +1271,7 @@ Handle(Geom_BSplineSurface) GeomAdaptor_Surface::BSpline() const
 {
   if (mySurfaceType != GeomAbs_BSplineSurface)  
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BSpline");
-  return *((Handle(Geom_BSplineSurface)*)&mySurface);
+  return Handle(Geom_BSplineSurface)::DownCast (mySurface);
 }
 
 //=======================================================================
@@ -1283,7 +1283,7 @@ gp_Ax1 GeomAdaptor_Surface::AxeOfRevolution() const
 {
   if (mySurfaceType != GeomAbs_SurfaceOfRevolution)
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::AxeOfRevolution");
-  return (*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->Axis();
+  return Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->Axis();
 }
 
 //=======================================================================
@@ -1295,7 +1295,7 @@ gp_Dir GeomAdaptor_Surface::Direction() const
 {
   if (mySurfaceType != GeomAbs_SurfaceOfExtrusion)
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Direction");
-  return (*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->Direction();
+  return Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->Direction();
 }
 
 //=======================================================================
@@ -1307,9 +1307,9 @@ Handle(Adaptor3d_HCurve) GeomAdaptor_Surface::BasisCurve() const
 {
   Handle(Geom_Curve) C;
   if (mySurfaceType == GeomAbs_SurfaceOfExtrusion)
-    C = (*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve();
+    C = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve();
   else if (mySurfaceType == GeomAbs_SurfaceOfRevolution)
-    C = (*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve();
+    C = Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve();
   else
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisCurve");
   return Handle(GeomAdaptor_HCurve)(new GeomAdaptor_HCurve(C));
@@ -1325,7 +1325,7 @@ Handle(Adaptor3d_HSurface) GeomAdaptor_Surface::BasisSurface() const
   if (mySurfaceType != GeomAbs_OffsetSurface) 
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisSurface");
   return new GeomAdaptor_HSurface
-    ((*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface(),
+    (Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface(),
      myUFirst,myULast,myVFirst,myVLast);
 }
 
@@ -1338,7 +1338,7 @@ Standard_Real GeomAdaptor_Surface::OffsetValue() const
 {
   if (mySurfaceType != GeomAbs_OffsetSurface) 
     Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisSurface");
-  return (*((Handle(Geom_OffsetSurface)*)&mySurface))->Offset();
+  return Handle(Geom_OffsetSurface)::DownCast (mySurface)->Offset();
 }
 
 //=======================================================================
index 6903378173f0e4957fa41c50fcbaba32a6a4e12a..049f7fbc000d619afe20ed59a871b18a0d0c8366 100644 (file)
@@ -355,7 +355,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
   Handle(Geom_Surface) S; 
   Handle(Geom_OffsetSurface) OffsetSur;
   if (Sr->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) {
-    OffsetSur = *((Handle(Geom_OffsetSurface)*)& Sr);
+    OffsetSur = Handle(Geom_OffsetSurface)::DownCast (Sr);
     S = OffsetSur->Surface();
     if (!S.IsNull()) { // Convert the equivalent surface.
       return SurfaceToBSplineSurface(S);
index 643371476c5e14876c989b153cffc39eaa3062e0..b94d862e9281dab7046946d91fad835ed0e2885d 100644 (file)
@@ -175,7 +175,7 @@ void GeomFill_BoundWithSurf::Reparametrize(const Standard_Real First,
                                                 HasDF,HasDL,DF,DL,
                                                 Rev,30);
   myPar = new Law_BSpFunc();
-  (*((Handle(Law_BSpFunc)*) &myPar))->SetCurve(curve);
+  Handle(Law_BSpFunc)::DownCast (myPar)->SetCurve(curve);
 }
 
 //=======================================================================
index b0f7b5fcda785074ae6811b6b0cd6a915e1fddd0..51d5b90a929f6394536779fa00ee14f36e3367bd 100644 (file)
@@ -395,8 +395,8 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1,
       if(!CheckTgte(i)) {
        Handle(Law_Function) fu1,fu2;
        ptch->Func(fu1,fu2);
-       fu1 = Law::MixBnd(*((Handle(Law_Linear)*) &fu1));
-       fu2 = Law::MixBnd(*((Handle(Law_Linear)*) &fu2));
+       fu1 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu1));
+       fu2 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu2));
        ptch->Func(fu1,fu2);
        break;
       } 
@@ -476,8 +476,8 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1,
       if(!CheckTgte(i)) {
        Handle(Law_Function) fu1,fu2;
        ptch->Func(fu1,fu2);
-       Handle(Law_Function) ffu1 = Law::MixBnd(*((Handle(Law_Linear)*) &fu1));
-       Handle(Law_Function) ffu2 = Law::MixBnd(*((Handle(Law_Linear)*) &fu2));
+       Handle(Law_Function) ffu1 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu1));
+       Handle(Law_Function) ffu2 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu2));
        ptch->SetFunc(ffu1,ffu2);
        break;
       } 
index 0aa34487e514770857ccc42d808f1de2a4770f15..c30431e12954f114b19fd1349d56b4c774f99698 100644 (file)
@@ -142,7 +142,7 @@ void GeomFill_Profiler::AddCurve(const Handle(Geom_Curve)& Curve)
   //// modified by jgv, 19.01.05 for OCC7354 ////
   Handle(Geom_Curve) theCurve = Curve;
   if (theCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
-    theCurve = (*((Handle(Geom_TrimmedCurve)*)&theCurve))->BasisCurve();
+    theCurve = Handle(Geom_TrimmedCurve)::DownCast (theCurve)->BasisCurve();
   if (theCurve->IsKind(STANDARD_TYPE(Geom_Conic)))
     {
       GeomConvert_ApproxCurve appr(Curve, Precision::Confusion(), GeomAbs_C1, 16, 14);
index 3eb8f098a6ffa3da0e236e2f1eba3277da7ea05e..487d2ee2a029ff528c148e5dd753bb0a72aeb831 100644 (file)
@@ -77,7 +77,7 @@ void GeomFill_SimpleBound::Reparametrize(const Standard_Real First,
                                                 HasDF,HasDL,DF,DL,
                                                 Rev,30);
   myPar = new Law_BSpFunc();
-  (*((Handle(Law_BSpFunc)*) &myPar))->SetCurve(curve);
+  Handle(Law_BSpFunc)::DownCast (myPar)->SetCurve(curve);
 }
 
 //=======================================================================
index 7c4bed32d6506ef6bcc07143ff2186b28d1409a7..6922ec799bb0d739c38b643d20319fcd0643cfcc 100644 (file)
@@ -325,8 +325,7 @@ GeomFill_Sweep::GeomFill_Sweep(const Handle(GeomFill_LocationLaw)& Location,
         myCurve2d = new  (TColGeom2d_HArray1OfCurve) (1, 2);
         CError =  new (TColStd_HArray2OfReal) (1,2, 1,2);
 
-        const Handle(Geom_BSplineSurface)& BSplSurf =
-          Handle(Geom_BSplineSurface)::DownCast(mySurface);
+        Handle(Geom_BSplineSurface) BSplSurf (Handle(Geom_BSplineSurface)::DownCast(mySurface));
         
         gp_Dir2d D(0., 1.);
         gp_Pnt2d P(BSplSurf->UKnot(1), 0);
index bc32606753c2c4bdac072bafe22174c16cc3eb07..f35b14c9fd21155b727e8dee3bdaecc9e46bcdc4 100644 (file)
@@ -145,7 +145,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L)
   const IntPatch_IType typl = L->ArcType();
   if(typl == IntPatch_Analytic)  {
     Standard_Real u1,v1,u2,v2;
-    Handle(IntPatch_ALine)& ALine =  *((Handle(IntPatch_ALine) *)&L);
+    Handle(IntPatch_ALine)& ALine =  Handle(IntPatch_ALine)::DownCast (L);
     seqp.Clear();
     nbvtx = GeomInt_LineTool::NbVertex(L);
     for(i=1;i<nbvtx;i++)   {
@@ -171,7 +171,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L)
   } // if(typl == IntPatch_Analytic)  {
   else if(typl == IntPatch_Walking)  {
     Standard_Real u1,v1,u2,v2;
-    Handle(IntPatch_WLine)& WLine =  *((Handle(IntPatch_WLine) *)&L);
+    Handle(IntPatch_WLine)& WLine =  Handle(IntPatch_WLine)::DownCast (L);
     seqp.Clear();
     nbvtx = GeomInt_LineTool::NbVertex(L);
     for(i=1;i<nbvtx;i++)    { 
@@ -287,7 +287,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L)
   else if (typl != IntPatch_Restriction)  {
     seqp.Clear();
     //
-    Handle(IntPatch_GLine)& GLine =  *((Handle(IntPatch_GLine) *)&L);
+    Handle(IntPatch_GLine)& GLine =  Handle(IntPatch_GLine)::DownCast (L);
     //
     if(typl == IntPatch_Circle || typl == IntPatch_Ellipse) { 
       TreatCircle(L, Tol);
@@ -726,7 +726,7 @@ void GeomInt_LineConstructor::TreatCircle(const Handle(IntPatch_Line)& aLine,
   IntPatch_IType aType;
   //
   aType=aLine->ArcType();
-  Handle(IntPatch_GLine)& aGLine=*((Handle(IntPatch_GLine) *)&aLine);
+  Handle(IntPatch_GLine)& aGLine=Handle(IntPatch_GLine)::DownCast (aLine);
   //
   bRejected=RejectMicroCircle(aGLine, aType, aTol);
   if (bRejected) {
index 2908a169d1909f3861b0e4452e9fe876a5d4e6a2..dc3ec85842050845cf2ae23ba7ab14c3d29add76 100644 (file)
@@ -1057,10 +1057,8 @@ void GeomLib::BuildCurve3d(const Standard_Real           Tolerance,
   Standard_Integer curve_not_computed = 1 ;
   MaxDeviation     = 0.0e0 ;
   AverageDeviation = 0.0e0 ;
-  const Handle(GeomAdaptor_HSurface) &     geom_adaptor_surface_ptr =
-  Handle(GeomAdaptor_HSurface)::DownCast(Curve.GetSurface()) ;
-  const Handle(Geom2dAdaptor_HCurve) &     geom_adaptor_curve_ptr =
-  Handle(Geom2dAdaptor_HCurve)::DownCast(Curve.GetCurve()) ;
+  Handle(GeomAdaptor_HSurface) geom_adaptor_surface_ptr (Handle(GeomAdaptor_HSurface)::DownCast(Curve.GetSurface()) );
+  Handle(Geom2dAdaptor_HCurve) geom_adaptor_curve_ptr (Handle(Geom2dAdaptor_HCurve)::DownCast(Curve.GetCurve()) );
    
   if (! geom_adaptor_curve_ptr.IsNull() &&
       ! geom_adaptor_surface_ptr.IsNull()) {
index 74e64f4a08e734bf24456bd5300e052d8c147a12..03004ffd083c6cf02d6ea0647ffded96f9afe806 100644 (file)
@@ -1341,7 +1341,7 @@ static Standard_Integer mypoints (Draw_Interpretor& di, Standard_Integer /*n*/,
 
   Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
   defl = Draw::Atof(a[3]);
-  const Handle(Geom_BSplineCurve)& aBS = Handle(Geom_BSplineCurve)::DownCast(C);
+  Handle(Geom_BSplineCurve) aBS (Handle(Geom_BSplineCurve)::DownCast(C));
 
   if(aBS.IsNull()) return 1;
 
index c3b10080fbb6e2098d4346b996acdee7b8f100e3..80e09a7cd52bed99afed684013d257a7ff08bbca 100644 (file)
@@ -91,7 +91,7 @@ TopoDS_Edge HLRBRep::MakeEdge (const HLRBRep_Curve& ec,
     Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
     if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve))
       aCurve = (Handle(Geom_TrimmedCurve)::DownCast(aCurve))->BasisCurve();
-    const Handle(Geom_BSplineCurve)& BSplCurve = Handle(Geom_BSplineCurve)::DownCast(aCurve);
+    Handle(Geom_BSplineCurve) BSplCurve (Handle(Geom_BSplineCurve)::DownCast(aCurve));
     Handle(Geom_BSplineCurve) theCurve = Handle(Geom_BSplineCurve)::DownCast(BSplCurve->Copy());
     if (theCurve->IsPeriodic() && !GAcurve.IsClosed())
     {
index 957fd4ecdc47f7aca664efbfd6fed24caf8c573e..741fc34ad27cbacb05cb68099fd5518548c8360a 100644 (file)
@@ -530,10 +530,10 @@ void PutPointsOnLine(const Handle(Adaptor3d_HSurface)& S1,
              solpnt.SetArc(OnFirst,currentarc, currentparameter,
                            Transline,Transarc);
              if (TheType == IntPatch_Analytic) {
-               (*((Handle(IntPatch_ALine)*)&lin))->AddVertex(solpnt);
+               Handle(IntPatch_ALine)::DownCast (lin)->AddVertex(solpnt);
              }
              else {
-               (*((Handle(IntPatch_GLine)*)&lin))->AddVertex(solpnt);
+               Handle(IntPatch_GLine)::DownCast (lin)->AddVertex(solpnt);
              }
              Done(i) = 1;
              
@@ -564,10 +564,10 @@ void PutPointsOnLine(const Handle(Adaptor3d_HSurface)& S1,
                        solpnt.SetArc(OnFirst,currentarc,currentparameter,
                                      Transline,Transarc);
                        if (TheType == IntPatch_Analytic) {
-                         (*((Handle(IntPatch_ALine)*)&lin))->AddVertex(solpnt);
+                         Handle(IntPatch_ALine)::DownCast (lin)->AddVertex(solpnt);
                        }
                        else {
-                         (*((Handle(IntPatch_GLine)*)&lin))->AddVertex(solpnt);
+                         Handle(IntPatch_GLine)::DownCast (lin)->AddVertex(solpnt);
                        }
                        Done(k) = 1;
                      }
@@ -639,18 +639,18 @@ Standard_Boolean  MultiplePoint (const IntPatch_SequenceOfPathPointOfTheSOnBound
     const Handle(IntPatch_Line)& slinValueii = slin.Value(ii);
     TheType = slinValueii->ArcType();
     if (TheType == IntPatch_Analytic) {
-      nbvtx = (*((Handle(IntPatch_ALine)*)&slinValueii))->NbVertex();
+      nbvtx = Handle(IntPatch_ALine)::DownCast (slinValueii)->NbVertex();
     }
     else {
-      nbvtx = (*((Handle(IntPatch_GLine)*)&slinValueii))->NbVertex();
+      nbvtx = Handle(IntPatch_GLine)::DownCast (slinValueii)->NbVertex();
     }
     jj = 1;
     while (jj <= nbvtx) {
       if (TheType == IntPatch_Analytic) {
-       intpt = (*((Handle(IntPatch_ALine)*)&slinValueii))->Vertex(jj);
+       intpt = Handle(IntPatch_ALine)::DownCast (slinValueii)->Vertex(jj);
       }
       else {
-       intpt = (*((Handle(IntPatch_GLine)*)&slinValueii))->Vertex(jj);
+       intpt = Handle(IntPatch_GLine)::DownCast (slinValueii)->Vertex(jj);
       }
       if (intpt.IsMultiple() && 
           (( OnFirst && !intpt.IsOnDomS1()) ||
@@ -696,10 +696,10 @@ Standard_Boolean  MultiplePoint (const IntPatch_SequenceOfPathPointOfTheSOnBound
 
 
          if (TheType == IntPatch_Analytic) {
-           (*((Handle(IntPatch_ALine)*)&slinValueii))->Replace(jj,intpt);
+           Handle(IntPatch_ALine)::DownCast (slinValueii)->Replace(jj,intpt);
          }
          else {
-           (*((Handle(IntPatch_GLine)*)&slinValueii))->Replace(jj,intpt);
+           Handle(IntPatch_GLine)::DownCast (slinValueii)->Replace(jj,intpt);
          }
           localdone(Index) = 1;
          if (goon) {
@@ -726,10 +726,10 @@ Standard_Boolean  MultiplePoint (const IntPatch_SequenceOfPathPointOfTheSOnBound
                    intpt.SetArc(OnFirst,currentarc,currentparameter,
                                  Transline,Transarc);
                    if (TheType == IntPatch_Analytic) {
-                     (*((Handle(IntPatch_ALine)*)&slinValueii))->AddVertex(intpt);
+                     Handle(IntPatch_ALine)::DownCast (slinValueii)->AddVertex(intpt);
                    }
                    else {
-                     (*((Handle(IntPatch_GLine)*)&slinValueii))->AddVertex(intpt);
+                     Handle(IntPatch_GLine)::DownCast (slinValueii)->AddVertex(intpt);
                    }
                    UsedLine(ii) = 1;
                    Retvalue = Standard_True;
@@ -799,18 +799,18 @@ Standard_Boolean PointOnSecondDom (const IntPatch_SequenceOfPathPointOfTheSOnBou
 
   TheType = lin->ArcType();
   if (TheType == IntPatch_Analytic) {
-    nbvtx = (*((Handle(IntPatch_ALine)*)&lin))->NbVertex();
+    nbvtx = Handle(IntPatch_ALine)::DownCast (lin)->NbVertex();
   }
   else {
-    nbvtx = (*((Handle(IntPatch_GLine)*)&lin))->NbVertex();
+    nbvtx = Handle(IntPatch_GLine)::DownCast (lin)->NbVertex();
   }
   jj = 1;
   while (jj <= nbvtx) {
     if (TheType == IntPatch_Analytic) {
-      intpt = (*((Handle(IntPatch_ALine)*)&lin))->Vertex(jj);
+      intpt = Handle(IntPatch_ALine)::DownCast (lin)->Vertex(jj);
     }
     else {
-      intpt = (*((Handle(IntPatch_GLine)*)&lin))->Vertex(jj);
+      intpt = Handle(IntPatch_GLine)::DownCast (lin)->Vertex(jj);
     }
     if (!intpt.IsOnDomS2()) {
       if (currentpointonrst.Value().Distance(intpt.Value()) <= 
@@ -839,10 +839,10 @@ Standard_Boolean PointOnSecondDom (const IntPatch_SequenceOfPathPointOfTheSOnBou
        intpt.SetArc(Standard_False,currentarc,currentparameter,
                     Transline,Transarc);
        if (TheType == IntPatch_Analytic) {
-         (*((Handle(IntPatch_ALine)*)&lin))->Replace(jj,intpt);
+         Handle(IntPatch_ALine)::DownCast (lin)->Replace(jj,intpt);
        }
        else {
-         (*((Handle(IntPatch_GLine)*)&lin))->Replace(jj,intpt);
+         Handle(IntPatch_GLine)::DownCast (lin)->Replace(jj,intpt);
        }
         Done(Index) = 1;
 
@@ -869,10 +869,10 @@ Standard_Boolean PointOnSecondDom (const IntPatch_SequenceOfPathPointOfTheSOnBou
                  intpt.SetArc(Standard_False,currentarc,currentparameter,
                                Transline,Transarc);
                  if (TheType == IntPatch_Analytic) {
-                   (*((Handle(IntPatch_ALine)*)&lin))->AddVertex(intpt);
+                   Handle(IntPatch_ALine)::DownCast (lin)->AddVertex(intpt);
                  }
                  else {
-                   (*((Handle(IntPatch_GLine)*)&lin))->AddVertex(intpt);
+                   Handle(IntPatch_GLine)::DownCast (lin)->AddVertex(intpt);
                  }
                   Done(k) = 1;
                 }
@@ -891,10 +891,10 @@ Standard_Boolean PointOnSecondDom (const IntPatch_SequenceOfPathPointOfTheSOnBou
       jj = jj+1;
     }
     if (TheType == IntPatch_Analytic) {
-      nbvtx = (*((Handle(IntPatch_ALine)*)&lin))->NbVertex();
+      nbvtx = Handle(IntPatch_ALine)::DownCast (lin)->NbVertex();
     }
     else {
-      nbvtx = (*((Handle(IntPatch_GLine)*)&lin))->NbVertex();
+      nbvtx = Handle(IntPatch_GLine)::DownCast (lin)->NbVertex();
     }
   }
   return Retvalue;
@@ -934,18 +934,18 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
     typarc = lin->ArcType();
     if (typarc == IntPatch_Analytic) {
       Standard_Boolean foo;
-      lower = (*((Handle(IntPatch_ALine)*)&lin))->FirstParameter(foo);
-      upper = (*((Handle(IntPatch_ALine)*)&lin))->LastParameter(foo);
+      lower = Handle(IntPatch_ALine)::DownCast (lin)->FirstParameter(foo);
+      upper = Handle(IntPatch_ALine)::DownCast (lin)->LastParameter(foo);
     }
     else {
-      if ((*((Handle(IntPatch_GLine)*)&lin))->HasFirstPoint()) {
-       lower = (*((Handle(IntPatch_GLine)*)&lin))->FirstPoint().ParameterOnLine();
+      if (Handle(IntPatch_GLine)::DownCast (lin)->HasFirstPoint()) {
+       lower = Handle(IntPatch_GLine)::DownCast (lin)->FirstPoint().ParameterOnLine();
       }
       else {
        lower = RealFirst();
       }
-      if ((*((Handle(IntPatch_GLine)*)&lin))->HasLastPoint()) {
-       upper = (*((Handle(IntPatch_GLine)*)&lin))->LastPoint().ParameterOnLine();
+      if (Handle(IntPatch_GLine)::DownCast (lin)->HasLastPoint()) {
+       upper = Handle(IntPatch_GLine)::DownCast (lin)->LastPoint().ParameterOnLine();
       }
       else {
        upper = RealLast();
@@ -955,9 +955,9 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
     switch (typarc) {
     case IntPatch_Lin :
       {
-       para = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Line(),Psurf);
+       para = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Line(),Psurf);
        if (para <= upper && para >= lower) {
-         pt = ElCLib::Value(para,(*((Handle(IntPatch_GLine)*)&lin))->Line());
+         pt = ElCLib::Value(para,Handle(IntPatch_GLine)::DownCast (lin)->Line());
          dist = Psurf.Distance(pt);
          if (dist< distmin) {
            distmin = dist;
@@ -969,11 +969,11 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
       break;
     case IntPatch_Circle :
       {
-       para = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Circle(),Psurf);
+       para = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Circle(),Psurf);
        if ((para <= upper && para >= lower) ||
            (para + 2.*M_PI <=upper && para + 2.*M_PI >= lower) ||
            (para - 2.*M_PI <=upper && para - 2.*M_PI >= lower)) {
-         pt = ElCLib::Value(para,(*((Handle(IntPatch_GLine)*)&lin))->Circle());
+         pt = ElCLib::Value(para,Handle(IntPatch_GLine)::DownCast (lin)->Circle());
          dist = Psurf.Distance(pt);
          if (dist< distmin) {
            distmin = dist;
@@ -985,11 +985,11 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
       break;
     case IntPatch_Ellipse :
       {
-       para = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Ellipse(),Psurf);
+       para = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Ellipse(),Psurf);
        if ((para <= upper && para >= lower) ||
            (para + 2.*M_PI <=upper && para + 2.*M_PI >= lower) ||
            (para - 2.*M_PI <=upper && para - 2.*M_PI >= lower)) {
-         pt = ElCLib::Value(para,(*((Handle(IntPatch_GLine)*)&lin))->Ellipse());
+         pt = ElCLib::Value(para,Handle(IntPatch_GLine)::DownCast (lin)->Ellipse());
          dist = Psurf.Distance(pt);
          if (dist< distmin) {
            distmin = dist;
@@ -1003,9 +1003,9 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
       {
        
 #if 0  
-       para = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Parabola(),Psurf);
+       para = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Parabola(),Psurf);
        if (para <= upper && para >= lower) {
-         pt = ElCLib::Value(para,(*((Handle(IntPatch_GLine)*)&lin))->Parabola());
+         pt = ElCLib::Value(para,Handle(IntPatch_GLine)::DownCast (lin)->Parabola());
          dist = Psurf.Distance(pt);
          if (dist< distmin) {
            distmin = dist;
@@ -1018,7 +1018,7 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
        //-- de la meilleure facon de calculer (axe X ou axe Y). Bilan : Si la parabole est tres 
        //-- pointue (focal de l'ordre de 1e-2 et si le point est a un parametre grand, ca foire. )
        //-- On ne peut pas modifier faciolement ds ElCLib car on ne passe pas la focale. ...
-       const gp_Parab& Parab=(*((Handle(IntPatch_GLine)*)&lin))->Parabola();
+       const gp_Parab& Parab=Handle(IntPatch_GLine)::DownCast (lin)->Parabola();
        para = ElCLib::Parameter(Parab,Psurf);
        if (para <= upper && para >= lower) {
          Standard_Integer amelioration=0;
@@ -1059,9 +1059,9 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
       break;
     case IntPatch_Hyperbola :
       {
-       para = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Hyperbola(),Psurf);
+       para = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Hyperbola(),Psurf);
        if (para <= upper && para >= lower) {
-         pt = ElCLib::Value(para,(*((Handle(IntPatch_GLine)*)&lin))->Hyperbola());
+         pt = ElCLib::Value(para,Handle(IntPatch_GLine)::DownCast (lin)->Hyperbola());
          dist = Psurf.Distance(pt);
          if (dist< distmin) {
            distmin = dist;
@@ -1074,7 +1074,7 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
 
     case IntPatch_Analytic :
       {
-       const Handle(IntPatch_ALine)& alin = (*((Handle(IntPatch_ALine)*)&lin));
+       Handle(IntPatch_ALine) alin (Handle(IntPatch_ALine)::DownCast (lin));
        Standard_Boolean ok = alin->FindParameter(Psurf,para);
        if (ok) {
          pt = alin->Value(para);
@@ -1238,28 +1238,28 @@ Standard_Boolean  SingleLine (const gp_Pnt& Psurf,
 
   switch (typarc) {
   case IntPatch_Lin :
-    parproj = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Line(),Psurf);
-    ElCLib::D1(parproj,(*((Handle(IntPatch_GLine)*)&lin))->Line(),ptproj,tgint);
+    parproj = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Line(),Psurf);
+    ElCLib::D1(parproj,Handle(IntPatch_GLine)::DownCast (lin)->Line(),ptproj,tgint);
     break;
   case IntPatch_Circle :
-    parproj = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Circle(),Psurf);
-    ElCLib::D1(parproj,(*((Handle(IntPatch_GLine)*)&lin))->Circle(),ptproj,tgint);
+    parproj = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Circle(),Psurf);
+    ElCLib::D1(parproj,Handle(IntPatch_GLine)::DownCast (lin)->Circle(),ptproj,tgint);
     break;
   case IntPatch_Ellipse :
-    parproj = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Ellipse(),Psurf);
-    ElCLib::D1(parproj,(*((Handle(IntPatch_GLine)*)&lin))->Ellipse(),ptproj,tgint);
+    parproj = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Ellipse(),Psurf);
+    ElCLib::D1(parproj,Handle(IntPatch_GLine)::DownCast (lin)->Ellipse(),ptproj,tgint);
     break;
   case IntPatch_Parabola :
-    parproj = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Parabola(),Psurf);
-    ElCLib::D1(parproj,(*((Handle(IntPatch_GLine)*)&lin))->Parabola(),ptproj,tgint);
+    parproj = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Parabola(),Psurf);
+    ElCLib::D1(parproj,Handle(IntPatch_GLine)::DownCast (lin)->Parabola(),ptproj,tgint);
     break;
   case IntPatch_Hyperbola :
-    parproj = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Hyperbola(),Psurf);
-    ElCLib::D1(parproj,(*((Handle(IntPatch_GLine)*)&lin))->Hyperbola(),ptproj,tgint);
+    parproj = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Hyperbola(),Psurf);
+    ElCLib::D1(parproj,Handle(IntPatch_GLine)::DownCast (lin)->Hyperbola(),ptproj,tgint);
     break;
   case IntPatch_Analytic :
     {
-      const Handle(IntPatch_ALine)& alin = (*((Handle(IntPatch_ALine)*)&lin));
+      Handle(IntPatch_ALine) alin (Handle(IntPatch_ALine)::DownCast (lin));
       Standard_Boolean ok = alin->FindParameter(Psurf,parproj);
       if (ok) {
        gp_Pnt ptbid;
@@ -1460,36 +1460,36 @@ void ProcessSegments (const IntPatch_SequenceOfSegmentOfTheSOnBounds& listedg,
        const Handle(IntPatch_Line)& slinj = slin(j);
        typ = slinj->ArcType();
        if (typ == IntPatch_Analytic) {
-         Nbpts = (*((Handle(IntPatch_ALine)*)&slinj))->NbVertex();
+         Nbpts = Handle(IntPatch_ALine)::DownCast (slinj)->NbVertex();
        }
        else if (typ == IntPatch_Restriction) {
-         Nbpts = (*((Handle(IntPatch_RLine)*)&slinj))->NbVertex();
+         Nbpts = Handle(IntPatch_RLine)::DownCast (slinj)->NbVertex();
        }
        else {
-         Nbpts = (*((Handle(IntPatch_GLine)*)&slinj))->NbVertex();
+         Nbpts = Handle(IntPatch_GLine)::DownCast (slinj)->NbVertex();
        }
        for (k=1; k<=Nbpts;k++) {
          if (typ == IntPatch_Analytic) {
-           ptvtx = (*((Handle(IntPatch_ALine)*)&slinj))->Vertex(k);
+           ptvtx = Handle(IntPatch_ALine)::DownCast (slinj)->Vertex(k);
          }
          else if (typ == IntPatch_Restriction) {
-           ptvtx = (*((Handle(IntPatch_RLine)*)&slinj))->Vertex(k);
+           ptvtx = Handle(IntPatch_RLine)::DownCast (slinj)->Vertex(k);
          }
          else {
-           ptvtx = (*((Handle(IntPatch_GLine)*)&slinj))->Vertex(k);
+           ptvtx = Handle(IntPatch_GLine)::DownCast (slinj)->Vertex(k);
          }
          
          if (EdgeDegenere==Standard_False && dofirst) {
            if (ptvtx.Value().Distance(PStartf.Value()) <=TolArc) {
              ptvtx.SetMultiple(Standard_True);
              if (typ == IntPatch_Analytic) {
-               (*((Handle(IntPatch_ALine)*)&slinj))->Replace(k,ptvtx);
+               Handle(IntPatch_ALine)::DownCast (slinj)->Replace(k,ptvtx);
              }
              else if (typ == IntPatch_Restriction) {
-               (*((Handle(IntPatch_RLine)*)&slinj))->Replace(k,ptvtx);
+               Handle(IntPatch_RLine)::DownCast (slinj)->Replace(k,ptvtx);
              }
              else {
-               (*((Handle(IntPatch_GLine)*)&slinj))->Replace(k,ptvtx);
+               Handle(IntPatch_GLine)::DownCast (slinj)->Replace(k,ptvtx);
              }
              newptvtx = ptvtx;
              newptvtx.SetParameter(paramf);
@@ -1547,13 +1547,13 @@ void ProcessSegments (const IntPatch_SequenceOfSegmentOfTheSOnBounds& listedg,
            if (ptvtx.Value().Distance(PStartl.Value()) <=TolArc) {
              ptvtx.SetMultiple(Standard_True);
              if (typ == IntPatch_Analytic) {
-               (*((Handle(IntPatch_ALine)*)&slinj))->Replace(k,ptvtx);
+               Handle(IntPatch_ALine)::DownCast (slinj)->Replace(k,ptvtx);
              }
              else if (typ == IntPatch_Restriction) {
-               (*((Handle(IntPatch_RLine)*)&slinj))->Replace(k,ptvtx);
+               Handle(IntPatch_RLine)::DownCast (slinj)->Replace(k,ptvtx);
              }
              else {
-               (*((Handle(IntPatch_GLine)*)&slinj))->Replace(k,ptvtx);
+               Handle(IntPatch_GLine)::DownCast (slinj)->Replace(k,ptvtx);
              }
 
              newptvtx = ptvtx;
@@ -1858,27 +1858,27 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
        Nbpt = seq_Pnt3d.Length();      // important que ce soit ici
        typ2 = slinj->ArcType();
        if (typ2 != IntPatch_Restriction) {
-         //-- arcref = (*((Handle(IntPatch_RLine)*)&slini))->Arc();
-         //-- OnFirst = (*((Handle(IntPatch_RLine)*)&slini))->IsOnFirstSurface();
+         //-- arcref = Handle(IntPatch_RLine)::DownCast (slini)->Arc();
+         //-- OnFirst = Handle(IntPatch_RLine)::DownCast (slini)->IsOnFirstSurface();
 
          //-- DES CHOSES A FAIRE ICI 
-         if((*((Handle(IntPatch_RLine)*)&slini))->IsArcOnS1()) { 
+         if(Handle(IntPatch_RLine)::DownCast (slini)->IsArcOnS1()) { 
            OnFirst=Standard_True;
-           arcref= (*((Handle(IntPatch_RLine)*)&slini))->ArcOnS1();
+           arcref= Handle(IntPatch_RLine)::DownCast (slini)->ArcOnS1();
          }
-         else if((*((Handle(IntPatch_RLine)*)&slini))->IsArcOnS2()) { 
-           arcref= (*((Handle(IntPatch_RLine)*)&slini))->ArcOnS2();
+         else if(Handle(IntPatch_RLine)::DownCast (slini)->IsArcOnS2()) { 
+           arcref= Handle(IntPatch_RLine)::DownCast (slini)->ArcOnS2();
            OnFirst=Standard_False;
          }
-         if ((*((Handle(IntPatch_RLine)*)&slini))->HasFirstPoint()) {
-           paramf = (*((Handle(IntPatch_RLine)*)&slini))->FirstPoint().ParameterOnLine();
+         if (Handle(IntPatch_RLine)::DownCast (slini)->HasFirstPoint()) {
+           paramf = Handle(IntPatch_RLine)::DownCast (slini)->FirstPoint().ParameterOnLine();
          }
          else {
            // cout << "Pas de param debut sur rst solution" << endl;
            paramf = RealFirst();
          }
-         if ((*((Handle(IntPatch_RLine)*)&slini))->HasLastPoint()) {
-           paraml = (*((Handle(IntPatch_RLine)*)&slini))->LastPoint().ParameterOnLine();
+         if (Handle(IntPatch_RLine)::DownCast (slini)->HasLastPoint()) {
+           paraml = Handle(IntPatch_RLine)::DownCast (slini)->LastPoint().ParameterOnLine();
          }
          else {
            // cout << "Pas de param debut sur rst solution" << endl;
@@ -1886,10 +1886,10 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
          }
 
          if (typ2 == IntPatch_Analytic) {
-           Nbvtx = (*((Handle(IntPatch_ALine)*)&slinj))->NbVertex();
+           Nbvtx = Handle(IntPatch_ALine)::DownCast (slinj)->NbVertex();
          }
          else {
-           Nbvtx = (*((Handle(IntPatch_GLine)*)&slinj))->NbVertex();
+           Nbvtx = Handle(IntPatch_GLine)::DownCast (slinj)->NbVertex();
          }
 
          
@@ -1909,10 +1909,10 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
 
          for (k=1; EdgeDegenere==Standard_False && k<=Nbvtx; k++) {
            if (typ2 == IntPatch_Analytic) {
-             Ptvtx = (*((Handle(IntPatch_ALine)*)&slinj))->Vertex(k);
+             Ptvtx = Handle(IntPatch_ALine)::DownCast (slinj)->Vertex(k);
            }
            else {
-             Ptvtx = (*((Handle(IntPatch_GLine)*)&slinj))->Vertex(k);
+             Ptvtx = Handle(IntPatch_GLine)::DownCast (slinj)->Vertex(k);
            }
            if ((OnFirst && !Ptvtx.IsOnDomS1()) ||
                (!OnFirst && !Ptvtx.IsOnDomS2())) {
@@ -1960,15 +1960,15 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
                    for (int ri=1; ri<=Nblin; ri++) {
                      const Handle(IntPatch_Line)& slinri = slin(ri);
                      if (slinri->ArcType() == IntPatch_Restriction) {
-                       if(OnFirst && (*((Handle(IntPatch_RLine)*)&slinri))->IsArcOnS1()) { 
-                         if(arcref == (*((Handle(IntPatch_RLine)*)&slinri))->ArcOnS1()) { 
-                           (*((Handle(IntPatch_RLine)*)&slinri))->AddVertex(newptvtx);
+                       if(OnFirst && Handle(IntPatch_RLine)::DownCast (slinri)->IsArcOnS1()) { 
+                         if(arcref == Handle(IntPatch_RLine)::DownCast (slinri)->ArcOnS1()) { 
+                           Handle(IntPatch_RLine)::DownCast (slinri)->AddVertex(newptvtx);
                            //printf("\n ImpImpIntersection_0.gxx CAS1 \n");
                          }
                        }
-                       else if(OnFirst==Standard_False && (*((Handle(IntPatch_RLine)*)&slinri))->IsArcOnS2()) { 
-                         if(arcref == (*((Handle(IntPatch_RLine)*)&slinri))->ArcOnS2()) { 
-                           (*((Handle(IntPatch_RLine)*)&slinri))->AddVertex(newptvtx);
+                       else if(OnFirst==Standard_False && Handle(IntPatch_RLine)::DownCast (slinri)->IsArcOnS2()) { 
+                         if(arcref == Handle(IntPatch_RLine)::DownCast (slinri)->ArcOnS2()) { 
+                           Handle(IntPatch_RLine)::DownCast (slinri)->AddVertex(newptvtx);
                            //printf("\n ImpImpIntersection_0.gxx CAS2 \n");
                          }
                        }
@@ -1988,10 +1988,10 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
                newptvtx.SetMultiple(Standard_True);
                
                if (typ2 == IntPatch_Analytic) {
-                 (*((Handle(IntPatch_ALine)*)&slinj))->Replace(k,Ptvtx);
+                 Handle(IntPatch_ALine)::DownCast (slinj)->Replace(k,Ptvtx);
                }
                else {
-                 (*((Handle(IntPatch_GLine)*)&slinj))->Replace(k,Ptvtx);
+                 Handle(IntPatch_GLine)::DownCast (slinj)->Replace(k,Ptvtx);
                }
 
                if (Ptvtx.IsOnDomS1() || Ptvtx.IsOnDomS2()) {
@@ -2039,7 +2039,7 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
                  }
                } //-- if (Ptvtx.IsOnDomS1() || Ptvtx.IsOnDomS2())
 
-               (*((Handle(IntPatch_RLine)*)&slini))->AddVertex(newptvtx);
+               Handle(IntPatch_RLine)::DownCast (slini)->AddVertex(newptvtx);
 
              } //-- if (keeppoint)
            } //-- if ((OnFirst && !Ptvtx.IsOnDomS1())||(!OnFirst && !Ptvtx.IsOnDomS2()))
index 398a33e6c7d4a329ca67ee38ef79dcdf2ec996c7..b9e75300193b7d30a0a62e29b6178e08412b4cf8 100644 (file)
@@ -2893,8 +2893,7 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
   {
     for(Standard_Integer aNbLin = 1; aNbLin <= theSlin.Length(); aNbLin++)
     {
-      const Handle(IntPatch_WLine)& aWLine1 = 
-                Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNbLin));
+      Handle(IntPatch_WLine) aWLine1 (Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNbLin)));
 
       const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1);
       const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aWLine1->NbPnts());
index 4f9c2b0f067d30d8fb659ae759b6720e5cb35d81..916f6b8afe763f840e68cbeaf5e180f53276ccb2 100644 (file)
@@ -966,7 +966,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
     for (Standard_Integer j=1; j<=Nblines-1; j++) {
       dofirst = dolast = Standard_False;
       const  Handle(IntPatch_Line)& slinj = slin(j);
-      const Handle(IntPatch_WLine)& wlin1 = *((Handle(IntPatch_WLine)*)&slinj);
+      Handle(IntPatch_WLine) wlin1 (Handle(IntPatch_WLine)::DownCast (slinj));
       if (wlin1->HasFirstPoint()) {
         ptdeb = wlin1->FirstPoint(indfirst);
         if (ptdeb.IsTangencyPoint()) {
@@ -983,7 +983,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
       if (dofirst || dolast) {
         for (Standard_Integer k=j+1; k<=Nblines;k++) {
           const  Handle(IntPatch_Line)& slink = slin(k);
-          const  Handle(IntPatch_WLine)& wlin2 = *((Handle(IntPatch_WLine)*)&slink);
+          Handle(IntPatch_WLine) wlin2 (Handle(IntPatch_WLine)::DownCast (slink));
           if (wlin2->HasFirstPoint()) {
             ptbis = wlin2->FirstPoint(ind2);
             if (ptbis.IsTangencyPoint()) {
@@ -1281,27 +1281,27 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
           const Handle(IntPatch_Line)& slinj = slin(j);
           typ = slinj->ArcType();
           if (typ == IntPatch_Walking) {
-            Nbpts = (*((Handle(IntPatch_WLine)*)&slinj))->NbVertex();
+            Nbpts = Handle(IntPatch_WLine)::DownCast (slinj)->NbVertex();
           }
           else {
-            Nbpts = (*((Handle(IntPatch_RLine)*)&slinj))->NbVertex();
+            Nbpts = Handle(IntPatch_RLine)::DownCast (slinj)->NbVertex();
           }
           for (Standard_Integer k=1; k<=Nbpts;k++) {
             if (typ == IntPatch_Walking) {
-              ptdeb = (*((Handle(IntPatch_WLine)*)&slinj))->Vertex(k);
+              ptdeb = Handle(IntPatch_WLine)::DownCast (slinj)->Vertex(k);
             }
             else {
-              ptdeb = (*((Handle(IntPatch_RLine)*)&slinj))->Vertex(k);
+              ptdeb = Handle(IntPatch_RLine)::DownCast (slinj)->Vertex(k);
             }
             if (dofirst) {
 
               if (ptdeb.Value().Distance(PStartf.Value()) <=TolArc) {
                 ptdeb.SetMultiple(Standard_True);
                 if (typ == IntPatch_Walking) {
-                  (*((Handle(IntPatch_WLine)*)&slinj))->Replace(k,ptdeb);
+                  Handle(IntPatch_WLine)::DownCast (slinj)->Replace(k,ptdeb);
                 }
                 else {
-                  (*((Handle(IntPatch_RLine)*)&slinj))->Replace(k,ptdeb);
+                  Handle(IntPatch_RLine)::DownCast (slinj)->Replace(k,ptdeb);
                 }
                 ptdeb.SetParameter(paramf);
                 rline->AddVertex(ptdeb);
@@ -1314,19 +1314,19 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
             if (dolast) {
               if(dofirst) { //-- on recharge le ptdeb
                 if (typ == IntPatch_Walking) {
-                  ptdeb = (*((Handle(IntPatch_WLine)*)&slinj))->Vertex(k);
+                  ptdeb = Handle(IntPatch_WLine)::DownCast (slinj)->Vertex(k);
                 }
                 else {
-                  ptdeb = (*((Handle(IntPatch_RLine)*)&slinj))->Vertex(k);
+                  ptdeb = Handle(IntPatch_RLine)::DownCast (slinj)->Vertex(k);
                 }
               }
               if (ptdeb.Value().Distance(PStartl.Value()) <=TolArc) {
                 ptdeb.SetMultiple(Standard_True);
                 if (typ == IntPatch_Walking) {
-                  (*((Handle(IntPatch_WLine)*)&slinj))->Replace(k,ptdeb);
+                  Handle(IntPatch_WLine)::DownCast (slinj)->Replace(k,ptdeb);
                 }
                 else {
-                  (*((Handle(IntPatch_RLine)*)&slinj))->Replace(k,ptdeb);
+                  Handle(IntPatch_RLine)::DownCast (slinj)->Replace(k,ptdeb);
                 }
                 ptdeb.SetParameter(paraml);
                 rline->AddVertex(ptdeb);
@@ -2244,7 +2244,7 @@ static void PutIntVertices(Handle(IntPatch_Line)&    Line,
   if(nbp < 3)
     return;
 
-  Handle(IntPatch_WLine)& WLine = (*((Handle(IntPatch_WLine)*)&Line));
+  Handle(IntPatch_WLine)& WLine = Handle(IntPatch_WLine)::DownCast (Line);
   Standard_Integer ip = 0, iv = 0;
   gp_Pnt aPnt;
   IntPatch_Point thePnt;
@@ -2388,7 +2388,7 @@ static Standard_Boolean DecomposeResult(const Handle(IntPatch_Line)& theLine,
     return Standard_False;
   }
 
-  const Handle(IntPatch_WLine)& aWLine = (*((Handle(IntPatch_WLine)*)&theLine));
+  Handle(IntPatch_WLine) aWLine (Handle(IntPatch_WLine)::DownCast (theLine));
   const Handle(IntSurf_LineOn2S)& aSLine = aWLine->Curve();
 
   if(aSLine->NbPoints() <= 2)
index c9a02f4e20e870bda6bd84d711560ec6e765dc53..a9ceb7696b17dae60793adabf36d0b968424b02d 100644 (file)
@@ -104,7 +104,7 @@ static void JoinWLines(IntPatch_SequenceOfLine& theSlin,
 
   for(Standard_Integer aNumOfLine1 = 1; aNumOfLine1 <= theSlin.Length(); aNumOfLine1++)
   {
-    const Handle(IntPatch_WLine)& aWLine1 = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine1));
+    Handle(IntPatch_WLine) aWLine1 (Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine1)));
 
     if(aWLine1.IsNull())
     {//We must have failed to join not-point-lines
@@ -130,7 +130,7 @@ static void JoinWLines(IntPatch_SequenceOfLine& theSlin,
     Standard_Boolean hasBeenRemoved = Standard_False;
     for(Standard_Integer aNumOfLine2 = aNumOfLine1 + 1; aNumOfLine2 <= theSlin.Length(); aNumOfLine2++)
     {
-      const Handle(IntPatch_WLine)& aWLine2 = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine2));
+      Handle(IntPatch_WLine) aWLine2 (Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine2)));
 
       const Standard_Integer aNbPntsWL1 = aWLine1->NbPnts();
       const Standard_Integer aNbPntsWL2 = aWLine2->NbPnts();
@@ -518,7 +518,7 @@ static void FUN_GetUiso(const Handle(Geom_Surface)& GS,
   }
   else//OffsetSurface
   {
-    const Handle(Geom_OffsetSurface) gos = *(Handle(Geom_OffsetSurface)*)&GS;
+    const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (GS);
     const Handle(Geom_Surface) bs = gos->BasisSurface();
     Handle(Geom_Curve) gcbs = bs->UIso(U);
     GeomAdaptor_Curve gac(gcbs);
@@ -588,7 +588,7 @@ static void FUN_GetViso(const Handle(Geom_Surface)& GS,
   }
   else//OffsetSurface
   {
-    const Handle(Geom_OffsetSurface) gos = *(Handle(Geom_OffsetSurface)*)&GS;
+    const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (GS);
     const Handle(Geom_Surface) bs = gos->BasisSurface();
     Handle(Geom_Curve) gcbs = bs->VIso(V);
     GeomAdaptor_Curve gac(gcbs);
@@ -663,7 +663,7 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1,
   else if(!S1->IsVPeriodic() && !S1->IsVClosed()) {
     if(T1 != GeomAbs_OffsetSurface) C1 = gs1->UIso(MS1[0]);
     else {
-      const Handle(Geom_OffsetSurface) gos = *(Handle(Geom_OffsetSurface)*)&gs1;
+      const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (gs1);
       const Handle(Geom_Surface) bs = gos->BasisSurface();
       C1 = bs->UIso(MS1[0]);
     }
@@ -673,7 +673,7 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1,
   if(!S1->IsUPeriodic() && !S1->IsUClosed()) {
     if(T1 != GeomAbs_OffsetSurface) C1 = gs1->VIso(MS1[1]);
     else {
-      const Handle(Geom_OffsetSurface) gos = *(Handle(Geom_OffsetSurface)*)&gs1;
+      const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (gs1);
       const Handle(Geom_Surface) bs = gos->BasisSurface();
       C1 = bs->VIso(MS1[1]);
     }
@@ -684,7 +684,7 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1,
   else if(!S2->IsVPeriodic() && !S2->IsVClosed()) {
     if(T2 != GeomAbs_OffsetSurface) C2 = gs2->UIso(MS2[0]);
     else {
-      const Handle(Geom_OffsetSurface) gos = *(Handle(Geom_OffsetSurface)*)&gs2;
+      const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (gs2);
       const Handle(Geom_Surface) bs = gos->BasisSurface();
       C2 = bs->UIso(MS2[0]);
     }
@@ -694,7 +694,7 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1,
   if(!S2->IsUPeriodic() && !S2->IsUClosed()) {
     if(T2 != GeomAbs_OffsetSurface) C2 = gs2->VIso(MS2[1]);
     else {
-      const Handle(Geom_OffsetSurface) gos = *(Handle(Geom_OffsetSurface)*)&gs2;
+      const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (gs2);
       const Handle(Geom_Surface) bs = gos->BasisSurface();
       C2 = bs->VIso(MS2[1]);
     }
@@ -760,9 +760,9 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1,
     GeomProjLib::ProjectOnPlane(C2,GPln,gp_Dir(DV),Standard_True);
   if(C1Prj.IsNull() || C2Prj.IsNull()) return;
   Handle(Geom2d_Curve) C1Prj2d =
-    GeomProjLib::Curve2d(C1Prj,*(Handle(Geom_Surface) *)&GPln);
+    GeomProjLib::Curve2d(C1Prj,Handle(Geom_Surface)::DownCast (GPln));
   Handle(Geom2d_Curve) C2Prj2d =
-    GeomProjLib::Curve2d(C2Prj,*(Handle(Geom_Surface) *)&GPln);
+    GeomProjLib::Curve2d(C2Prj,Handle(Geom_Surface)::DownCast (GPln));
   Geom2dAPI_InterCurveCurve ICC(C1Prj2d,C2Prj2d,1.0e-7);
   if(ICC.NbPoints() > 0 )
   {
@@ -864,14 +864,14 @@ static void FUN_TrimBothSurf(const Handle(Adaptor3d_HSurface)& S1,
   if(T1 != GeomAbs_OffsetSurface){ visoS1 = gs1->VIso(VM1); uisoS1 = gs1->UIso(UM1); }
   else
   {
-    const Handle(Geom_OffsetSurface) gos = *(Handle(Geom_OffsetSurface)*)&gs1;
+    const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (gs1);
     const Handle(Geom_Surface) bs = gos->BasisSurface();
     visoS1 = bs->VIso(VM1); uisoS1 = bs->UIso(UM1);
   }
   if(T2 != GeomAbs_OffsetSurface){ visoS2 = gs2->VIso(VM2); uisoS2 = gs2->UIso(UM2); }
   else
   {
-    const Handle(Geom_OffsetSurface) gos = *(Handle(Geom_OffsetSurface)*)&gs2;
+    const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (gs2);
     const Handle(Geom_Surface) bs = gos->BasisSurface();
     visoS2 = bs->VIso(VM2); uisoS2 = bs->UIso(UM2);
   }
@@ -1451,7 +1451,7 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_HSurface)&
         {
           gp_Lin lin(sop.Value(ip),gp_Dir(v));
           Handle(IntPatch_GLine) gl = new IntPatch_GLine(lin,Standard_False);
-          slin.Append(*(Handle(IntPatch_Line) *)&gl);
+          slin.Append(Handle(IntPatch_Line)::DownCast (gl));
         }
 
         done = Standard_True;
@@ -1635,7 +1635,7 @@ void IntPatch_Intersection::
         {
           gp_Lin lin(sop.Value(ip),gp_Dir(v));
           Handle(IntPatch_GLine) gl = new IntPatch_GLine(lin,Standard_False);
-          slin.Append(*(Handle(IntPatch_Line) *)&gl);
+          slin.Append(Handle(IntPatch_Line)::DownCast (gl));
         }
 
         done = Standard_True;
@@ -1901,7 +1901,7 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
     else     if(IType == IntPatch_Restriction) { 
       nbr++;
       Handle(IntPatch_RLine)& rlin =
-        *((Handle(IntPatch_RLine) *)&line);
+        Handle(IntPatch_RLine)::DownCast (line);
       if(rlin->IsArcOnS1()) nbr1++;
       if(rlin->IsArcOnS2()) nbr2++;
     }
@@ -1938,7 +1938,7 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
       const Handle(IntPatch_Line)& LineK = LineConstructor.Line(k);
       if (LineK->ArcType() == IntPatch_Analytic) { 
         Handle(IntPatch_ALine)& alin =
-          *((Handle(IntPatch_ALine) *)&LineK);
+          Handle(IntPatch_ALine)::DownCast (LineK);
         nbvtx=alin->NbVertex();
         nbva+=nbvtx;        nba++;
         for(v=1;v<=nbvtx;v++) { 
@@ -1947,7 +1947,7 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
       }
       else if (LineK->ArcType() == IntPatch_Restriction) {
         Handle(IntPatch_RLine)& rlin =
-          *((Handle(IntPatch_RLine) *)&LineK);
+          Handle(IntPatch_RLine)::DownCast (LineK);
         nbvtx=rlin->NbVertex();
         nbvr+=nbvtx;        nbr++;
         for(v=1;v<=nbvtx;v++) { 
@@ -1956,7 +1956,7 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
       }
       else if (LineK->ArcType() == IntPatch_Walking) {
         Handle(IntPatch_WLine)& wlin =
-          *((Handle(IntPatch_WLine) *)&LineK);
+          Handle(IntPatch_WLine)::DownCast (LineK);
         nbvtx=wlin->NbVertex();
         nbvw+=nbvtx;        nbw++;
         for(v=1;v<=nbvtx;v++) { 
@@ -1965,7 +1965,7 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
       }
       else { 
         Handle(IntPatch_GLine)& glin =
-          *((Handle(IntPatch_GLine) *)&LineK);
+          Handle(IntPatch_GLine)::DownCast (LineK);
         nbvtx=glin->NbVertex();
         nbvg+=nbvtx;        nbg++;
         for(v=1;v<=nbvtx;v++) { 
index c388b2afb7ce505e9d578c1bd363e109a41c4f59..fa0191bca2a10409de2e87f62896fc8fa90c5ea0 100644 (file)
@@ -199,7 +199,7 @@ static Standard_Real LocalFirstParameter (const Handle(IntPatch_Line)& L)
   switch (typl) {
   case IntPatch_Analytic:
     {
-      Handle(IntPatch_ALine)& alin = *((Handle(IntPatch_ALine) *)&L);
+      Handle(IntPatch_ALine)& alin = Handle(IntPatch_ALine)::DownCast (L);
       if (alin->HasFirstPoint()) {
        firstp = alin->FirstPoint().ParameterOnLine();
       }
@@ -215,7 +215,7 @@ static Standard_Real LocalFirstParameter (const Handle(IntPatch_Line)& L)
 
   case IntPatch_Restriction:
     {
-      Handle(IntPatch_RLine)& rlin = *((Handle(IntPatch_RLine) *)&L);
+      Handle(IntPatch_RLine)& rlin = Handle(IntPatch_RLine)::DownCast (L);
       if (rlin->HasFirstPoint()) {
        firstp = rlin->FirstPoint().ParameterOnLine();
       }
@@ -227,7 +227,7 @@ static Standard_Real LocalFirstParameter (const Handle(IntPatch_Line)& L)
    case IntPatch_Walking:
     {
       
-      Handle(IntPatch_WLine)& wlin = *((Handle(IntPatch_WLine) *) &L);
+      Handle(IntPatch_WLine)& wlin = Handle(IntPatch_WLine)::DownCast (L);
       if (wlin->HasFirstPoint()) {
        firstp = wlin->FirstPoint().ParameterOnLine();
       }
@@ -239,7 +239,7 @@ static Standard_Real LocalFirstParameter (const Handle(IntPatch_Line)& L)
        
   default:
     {
-      Handle(IntPatch_GLine)& glin = *((Handle(IntPatch_GLine) *)&L);
+      Handle(IntPatch_GLine)& glin = Handle(IntPatch_GLine)::DownCast (L);
       if (glin->HasFirstPoint()) {
        firstp = glin->FirstPoint().ParameterOnLine();
       }
@@ -278,7 +278,7 @@ static Standard_Real LocalLastParameter (const Handle(IntPatch_Line)& L)
   switch (typl) {
   case IntPatch_Analytic:
     {
-      Handle(IntPatch_ALine)& alin = *((Handle(IntPatch_ALine) *)&L);
+      Handle(IntPatch_ALine)& alin = Handle(IntPatch_ALine)::DownCast (L);
 
       if (alin->HasLastPoint()) {
        lastp = alin->LastPoint().ParameterOnLine();
@@ -295,7 +295,7 @@ static Standard_Real LocalLastParameter (const Handle(IntPatch_Line)& L)
 
   case IntPatch_Restriction:
     {
-      Handle(IntPatch_RLine)& rlin = *((Handle(IntPatch_RLine) *)&L);
+      Handle(IntPatch_RLine)& rlin = Handle(IntPatch_RLine)::DownCast (L);
       
       if (rlin->HasLastPoint()) {
        lastp = rlin->LastPoint().ParameterOnLine();
@@ -307,7 +307,7 @@ static Standard_Real LocalLastParameter (const Handle(IntPatch_Line)& L)
     }
    case IntPatch_Walking:
     {
-      Handle(IntPatch_WLine)& wlin = *((Handle(IntPatch_WLine) *)&L);
+      Handle(IntPatch_WLine)& wlin = Handle(IntPatch_WLine)::DownCast (L);
 
       if (wlin->HasLastPoint()) {
        lastp = wlin->LastPoint().ParameterOnLine();
@@ -320,7 +320,7 @@ static Standard_Real LocalLastParameter (const Handle(IntPatch_Line)& L)
        
   default:
     {
-      Handle(IntPatch_GLine)& glin = *((Handle(IntPatch_GLine) *)&L);
+      Handle(IntPatch_GLine)& glin = Handle(IntPatch_GLine)::DownCast (L);
       
       if (glin->HasLastPoint()) {
        lastp = glin->LastPoint().ParameterOnLine();
@@ -562,7 +562,7 @@ static void AddLine(const Handle(IntPatch_Line)& L,
   IntPatch_IType typl = L->ArcType();
   switch (typl) {
     case IntPatch_Analytic: { 
-      Handle(IntPatch_ALine)& ALine = *((Handle(IntPatch_ALine) *)&L);
+      Handle(IntPatch_ALine)& ALine = Handle(IntPatch_ALine)::DownCast (L);
       Handle(IntPatch_ALine) alig;
       if(L->TransitionOnS1() == IntSurf_Undecided)
        alig = new IntPatch_ALine(ALine->Curve(),L->IsTangent());
@@ -582,7 +582,7 @@ static void AddLine(const Handle(IntPatch_Line)& L,
       break;
     }
     case IntPatch_Walking: {  //-- ****************************************
-      Handle(IntPatch_WLine)& WLine = *((Handle(IntPatch_WLine) *)&L);
+      Handle(IntPatch_WLine)& WLine = Handle(IntPatch_WLine)::DownCast (L);
       const Handle(IntSurf_LineOn2S)& Lori = WLine->Curve();
       Handle(IntSurf_LineOn2S) LineOn2S = new IntSurf_LineOn2S();
       Standard_Integer ParamMinOnLine = (Standard_Integer) WLine->Vertex(i).ParameterOnLine();   
@@ -623,7 +623,7 @@ static void AddLine(const Handle(IntPatch_Line)& L,
       break;
     }
     case IntPatch_Restriction: { 
-      Handle(IntPatch_RLine)& RLine = *((Handle(IntPatch_RLine) *)&L);
+      Handle(IntPatch_RLine)& RLine = Handle(IntPatch_RLine)::DownCast (L);
       IndexLastVertex=2;
       IndexFirstVertex=1;
       Handle(IntPatch_RLine) rlig;
@@ -661,7 +661,7 @@ static void AddLine(const Handle(IntPatch_Line)& L,
     case IntPatch_Hyperbola:
     case IntPatch_Circle:
     case IntPatch_Ellipse: { 
-      Handle(IntPatch_GLine)& GLine = *((Handle(IntPatch_GLine) *)&L);
+      Handle(IntPatch_GLine)& GLine = Handle(IntPatch_GLine)::DownCast (L);
       Handle(IntPatch_GLine) glig;
       switch (typl) {
       case IntPatch_Lin:
@@ -1195,7 +1195,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref,
   if(typl == IntPatch_Analytic) { 
     Standard_Real u1,v1,u2,v2;
     Handle(IntPatch_ALine)& ALine 
-      =  *((Handle(IntPatch_ALine) *)&L);
+      =  Handle(IntPatch_ALine)::DownCast (L);
     slin.Clear();
     nbvtx = ALine->NbVertex();
     //-- -------------------------------------------------------------------
@@ -1248,7 +1248,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref,
   else if(typl == IntPatch_Walking) { 
     Standard_Real u1,v1,u2,v2;
     Handle(IntPatch_WLine)& WLine 
-      =  *((Handle(IntPatch_WLine) *)&L);
+      =  Handle(IntPatch_WLine)::DownCast (L);
     slin.Clear();
     nbvtx = WLine->NbVertex();
     //-- -------------------------------------------------------------------
@@ -1408,7 +1408,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref,
   else if (typl != IntPatch_Restriction) { // JAG 01.07.96
     Standard_Real u1,v1,u2,v2;
     Handle(IntPatch_GLine)& GLine 
-      =  *((Handle(IntPatch_GLine) *)&L);
+      =  Handle(IntPatch_GLine)::DownCast (L);
     slin.Clear();
     nbvtx = GLine->NbVertex();
     //-- -------------------------------------------------------------------
@@ -1540,7 +1540,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref,
   }
   else {  //-- Restriction
     Handle(IntPatch_RLine)& RLine 
-      =  *((Handle(IntPatch_RLine) *)&L);
+      =  Handle(IntPatch_RLine)::DownCast (L);
     slin.Clear();
     Standard_Integer NbVtx    = RLine->NbVertex();
     Standard_Boolean RestOnS1 = RLine->IsArcOnS1();
index 8d07c7b2df76033b1ce0af1203f794c52b66e153..5b0fef39365e403b5e40dacf5149511442f792a2 100644 (file)
@@ -1621,7 +1621,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
                     IntPatch_IType aType = aSLine->ArcType();
                     if( aType != IntPatch_Walking)
                       continue;
-                    const Handle(IntPatch_WLine)&  aWLine = (*((Handle(IntPatch_WLine)*)&aSLine));
+                    Handle(IntPatch_WLine) aWLine (Handle(IntPatch_WLine)::DownCast (aSLine));
                     Standard_Integer tnbV = aWLine->NbVertex();
                     Standard_Integer tiV;
                     for( tiV = 1; tiV <= tnbV; tiV++ ) {
@@ -1645,7 +1645,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
 
                   if( VDMin != 0 ) {
                     const Handle(IntPatch_Line)& aSLine = SLin.Value(WLDMin);
-                    const Handle(IntPatch_WLine)&  aWLine = (*((Handle(IntPatch_WLine)*)&aSLine));
+                    Handle(IntPatch_WLine) aWLine (Handle(IntPatch_WLine)::DownCast (aSLine));
                     Standard_Integer tiVpar = (Standard_Integer)aWLine->Vertex(VDMin).ParameterOnLine();
                     Standard_Integer ciVpar = (Standard_Integer)wline->Vertex(ciV).ParameterOnLine();
                     Standard_Real u11 = 0., u12 = 0., v11 = 0., v12 = 0.;
@@ -2441,7 +2441,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
                             IntPatch_IType aType = aSLine->ArcType();
                             if( aType != IntPatch_Walking)
                               continue;
-                            const Handle(IntPatch_WLine)&  aWLine = (*((Handle(IntPatch_WLine)*)&aSLine));
+                            Handle(IntPatch_WLine) aWLine (Handle(IntPatch_WLine)::DownCast (aSLine));
                             Standard_Integer tnbV = aWLine->NbVertex();
                             Standard_Integer tiV;
                             for( tiV = 1; tiV <= tnbV; tiV++ )
@@ -2469,7 +2469,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
                           if( VDMin != 0 )
                           {
                             const Handle(IntPatch_Line)& aSLine = SLin.Value(WLDMin);
-                            const Handle(IntPatch_WLine)&  aWLine = (*((Handle(IntPatch_WLine)*)&aSLine));
+                            Handle(IntPatch_WLine) aWLine (Handle(IntPatch_WLine)::DownCast (aSLine));
                             Standard_Integer tiVpar = (Standard_Integer)aWLine->Vertex(VDMin).ParameterOnLine();
                             Standard_Integer ciVpar = (Standard_Integer)wline->Vertex(ciV).ParameterOnLine();
                             Standard_Real u11 = 0., u12 = 0., v11 = 0., v12 = 0.;
index 2b34977076f0acce3d1a6cb2f0f01b9c1563eb6b..bae5084e5c68703a17bf37555356c91f2cb0d294 100644 (file)
@@ -286,8 +286,8 @@ static Standard_Boolean FindParameter(const Handle(IntPatch_Line)& L,
   // Dans le cas d une ligne de cheminement, il faudrait voir la projection
   // et le calcul de la tangente.
 
-  const Handle(IntPatch_RLine)&  rlin = (*((Handle(IntPatch_RLine)*)&L)); //-- aucune verification n est 
-  const Handle(IntPatch_WLine)&  wlin = (*((Handle(IntPatch_WLine)*)&L)); //-- faite au cast. 
+  Handle(IntPatch_RLine) rlin (Handle(IntPatch_RLine)::DownCast (L)); //-- aucune verification n est 
+  Handle(IntPatch_WLine) wlin (Handle(IntPatch_WLine)::DownCast (L)); //-- faite au cast. 
   gp_Pnt ptbid;
   gp_Vec d1u,d1v;
   gp_Pnt2d p2d;
@@ -462,8 +462,8 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
   Standard_Integer i,j,k;
   TColgp_SequenceOfPnt locpt;
   TColgp_SequenceOfPnt2d locpt2;
-  const Handle(IntPatch_RLine)&  rlin = (*((Handle(IntPatch_RLine)*)&L)); //-- aucune verification n est 
-  const Handle(IntPatch_WLine)&  wlin = (*((Handle(IntPatch_WLine)*)&L)); //-- faite au cast. 
+  Handle(IntPatch_RLine) rlin (Handle(IntPatch_RLine)::DownCast (L)); //-- aucune verification n est 
+  Handle(IntPatch_WLine) wlin (Handle(IntPatch_WLine)::DownCast (L)); //-- faite au cast. 
   Standard_Integer Nbvtx =0; 
   Standard_Integer Nbptlin =0;
   Standard_Real tolPLin = Surf->UResolution(Precision::Confusion());
index 580a27173652246b695284d1301572984a09620e..6f44247662004ab3cc6bb767fcd1e64852cc5620 100644 (file)
@@ -1303,10 +1303,10 @@ Standard_Real ResolutionCoeff(const BRepAdaptor_Curve& theBAC,
   //
   switch (aCurveType) {
   case GeomAbs_Circle :
-    aResCoeff = 1. / (2 * (*((Handle(Geom_Circle)*)&aCurve))->Circ().Radius());
+    aResCoeff = 1. / (2 * Handle(Geom_Circle)::DownCast (aCurve)->Circ().Radius());
     break;
   case GeomAbs_Ellipse :
-    aResCoeff =  1. / (*((Handle(Geom_Ellipse)*)&aCurve))->MajorRadius();
+    aResCoeff =  1. / Handle(Geom_Ellipse)::DownCast (aCurve)->MajorRadius();
     break;
   case GeomAbs_Hyperbola :
   case GeomAbs_Parabola : 
@@ -1365,10 +1365,10 @@ Standard_Real Resolution(const Handle(Geom_Curve)& theCurve,
     break;
   }
   case GeomAbs_BezierCurve:
-    (*((Handle(Geom_BezierCurve)*)&theCurve))->Resolution(theR3D, aRes);
+    Handle(Geom_BezierCurve)::DownCast (theCurve)->Resolution(theR3D, aRes);
     break;
   case GeomAbs_BSplineCurve:
-    (*((Handle(Geom_BSplineCurve)*)&theCurve))->Resolution(theR3D, aRes);
+    Handle(Geom_BSplineCurve)::DownCast (theCurve)->Resolution(theR3D, aRes);
     break;
   default:
     aRes = theResCoeff * theR3D;
index 40cebc23b58e39c529d13ea372db201405ab0abb..07854603a23fc3f38347ec8138411a7be5f2f1ff 100644 (file)
@@ -963,8 +963,7 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
     //
     const IntTools_Curve& aIC=mySeqOfCurve(1);
     const Handle(Geom_Curve)& aC3D=aIC.Curve();
-    const Handle(Geom_BSplineCurve)& aBS=
-      Handle(Geom_BSplineCurve)::DownCast(aC3D);
+    Handle(Geom_BSplineCurve) aBS (Handle(Geom_BSplineCurve)::DownCast(aC3D));
     if (aBS.IsNull()) {
       return;
     }
@@ -1061,8 +1060,7 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
   if(typl==IntPatch_Walking) {
     Handle(IntPatch_Line) anewL;
     //
-    const Handle(IntPatch_WLine)& aWLine=
-      Handle(IntPatch_WLine)::DownCast(L);
+    Handle(IntPatch_WLine) aWLine (Handle(IntPatch_WLine)::DownCast(L));
     //DumpWLine(aWLine);
 
     anewL = ComputePurgedWLine(aWLine);
@@ -1071,7 +1069,7 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
     }
     L = anewL;
     
-    //const Handle(IntPatch_WLine)& aWLineX = Handle(IntPatch_WLine)::DownCast(L);
+    //Handle(IntPatch_WLine) aWLineX (Handle(IntPatch_WLine)::DownCast(L));
     //DumpWLine(aWLineX);
 
     //
index ffb99f0c341de92c956d04e89e976d94343fa794..4c0237b909bcca3f3dd13570e42b261eaeebaf17 100644 (file)
@@ -61,11 +61,11 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
     Cf = BRep_Tool::Curve(edgf,Loc,ff,lf);
     if (!Loc.IsIdentity()) {
       Handle(Geom_Geometry) GGf = Cf->Transformed(Loc.Transformation());
-      Cf = *((Handle(Geom_Curve)*)&GGf);
+      Cf = Handle(Geom_Curve)::DownCast (GGf);
     }
     Tf = Cf->DynamicType();
     if (Tf == STANDARD_TYPE(Geom_TrimmedCurve)) {
-      Cf = (*((Handle(Geom_TrimmedCurve)*)&Cf))->BasisCurve();
+      Cf = Handle(Geom_TrimmedCurve)::DownCast (Cf)->BasisCurve();
       Tf = Cf->DynamicType();
     }
     if (Tf != STANDARD_TYPE(Geom_Line) && Tf != STANDARD_TYPE(Geom_Circle) &&
@@ -78,11 +78,11 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
       Ct = BRep_Tool::Curve(edgt,Loc,ft,lt);
       if (!Loc.IsIdentity()) {
        Handle(Geom_Geometry) GGt = Ct->Transformed(Loc.Transformation());
-       Ct = *((Handle(Geom_Curve)*)&GGt);
+       Ct = Handle(Geom_Curve)::DownCast (GGt);
       }
       Tt = Ct->DynamicType();
       if (Tt == STANDARD_TYPE(Geom_TrimmedCurve)) {
-       Ct = (*((Handle(Geom_TrimmedCurve)*)&Ct))->BasisCurve();
+       Ct = Handle(Geom_TrimmedCurve)::DownCast (Ct)->BasisCurve();
        Tt = Ct->DynamicType();
       }
       if (Tt != Tf) {
@@ -91,8 +91,8 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
       // On a presomption de confusion
       Standard_Real Tol = Precision::Confusion();
       if (Tt == STANDARD_TYPE(Geom_Line)) {
-       gp_Lin lif = (*((Handle(Geom_Line)*)&Cf))->Lin();
-       gp_Lin lit = (*((Handle(Geom_Line)*)&Ct))->Lin();
+       gp_Lin lif = Handle(Geom_Line)::DownCast (Cf)->Lin();
+       gp_Lin lit = Handle(Geom_Line)::DownCast (Ct)->Lin();
        gp_Pnt p1 = ElCLib::Value(ff,lif);
        gp_Pnt p2 = ElCLib::Value(lf,lif);
        Standard_Real prm1 = ElCLib::Parameter(lit,p1);
@@ -112,8 +112,8 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
        }
       }
       else if (Tt == STANDARD_TYPE(Geom_Circle)) {
-       gp_Circ cif = (*((Handle(Geom_Circle)*)&Cf))->Circ();
-       gp_Circ cit = (*((Handle(Geom_Circle)*)&Ct))->Circ();
+       gp_Circ cif = Handle(Geom_Circle)::DownCast (Cf)->Circ();
+       gp_Circ cit = Handle(Geom_Circle)::DownCast (Ct)->Circ();
        if (Abs(cif.Radius()-cit.Radius()) <= Tol &&
            cif.Location().SquareDistance(cit.Location()) <= Tol*Tol) {
          // Point debut, calage dans periode, et detection meme sens
@@ -163,8 +163,8 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
        }
       }
       else if (Tt == STANDARD_TYPE(Geom_Ellipse)) {
-       gp_Elips cif = (*((Handle(Geom_Ellipse)*)&Cf))->Elips();
-       gp_Elips cit = (*((Handle(Geom_Ellipse)*)&Ct))->Elips();
+       gp_Elips cif = Handle(Geom_Ellipse)::DownCast (Cf)->Elips();
+       gp_Elips cit = Handle(Geom_Ellipse)::DownCast (Ct)->Elips();
        
 
        if (Abs(cif.MajorRadius()-cit.MajorRadius()) <= Tol &&
@@ -213,8 +213,8 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
        }
       }
       else if (Tt == STANDARD_TYPE(Geom_BSplineCurve)) {
-       Handle(Geom_BSplineCurve) Bf = *((Handle(Geom_BSplineCurve)*)&Cf);
-       Handle(Geom_BSplineCurve) Bt = *((Handle(Geom_BSplineCurve)*)&Ct);
+       Handle(Geom_BSplineCurve) Bf = Handle(Geom_BSplineCurve)::DownCast (Cf);
+       Handle(Geom_BSplineCurve) Bt = Handle(Geom_BSplineCurve)::DownCast (Ct);
 
        Standard_Boolean IsSame = Standard_True;
 
@@ -299,8 +299,8 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
        }
       }
       else if (Tt == STANDARD_TYPE(Geom_BezierCurve)) {
-       Handle(Geom_BezierCurve) Bf = *((Handle(Geom_BezierCurve)*)&Cf);
-       Handle(Geom_BezierCurve) Bt = *((Handle(Geom_BezierCurve)*)&Ct);
+       Handle(Geom_BezierCurve) Bf = Handle(Geom_BezierCurve)::DownCast (Cf);
+       Handle(Geom_BezierCurve) Bt = Handle(Geom_BezierCurve)::DownCast (Ct);
 
        Standard_Boolean IsSame = Standard_True;
 
index d2088d58409a3534c7535a20a64c5be3137b11e2..4afda272f7e793f5a3ad84ad8f0e20bfb324f357 100644 (file)
@@ -472,7 +472,7 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G)
     newface.Orientation(TopAbs_FORWARD);
     S = BRep_Tool::Surface(fac);
     if (S->DynamicType()== STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-      S = (*((Handle(Geom_RectangularTrimmedSurface)*)&S))->BasisSurface();
+      S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
     }
     P = Handle(Geom_Plane)::DownCast(S);
     TopoDS_Wire wir;
@@ -548,10 +548,10 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G)
                    C = BRep_Tool::Curve(edg,loc,f,l);
                    if (!loc.IsIdentity()) {
                      Handle(Geom_Geometry) GG = C->Transformed(loc.Transformation());
-                     C = *((Handle(Geom_Curve)*)&GG);
+                     C = Handle(Geom_Curve)::DownCast (GG);
                    }
                    if (C->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) {
-                     C = (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve();
+                     C = Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve();
                    }
                    
                    Handle(Geom2d_Curve) C2d = GeomProjLib::Curve2d(C,f,l,S,tol);
@@ -613,10 +613,10 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G)
            C = BRep_Tool::Curve(newedg,loc,f,l);
            if (!loc.IsIdentity()) {
              Handle(Geom_Geometry) GG = C->Transformed(loc.Transformation());
-             C = *((Handle(Geom_Curve)*)&GG);
+             C = Handle(Geom_Curve)::DownCast (GG);
            }
            if (C->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) {
-             C = (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve();
+             C = Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve();
            }
            if (P.IsNull()) { // on met les courbes 2d si on n`est pas 
                              // sur un plan
@@ -707,10 +707,10 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G)
                  C = BRep_Tool::Curve(edgbis,loc,f,l);
                  if (!loc.IsIdentity()) {
                    Handle(Geom_Geometry) GG = C->Transformed(loc.Transformation());
-                   C = *((Handle(Geom_Curve)*)&GG);
+                   C = Handle(Geom_Curve)::DownCast (GG);
                  }
                  if (C->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) {
-                   C = (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve();
+                   C = Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve();
                  }
                  prmvt = 
                    BRep_Tool::Parameter(TopoDS::Vertex(it1.Value()),edgbis);
@@ -864,10 +864,10 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G)
                  C = BRep_Tool::Curve(edg,loc,f,l);
                  if (!loc.IsIdentity()) {
                    Handle(Geom_Geometry) GG = C->Transformed(loc.Transformation());
-                   C = *((Handle(Geom_Curve)*)&GG);
+                   C = Handle(Geom_Curve)::DownCast (GG);
                  }
                  if (C->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) {
-                   C =  (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve();
+                   C =  Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve();
                  }
                  
                  C2d = GeomProjLib::Curve2d(C,f,l,S,tol);
@@ -1074,12 +1074,12 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
   typS2 = S2->DynamicType();
 
   if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S1 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S1))->BasisSurface();
+    S1 =  Handle(Geom_RectangularTrimmedSurface)::DownCast (S1)->BasisSurface();
     typS1 = S1->DynamicType();
   }
 
   if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S2 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S2))->BasisSurface();
+    S2 =  Handle(Geom_RectangularTrimmedSurface)::DownCast (S2)->BasisSurface();
     typS2 = S2->DynamicType();
   }
 
@@ -1091,8 +1091,8 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
   Standard_Boolean ValRet = Standard_False;
   if (typS1 == STANDARD_TYPE(Geom_Plane)) {
 
-    gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln());
-    gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln());
+    gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln());
+    gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln());
 
     pl1.Transform(loc1.Transformation());
     pl2.Transform(loc2.Transformation());
@@ -1129,24 +1129,24 @@ Standard_Boolean ToFuse(const TopoDS_Edge& E1,
   C1 = BRep_Tool::Curve(E1,loc1,f,l);
   if (!loc1.IsIdentity()) {
     Handle(Geom_Geometry) CC1 = C1->Transformed(loc1.Transformation());
-    C1 = *((Handle(Geom_Curve)*)&CC1);
+    C1 = Handle(Geom_Curve)::DownCast (CC1);
   }
 
   C2 = BRep_Tool::Curve(E2,loc2,f,l);
   if (!loc2.IsIdentity()) {
     Handle(Geom_Geometry) CC2 = C2->Transformed(loc2.Transformation());
-    C2 = *((Handle(Geom_Curve)*)&CC2);
+    C2 = Handle(Geom_Curve)::DownCast (CC2);
   }
 
   typC1 = C1->DynamicType();
   typC2 = C2->DynamicType();
 
   if (typC1 == STANDARD_TYPE(Geom_TrimmedCurve)) {
-    C1 =  (*((Handle(Geom_TrimmedCurve)*)&C1))->BasisCurve();
+    C1 =  Handle(Geom_TrimmedCurve)::DownCast (C1)->BasisCurve();
     typC1 = C1->DynamicType();
   }
   if (typC2 == STANDARD_TYPE(Geom_TrimmedCurve)) {
-    C2 =  (*((Handle(Geom_TrimmedCurve)*)&C2))->BasisCurve();
+    C2 =  Handle(Geom_TrimmedCurve)::DownCast (C2)->BasisCurve();
     typC2 = C2->DynamicType();
   }
 
@@ -1156,8 +1156,8 @@ Standard_Boolean ToFuse(const TopoDS_Edge& E1,
 
   Standard_Boolean ValRet = Standard_False;
   if (typC1 == STANDARD_TYPE(Geom_Line)) {
-    gp_Lin li1( (*((Handle(Geom_Line)*)&C1))->Lin());
-    gp_Lin li2( (*((Handle(Geom_Line)*)&C2))->Lin());
+    gp_Lin li1( Handle(Geom_Line)::DownCast (C1)->Lin());
+    gp_Lin li2( Handle(Geom_Line)::DownCast (C2)->Lin());
 
     if (li1.Position().IsCoaxial(li2.Position(),tolang,tollin)) {
       ValRet = Standard_True;
@@ -1216,20 +1216,20 @@ Standard_Real NewParameter(const TopoDS_Edge& Edg,
   C = BRep_Tool::Curve(Edg,loc,f,l);
   if (!loc.IsIdentity()) {
     Handle(Geom_Geometry) GG = C->Transformed(loc.Transformation());
-    C = *((Handle(Geom_Curve)*)&GG);
+    C = Handle(Geom_Curve)::DownCast (GG);
   }
   typC = C->DynamicType();
   if (typC == STANDARD_TYPE(Geom_TrimmedCurve)) {
-    C =  (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve();
+    C =  Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve();
     typC = C->DynamicType();
   }
 
   if (typC == STANDARD_TYPE(Geom_Line)) {
-    return ElCLib::Parameter( (*((Handle(Geom_Line)*)&C))->Lin(),P);
+    return ElCLib::Parameter( Handle(Geom_Line)::DownCast (C)->Lin(),P);
   }
   else if (typC == STANDARD_TYPE(Geom_Circle)) {
     Standard_Real prm = ElCLib::Parameter
-      ( (*((Handle(Geom_Circle)*)&C))->Circ(),P);
+      ( Handle(Geom_Circle)::DownCast (C)->Circ(),P);
     // Vtx vient d`une exploration de Edg orientee FORWARD
 
     TopAbs_Orientation orient = TopAbs::Reverse(Vtx.Orientation());
index 5a4b757dd5386e40c3fa87f600f580269f0111c8..51d1585a69a28d45d77d4d47e4063d01d78d5912 100644 (file)
@@ -602,7 +602,7 @@ static void Select(const TopoDS_Edge& Ebase,
 
   if (!Loc.IsIdentity()) {
     Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
-    C = *((Handle(Geom_Curve)*)&GG);
+    C = Handle(Geom_Curve)::DownCast (GG);
   }
   gp_Pnt Pt(C->Value((f+l)/2.));
 
@@ -615,7 +615,7 @@ static void Select(const TopoDS_Edge& Ebase,
     C = BRep_Tool::Curve(edg,Loc,f,l);
     if (!Loc.IsIdentity()) {
       Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
-      C = *((Handle(Geom_Curve)*)&GG);
+      C = Handle(Geom_Curve)::DownCast (GG);
     }
     proj.Init(Pt,C,f,l);
     if (proj.NbPoints() > 0) {
index 013428bcdcea384e061c4f2ba060a34331cc5eac..edc1af194aa0d5754a7b133f673020b9c4799ee2 100644 (file)
@@ -541,7 +541,7 @@ Standard_Real Project(const TopoDS_Vertex& V,
   C = BRep_Tool::Curve(theEdge,Loc,f,l);
   if (!Loc.IsIdentity()) {
     Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
-    C = *((Handle(Geom_Curve)*)&GG);
+    C = Handle(Geom_Curve)::DownCast (GG);
   }
   proj.Init(toproj,C,f,l);
   
@@ -570,7 +570,7 @@ Standard_Real Project(const TopoDS_Vertex&,
   /*
   if (!Loc.IsIdentity()) {
     Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
-    C = *((Handle(Geom_Curve)*)&GG);
+    C = Handle(Geom_Curve)::DownCast (GG);
   }
   */
   proj.Init(p2d, PC, f, l);
@@ -636,7 +636,7 @@ void PutPCurve(const TopoDS_Edge& Edg,
   Handle(Geom_Curve) C = BRep_Tool::Curve(Edg,Loc,f,l);
   if (!Loc.IsIdentity()) {
     Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
-    C = *((Handle(Geom_Curve)*)&GG);
+    C = Handle(Geom_Curve)::DownCast (GG);
   }
 
   if (C->DynamicType() != STANDARD_TYPE(Geom_TrimmedCurve)) {
@@ -835,7 +835,7 @@ void PutPCurves(const TopoDS_Edge& Efrom,
       C = BRep_Tool::Curve(Efrom,Loc,f,l);
       if (!Loc.IsIdentity()) {
        Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
-       C = *((Handle(Geom_Curve)*)&GG);
+       C = Handle(Geom_Curve)::DownCast (GG);
       }
       
       if (C->DynamicType() != STANDARD_TYPE(Geom_TrimmedCurve)) {
@@ -1000,7 +1000,7 @@ void PutPCurves(const TopoDS_Edge& Efrom,
     C = BRep_Tool::Curve(Efrom,Loc,f,l);
     if (!Loc.IsIdentity()) {
       Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
-      C = *((Handle(Geom_Curve)*)&GG);
+      C = Handle(Geom_Curve)::DownCast (GG);
     }
 
     gp_Pnt pt;
@@ -1019,7 +1019,7 @@ void PutPCurves(const TopoDS_Edge& Efrom,
     C = BRep_Tool::Curve(Eto,Loc,f,l);
     if (!Loc.IsIdentity()) {
       Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
-      C = *((Handle(Geom_Curve)*)&GG);
+      C = Handle(Geom_Curve)::DownCast (GG);
     }
     
     C->D1(prmproj,pt,d1t);
@@ -1038,7 +1038,7 @@ void PutPCurves(const TopoDS_Edge& Efrom,
       C = BRep_Tool::Curve(Efrom,Loc,f,l);
       if (!Loc.IsIdentity()) {
        Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
-       C = *((Handle(Geom_Curve)*)&GG);
+       C = Handle(Geom_Curve)::DownCast (GG);
       }
       
       if (C->DynamicType() != STANDARD_TYPE(Geom_TrimmedCurve)) {
index 0fec97ca60f9d4af374951e5a8b4c109d1cc8488..a9ff522008467bbfc905c57b38ed147bc0a82425 100644 (file)
@@ -71,7 +71,7 @@ Handle(Storage_Schema) PCDM::Schema(const TCollection_ExtendedString& aSchemaNam
     Standard_NoSuchObject::Raise(aMsg);
   }
   Handle(Standard_Transient) t = Plugin::Load(UTL::GUID(UTL::Value(r,aSchemaName)));
-  return *((Handle(Storage_Schema)*)&t);
+  return Handle(Storage_Schema)::DownCast (t);
   
 }
 
index c01970800175b3c439a7a85280da778e12ee63e2..6bd0395f04c38396b43f383922afe57a1ee608cf 100644 (file)
@@ -173,7 +173,7 @@ void PCDM_RetrievalDriver::Read(const TCollection_ExtendedString& theFileName,
     Standard_Failure::Raise(aMsg);
   }
   Handle(Standard_Persistent) theObject=theDocument->Object();
-  Handle(PCDM_Document) thePDocument = *((Handle(PCDM_Document)*)&theObject);
+  Handle(PCDM_Document) thePDocument = Handle(PCDM_Document)::DownCast (theObject);
 
 
   {
index cb67429d5b92378b5ac4acc869a522282803cb96..96feda1158bacd0082eacebd38f3788e6187d6c5 100644 (file)
@@ -146,7 +146,7 @@ Standard_Boolean Prs3d_ShapeTool::IsPlanarFace() const
 
   if (TheType == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
     Handle(Geom_RectangularTrimmedSurface) 
-       RTS = *((Handle(Geom_RectangularTrimmedSurface)*)&S);
+       RTS = Handle(Geom_RectangularTrimmedSurface)::DownCast (S);
     TheType = RTS->BasisSurface()->DynamicType();
   }
   return (TheType == STANDARD_TYPE(Geom_Plane));
index 33d6c609fa69fdf4bde70f913854bdc7f6606b4d..8514341f8043ecf096c3a632cc64010ba905a670 100644 (file)
@@ -307,7 +307,7 @@ void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)&
                                    const Handle(Graphic3d_Structure)&            theStructToFill)
 {
   theStructToFill->Clear();
-  const Handle(Prs3d_Presentation)& aPrs = *((Handle(Prs3d_Presentation)* )&theStructToFill);
+  Handle(Prs3d_Presentation) aPrs (Handle(Prs3d_Presentation)::DownCast (theStructToFill));
   myPresentableObject->Compute (Projector (theProjector), aPrs);
 }
 
@@ -356,7 +356,7 @@ void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)&
                                    const Handle(Graphic3d_Structure)&            theStructToFill)
 {
   // recompute HLR after transformation in all the case
-  Handle(Prs3d_Presentation) aPrs = *((Handle(Prs3d_Presentation)*)&theStructToFill);
+  Handle(Prs3d_Presentation) aPrs = Handle(Prs3d_Presentation)::DownCast (theStructToFill);
   theStructToFill->Clear();
   myPresentableObject->Compute (Projector (theProjector), theTrsf, aPrs);
 }
@@ -367,7 +367,7 @@ void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)&
 //=======================================================================
 Handle(Prs3d_Projector) PrsMgr_Presentation::Projector (const Handle(Graphic3d_DataStructureManager)& theProjector)
 {
-  const Handle(Graphic3d_Camera)& aCamera = Handle(Visual3d_View)::DownCast (theProjector)->Camera();
+  Handle(Graphic3d_Camera) aCamera (Handle(Visual3d_View)::DownCast (theProjector)->Camera());
   const gp_Dir aDir = aCamera->Direction().Reversed();
   const gp_Pnt anAt = aCamera->Center();
   const gp_Dir anUp = aCamera->Up();
index def28eaa62d6d81182d0ab8670748f079a14e128..c5644ca91a2a9ad50f048df205bc46ab352df2e2 100644 (file)
@@ -325,7 +325,7 @@ static Standard_Integer OCC10bug (Draw_Interpretor& di, Standard_Integer argc, c
     // un AIS_PlaneTrihedron
     if (aShape->Type()==AIS_KOI_Datum && aShape->Signature()==4) {
       // On downcast aShape de AIS_InteractiveObject a AIS_PlaneTrihedron
-      theAISPlaneTri = *(Handle(AIS_PlaneTrihedron)*) &aShape;
+      theAISPlaneTri = Handle(AIS_PlaneTrihedron)::DownCast (aShape);
 
       theAISPlaneTri->SetLength(Length);
   
index 852a840420a12c1ce4fb041d57c98dd96e2100b1..ce65c74798d53314339ed66ec6e950edaa15b757 100644 (file)
@@ -290,7 +290,7 @@ static Standard_Integer OCC218bug (Draw_Interpretor& di, Standard_Integer argc,
     // un AIS_PlaneTrihedron
     if (aShape->Type()==AIS_KOI_Datum && aShape->Signature()==4) {
       // On downcast aShape de AIS_InteractiveObject a AIS_PlaneTrihedron
-      theAISPlaneTri = *(Handle(AIS_PlaneTrihedron)*) &aShape;
+      theAISPlaneTri = Handle(AIS_PlaneTrihedron)::DownCast (aShape);
 
       theAISPlaneTri->SetXLabel(Xlabel);
       theAISPlaneTri->SetYLabel(Ylabel);
index 5f89ee2a05465708d59fadc346622617a2c8c5d0..e263b228f6edfd894402b1c6e716d6c8e37e268c 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <Interface_Macros.hxx>
 //#define DeclareAndCast(atype,result,start) \  NON car Name
-// Handle(atype) result = *((Handle(atype)*) &start)
+// Handle(atype) result = Handle(atype)::DownCast (start)
 
 #include <Interface_GeneralLib.hxx>
 #include <Interface_Category.hxx>
index 4cd96cea7c24087414b27ff13020c6d49b08cf8a..0255255cdcfc1da8946337f92b9adbb431cd0d29 100644 (file)
@@ -25,7 +25,7 @@
 
 
 #define DeclareAndCast(atype,result,start) \
-Handle(atype) result = *((Handle(atype)*) &start)
+Handle(atype) result = Handle(atype)::DownCast (start)
 
 #include <StepBasic_Address.hxx>
 #include <StepShape_AdvancedBrepShapeRepresentation.hxx>
index 1138f572bfd83afd9f7538b1ce8f46247dc36b6e..4e7c93ea32ae7b3056ad2e98c70a6967e68f5c56 100644 (file)
@@ -491,7 +491,7 @@ Standard_Boolean SelectMgr_SelectionManager::IsActivated (const Handle(SelectMgr
   {
     for (TColStd_MapIteratorOfMapOfTransient aSelectorIter (mySelectors); aSelectorIter.More(); aSelectorIter.Next())
     {
-      const Handle(SelectMgr_ViewerSelector)& aSelector = Handle(SelectMgr_ViewerSelector)::DownCast (aSelectorIter.Key());
+      Handle(SelectMgr_ViewerSelector) aSelector (Handle(SelectMgr_ViewerSelector)::DownCast (aSelectorIter.Key()));
       if (aSelector->Status (aSelection) == SelectMgr_SOS_Activated)
         return Standard_True;
     }
@@ -692,7 +692,7 @@ void SelectMgr_SelectionManager::RecomputeSelection (const Handle(SelectMgr_Sele
 
     for (TColStd_MapIteratorOfMapOfTransient aSelectorIter (mySelectors); aSelectorIter.More(); aSelectorIter.Next())
     {
-      const Handle(SelectMgr_ViewerSelector)& aCurSelector = Handle(SelectMgr_ViewerSelector)::DownCast (aSelectorIter.Key());
+      Handle(SelectMgr_ViewerSelector) aCurSelector (Handle(SelectMgr_ViewerSelector)::DownCast (aSelectorIter.Key()));
       if (aCurSelector->Status (aSelection) == SelectMgr_SOS_Activated)
       {
           ClearSelectionStructures (theObject, aSelMode, aCurSelector);
@@ -747,7 +747,7 @@ void SelectMgr_SelectionManager::Update (const Handle(SelectMgr_SelectableObject
 
     for (TColStd_MapIteratorOfMapOfTransient aSelectorIter (mySelectors); aSelectorIter.More(); aSelectorIter.Next())
     {
-      const Handle(SelectMgr_ViewerSelector)& aSelector = Handle(SelectMgr_ViewerSelector)::DownCast (aSelectorIter.Key());
+      Handle(SelectMgr_ViewerSelector) aSelector (Handle(SelectMgr_ViewerSelector)::DownCast (aSelectorIter.Key()));
       Update (theObject, aSelector, Standard_False);
     }
   }
index 32326e0cbc39179e54aa661458ea4109954dd6de..0b8bfd30b3e5e17b68290b1393040b5796f36ecf 100644 (file)
@@ -106,8 +106,7 @@ Standard_Real SelectMgr_SensitiveEntitySet::Center (const Standard_Integer theIn
 {
   const Handle(SelectBasics_SensitiveEntity)& aBasicEntity =
     GetSensitiveById (theIndex)->BaseSensitive();
-  const Handle(Select3D_SensitiveEntity)& aSensitive =
-    Handle(Select3D_SensitiveEntity)::DownCast (aBasicEntity);
+  Handle(Select3D_SensitiveEntity) aSensitive (Handle(Select3D_SensitiveEntity)::DownCast (aBasicEntity));
   const gp_Pnt aCenter = aSensitive->CenterOfGeometry();
   Standard_Real aCenterCoord = 0.0;
   aCenterCoord = theAxis == 0 ? aCenter.X() :
index 5b41ac7aec8d1f5060c533964502d36502175863..d264e443a72c3d2d7c5ebb1c80dc1660e3a01e13 100644 (file)
@@ -264,8 +264,7 @@ void SelectMgr_ViewerSelector::checkOverlap (const Handle(SelectBasics_Sensitive
                                              const Standard_Integer theEntityIdx,
                                              SelectMgr_SelectingVolumeManager& theMgr)
 {
-  const Handle(SelectMgr_EntityOwner)& anOwner =
-    Handle(SelectMgr_EntityOwner)::DownCast (theEntity->OwnerId());
+  Handle(SelectMgr_EntityOwner) anOwner (Handle(SelectMgr_EntityOwner)::DownCast (theEntity->OwnerId()));
 
   SelectBasics_PickResult aPickResult;
   if (theEntity->Matches (theMgr, aPickResult))
@@ -490,7 +489,7 @@ Handle(SelectMgr_EntityOwner) SelectMgr_ViewerSelector
 {
   Standard_Integer RankInMap = myIndexes->Value (myCurRank);
   const Handle(SelectBasics_EntityOwner)& toto = mystored.FindKey(RankInMap);
-  Handle(SelectMgr_EntityOwner) Ownr = *((Handle(SelectMgr_EntityOwner)*) &toto);
+  Handle(SelectMgr_EntityOwner) Ownr = Handle(SelectMgr_EntityOwner)::DownCast (toto);
   return Ownr;
 }
 
@@ -521,7 +520,7 @@ Handle(SelectMgr_EntityOwner) SelectMgr_ViewerSelector
   if(More()){
     Standard_Integer RankInMap = myIndexes->Value (myIndexes->Lower());
     const Handle(SelectBasics_EntityOwner)& toto = mystored.FindKey(RankInMap);
-    Handle(SelectMgr_EntityOwner) Ownr = *((Handle(SelectMgr_EntityOwner)*) &toto);
+    Handle(SelectMgr_EntityOwner) Ownr = Handle(SelectMgr_EntityOwner)::DownCast (toto);
     return Ownr;
   }
 
index 54bb54e20db148c38c0e89346e8736e47c4b77df..7062de7ba5125c20fc931d281866027a0f94e63e 100644 (file)
@@ -776,7 +776,7 @@ static void AppendControlPoles (TColgp_SequenceOfPnt& seq,
     seq.Append(curve->Value(M_PI));
   } else if ( curve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
     //DeclareAndCast(Geom_TrimmedCurve, Trimmed, curve);
-    Handle(Geom_TrimmedCurve) Trimmed = *((Handle(Geom_TrimmedCurve) *) &curve);
+    Handle(Geom_TrimmedCurve) Trimmed = Handle(Geom_TrimmedCurve)::DownCast (curve);
 //     AppendControlPoles(seq,Trimmed->BasisCurve());
     Handle(Geom_Curve) aBaseCrv = Trimmed->BasisCurve();
     Standard_Boolean done = Standard_False;
@@ -811,14 +811,14 @@ static void AppendControlPoles (TColgp_SequenceOfPnt& seq,
     }
   } else if ( curve->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) {
     //DeclareAndCast(Geom_OffsetCurve, OffsetC, curve);
-    Handle(Geom_OffsetCurve) OffsetC = *((Handle(Geom_OffsetCurve) *) &curve);
+    Handle(Geom_OffsetCurve) OffsetC = Handle(Geom_OffsetCurve)::DownCast (curve);
 //     AppendControlPoles(seq,OffsetC->BasisCurve());
     seq.Append(curve->Value(curve->FirstParameter()));
     seq.Append(curve->Value((curve->FirstParameter() + curve->LastParameter())/2.));
     seq.Append(curve->Value(curve->LastParameter()));
   } else if ( curve->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) {
     //DeclareAndCast(Geom_BSplineCurve, BSpline, curve);
-    Handle(Geom_BSplineCurve) BSpline = *((Handle(Geom_BSplineCurve) *) &curve);
+    Handle(Geom_BSplineCurve) BSpline = Handle(Geom_BSplineCurve)::DownCast (curve);
     TColgp_Array1OfPnt Poles(1,BSpline->NbPoles());
     BSpline->Poles(Poles);
     for(Standard_Integer i = 1; i <= BSpline->NbPoles(); i++)
@@ -826,7 +826,7 @@ static void AppendControlPoles (TColgp_SequenceOfPnt& seq,
   } else if ( curve->IsKind(STANDARD_TYPE(Geom_BezierCurve)))  {
     //DeclareAndCast(Geom_BezierCurve, Bezier, curve);
     //Handle(Geom_BezierCurve) Bezier = Handle(Geom_BezierCurve)::DownCast(curve);
-    Handle(Geom_BezierCurve) Bezier = *((Handle(Geom_BezierCurve) *) &curve);
+    Handle(Geom_BezierCurve) Bezier = Handle(Geom_BezierCurve)::DownCast (curve);
     TColgp_Array1OfPnt Poles(1,Bezier->NbPoles());
     Bezier->Poles(Poles);
     for(Standard_Integer i = 1; i <= Bezier->NbPoles(); i++)
@@ -915,7 +915,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsPlanar (const TColgp_Array1OfPnt& pnts,
 
   if (curve->IsKind(STANDARD_TYPE(Geom_Line))) {
     //DeclareAndCast(Geom_Line, Line, curve);
-    Handle(Geom_Line) Line = *((Handle(Geom_Line) *) &curve);
+    Handle(Geom_Line) Line = Handle(Geom_Line)::DownCast (curve);
     gp_XYZ N1 = Line->Position().Direction().XYZ();
     if (noNorm) {
       Normal = GetAnyNormal(N1);
@@ -926,7 +926,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsPlanar (const TColgp_Array1OfPnt& pnts,
 
   if (curve->IsKind(STANDARD_TYPE(Geom_Conic))) {
     //DeclareAndCast(Geom_Conic, Conic, curve);
-    Handle(Geom_Conic) Conic = *((Handle(Geom_Conic) *) &curve);
+    Handle(Geom_Conic) Conic = Handle(Geom_Conic)::DownCast (curve);
     gp_XYZ N1 = Conic->Axis().Direction().XYZ();
     if (noNorm) {
       Normal = N1;
@@ -938,19 +938,19 @@ Standard_Boolean ShapeAnalysis_Curve::IsPlanar (const TColgp_Array1OfPnt& pnts,
 
   if (curve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
     //DeclareAndCast(Geom_TrimmedCurve, Trimmed, curve);
-    Handle(Geom_TrimmedCurve) Trimmed = *((Handle(Geom_TrimmedCurve) *) &curve);
+    Handle(Geom_TrimmedCurve) Trimmed = Handle(Geom_TrimmedCurve)::DownCast (curve);
     return IsPlanar(Trimmed->BasisCurve(),Normal,precision);
   }
 
   if (curve->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) {
     //DeclareAndCast(Geom_OffsetCurve, OffsetC, curve);
-    Handle(Geom_OffsetCurve) OffsetC = *((Handle(Geom_OffsetCurve) *) &curve);
+    Handle(Geom_OffsetCurve) OffsetC = Handle(Geom_OffsetCurve)::DownCast (curve);
     return IsPlanar(OffsetC->BasisCurve(),Normal,precision);
   }
 
   if (curve->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) {
     //DeclareAndCast(Geom_BSplineCurve, BSpline, curve);
-    Handle(Geom_BSplineCurve) BSpline = *((Handle(Geom_BSplineCurve) *) &curve);
+    Handle(Geom_BSplineCurve) BSpline = Handle(Geom_BSplineCurve)::DownCast (curve);
     TColgp_Array1OfPnt Poles(1,BSpline->NbPoles());
     BSpline->Poles(Poles);
     return IsPlanar(Poles,Normal,precision);
@@ -958,7 +958,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsPlanar (const TColgp_Array1OfPnt& pnts,
 
   if (curve->IsKind(STANDARD_TYPE(Geom_BezierCurve))) {
     //DeclareAndCast(Geom_BezierCurve, Bezier, curve);
-    Handle(Geom_BezierCurve) Bezier = *((Handle(Geom_BezierCurve) *) &curve);
+    Handle(Geom_BezierCurve) Bezier = Handle(Geom_BezierCurve)::DownCast (curve);
     TColgp_Array1OfPnt Poles(1,Bezier->NbPoles());
     Bezier->Poles(Poles);
     return IsPlanar(Poles,Normal,precision);
@@ -966,7 +966,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsPlanar (const TColgp_Array1OfPnt& pnts,
 
   if (curve->IsKind(STANDARD_TYPE(ShapeExtend_ComplexCurve))) {
     //DeclareAndCast(ShapeExtend_ComplexCurve, Complex, curve);
-    Handle(ShapeExtend_ComplexCurve) Complex = *((Handle(ShapeExtend_ComplexCurve) *) &curve);
+    Handle(ShapeExtend_ComplexCurve) Complex = Handle(ShapeExtend_ComplexCurve)::DownCast (curve);
     TColgp_SequenceOfPnt sequence;
     Standard_Integer i; // svv Jan11 2000 : porting on DEC
     for (i = 1; i <= Complex->NbCurves(); i++)
index c214fa81d38d8728406d13724f26d310309834ca..80da39fef9d5e31f99b966eba98b7ba76648f318 100644 (file)
@@ -81,7 +81,7 @@ void StdSelect_BRepSelectionTool::preBuildBVH (const Handle(SelectMgr_Selection)
 
     if (aSensitive->IsInstance ("Select3D_SensitiveGroup"))
     {
-      const Handle(Select3D_SensitiveGroup)& aGroup = Handle(Select3D_SensitiveGroup)::DownCast (aSensitive);
+      Handle(Select3D_SensitiveGroup) aGroup (Handle(Select3D_SensitiveGroup)::DownCast (aSensitive));
       const Select3D_EntitySequence& aSubEntities = aGroup->GetEntities();
       for (Select3D_EntitySequenceIter aSubEntitiesIter (aSubEntities); aSubEntitiesIter.More(); aSubEntitiesIter.Next())
       {
index e984dc56a63273d89cd87c2e67f5a471d60ec2c6..796885b02cd5b6ce5ee76d965c6deaaaca025955 100644 (file)
@@ -64,7 +64,7 @@ Standard_Boolean StdSelect_EdgeFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
 {
   if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull()) return Standard_False;
   
-  const TopoDS_Shape& sh = ((Handle(StdSelect_BRepOwner)&)EO)->Shape();
+  const TopoDS_Shape& sh = Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape();
   if(sh.ShapeType()!= TopAbs_EDGE) return Standard_False;
   
   switch(mytype){
index b913a7eee890597400e240057cd914517c8bc3b2..dfef5a0db2a60880923f1664ab7d09d97bf86de3 100644 (file)
@@ -51,7 +51,7 @@ 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)&)EO)->Shape();
+  const TopoDS_Shape& anobj= Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape();
   if(anobj.ShapeType()!= TopAbs_FACE)return Standard_False;  
   switch(mytype) {
   case StdSelect_AnyFace:
index 2493640be7f35b5c0f916fc4b1e7a0c678a8a27a..a645173fafc1f875eab0f91f4175d729604e2f46 100644 (file)
@@ -517,16 +517,15 @@ void StdSelect_ViewerSelector3d::ComputeSensitivePrs (const Handle(SelectMgr_Sel
     //==========================================================
     else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveTriangulation))
     {
-      const Handle(Poly_Triangulation)& PT =
-        (*((Handle(Select3D_SensitiveTriangulation)*) &Ent))->Triangulation();
+      Handle(Poly_Triangulation) PT (Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->Triangulation());
 
       const Poly_Array1OfTriangle& triangles = PT->Triangles();
       const TColgp_Array1OfPnt& Nodes = PT->Nodes();
       Standard_Integer n[3];
 
       TopLoc_Location iloc, bidloc;
-      if ((*((Handle(Select3D_SensitiveTriangulation)*) &Ent))->HasInitLocation())
-        bidloc = (*((Handle(Select3D_SensitiveTriangulation)*) &Ent))->GetInitLocation();
+      if (Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->HasInitLocation())
+        bidloc = Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->GetInitLocation();
 
       if (bidloc.IsIdentity())
         iloc = theLoc;
index 5588b0e9e31ccbb8b45a080d5281d4b26984f274..7780d1fd0fb030d3cc823b1ec324a8afcdfa3704 100644 (file)
@@ -49,16 +49,16 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve))) {
     const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)
       Bspli = Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC);
-       return StepToGeom_MakeBSplineCurve::Convert(Bspli,*((Handle(Geom_BSplineCurve)*)&CC));
+       return StepToGeom_MakeBSplineCurve::Convert(Bspli,Handle(Geom_BSplineCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnots))) {
     const Handle(StepGeom_BSplineCurveWithKnots)
       Bspli = Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC);
-       return StepToGeom_MakeBSplineCurve::Convert(Bspli,*((Handle(Geom_BSplineCurve)*)&CC));
+       return StepToGeom_MakeBSplineCurve::Convert(Bspli,Handle(Geom_BSplineCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve))) {
     const Handle(StepGeom_TrimmedCurve) L = Handle(StepGeom_TrimmedCurve)::DownCast(SC);
-       return StepToGeom_MakeTrimmedCurve::Convert(L,*((Handle(Geom_TrimmedCurve)*)&CC));
+       return StepToGeom_MakeTrimmedCurve::Convert(L,Handle(Geom_TrimmedCurve)::DownCast (CC));
   }
   // STEP BezierCurve, UniformCurve and QuasiUniformCurve are transformed into
   // STEP BSplineCurve before being mapped onto CAS.CADE/SF
@@ -82,7 +82,7 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
     Knots->SetValue(2, 1.);
     BSPL->SetKnotMultiplicities(Kmult);
     BSPL->SetKnots(Knots);
-       return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC));
+       return StepToGeom_MakeBSplineCurve::Convert(BSPL,Handle(Geom_BSplineCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurve))) {
     const Handle(StepGeom_UniformCurve) UC = Handle(StepGeom_UniformCurve)::DownCast(SC);
@@ -105,7 +105,7 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
     }
     BSPL->SetKnotMultiplicities(Kmult);
     BSPL->SetKnots(Knots);
-       return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC));
+       return StepToGeom_MakeBSplineCurve::Convert(BSPL,Handle(Geom_BSplineCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurve))) {
     const Handle(StepGeom_QuasiUniformCurve) QUC = 
@@ -131,7 +131,7 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
     Kmult->SetValue(nbK, BSPL->Degree() + 1);
     BSPL->SetKnotMultiplicities(Kmult);
     BSPL->SetKnots(Knots);
-       return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC));
+       return StepToGeom_MakeBSplineCurve::Convert(BSPL,Handle(Geom_BSplineCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurveAndRationalBSplineCurve))) {
     const Handle(StepGeom_UniformCurveAndRationalBSplineCurve) RUC = 
@@ -153,7 +153,7 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
     RBSPL->Init(RUC->Name(), aDegree, RUC->ControlPointsList(), RUC->CurveForm(),
                RUC->ClosedCurve(), RUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified,
                RUC->WeightsData());
-       return StepToGeom_MakeBSplineCurve::Convert(RBSPL,*((Handle(Geom_BSplineCurve)*)&CC));
+       return StepToGeom_MakeBSplineCurve::Convert(RBSPL,Handle(Geom_BSplineCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurveAndRationalBSplineCurve))) {
     const Handle(StepGeom_QuasiUniformCurveAndRationalBSplineCurve) RQUC = 
@@ -177,11 +177,11 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
     RBSPL->Init(RQUC->Name(), aDegree, RQUC->ControlPointsList(), RQUC->CurveForm(),
                RQUC->ClosedCurve(), RQUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified,
                RQUC->WeightsData());
-       return StepToGeom_MakeBSplineCurve::Convert(RBSPL,*((Handle(Geom_BSplineCurve)*)&CC));
+       return StepToGeom_MakeBSplineCurve::Convert(RBSPL,Handle(Geom_BSplineCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Polyline))) { //:n6 abv 15 Feb 99
     const Handle(StepGeom_Polyline) PL = Handle(StepGeom_Polyline)::DownCast (SC);
-    return StepToGeom_MakePolyline::Convert(PL,*((Handle(Geom_BSplineCurve)*)&CC));
+    return StepToGeom_MakePolyline::Convert(PL,Handle(Geom_BSplineCurve)::DownCast (CC));
   }
   return Standard_False;
 }
index 1fb976ffa82ad8fa319ef1e589a9f8bd87ef6bd7..68b96e461831eabe3fe733b1c5eb7ac29e4a85ef 100644 (file)
@@ -35,20 +35,20 @@ Standard_Boolean StepToGeom_MakeBoundedCurve2d::Convert (const Handle(StepGeom_B
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve))) {
     const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)
       Bspli = Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC);
-       return StepToGeom_MakeBSplineCurve2d::Convert(Bspli,*((Handle(Geom2d_BSplineCurve)*)&CC));
+       return StepToGeom_MakeBSplineCurve2d::Convert(Bspli,Handle(Geom2d_BSplineCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnots))) {
     const Handle(StepGeom_BSplineCurveWithKnots)
       Bspli = Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC);
-       return StepToGeom_MakeBSplineCurve2d::Convert(Bspli,*((Handle(Geom2d_BSplineCurve)*)&CC));
+       return StepToGeom_MakeBSplineCurve2d::Convert(Bspli,Handle(Geom2d_BSplineCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve))) {
     const Handle(StepGeom_TrimmedCurve) TC = Handle(StepGeom_TrimmedCurve)::DownCast(SC);
-       return StepToGeom_MakeTrimmedCurve2d::Convert(TC,*((Handle(Geom2d_BSplineCurve)*)&CC));
+       return StepToGeom_MakeTrimmedCurve2d::Convert(TC,Handle(Geom2d_BSplineCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Polyline))) { //:n6 abv 15 Feb 99
     const Handle(StepGeom_Polyline) PL = Handle(StepGeom_Polyline)::DownCast(SC);
-       return StepToGeom_MakePolyline2d::Convert(PL,*((Handle(Geom2d_BSplineCurve)*)&CC));
+       return StepToGeom_MakePolyline2d::Convert(PL,Handle(Geom2d_BSplineCurve)::DownCast (CC));
   }
   return Standard_False;
 }
index a0ee4cb35dcd3fd7ae66e186187f5b8519076c6b..99528ebbb54d8100ae512b93df95447f164d415e 100644 (file)
@@ -52,17 +52,17 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
   if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface))) { 
     const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) BS =
       Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)::DownCast(SS);
-       return StepToGeom_MakeBSplineSurface::Convert(BS,*((Handle(Geom_BSplineSurface)*)&CS));
+       return StepToGeom_MakeBSplineSurface::Convert(BS,Handle(Geom_BSplineSurface)::DownCast (CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnots))) {
     const Handle(StepGeom_BSplineSurfaceWithKnots) BS
       = Handle(StepGeom_BSplineSurfaceWithKnots)::DownCast(SS);
-       return StepToGeom_MakeBSplineSurface::Convert(BS,*((Handle(Geom_BSplineSurface)*)&CS));
+       return StepToGeom_MakeBSplineSurface::Convert(BS,Handle(Geom_BSplineSurface)::DownCast (CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_RectangularTrimmedSurface))) {
     const Handle(StepGeom_RectangularTrimmedSurface) Sur = 
       Handle(StepGeom_RectangularTrimmedSurface)::DownCast(SS);
-    return StepToGeom_MakeRectangularTrimmedSurface::Convert(Sur,*((Handle(Geom_RectangularTrimmedSurface)*)&CS));
+    return StepToGeom_MakeRectangularTrimmedSurface::Convert(Sur,Handle(Geom_RectangularTrimmedSurface)::DownCast (CS));
   }
   // STEP BezierSurface, UniformSurface and QuasiUniformSurface are transformed
   // into STEP BSplineSurface before being mapped onto CAS.CADE/SF
@@ -93,7 +93,7 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
     BSPL->SetVMultiplicities(VKmult);
     BSPL->SetUKnots(UKnots);
     BSPL->SetVKnots(VKnots);
-       return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS));
+       return StepToGeom_MakeBSplineSurface::Convert(BSPL,Handle(Geom_BSplineSurface)::DownCast (CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurface))) {
     const Handle(StepGeom_UniformSurface) US = Handle(StepGeom_UniformSurface)::DownCast(SS);
@@ -125,7 +125,7 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
     }
     BSPL->SetVMultiplicities(VKmult);
     BSPL->SetVKnots(VKnots);
-       return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS));
+       return StepToGeom_MakeBSplineSurface::Convert(BSPL,Handle(Geom_BSplineSurface)::DownCast (CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurface))) {
     const Handle(StepGeom_QuasiUniformSurface) QUS = 
@@ -162,7 +162,7 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
     VKmult->SetValue(nbKV, BSPL->VDegree() + 1);
     BSPL->SetVMultiplicities(VKmult);
     BSPL->SetVKnots(VKnots);
-       return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS));
+       return StepToGeom_MakeBSplineSurface::Convert(BSPL,Handle(Geom_BSplineSurface)::DownCast (CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurfaceAndRationalBSplineSurface))) {
     const Handle(StepGeom_UniformSurfaceAndRationalBSplineSurface) RUS = 
@@ -191,7 +191,7 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
                RUS->UClosed(), RUS->VClosed(), RUS->SelfIntersect(), 
                UKmult, VKmult, UKnots, VKnots, StepGeom_ktUnspecified,
                RUS->WeightsData());
-       return StepToGeom_MakeBSplineSurface::Convert(RBSPL,*((Handle(Geom_BSplineSurface)*)&CS));
+       return StepToGeom_MakeBSplineSurface::Convert(RBSPL,Handle(Geom_BSplineSurface)::DownCast (CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface))) {
     const Handle(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface) RQUS = 
@@ -223,7 +223,7 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
                RQUS->SurfaceForm(), RQUS->UClosed(), RQUS->VClosed(), 
                RQUS->SelfIntersect(), UKmult, VKmult, UKnots, VKnots, StepGeom_ktUnspecified,
                RQUS->WeightsData());
-       return StepToGeom_MakeBSplineSurface::Convert(RBSPL,*((Handle(Geom_BSplineSurface)*)&CS));
+       return StepToGeom_MakeBSplineSurface::Convert(RBSPL,Handle(Geom_BSplineSurface)::DownCast (CS));
   }
 /* //:S4136: ass-tol2.stp #9861
   // UPDATE FMA 15-03-96
index dd46f5c048fccdce5e02b738955cbed44a9e5cb7..9051eb59bc3b8c8d0acb1ebc8a2975eb31721818 100644 (file)
@@ -37,19 +37,19 @@ Standard_Boolean StepToGeom_MakeConic::Convert
 {
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Circle))) {
     const Handle(StepGeom_Circle) Cir = Handle(StepGeom_Circle)::DownCast(SC);
-       return StepToGeom_MakeCircle::Convert(Cir,*((Handle(Geom_Circle)*)&CC));
+       return StepToGeom_MakeCircle::Convert(Cir,Handle(Geom_Circle)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
     const Handle(StepGeom_Ellipse) Ell = Handle(StepGeom_Ellipse)::DownCast(SC);
-       return StepToGeom_MakeEllipse::Convert(Ell,*((Handle(Geom_Ellipse)*)&CC));
+       return StepToGeom_MakeEllipse::Convert(Ell,Handle(Geom_Ellipse)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Hyperbola))) {
     const Handle(StepGeom_Hyperbola) Hyp = Handle(StepGeom_Hyperbola)::DownCast(SC);
-       return StepToGeom_MakeHyperbola::Convert(Hyp,*((Handle(Geom_Hyperbola)*)&CC));
+       return StepToGeom_MakeHyperbola::Convert(Hyp,Handle(Geom_Hyperbola)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Parabola))) {
     const Handle(StepGeom_Parabola) Par = Handle(StepGeom_Parabola)::DownCast(SC);
-       return StepToGeom_MakeParabola::Convert(Par,*((Handle(Geom_Parabola)*)&CC));
+       return StepToGeom_MakeParabola::Convert(Par,Handle(Geom_Parabola)::DownCast (CC));
   }
   // Attention : Other conic shall be implemented !
   return Standard_False;
index e02d53522e0b7d4559cf7e623d7b4cb5bcdf9f1a..4384fad8893f63caac2900363e49b1e2f98f7e73 100644 (file)
@@ -37,19 +37,19 @@ Standard_Boolean StepToGeom_MakeConic2d::Convert
 {
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Circle))) {
     const Handle(StepGeom_Circle) Cir = Handle(StepGeom_Circle)::DownCast(SC);
-       return StepToGeom_MakeCircle2d::Convert(Cir,*((Handle(Geom2d_Circle)*)&CC));
+       return StepToGeom_MakeCircle2d::Convert(Cir,Handle(Geom2d_Circle)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
     const Handle(StepGeom_Ellipse) Ell = Handle(StepGeom_Ellipse)::DownCast(SC);
-       return StepToGeom_MakeEllipse2d::Convert(Ell,*((Handle(Geom2d_Ellipse)*)&CC));
+       return StepToGeom_MakeEllipse2d::Convert(Ell,Handle(Geom2d_Ellipse)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Hyperbola))) {
     const Handle(StepGeom_Hyperbola) Hyp = Handle(StepGeom_Hyperbola)::DownCast(SC);
-       return StepToGeom_MakeHyperbola2d::Convert(Hyp,*((Handle(Geom2d_Hyperbola)*)&CC));
+       return StepToGeom_MakeHyperbola2d::Convert(Hyp,Handle(Geom2d_Hyperbola)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Parabola))) {
     const Handle(StepGeom_Parabola) Par = Handle(StepGeom_Parabola)::DownCast(SC);
-       return StepToGeom_MakeParabola2d::Convert(Par,*((Handle(Geom2d_Parabola)*)&CC));
+       return StepToGeom_MakeParabola2d::Convert(Par,Handle(Geom2d_Parabola)::DownCast (CC));
   }
   // Attention : Other conic shall be implemented !
   return Standard_False;
index fbef671e8d6f60e36395be23c24d0d714ccdf201..71d960473b06a5b6029f0a6e7dcb520a8f0cece9 100644 (file)
@@ -53,19 +53,19 @@ Standard_Boolean StepToGeom_MakeCurve::Convert (const Handle(StepGeom_Curve)& SC
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Line))) {
     const Handle(StepGeom_Line) L = Handle(StepGeom_Line)::DownCast(SC);
-    return StepToGeom_MakeLine::Convert(L,*((Handle(Geom_Line)*)&CC));
+    return StepToGeom_MakeLine::Convert(L,Handle(Geom_Line)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve))) {
     const Handle(StepGeom_TrimmedCurve) TC = Handle(StepGeom_TrimmedCurve)::DownCast(SC);
-    return StepToGeom_MakeTrimmedCurve::Convert(TC,*((Handle(Geom_TrimmedCurve)*)&CC));
+    return StepToGeom_MakeTrimmedCurve::Convert(TC,Handle(Geom_TrimmedCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Conic))) {
     const Handle(StepGeom_Conic) CO = Handle(StepGeom_Conic)::DownCast(SC);
-    return StepToGeom_MakeConic::Convert(CO,*((Handle(Geom_Conic)*)&CC));
+    return StepToGeom_MakeConic::Convert(CO,Handle(Geom_Conic)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BoundedCurve))) {
     const Handle(StepGeom_BoundedCurve) BC = Handle(StepGeom_BoundedCurve)::DownCast(SC);
-    return StepToGeom_MakeBoundedCurve::Convert(BC,*((Handle(Geom_BoundedCurve)*)&CC));
+    return StepToGeom_MakeBoundedCurve::Convert(BC,Handle(Geom_BoundedCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_CurveReplica))) { //:n7 abv 16 Feb 99
     const Handle(StepGeom_CurveReplica) CR = Handle(StepGeom_CurveReplica)::DownCast(SC);
index 112a3366ac9f23c644133a613761d84d3597edfa..1e989dde510b55394c572030bac9802399c4c324 100644 (file)
@@ -43,15 +43,15 @@ Standard_Boolean StepToGeom_MakeCurve2d::Convert (const Handle(StepGeom_Curve)&
 {
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Line))) {
     const Handle(StepGeom_Line) L = Handle(StepGeom_Line)::DownCast(SC);
-       return StepToGeom_MakeLine2d::Convert(L,*((Handle(Geom2d_Line)*)&CC));
+       return StepToGeom_MakeLine2d::Convert(L,Handle(Geom2d_Line)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Conic))) {
     const Handle(StepGeom_Conic) L = Handle(StepGeom_Conic)::DownCast(SC);
-       return StepToGeom_MakeConic2d::Convert(L,*((Handle(Geom2d_Conic)*)&CC));
+       return StepToGeom_MakeConic2d::Convert(L,Handle(Geom2d_Conic)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BoundedCurve))) {
     const Handle(StepGeom_BoundedCurve) L = Handle(StepGeom_BoundedCurve)::DownCast(SC);
-       return StepToGeom_MakeBoundedCurve2d::Convert(L,*((Handle(Geom2d_BoundedCurve)*)&CC));
+       return StepToGeom_MakeBoundedCurve2d::Convert(L,Handle(Geom2d_BoundedCurve)::DownCast (CC));
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_CurveReplica))) { //:n7 abv 16 Feb 99
     const Handle(StepGeom_CurveReplica) CR = Handle(StepGeom_CurveReplica)::DownCast(SC);
index 753172d1b712b538cc553a0988bc637cb5a52726..fb07d1c955b4f5f2c7c1a240d273a018ec0da6dd 100644 (file)
@@ -38,23 +38,23 @@ Standard_Boolean StepToGeom_MakeElementarySurface::Convert (const Handle(StepGeo
 {
   if (SS->IsKind(STANDARD_TYPE(StepGeom_Plane))) {
     const Handle(StepGeom_Plane) Sur = Handle(StepGeom_Plane)::DownCast(SS);
-       return StepToGeom_MakePlane::Convert(Sur,*((Handle(Geom_Plane)*)&CS));
+       return StepToGeom_MakePlane::Convert(Sur,Handle(Geom_Plane)::DownCast (CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_CylindricalSurface))) {
     const Handle(StepGeom_CylindricalSurface) Sur = Handle(StepGeom_CylindricalSurface)::DownCast(SS);
-    return StepToGeom_MakeCylindricalSurface::Convert(Sur,*((Handle(Geom_CylindricalSurface)*)&CS));
+    return StepToGeom_MakeCylindricalSurface::Convert(Sur,Handle(Geom_CylindricalSurface)::DownCast (CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_ConicalSurface))) {
     const Handle(StepGeom_ConicalSurface) Sur = Handle(StepGeom_ConicalSurface)::DownCast(SS);
-       return StepToGeom_MakeConicalSurface::Convert(Sur,*((Handle(Geom_ConicalSurface)*)&CS));
+       return StepToGeom_MakeConicalSurface::Convert(Sur,Handle(Geom_ConicalSurface)::DownCast (CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_SphericalSurface))) {
     const Handle(StepGeom_SphericalSurface) Sur = Handle(StepGeom_SphericalSurface)::DownCast(SS);
-    return StepToGeom_MakeSphericalSurface::Convert(Sur,*((Handle(Geom_SphericalSurface)*)&CS));
+    return StepToGeom_MakeSphericalSurface::Convert(Sur,Handle(Geom_SphericalSurface)::DownCast (CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_ToroidalSurface))) {
     const Handle(StepGeom_ToroidalSurface) Sur = Handle(StepGeom_ToroidalSurface)::DownCast(SS);
-    return StepToGeom_MakeToroidalSurface::Convert(Sur,*((Handle(Geom_ToroidalSurface)*)&CS));
+    return StepToGeom_MakeToroidalSurface::Convert(Sur,Handle(Geom_ToroidalSurface)::DownCast (CS));
   }
   return Standard_False;
 }       
index 080d9d712e7f208b14c86f0beb0ef2456d266800..4ce83ab68503da2aaa58ca571cb47f596cdb38b6 100644 (file)
@@ -63,18 +63,18 @@ Standard_Boolean StepToGeom_MakeSurface::Convert (const Handle(StepGeom_Surface)
     OCC_CATCH_SIGNALS
     if (SS->IsKind(STANDARD_TYPE(StepGeom_BoundedSurface))) {
       const Handle(StepGeom_BoundedSurface) S1 = Handle(StepGeom_BoundedSurface)::DownCast(SS);
-      return StepToGeom_MakeBoundedSurface::Convert(S1,*((Handle(Geom_BoundedSurface)*)&CS));
+      return StepToGeom_MakeBoundedSurface::Convert(S1,Handle(Geom_BoundedSurface)::DownCast (CS));
     }
     if (SS->IsKind(STANDARD_TYPE(StepGeom_ElementarySurface))) {
       const Handle(StepGeom_ElementarySurface) S1 = Handle(StepGeom_ElementarySurface)::DownCast(SS);
       if(S1->Position().IsNull())
         return Standard_False;
 
-      return StepToGeom_MakeElementarySurface::Convert(S1,*((Handle(Geom_ElementarySurface)*)&CS));
+      return StepToGeom_MakeElementarySurface::Convert(S1,Handle(Geom_ElementarySurface)::DownCast (CS));
     }
     if (SS->IsKind(STANDARD_TYPE(StepGeom_SweptSurface))) {
       const Handle(StepGeom_SweptSurface) S1 = Handle(StepGeom_SweptSurface)::DownCast(SS);
-      return StepToGeom_MakeSweptSurface::Convert(S1,*((Handle(Geom_SweptSurface)*)&CS));
+      return StepToGeom_MakeSweptSurface::Convert(S1,Handle(Geom_SweptSurface)::DownCast (CS));
     }
     if (SS->IsKind(STANDARD_TYPE(StepGeom_OffsetSurface))) { //:d4 abv 12 Mar 98
       const Handle(StepGeom_OffsetSurface) OS = Handle(StepGeom_OffsetSurface)::DownCast(SS);
index 3272e5f20bff4cac4c5bdf1f5fbd4861c5667d79..ff0685f0cc2324fda5712f780b7a3197ecbac33d 100644 (file)
@@ -33,11 +33,11 @@ Standard_Boolean StepToGeom_MakeSweptSurface::Convert (const Handle(StepGeom_Swe
 {
   if (SS->IsKind(STANDARD_TYPE(StepGeom_SurfaceOfLinearExtrusion))) {
     const Handle(StepGeom_SurfaceOfLinearExtrusion) Sur = Handle(StepGeom_SurfaceOfLinearExtrusion)::DownCast(SS);
-    return StepToGeom_MakeSurfaceOfLinearExtrusion::Convert(Sur,*((Handle(Geom_SurfaceOfLinearExtrusion)*)&CS));
+    return StepToGeom_MakeSurfaceOfLinearExtrusion::Convert(Sur,Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (CS));
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_SurfaceOfRevolution))) {
     const Handle(StepGeom_SurfaceOfRevolution) Sur = Handle(StepGeom_SurfaceOfRevolution)::DownCast(SS);
-    return StepToGeom_MakeSurfaceOfRevolution::Convert(Sur,*((Handle(Geom_SurfaceOfRevolution)*)&CS));
+    return StepToGeom_MakeSurfaceOfRevolution::Convert(Sur,Handle(Geom_SurfaceOfRevolution)::DownCast (CS));
   }
   return Standard_False;
 }       
index 79d95eee83f4e0a08dc7207cd105c27fb17a5a20..b0cea80f013be8eff76483d64aa4cce2408fe642 100644 (file)
@@ -35,9 +35,9 @@
 
 #include <Standard_TypeMismatch.hxx>
 
-#define DeclareAndSpeedCast(V,T,Vdown) Handle(T) Vdown = *((Handle(T)*)& V)
+#define DeclareAndSpeedCast(V,T,Vdown) Handle(T) Vdown = Handle(T)::DownCast (V)
 #define DeclareConstAndSpeedCast(V,T,Vdown) const Handle(T)& Vdown = (Handle(T)&) V
-#define SpeedCast(V,T,Vdown) Vdown = *((Handle(T)*)& V)
+#define SpeedCast(V,T,Vdown) Vdown = Handle(T)::DownCast (V)
 
 
 //=======================================================================
index 30687aeb7db07a335bf6a1885289e0fb394ece5b..a636099e6094edf21e5fc2137df077845928aee7 100644 (file)
@@ -40,9 +40,9 @@
 
 #include <Standard_TypeMismatch.hxx>
 
-#define DeclareAndSpeedCast(V,T,Vdown) Handle(T) Vdown = *((Handle(T)*)& V)
+#define DeclareAndSpeedCast(V,T,Vdown) Handle(T) Vdown = Handle(T)::DownCast (V)
 #define DeclareConstAndSpeedCast(V,T,Vdown) const Handle(T)& Vdown = (Handle(T)&) V
-#define SpeedCast(V,T,Vdown) Vdown = *((Handle(T)*)& V)
+#define SpeedCast(V,T,Vdown) Vdown = Handle(T)::DownCast (V)
 
 
 //=======================================================================
index ba66b32aa4041e1d5c11f68802450183133e165e..3d824ac345a2b9af961a604b7a84806846a96ba0 100644 (file)
@@ -238,7 +238,7 @@ Handle(TDF_DeltaOnModification) TDataStd_ByteArray::DeltaOnModification
 (const Handle(TDF_Attribute)& OldAttribute) const
 {
   if(myIsDelta)
-    return new TDataStd_DeltaOnModificationOfByteArray(*((Handle(TDataStd_ByteArray)*)&OldAttribute));
+    return new TDataStd_DeltaOnModificationOfByteArray(Handle(TDataStd_ByteArray)::DownCast (OldAttribute));
   else return new TDF_DefaultDeltaOnModification(OldAttribute);
 }
 
index b694a54486dca937d4beab7005cb580f66722d25..a94aad36b29bb766407275daab1a2d4f6cebaf57 100644 (file)
@@ -97,7 +97,7 @@ void TDataStd_DeltaOnModificationOfByteArray::Apply()
 {
 
   Handle(TDF_Attribute) TDFAttribute = Attribute();
-  Handle(TDataStd_ByteArray) BackAtt = (*((Handle(TDataStd_ByteArray)*)&TDFAttribute));
+  Handle(TDataStd_ByteArray) BackAtt = Handle(TDataStd_ByteArray)::DownCast (TDFAttribute);
   if(BackAtt.IsNull()) {
 #ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfByteArray::Apply: OldAtt is Null" <<endl;
index b18e18cd5af4aa3b7c74a031c7f919119f849f84..ee8c6ee577f4d79df5d8805a9eeb9a49113c4875 100644 (file)
@@ -96,7 +96,7 @@ void TDataStd_DeltaOnModificationOfExtStringArray::Apply()
 {
 
   Handle(TDF_Attribute) TDFAttribute = Attribute();
-  Handle(TDataStd_ExtStringArray) BackAtt = (*((Handle(TDataStd_ExtStringArray)*)&TDFAttribute));
+  Handle(TDataStd_ExtStringArray) BackAtt = Handle(TDataStd_ExtStringArray)::DownCast (TDFAttribute);
   if(BackAtt.IsNull()) {
 #ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfExtStringArray::Apply: OldAtt is Null" <<endl;
index b0cb0c00e666b23ce4e27c663557311b43f3fe6b..9acfe8b8d94f4362561a14eea0f4b923f047603a 100644 (file)
@@ -94,7 +94,7 @@ void TDataStd_DeltaOnModificationOfIntArray::Apply()
 {
 
   Handle(TDF_Attribute) TDFAttribute = Attribute();
-  Handle(TDataStd_IntegerArray) BackAtt = (*((Handle(TDataStd_IntegerArray)*)&TDFAttribute));
+  Handle(TDataStd_IntegerArray) BackAtt = Handle(TDataStd_IntegerArray)::DownCast (TDFAttribute);
   if(BackAtt.IsNull()) {
 #ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfIntArray::Apply: OldAtt is Null" <<endl;
index 2cb297d6930167b3d03b4be7377ed4e33a681266..c342d1cc21369040f48d6d69ca005dc4366db9a0 100644 (file)
@@ -79,7 +79,7 @@ void TDataStd_DeltaOnModificationOfIntPackedMap::Apply()
 {
 
   Handle(TDF_Attribute) aTDFAttribute = Attribute();
-  Handle(TDataStd_IntPackedMap) aBackAtt = (*((Handle(TDataStd_IntPackedMap)*)&aTDFAttribute));
+  Handle(TDataStd_IntPackedMap) aBackAtt = Handle(TDataStd_IntPackedMap)::DownCast (aTDFAttribute);
   if(aBackAtt.IsNull()) {
 #ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfIntPAckedMap::Apply: OldAtt is Null" <<endl;
index b7699a9ef28b8ac61153c8030038b8ae4b69d88c..bc11404d587e5bbcb0ae4c7e178459ab9a8d586d 100644 (file)
@@ -93,7 +93,7 @@ void TDataStd_DeltaOnModificationOfRealArray::Apply()
 {
 
   Handle(TDF_Attribute) TDFAttribute = Attribute();
-  Handle(TDataStd_RealArray) BackAtt = (*((Handle(TDataStd_RealArray)*)&TDFAttribute));
+  Handle(TDataStd_RealArray) BackAtt = Handle(TDataStd_RealArray)::DownCast (TDFAttribute);
   if(BackAtt.IsNull()) {
 #ifdef OCCT_DEBUG
     cout << "DeltaOnModificationOfRealArray::Apply: OldAtt is Null" <<endl;
index 1d58aec79892f5d247d33d3669bdeebec5541819..f7630bf0db7602c5d49096809e079c4e498b546d 100644 (file)
@@ -266,7 +266,7 @@ Handle(TDF_DeltaOnModification) TDataStd_ExtStringArray::DeltaOnModification
 (const Handle(TDF_Attribute)& OldAttribute) const
 {
   if(myIsDelta)
-    return new TDataStd_DeltaOnModificationOfExtStringArray(*((Handle(TDataStd_ExtStringArray)*)&OldAttribute));
+    return new TDataStd_DeltaOnModificationOfExtStringArray(Handle(TDataStd_ExtStringArray)::DownCast (OldAttribute));
   else return new TDF_DefaultDeltaOnModification(OldAttribute);
 }
 
index e669f1cb0aee6fc0acaf40b3e64f60e68fc155f9..63187d57a31ea0a410916ab9f03ee005338c17f2 100644 (file)
@@ -209,7 +209,7 @@ Handle(TDF_DeltaOnModification) TDataStd_IntPackedMap::DeltaOnModification
 (const Handle(TDF_Attribute)& OldAttribute) const
 {
   if(myIsDelta)
-    return new TDataStd_DeltaOnModificationOfIntPackedMap(*((Handle(TDataStd_IntPackedMap)*)&OldAttribute));
+    return new TDataStd_DeltaOnModificationOfIntPackedMap(Handle(TDataStd_IntPackedMap)::DownCast (OldAttribute));
   else return new TDF_DefaultDeltaOnModification(OldAttribute);
 }
 
index 77a8d3aaa6e0e14abb9682977f2753a7e91859d7..0238732738da0cdec0ea49f0b0c3f9ff74a4a48b 100644 (file)
@@ -267,7 +267,7 @@ Handle(TDF_DeltaOnModification) TDataStd_IntegerArray::DeltaOnModification
 (const Handle(TDF_Attribute)& OldAttribute) const
 {
   if(myIsDelta)
-    return new TDataStd_DeltaOnModificationOfIntArray(*((Handle(TDataStd_IntegerArray)*)&OldAttribute));
+    return new TDataStd_DeltaOnModificationOfIntArray(Handle(TDataStd_IntegerArray)::DownCast (OldAttribute));
   else return new TDF_DefaultDeltaOnModification(OldAttribute);
 }
 
index cfeac02de5551b5cd5e698c06206241eb86b9bd9..5d640a2015ae48803b29eab06662ab7b8a77729e 100644 (file)
@@ -263,6 +263,6 @@ Handle(TDF_DeltaOnModification) TDataStd_RealArray::DeltaOnModification
 (const Handle(TDF_Attribute)& OldAtt) const
 {
   if(myIsDelta)
-    return new TDataStd_DeltaOnModificationOfRealArray(*((Handle(TDataStd_RealArray)*)&OldAtt));
+    return new TDataStd_DeltaOnModificationOfRealArray(Handle(TDataStd_RealArray)::DownCast (OldAtt));
   else return new TDF_DefaultDeltaOnModification(OldAtt);
 }
index 63130aedff2e912fd9c839104964f3becc3ca6d0..bf90e2d38ee2eba0d9891f73937a668d0dee8128 100644 (file)
@@ -212,7 +212,7 @@ void TDataXtd_Constraint::SetPlane(const Handle(TNaming_NamedShape)& plane)
 //=======================================================================
 const Handle(TNaming_NamedShape)&  TDataXtd_Constraint::GetPlane() const 
 {
-  return (Handle(TNaming_NamedShape)&) myPlane;
+  return Handle(TNaming_NamedShape)::DownCast (myPlane);
 }
 
 //=======================================================================
index 6cbbe85b224af3f97b5b6ff657c9b971665ca047..a8a166930212220f23f046164a16f70bdd89f9ab 100644 (file)
@@ -285,7 +285,7 @@ Standard_Boolean TDataXtd_Geometry::Plane(const Handle(TNaming_NamedShape)& NS,
     Handle(Geom_Surface) surface = BRep_Tool::Surface (face);
     if (!surface.IsNull())  {
        if (surface->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) 
-        surface = ((Handle(Geom_RectangularTrimmedSurface)&) surface)->BasisSurface();
+        surface = Handle(Geom_RectangularTrimmedSurface)::DownCast (surface)->BasisSurface();
        Handle(Geom_Plane) S = Handle(Geom_Plane)::DownCast(surface);  
        if (!S.IsNull()) {
         G = S->Pln();
@@ -326,7 +326,7 @@ Standard_Boolean TDataXtd_Geometry::Cylinder(const Handle(TNaming_NamedShape)& N
     Handle(Geom_Surface) surface = BRep_Tool::Surface (face);
     if (!surface.IsNull())  {
       if (surface->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) 
-       surface = ((Handle(Geom_RectangularTrimmedSurface)&) surface)->BasisSurface();
+       surface = Handle(Geom_RectangularTrimmedSurface)::DownCast (surface)->BasisSurface();
       Handle(Geom_CylindricalSurface) S = Handle(Geom_CylindricalSurface)::DownCast(surface);
       if (!S.IsNull()) {
        G = S->Cylinder();
@@ -401,7 +401,7 @@ TDataXtd_GeometryEnum  TDataXtd_Geometry::Type (const Handle(TNaming_NamedShape)
       Handle(Geom_Surface) surface = BRep_Tool::Surface (face);
       if (!surface.IsNull()) {
        if (surface->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) { 
-         surface = ((Handle(Geom_RectangularTrimmedSurface)&) surface)->BasisSurface();
+         surface = Handle(Geom_RectangularTrimmedSurface)::DownCast (surface)->BasisSurface();
        }
        if (surface->IsInstance(STANDARD_TYPE(Geom_CylindricalSurface))) {
          type = TDataXtd_CYLINDER;
index 4ba6afd18372071cd49514e9a9ef4154bdfbf237..246afaa2280d9bff3758f14e646235410d857980 100644 (file)
@@ -227,8 +227,7 @@ Handle(TDF_Attribute) TDocStd_XLink::BackupCopy() const
 
 void TDocStd_XLink::Restore(const Handle(TDF_Attribute)& anAttribute) 
 {
-  const Handle(TDocStd_XLink)& xRef =
-    Handle(TDocStd_XLink)::DownCast(anAttribute);
+  Handle(TDocStd_XLink) xRef (Handle(TDocStd_XLink)::DownCast(anAttribute));
   if (!xRef.IsNull()) {
     myDocEntry = xRef->DocumentEntry();
     myLabelEntry = xRef->LabelEntry();
@@ -254,8 +253,7 @@ void TDocStd_XLink::Paste
 (const Handle(TDF_Attribute)& intoAttribute,
  const Handle(TDF_RelocationTable)& /*aRelocationTable*/) const
 {
-  const Handle(TDocStd_XLink)& xRef =
-    Handle(TDocStd_XLink)::DownCast(intoAttribute);
+  Handle(TDocStd_XLink) xRef (Handle(TDocStd_XLink)::DownCast(intoAttribute));
   if (!xRef.IsNull()) {
     xRef->DocumentEntry(myDocEntry);
     xRef->LabelEntry(myLabelEntry);
index 0ab91187e34ae3f08a591b0c822fe639ca03c084..14b8c264e24f8a2892a2de04c5b890f866373238 100644 (file)
@@ -109,7 +109,7 @@ void TNaming_DeltaOnModification::Apply()
 {
 
   Handle(TDF_Attribute) TDFAttribute = Attribute();
-  Handle(TNaming_NamedShape) NS = (*((Handle(TNaming_NamedShape)*)&TDFAttribute));
+  Handle(TNaming_NamedShape) NS = Handle(TNaming_NamedShape)::DownCast (TDFAttribute);
   
 
   // If there is no attribute, reinsert the previous. Otherwise a new one 
index 2d0930b1186d3c0ddd8af9c2e450c9f08c2231b2..2edacafb651ef9ca26fa1d1d23b0d37b1ddfe398 100644 (file)
@@ -422,7 +422,7 @@ Handle(TDF_DeltaOnModification) TNaming_NamedShape::DeltaOnModification
 (const Handle(TDF_Attribute)& anOldAttribute) const
 {
   
-  return new TNaming_DeltaOnModification(*((Handle(TNaming_NamedShape)*)&anOldAttribute));
+  return new TNaming_DeltaOnModification(Handle(TNaming_NamedShape)::DownCast (anOldAttribute));
 }
 
 //=======================================================================
index bf7a7d6b491ee714a0c1480257f227807d9878bf..02d17cb83b23cbbcd2c6b9225e926be9713728ef 100644 (file)
@@ -153,7 +153,7 @@ static Standard_Boolean IsSpecificCase(const  TDF_Label& F, const TopoDS_Shape&
     }
 
     for(;cit.More();cit.Next()) {
-      const Handle(TNaming_NamedShape)& NS = Handle(TNaming_NamedShape)::DownCast(cit.Value()); 
+      Handle(TNaming_NamedShape) NS (Handle(TNaming_NamedShape)::DownCast(cit.Value())); 
       if(!NS.IsNull()) {  
        TopoDS_Shape aS = TNaming_Tool::CurrentShape(NS);
        if(aS.IsNull()) continue;
index 4f778e6d51edf88d7eb8a49bf64d5ec59a71a28e..74578c034b22363b0ee76e1345d98e0e7e8b1719 100644 (file)
@@ -587,7 +587,7 @@ void TNaming_Tool::FindShape(const TDF_LabelMap&               Valid,
 #ifdef OCCT_DEBUG
 //      Standard_Integer nbExtArgs = extArgs.Extent();
 #endif
-      const Handle(TNaming_NamedShape)& anExtArg = Handle(TNaming_NamedShape)::DownCast(itr.Key());
+      Handle(TNaming_NamedShape) anExtArg (Handle(TNaming_NamedShape)::DownCast(itr.Key()));
       const Handle(TNaming_NamedShape)& aCurrentExtArg = TNaming_Tool::CurrentNamedShape(anExtArg);
       if (!aCurrentExtArg.IsNull() && !aCurrentExtArg->IsEmpty())
        extArgs.Append(aCurrentExtArg);
index 9ff936ceeb99586c57cf1d8089eeb2061afe2852..2e0730e81a78cc02199cc62e42b1c663f6dc7eb1 100644 (file)
@@ -132,8 +132,8 @@ void TNaming_Translator::DumpMap(const Standard_Boolean isWrite) const
         T == STANDARD_TYPE (TopoDS_TCompSolid)|| T == STANDARD_TYPE (TopoDS_TCompound))
        {
          if(isWrite) {
-           const Handle(TopoDS_TShape)& key = Handle(TopoDS_TShape)::DownCast(myMap.FindKey(i));
-           const Handle(TopoDS_TShape)& item = Handle(TopoDS_TShape)::DownCast(myMap.FindFromIndex(i));
+           Handle(TopoDS_TShape) key (Handle(TopoDS_TShape)::DownCast(myMap.FindKey(i)));
+           Handle(TopoDS_TShape) item (Handle(TopoDS_TShape)::DownCast(myMap.FindFromIndex(i)));
            TopoDS_Shape S1; S1.TShape(key);
            TopoDS_Shape S2; S2.TShape(item);
            BRepTools::Write(S1, keyname.Cat(i).ToCString());
index 75c82c27deb305707f0d9e93bc7eae6fe1b92248..283506fec0f08f5259451bab28d6466860c95467 100644 (file)
@@ -1076,11 +1076,11 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
     }
     ais->SetMeasuredGeometry (TopoDS::Face (shape1), TopoDS::Face (shape2));
     if (isplan)
-      ais->SetCustomPlane (((Handle(Geom_Plane)&) ageom3)->Pln());
+      ais->SetCustomPlane (Handle(Geom_Plane)::DownCast (ageom3)->Pln());
     else if (!isCurvilinear)
     {
       gp_Pln aPlane;
-      aPlane.SetAxis (((Handle(Geom_Line)&) ageom3)->Position());
+      aPlane.SetAxis (Handle(Geom_Line)::DownCast (ageom3)->Position());
       ais->SetCustomPlane (aPlane);
     }
   }
@@ -1847,7 +1847,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
        // Works only with line !!
 //#ifndef OCCT_DEBUG
         Handle(Geom_Geometry) aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
-        gp_Lin OLin = ((Handle(Geom_Line)&) aGeomGeometry)->Lin();
+        gp_Lin OLin = Handle(Geom_Line)::DownCast (aGeomGeometry)->Lin();
 //#else
 //     gp_Lin OLin = ((Handle(Geom_Line)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Lin();
 //#endif
@@ -1855,7 +1855,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
        CURVE.Initialize (NE);
 //#ifndef OCCT_DEBUG
         aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
-        gp_Lin NLin = ((Handle(Geom_Line)&)aGeomGeometry)->Lin();
+        gp_Lin NLin = Handle(Geom_Line)::DownCast (aGeomGeometry)->Lin();
 //#else
 //     gp_Lin NLin = ((Handle(Geom_Line)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Lin();
 //#endif
@@ -1878,7 +1878,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
       if (CURVE.GetType() == GeomAbs_Circle)  {
 //#ifndef OCCT_DEBUG
         Handle(Geom_Geometry) aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
-        gp_Ax1 ax = ((Handle(Geom_Circle)&) aGeomGeometry)->Circ().Axis();
+        gp_Ax1 ax = Handle(Geom_Circle)::DownCast (aGeomGeometry)->Circ().Axis();
 //#else
 //     gp_Ax1 ax = ((Handle(Geom_Circle)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Circ().Axis();
 //#endif
@@ -1904,7 +1904,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
       if (MkF.IsDone())  {
 //#ifndef OCCT_DEBUG
         Handle(Geom_Surface) aGeomSurface = BRep_Tool::Surface(MkF.Face());
-        aplane = (Handle(Geom_Plane)&) aGeomSurface ;
+        aplane = Handle(Geom_Plane)::DownCast (aGeomSurface) ;
 //#else
 //     aplane = ((Handle(Geom_Plane)&) BRep_Tool::Surface(MkF.Face()));
 //#endif
index 46e3af386fae94eb3f09f76e9a0b7ce7389c65ef..885d409f6e98a2efc1aa3311b6f36c4a2bb2aa6f 100644 (file)
@@ -116,13 +116,13 @@ void TopOpeBRep_LineInter::SetLine(const Handle(IntPatch_Line)& L,
 
   switch (type) {
   case IntPatch_Analytic :
-    myILA = *((Handle(IntPatch_ALine)*)&L); break;
+    myILA = Handle(IntPatch_ALine)::DownCast (L); break;
   case IntPatch_Restriction :
-    myILR = *((Handle(IntPatch_RLine)*)&L); break;
+    myILR = Handle(IntPatch_RLine)::DownCast (L); break;
   case IntPatch_Walking : 
-    myILW = *((Handle(IntPatch_WLine)*)&L); break;
+    myILW = Handle(IntPatch_WLine)::DownCast (L); break;
   default :  //"geometric" line
-    myILG = *((Handle(IntPatch_GLine)*)&L); break;
+    myILG = Handle(IntPatch_GLine)::DownCast (L); break;
   }
 
   // transform an analytic line to a walking line
index 88b65762ceb6ef5230dea50f39a670da3ceb45ae..c54d1f14ddc3df770ee339bda812728e68efebd3 100644 (file)
@@ -400,7 +400,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
 {
   const Handle(TopOpeBRepDS_HDataStructure)& HDS=myPB->DataStructure();
   const TopOpeBRepDS_DataStructure& BDS= HDS->DS();
-  const Handle(TopOpeBRepDS_ShapeShapeInterference)& SSI=Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(I);
+  Handle(TopOpeBRepDS_ShapeShapeInterference) SSI (Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(I));
   TopAbs_State TB1,TB2;myPG->StatesON(TB1,TB2); TopAbs_State TB=TB1;
   TopOpeBRepDS_Kind GT,ST;Standard_Integer GI,SI;FDS_data(SSI,GT,GI,ST,SI);
   const TopOpeBRepDS_Transition& TFE=SSI->Transition(); Standard_Boolean EGBoundFOR=SSI->GBound();
@@ -1179,7 +1179,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter
     Standard_Boolean ssif = Standard_False; Handle(TopOpeBRepDS_ShapeShapeInterference) ssie3;
     TopOpeBRepDS_ListIteratorOfListOfInterference itssi(BDS.ShapeInterferences(FCX));
     for (;itssi.More();itssi.Next()) {
-      const Handle(TopOpeBRepDS_ShapeShapeInterference)& ssi = Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(itssi.Value()); if (ssi.IsNull()) continue;
+      Handle(TopOpeBRepDS_ShapeShapeInterference) ssi (Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(itssi.Value())); if (ssi.IsNull()) continue;
       TopOpeBRepDS_Kind GT1,ST1; Standard_Integer G1,S1; FDS_data(ssi,GT1,G1,ST1,S1);
       Standard_Boolean cond = (GT1 == TopOpeBRepDS_EDGE && ST1 == TopOpeBRepDS_FACE);
       cond = cond && (G1 == ie3); 
index fa825088dba1d1cbcf62726c8d1106420bbae3da..2987afdfd4acf3bc324cf27d04f24b8bc30ea131 100644 (file)
@@ -106,7 +106,7 @@ void TopOpeBRepBuild_BuilderON::GFillONParts2dWES2(const Handle(TopOpeBRepDS_Int
 {
   const Handle(TopOpeBRepDS_HDataStructure)& HDS=myPB->DataStructure();
   const TopOpeBRepDS_DataStructure& BDS= HDS->DS();
-  const Handle(TopOpeBRepDS_ShapeShapeInterference)& SSI=Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(I);
+  Handle(TopOpeBRepDS_ShapeShapeInterference) SSI (Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(I));
   TopAbs_State TB1,TB2;myPG->StatesON(TB1,TB2);
   TopOpeBRepDS_Kind GT,ST;Standard_Integer GI,SI;FDS_data(SSI,GT,GI,ST,SI);
 //  const TopOpeBRepDS_Transition& TFE=SSI->Transition(); 
index da7edae5bb9d4d8fd142b1890449f5385d605941..06e56cab6bb6d7f9ec04bb8d1a92d98eb6dce895 100644 (file)
@@ -120,7 +120,7 @@ void TopOpeBRepBuild_EdgeBuilder::NextVertex()
 const TopoDS_Shape& TopOpeBRepBuild_EdgeBuilder::Vertex() const
 {
   const Handle(TopOpeBRepBuild_Loop)& L = Loop();
-  const Handle(TopOpeBRepBuild_Pave)& PV = *((Handle(TopOpeBRepBuild_Pave)*)&L);
+  Handle(TopOpeBRepBuild_Pave) PV (Handle(TopOpeBRepBuild_Pave)::DownCast (L));
   const TopoDS_Shape& V = PV->Vertex();
   return V;
 }
@@ -133,7 +133,7 @@ const TopoDS_Shape& TopOpeBRepBuild_EdgeBuilder::Vertex() const
 Standard_Real TopOpeBRepBuild_EdgeBuilder::Parameter() const
 {
   const Handle(TopOpeBRepBuild_Loop)& L = Loop();
-  const Handle(TopOpeBRepBuild_Pave)& PV = *((Handle(TopOpeBRepBuild_Pave)*)&L);
+  Handle(TopOpeBRepBuild_Pave) PV (Handle(TopOpeBRepBuild_Pave)::DownCast (L));
   Standard_Real parV = PV->Parameter();
   return parV;
 }
index 415074b1ac10fa9f988725b713781a9c78adb877..e4a372b08051ed30b5b3390c07c3cd9eb45e1c0d 100644 (file)
@@ -1040,24 +1040,24 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1,
   C1 = BRep_Tool::Curve(E1,loc,f1,l1);
   if (!loc.IsIdentity()) {
     Handle(Geom_Geometry) GG1 = C1->Transformed(loc.Transformation());
-    C1 = *((Handle(Geom_Curve)*)&GG1);
+    C1 = Handle(Geom_Curve)::DownCast (GG1);
   }
   C2 = BRep_Tool::Curve(E2,loc,f2,l2);
   if (!loc.IsIdentity()) {
     Handle(Geom_Geometry) GG2 = C2->Transformed(loc.Transformation());
-    C2 = *((Handle(Geom_Curve)*)&GG2);
+    C2 = Handle(Geom_Curve)::DownCast (GG2);
   }
   
   typC1 = C1->DynamicType();
   typC2 = C2->DynamicType();
   
   if (typC1 == STANDARD_TYPE(Geom_TrimmedCurve)) {
-    C1 =  (*((Handle(Geom_TrimmedCurve)*)&C1))->BasisCurve();
+    C1 =  Handle(Geom_TrimmedCurve)::DownCast (C1)->BasisCurve();
     typC1 = C1->DynamicType();
   }
   
   if (typC2 == STANDARD_TYPE(Geom_TrimmedCurve)) {
-    C2 =  (*((Handle(Geom_TrimmedCurve)*)&C2))->BasisCurve();
+    C2 =  Handle(Geom_TrimmedCurve)::DownCast (C2)->BasisCurve();
     typC2 = C2->DynamicType();
   }
   
@@ -1080,8 +1080,8 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1,
   const Standard_Real tollin = Precision::Confusion();
   const Standard_Real tolang = Precision::Angular();
   if (typC1 == STANDARD_TYPE(Geom_Line)) {
-    gp_Lin li1( (*((Handle(Geom_Line)*)&C1))->Lin());
-    gp_Lin li2( (*((Handle(Geom_Line)*)&C2))->Lin());
+    gp_Lin li1( Handle(Geom_Line)::DownCast (C1)->Lin());
+    gp_Lin li2( Handle(Geom_Line)::DownCast (C2)->Lin());
     
     if (Abs(li1.Angle(li2)) <= tolang &&
        li1.Location().SquareDistance(li2.Location()) <= tollin*tollin) {
@@ -1090,8 +1090,8 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1,
     return Standard_False;
   } 
   else if (typC1 == STANDARD_TYPE(Geom_Circle)) {
-    gp_Circ ci1 = (*((Handle(Geom_Circle)*)&C1))->Circ();
-    gp_Circ ci2 = (*((Handle(Geom_Circle)*)&C2))->Circ();
+    gp_Circ ci1 = Handle(Geom_Circle)::DownCast (C1)->Circ();
+    gp_Circ ci2 = Handle(Geom_Circle)::DownCast (C2)->Circ();
     if (Abs(ci1.Radius()-ci2.Radius()) <= tollin &&
        ci1.Location().SquareDistance(ci2.Location()) <= tollin*tollin) {
       // Point debut, calage dans periode, et detection meme sens
@@ -1100,8 +1100,8 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1,
     return Standard_False;
   }
   else if (typC1 == STANDARD_TYPE(Geom_Ellipse)) {
-    gp_Elips ci1 = (*((Handle(Geom_Ellipse)*)&C1))->Elips();
-    gp_Elips ci2 = (*((Handle(Geom_Ellipse)*)&C2))->Elips();
+    gp_Elips ci1 = Handle(Geom_Ellipse)::DownCast (C1)->Elips();
+    gp_Elips ci2 = Handle(Geom_Ellipse)::DownCast (C2)->Elips();
     
     if (Abs(ci1.MajorRadius()-ci2.MajorRadius()) <= tollin &&
        Abs(ci1.MinorRadius()-ci2.MinorRadius()) <= tollin &&
@@ -1112,8 +1112,8 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1,
     return Standard_False;
   }
   else if (typC1 == STANDARD_TYPE(Geom_BSplineCurve)) {
-    Handle(Geom_BSplineCurve) B1 = *((Handle(Geom_BSplineCurve)*)&C1);
-    Handle(Geom_BSplineCurve) B2 = *((Handle(Geom_BSplineCurve)*)&C2);
+    Handle(Geom_BSplineCurve) B1 = Handle(Geom_BSplineCurve)::DownCast (C1);
+    Handle(Geom_BSplineCurve) B2 = Handle(Geom_BSplineCurve)::DownCast (C2);
    
     Standard_Integer nbpoles = B1->NbPoles();
     if (nbpoles != B2->NbPoles()) {
@@ -1178,8 +1178,8 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1,
     return Standard_True;
   }
   else if (typC1 == STANDARD_TYPE(Geom_BezierCurve)) {
-    Handle(Geom_BezierCurve) B1 = *((Handle(Geom_BezierCurve)*)&C1);
-    Handle(Geom_BezierCurve) B2 = *((Handle(Geom_BezierCurve)*)&C2);
+    Handle(Geom_BezierCurve) B1 = Handle(Geom_BezierCurve)::DownCast (C1);
+    Handle(Geom_BezierCurve) B2 = Handle(Geom_BezierCurve)::DownCast (C2);
     
     Standard_Integer nbpoles = B1->NbPoles();
     if (nbpoles != B2->NbPoles()) {
index c0b139ea3d5ac04fc6cd74b7bf637dcb2728737f..39b31ff1d01695bb64c899b0595bd1f4591be994 100644 (file)
@@ -949,7 +949,7 @@ static Standard_Boolean allIonsectionedges(const Handle(TopOpeBRepDS_HDataStruct
 {  
   TopOpeBRepDS_ListIteratorOfListOfInterference it1(HDS->DS().ShapeInterferences(f1));
   for (; it1.More(); it1.Next()){
-    const Handle(TopOpeBRepDS_ShapeShapeInterference)& SSI1 = Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(it1.Value());    
+    Handle(TopOpeBRepDS_ShapeShapeInterference) SSI1 (Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(it1.Value()));    
     Standard_Integer G1 = SSI1->Geometry();
     Standard_Boolean isgbound = SSI1->GBound();
     const TopoDS_Shape& e1 = HDS->Shape(G1);
index 0b829e0380843d3af0a10021eadeebe37575b8b2..4b670891f9bc4f135f2ec2a76c76e74dc8570f2b 100644 (file)
@@ -544,7 +544,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
     const TopOpeBRepDS_ListOfInterference& LI = BDS.ShapeInterferences(FF); Standard_Integer nLI = LI.Extent(); 
     if (nLI == 0) continue;
     for (TopOpeBRepDS_ListIteratorOfListOfInterference ILI(LI); ILI.More(); ILI.Next() ) {
-      const Handle(TopOpeBRepDS_ShapeShapeInterference)& SSI = Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(ILI.Value()); 
+      Handle(TopOpeBRepDS_ShapeShapeInterference) SSI (Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(ILI.Value())); 
       if (SSI.IsNull()) continue;      
       TopOpeBRepDS_Kind GT,ST;Standard_Integer GI,SI;FDS_data(SSI,GT,GI,ST,SI); 
       if (ST != TopOpeBRepDS_FACE) continue;      
@@ -590,7 +590,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
     const TopOpeBRepDS_ListOfInterference& LI = BDS.ShapeInterferences(FF); Standard_Integer nLI = LI.Extent(); 
     if (nLI == 0) continue;
     for (TopOpeBRepDS_ListIteratorOfListOfInterference ILI(LI); ILI.More(); ILI.Next() ) {
-      const Handle(TopOpeBRepDS_ShapeShapeInterference)& SSI = Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(ILI.Value()); 
+      Handle(TopOpeBRepDS_ShapeShapeInterference) SSI (Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(ILI.Value())); 
       if (SSI.IsNull()) continue;      
       TopOpeBRepDS_Kind GT,ST;Standard_Integer GI,SI;FDS_data(SSI,GT,GI,ST,SI); 
       if (ST != TopOpeBRepDS_FACE) continue;      
index 80a12e89c6b49ef6026eba904e80ce43c3b935f2..afbaacc65ad14d6384b6b74947c61de41d9b72f4 100644 (file)
@@ -193,7 +193,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape,
   }
   
   if (!myCref.IsNull()) {
-    const Handle(BRep_GCurve)& GCref = *((Handle(BRep_GCurve)*)&myCref);
+    Handle(BRep_GCurve) GCref (Handle(BRep_GCurve)::DownCast (myCref));
     Standard_Real First,Last;
     GCref->Range(First,Last);
     if (Last<=First) {
@@ -245,7 +245,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape,
       const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
       if (cr != myCref && cr->IsCurveOnSurface(Su,L)) {
         pcurvefound = Standard_True;
-        const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
+        Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
         Standard_Real f,l;
         GC->Range(f,l);
         if (SameRange && (f != First || l != Last)) {
@@ -492,7 +492,7 @@ void CheckEdge (const TopoDS_Edge& Ed, const Standard_Real aMaxTol)
           
           TopAbs_Orientation orv = aVertex.Orientation();
           if (orv == TopAbs_FORWARD || orv == TopAbs_REVERSED) {
-            const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
+            Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
             
             if (orv==TopAbs_FORWARD)
               Controlp = C->Value(GC->First());
index cf437e9e4172af8b23fc12f9c30395afdeef39fe..864c56d8b32a121fd6e892e3faa85b2107306ab7 100644 (file)
@@ -521,7 +521,7 @@ void TopOpeBRepBuild_WireEdgeSet::IsUVISO(const TopoDS_Edge& E,const TopoDS_Face
 
   Handle(Standard_Type) TheType = PC->DynamicType();
   if (TheType == STANDARD_TYPE(Geom2d_Line)) {
-    const Handle(Geom2d_Line)& HL = *((Handle(Geom2d_Line)*)&PC);
+    Handle(Geom2d_Line) HL (Handle(Geom2d_Line)::DownCast (PC));
     const gp_Dir2d&  D = HL->Direction();
     Standard_Real    tol = Precision::Angular();
 
index 9aae4626e3fd68ecd47161df5c8ba7adee858c72..c6a11b95348daf85ade812ff4e68afcf56d94acb 100644 (file)
@@ -573,7 +573,7 @@ void TopOpeBRepBuild_Builder::GFABUMakeFaces(const TopoDS_Shape& FF,TopOpeBRepBu
     Standard_Boolean istrim = ( T == STANDARD_TYPE(Geom_RectangularTrimmedSurface) );
     if (istrim) {
       Handle(Geom_RectangularTrimmedSurface) 
-       hrts=*((Handle(Geom_RectangularTrimmedSurface)*)&Surf);
+       hrts=Handle(Geom_RectangularTrimmedSurface)::DownCast (Surf);
       Standard_Real oumin,oumax,ovmin,ovmax;
       hrts->Bounds(oumin,oumax,ovmin,ovmax);
       Standard_Real umin,umax,vmin,vmax;
index e433a931ee9c1c66bb65d392493adeed2a187898..22b9af19d16d6d24a60d48852602ceaedfed411d 100644 (file)
@@ -478,8 +478,7 @@ Standard_Boolean CheckEdgeParameter(const Handle(TopOpeBRepDS_HDataStructure)& m
     it1.Initialize(LI);
     while (it1.More() ) {
       const Handle(TopOpeBRepDS_Interference)& I1 = it1.Value();
-      const Handle(TopOpeBRepDS_CurvePointInterference)& CPI =
-       Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I1);
+      Handle(TopOpeBRepDS_CurvePointInterference) CPI (Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I1));
       if(!CPI.IsNull()) {
        Standard_Integer Param = 
 //#ifdef OCCT_DEBUG
index 59e251aa4ee1710c7e26243fbcef38fa28de23e7..42992936bba5df9813746d8c61917fa9acfcbd86 100644 (file)
@@ -269,7 +269,7 @@ const Handle(Geom2d_Curve)&  TopOpeBRepDS_Curve::Curve1()const
 {
   if ( ! mySCI1.IsNull() ) {
     return 
-      (*((Handle(TopOpeBRepDS_SurfaceCurveInterference)*)&mySCI1))->PCurve();
+      Handle(TopOpeBRepDS_SurfaceCurveInterference)::DownCast (mySCI1)->PCurve();
   }
   else {
     static Handle(Geom2d_Curve) STALOC_Geom2dCurveNull1;
@@ -285,7 +285,7 @@ const Handle(Geom2d_Curve)&  TopOpeBRepDS_Curve::Curve1()const
 void TopOpeBRepDS_Curve::Curve1(const Handle(Geom2d_Curve)& PC1)
 {
   if ( ! mySCI1.IsNull() ) {
-    (*((Handle(TopOpeBRepDS_SurfaceCurveInterference)*)&mySCI1))->PCurve(PC1);
+    Handle(TopOpeBRepDS_SurfaceCurveInterference)::DownCast (mySCI1)->PCurve(PC1);
   }
 }
 
@@ -299,7 +299,7 @@ const Handle(Geom2d_Curve)&  TopOpeBRepDS_Curve::Curve2()const
 {
   if ( ! mySCI2.IsNull() ) {
     return 
-      (*((Handle(TopOpeBRepDS_SurfaceCurveInterference)*)&mySCI2))->PCurve();
+      Handle(TopOpeBRepDS_SurfaceCurveInterference)::DownCast (mySCI2)->PCurve();
   }
   else {
     static Handle(Geom2d_Curve) STALOC_Geom2dCurveNull2;
@@ -315,7 +315,7 @@ const Handle(Geom2d_Curve)&  TopOpeBRepDS_Curve::Curve2()const
 void TopOpeBRepDS_Curve::Curve2(const Handle(Geom2d_Curve)& PC2)
 {
   if ( ! mySCI2.IsNull() ) {
-    (*((Handle(TopOpeBRepDS_SurfaceCurveInterference)*)&mySCI2))->PCurve(PC2);
+    Handle(TopOpeBRepDS_SurfaceCurveInterference)::DownCast (mySCI2)->PCurve(PC2);
   }
 }
 
index a8dfdc9499f0a6cb1c8ee095169780723bfcac2a..fc92e15cd4a7a79dd0487853a1f9c28e1d25ee22 100644 (file)
@@ -91,7 +91,7 @@ Standard_OStream& TopOpeBRepDS_Dumper::PrintType(const Handle(Geom_Curve)&
   else if (T==STANDARD_TYPE(Geom_Hyperbola))    OS<<"HYPERBOLA";
   else if (T==STANDARD_TYPE(Geom_BezierCurve))  OS<<"BEZIER";
   else if (T==STANDARD_TYPE(Geom_BSplineCurve)) 
-    OS<<"BSPLINE("<<(*((Handle(Geom_BSplineCurve)*)&C))->Degree()<<")";
+    OS<<"BSPLINE("<<Handle(Geom_BSplineCurve)::DownCast (C)->Degree()<<")";
   else if (T==STANDARD_TYPE(Geom_TrimmedCurve))
     {OS<<"TRIMMED ";PrintType(Handle(Geom_TrimmedCurve)::DownCast(C)->BasisCurve(),OS);}
   else if (T==STANDARD_TYPE(Geom_OffsetCurve))  OS<<"OFFSETCURVE";
@@ -126,7 +126,7 @@ Standard_OStream& TopOpeBRepDS_Dumper::PrintType(const Handle(Geom2d_Curve)&
   else if (T==STANDARD_TYPE(Geom2d_Hyperbola))    OS<<"HYPERBOLA";
   else if (T==STANDARD_TYPE(Geom2d_BezierCurve))  OS<<"BEZIER";
   else if (T==STANDARD_TYPE(Geom2d_BSplineCurve)) 
-    OS<<"BSPLINE("<<(*((Handle(Geom2d_BSplineCurve)*)&C))->Degree()<<")";
+    OS<<"BSPLINE("<<Handle(Geom2d_BSplineCurve)::DownCast (C)->Degree()<<")";
   else if (T==STANDARD_TYPE(Geom2d_TrimmedCurve)) 
     {OS<<"TRIMMED ";PrintType(Handle(Geom2d_TrimmedCurve)::DownCast(C)->BasisCurve(),OS);}
   else if (T==STANDARD_TYPE(Geom2d_OffsetCurve))  OS<<"OFFSETCURVE";
index faa5fcdd758fe5252ce51db7e7a0930e3c089812..3e19087b2b78dbd032fd275c30dcb30ed5352ddc 100644 (file)
@@ -282,12 +282,12 @@ static void FUN_ReducerEdge3d(const Standard_Integer SIX, TopOpeBRepDS_DataStruc
       Standard_Boolean isevi = I1->IsKind(STANDARD_TYPE(TopOpeBRepDS_EdgeVertexInterference));
       Standard_Boolean iscpi = I1->IsKind(STANDARD_TYPE(TopOpeBRepDS_CurvePointInterference));
       if (isevi) {
-       const Handle(TopOpeBRepDS_EdgeVertexInterference)& EVI = Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast(I1);
+       Handle(TopOpeBRepDS_EdgeVertexInterference) EVI (Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast(I1));
        newI = new TopOpeBRepDS_EdgeVertexInterference(T,TopOpeBRepDS_FACE,IB1,G1,EVI->GBound(),
                          TopOpeBRepDS_UNSHGEOMETRY,EVI->Parameter());    
       }
       if (iscpi) {
-       const Handle(TopOpeBRepDS_CurvePointInterference)& CPI = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I1);
+       Handle(TopOpeBRepDS_CurvePointInterference) CPI (Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I1));
        newI = new TopOpeBRepDS_CurvePointInterference(T,TopOpeBRepDS_FACE,IB1,TopOpeBRepDS_POINT,G1,CPI->Parameter());         
       }
 
@@ -384,7 +384,7 @@ static void FUN_ReducerSDEdge(const Standard_Integer SIX,const TopOpeBRepDS_Data
       } // it2
 
       if (complex1d) {
-       const Handle(TopOpeBRepDS_EdgeVertexInterference)& EVI = Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast(I1);
+       Handle(TopOpeBRepDS_EdgeVertexInterference) EVI (Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast(I1));
        TopOpeBRepDS_Config cEIX=BDS.SameDomainOri(SIX), c1=BDS.SameDomainOri(IB1); 
        TopOpeBRepDS_Config Conf = (cEIX == c1) ? TopOpeBRepDS_SAMEORIENTED : TopOpeBRepDS_DIFFORIENTED;
        Handle(TopOpeBRepDS_Interference) newI = new TopOpeBRepDS_EdgeVertexInterference(T,TopOpeBRepDS_EDGE,IB1,G,EVI->GBound(),Conf,EVI->Parameter());        
index a97ea30cc2571b7b112c6e97a7db317ec4884f74..fe531f9817b7d624d4b6c1498045bc9a3752f845 100644 (file)
@@ -2134,7 +2134,7 @@ Standard_EXPORT void FUN_ds_PointToVertex(const Handle(TopOpeBRepDS_HDataStructu
   
       for (TopOpeBRepDS_ListIteratorOfListOfInterference itl(loi); itl.More(); itl.Next()){
        const Handle(TopOpeBRepDS_Interference)& I = itl.Value();
-       const Handle(TopOpeBRepDS_CurvePointInterference)& CPI = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I);
+       Handle(TopOpeBRepDS_CurvePointInterference) CPI (Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I));
        if (CPI.IsNull()) continue;
 
        Standard_Real par = CPI->Parameter(); 
@@ -2481,8 +2481,8 @@ Standard_EXPORT Standard_Boolean FDS_LOIinfsup(
       FDS_Idata(I,tsb1,isb1,tsa1,isa1,GT1,G1,ST1,S1);
       if (tsb1 != TopAbs_FACE) continue;
       if (tsa1 != TopAbs_FACE) continue;
-      const Handle(TopOpeBRepDS_CurvePointInterference)& cpi = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I);
-      const Handle(TopOpeBRepDS_EdgeVertexInterference)& evi = Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast(I);
+      Handle(TopOpeBRepDS_CurvePointInterference) cpi (Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I));
+      Handle(TopOpeBRepDS_EdgeVertexInterference) evi (Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast(I));
       if (cpi.IsNull() && evi.IsNull()) continue;
       LOIsansGDS.Append(I);
       break;
index 5a5107c1bb6f1e878b92862500cc5e99e244ebe4..ac3d009a5aed8db3ea21230c212619bed8533cd4 100644 (file)
@@ -118,8 +118,8 @@ Standard_Boolean FUN_findPonF(const TopoDS_Edge& E,const TopOpeBRepDS_DataStruct
     Standard_Boolean pardef = Standard_False;
     
     Handle(TopOpeBRepDS_Interference)& I = itI.Value(); FDS_data(I,GT1,G1,ST1,S1);        
-    const Handle(TopOpeBRepDS_CurvePointInterference)& CPI = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I);
-    const Handle(TopOpeBRepDS_ShapeShapeInterference)& SSI = Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(I);
+    Handle(TopOpeBRepDS_CurvePointInterference) CPI (Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I));
+    Handle(TopOpeBRepDS_ShapeShapeInterference) SSI (Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(I));
     if      (!CPI.IsNull()) {
       par = CPI->Parameter(); pardef = Standard_True;
     }
index 9f455af4e9a9ccf0dfb499bdbb6d7076a09301f4..26c0ece26586c034372778767bd9e27f1ab0b054 100644 (file)
@@ -199,7 +199,7 @@ TopOpeBRepDS_FaceInterferenceTool::TopOpeBRepDS_FaceInterferenceTool
 void TopOpeBRepDS_FaceInterferenceTool::Init
 (const TopoDS_Shape& FFI,const TopoDS_Shape& EE,const Standard_Boolean EEisnew,const Handle(TopOpeBRepDS_Interference)& Iin)
 {
-  const Handle(TopOpeBRepDS_ShapeShapeInterference)& I = Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(Iin); if (I.IsNull()) return;  
+  Handle(TopOpeBRepDS_ShapeShapeInterference) I (Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(Iin)); if (I.IsNull()) return;  
   const TopoDS_Face& FI = TopoDS::Face(FFI);
   const TopoDS_Edge& E = TopoDS::Edge(EE);
 #ifdef OCCT_DEBUG
@@ -263,7 +263,7 @@ void TopOpeBRepDS_FaceInterferenceTool::Init
 void TopOpeBRepDS_FaceInterferenceTool::Add
 (const TopoDS_Shape& FFI,const TopoDS_Shape& FFT,const TopoDS_Shape& EE,const Standard_Boolean EEisnew,const Handle(TopOpeBRepDS_Interference)& Iin)
 {
-  const Handle(TopOpeBRepDS_ShapeShapeInterference)& I = Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(Iin); if (I.IsNull()) return;  
+  Handle(TopOpeBRepDS_ShapeShapeInterference) I (Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(Iin)); if (I.IsNull()) return;  
   const TopoDS_Face& FI = TopoDS::Face(FFI);
   const TopoDS_Face& FT = TopoDS::Face(FFT);
   const TopoDS_Edge& E = TopoDS::Edge(EE);
index d93d8b79224f0ed3d6684373f34c7eb575d75709..d62bbd8df09a8ce89734b5682a2eb472c9665c10 100644 (file)
@@ -359,7 +359,7 @@ static Standard_Boolean Normal(const Handle(TopOpeBRepDS_GapTool)&      A,
     IC->GKGSKS(GK,IG,SK,IS);
     if (SK == TopOpeBRepDS_CURVE) {
       const TopOpeBRepDS_Curve& C = HDS->Curve(IS);
-      Standard_Real P   = (*((Handle(TopOpeBRepDS_CurvePointInterference)*)&IC))->Parameter();
+      Standard_Real P   = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (IC)->Parameter();
       
       TopoDS_Shape S1,S2;
       C.GetShapes(S1,S2);
index f0c0fa9d09f3f1dc84e43c0b002a2cb118ca9e7f..0bce0f825f808cd99dfe75028b6b99f925bfdd97 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);
        }       
       }
     }
index 7b2815ea2ecbd719c83b6bb9501f074bc781dcc4..62056216672076ac33dae1f6745e16cf76b224e2 100644 (file)
@@ -135,7 +135,7 @@ Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInt
 //=======================================================================
 Standard_Real TopOpeBRepDS_InterferenceTool::Parameter(const Handle(TopOpeBRepDS_Interference)& I)
 {
-  return (*((Handle(TopOpeBRepDS_CurvePointInterference)*)&I))->Parameter();
+  return Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (I)->Parameter();
 }
 
 //=======================================================================
@@ -144,5 +144,5 @@ Standard_Real TopOpeBRepDS_InterferenceTool::Parameter(const Handle(TopOpeBRepDS
 //=======================================================================
 void TopOpeBRepDS_InterferenceTool::Parameter(const Handle(TopOpeBRepDS_Interference)& I,const Standard_Real Par)
 {
-  (*((Handle(TopOpeBRepDS_CurvePointInterference)*)&I))->Parameter(Par);
+  Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (I)->Parameter(Par);
 }
index 19313bcca27da7b400d5466874c2036d8bde93ce..24dc6a3d5f98783e8f27b45775305372d728763e 100644 (file)
@@ -86,10 +86,10 @@ Standard_Real  TopOpeBRepDS_PointIterator::Parameter()const
   const Handle(TopOpeBRepDS_Interference)& I = Value();
   Handle(Standard_Type) T = I->DynamicType(); 
   if      ( T == STANDARD_TYPE(TopOpeBRepDS_CurvePointInterference) ) { 
-    return (*((Handle(TopOpeBRepDS_CurvePointInterference)*)&I))->Parameter();
+    return Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (I)->Parameter();
   }
   else if ( T == STANDARD_TYPE(TopOpeBRepDS_EdgeVertexInterference) ) {
-    return (*((Handle(TopOpeBRepDS_EdgeVertexInterference)*)&I))->Parameter();
+    return Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast (I)->Parameter();
   }
   else {
     Standard_ProgramError::Raise("TopOpeBRepDS_PointIterator::Parameter()");
@@ -127,7 +127,7 @@ Standard_Boolean TopOpeBRepDS_PointIterator::DiffOriented() const
 {
   const Handle(TopOpeBRepDS_Interference)& I = Value();
   if ( I->DynamicType() == STANDARD_TYPE(TopOpeBRepDS_EdgeVertexInterference) ) {
-    return (*((Handle(TopOpeBRepDS_EdgeVertexInterference)*)&I))
+    return Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast (I)
       ->Config() == TopOpeBRepDS_DIFFORIENTED;
   }
   else {
@@ -146,7 +146,7 @@ Standard_Boolean TopOpeBRepDS_PointIterator::SameOriented() const
 {
   const Handle(TopOpeBRepDS_Interference)& I = Value();
   if ( I->DynamicType() == STANDARD_TYPE(TopOpeBRepDS_EdgeVertexInterference) ) {
-    return (*((Handle(TopOpeBRepDS_EdgeVertexInterference)*)&I))
+    return Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast (I)
       ->Config() == TopOpeBRepDS_SAMEORIENTED;
   }
   else {
index ec14f4621ee83509684a0bcef8729daab2c7acf6..a873c06513cb17e842e022eda94e3e4e33527297 100644 (file)
@@ -341,9 +341,9 @@ Standard_Boolean  TopOpeBRepTool_CurveTool::MakeCurves
   Standard_Integer iparmin = (Standard_Integer)parmin;
   Standard_Integer iparmax = (Standard_Integer)parmax;
 
-  Handle(Geom_BSplineCurve)&   HC3D = *((Handle(Geom_BSplineCurve)*)&C3D);
-  Handle(Geom2d_BSplineCurve)& HPC1 = *((Handle(Geom2d_BSplineCurve)*)&PC1);
-  Handle(Geom2d_BSplineCurve)& HPC2 = *((Handle(Geom2d_BSplineCurve)*)&PC2);
+  Handle(Geom_BSplineCurve)&   HC3D = Handle(Geom_BSplineCurve)::DownCast (C3D);
+  Handle(Geom2d_BSplineCurve)& HPC1 = Handle(Geom2d_BSplineCurve)::DownCast (PC1);
+  Handle(Geom2d_BSplineCurve)& HPC2 = Handle(Geom2d_BSplineCurve)::DownCast (PC2);
 
 //--------------------- IFV - "improving" initial curves
 #ifdef CurveImprovement
@@ -678,7 +678,7 @@ Standard_Boolean  TopOpeBRepTool_CurveTool::MakeCurves
 
   Standard_Boolean bf, bl;
 
-  const Handle(Geom_BSplineCurve)& Curve = Handle(Geom_BSplineCurve)::DownCast(C3Dnew);
+  Handle(Geom_BSplineCurve) Curve (Handle(Geom_BSplineCurve)::DownCast(C3Dnew));
   if(!Curve.IsNull()) {
     GeomLib_CheckBSplineCurve cbsc(Curve, 1.e-7, 0.1);
     cbsc.NeedTangentFix(bf, bl);
@@ -694,7 +694,7 @@ Standard_Boolean  TopOpeBRepTool_CurveTool::MakeCurves
     cbsc.FixTangent(bf, bl);
   }
   
-  const Handle(Geom2d_BSplineCurve)& Curve2df = Handle(Geom2d_BSplineCurve)::DownCast(PC1new);
+  Handle(Geom2d_BSplineCurve) Curve2df (Handle(Geom2d_BSplineCurve)::DownCast(PC1new));
   if(!Curve2df.IsNull()) {
     GeomLib_Check2dBSplineCurve cbsc2df(Curve2df, 1.e-7, 0.1);
     cbsc2df.NeedTangentFix(bf, bl);
@@ -709,7 +709,7 @@ Standard_Boolean  TopOpeBRepTool_CurveTool::MakeCurves
     cbsc2df.FixTangent(bf, bl);
   }
   
-  const Handle(Geom2d_BSplineCurve)& Curve2ds = Handle(Geom2d_BSplineCurve)::DownCast(PC2new);
+  Handle(Geom2d_BSplineCurve) Curve2ds (Handle(Geom2d_BSplineCurve)::DownCast(PC2new));
   if(!Curve2ds.IsNull()) {
     GeomLib_Check2dBSplineCurve cbsc2ds(Curve2ds, 1.e-7, 0.1);
     cbsc2ds.NeedTangentFix(bf, bl);
index 2d0ed32735f48ded3ee637d1e7fe33856576b789..111d435b155b43f73fbf5ffc04f038882f1e9696 100644 (file)
@@ -327,7 +327,7 @@ void TopOpeBRepTool_FuseEdges::BuildListResultEdges()
       // if the curve is trimmed we get the basis curve to fit the new vertices
       // otherwise the makeedge will fail.
       if (C->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) {
-       C = (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve();
+       C = Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve();
       }
   
 #ifdef OCCT_DEBUG
@@ -618,7 +618,7 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1,
 
   if (!loc.IsIdentity()) {
     Handle(Geom_Geometry) GG1 = C1->Transformed(loc.Transformation());
-    C1 = *((Handle(Geom_Curve)*)&GG1);
+    C1 = Handle(Geom_Curve)::DownCast (GG1);
   }
   C2 = BRep_Tool::Curve(E2,loc,f2,l2);
   //modified by NIZNHY-PKV Mon Nov 15 16:24:38 1999
@@ -627,19 +627,19 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1,
 
   if (!loc.IsIdentity()) {
     Handle(Geom_Geometry) GG2 = C2->Transformed(loc.Transformation());
-    C2 = *((Handle(Geom_Curve)*)&GG2);
+    C2 = Handle(Geom_Curve)::DownCast (GG2);
   }
   
   typC1 = C1->DynamicType();
   typC2 = C2->DynamicType();
   
   if (typC1 == STANDARD_TYPE(Geom_TrimmedCurve)) {
-    C1 =  (*((Handle(Geom_TrimmedCurve)*)&C1))->BasisCurve();
+    C1 =  Handle(Geom_TrimmedCurve)::DownCast (C1)->BasisCurve();
     typC1 = C1->DynamicType();
   }
   
   if (typC2 == STANDARD_TYPE(Geom_TrimmedCurve)) {
-    C2 =  (*((Handle(Geom_TrimmedCurve)*)&C2))->BasisCurve();
+    C2 =  Handle(Geom_TrimmedCurve)::DownCast (C2)->BasisCurve();
     typC2 = C2->DynamicType();
   }
   
@@ -662,8 +662,8 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1,
   const Standard_Real tollin = Precision::Confusion();
   const Standard_Real tolang = Precision::Angular();
   if (typC1 == STANDARD_TYPE(Geom_Line)) {
-    gp_Lin li1( (*((Handle(Geom_Line)*)&C1))->Lin());
-    gp_Lin li2( (*((Handle(Geom_Line)*)&C2))->Lin());
+    gp_Lin li1( Handle(Geom_Line)::DownCast (C1)->Lin());
+    gp_Lin li2( Handle(Geom_Line)::DownCast (C2)->Lin());
     gp_Dir dir1(li1.Direction());
     gp_Dir dir2(li2.Direction());
 
@@ -682,8 +682,8 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1,
     return Standard_False;
   } 
   else if (typC1 == STANDARD_TYPE(Geom_Circle)) {
-    gp_Circ ci1 = (*((Handle(Geom_Circle)*)&C1))->Circ();
-    gp_Circ ci2 = (*((Handle(Geom_Circle)*)&C2))->Circ();
+    gp_Circ ci1 = Handle(Geom_Circle)::DownCast (C1)->Circ();
+    gp_Circ ci2 = Handle(Geom_Circle)::DownCast (C2)->Circ();
     if (Abs(ci1.Radius()-ci2.Radius()) <= tollin &&
        ci1.Location().SquareDistance(ci2.Location()) <= tollin*tollin &&
        ci1.Axis().IsParallel(ci2.Axis(),tolang) ) {
@@ -693,8 +693,8 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1,
     return Standard_False;
   }
   else if (typC1 == STANDARD_TYPE(Geom_Ellipse)) {
-    gp_Elips ci1 = (*((Handle(Geom_Ellipse)*)&C1))->Elips();
-    gp_Elips ci2 = (*((Handle(Geom_Ellipse)*)&C2))->Elips();
+    gp_Elips ci1 = Handle(Geom_Ellipse)::DownCast (C1)->Elips();
+    gp_Elips ci2 = Handle(Geom_Ellipse)::DownCast (C2)->Elips();
     
     if (Abs(ci1.MajorRadius()-ci2.MajorRadius()) <= tollin &&
        Abs(ci1.MinorRadius()-ci2.MinorRadius()) <= tollin &&
@@ -714,8 +714,8 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1,
       return Standard_False;
     }
 
-    Handle(Geom_BSplineCurve) B1 = *((Handle(Geom_BSplineCurve)*)&C1);
-    Handle(Geom_BSplineCurve) B2 = *((Handle(Geom_BSplineCurve)*)&C2);
+    Handle(Geom_BSplineCurve) B1 = Handle(Geom_BSplineCurve)::DownCast (C1);
+    Handle(Geom_BSplineCurve) B2 = Handle(Geom_BSplineCurve)::DownCast (C2);
    
     Standard_Integer nbpoles = B1->NbPoles();
     if (nbpoles != B2->NbPoles()) {
@@ -787,8 +787,8 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1,
       return Standard_False;
     }
 
-    Handle(Geom_BezierCurve) B1 = *((Handle(Geom_BezierCurve)*)&C1);
-    Handle(Geom_BezierCurve) B2 = *((Handle(Geom_BezierCurve)*)&C2);
+    Handle(Geom_BezierCurve) B1 = Handle(Geom_BezierCurve)::DownCast (C1);
+    Handle(Geom_BezierCurve) B2 = Handle(Geom_BezierCurve)::DownCast (C2);
     
     Standard_Integer nbpoles = B1->NbPoles();
     if (nbpoles != B2->NbPoles()) {
@@ -939,16 +939,16 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::UpdatePCurve(const TopoDS_Edge& theOl
        Handle(Geom2d_Curve) Curv2dR = BRep_Tool::CurveOnSurface(aFEdge,
                                                                 aFFace,cf,cl);
        if (Curv2d->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
-         Curv2d = (*((Handle(Geom2d_TrimmedCurve)*)&Curv2d))->BasisCurve();
+         Curv2d = Handle(Geom2d_TrimmedCurve)::DownCast (Curv2d)->BasisCurve();
        if (Curv2dR->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
-         Curv2dR = (*((Handle(Geom2d_TrimmedCurve)*)&Curv2dR))->BasisCurve();
+         Curv2dR = Handle(Geom2d_TrimmedCurve)::DownCast (Curv2dR)->BasisCurve();
 
        B.UpdateEdge (theNewEdge,Curv2d,Curv2dR,Surf,loc,BRep_Tool::Tolerance(theNewEdge));
       }
       else {
        // update the new edge 
        if (Curv2d->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
-         Curv2d = (*((Handle(Geom2d_TrimmedCurve)*)&Curv2d))->BasisCurve();
+         Curv2d = Handle(Geom2d_TrimmedCurve)::DownCast (Curv2d)->BasisCurve();
        Standard_Real f, l;
        f = Curv2d->FirstParameter();
        l = Curv2d->LastParameter();
index 80f07e50ebb1bd0d9113e8f68c62cae443d688ab..dd708a897c0e6b366c4ac97c8f823bdc08a255c3 100644 (file)
@@ -320,7 +320,7 @@ Standard_Real TopOpeBRepTool_ShapeTool::PeriodizeParameter
   Handle(Standard_Type) TheType = PC->DynamicType();
   if (TheType == STANDARD_TYPE(Geom2d_Line)) {
 
-    const Handle(Geom2d_Line)& HL = *((Handle(Geom2d_Line)*)&PC);
+    Handle(Geom2d_Line) HL (Handle(Geom2d_Line)::DownCast (PC));
     const gp_Dir2d&  D = HL->Direction();
 
     Standard_Real    tol = Precision::Angular();
index 1ad280efe25150f4af7560f72195cd9ab1e69ccd..d3d75e65363fcf2b6effae0a1bcedfeba8f11fad 100644 (file)
@@ -267,7 +267,7 @@ void Units_UnitsDictionary::Creates(const Standard_CString afilename)
         if(move) {
           Standard_Integer last = theunitssequence->Length();
           unit = theunitssequence->Value(last);
-          shiftedunit = *(Handle(Units_ShiftedUnit)*)&unit;
+          shiftedunit = Handle(Units_ShiftedUnit)::DownCast (unit);
           shiftedunit->Move(move);
         }
       }
index 064b765d894b1b66d007439ea5bebd7cdfa81f35..08db60f5c8df73f6c7609c6decef9f74773d72bf 100644 (file)
@@ -402,7 +402,7 @@ Standard_Real Units_UnitsSystem::ConvertUserSystemValueToSI
 void Units_UnitsSystem::Dump() const
 {
   Handle(Standard_Transient) transient = This();
-  Handle(Units_UnitsSystem) unitssystem = *(Handle(Units_UnitsSystem)*)&transient;
+  Handle(Units_UnitsSystem) unitssystem = Handle(Units_UnitsSystem)::DownCast (transient);
   Units_Explorer explorer(unitssystem);
   cout<<" UNITSSYSTEM : "<<endl;
   for(; explorer.MoreQuantity(); explorer.NextQuantity()) {
index 8531049571d3403ee2b8c54fa377dd5359bc040f..b07adff27643de458eec1e4dc622e66c121fe059 100644 (file)
@@ -195,7 +195,7 @@ Graphic3d_Vertex V3d_View::Compute (const Graphic3d_Vertex & AVertex) const
   if (IsRectangular) {
     Standard_Real XS, YS;
     Handle(Aspect_RectangularGrid) theGrid =
-      *(Handle(Aspect_RectangularGrid) *) &MyGrid;
+      Handle(Aspect_RectangularGrid)::DownCast (MyGrid);
     XS = theGrid->XStep (), YS = theGrid->YStep ();
 
     // project point on plane to grid local space
@@ -215,7 +215,7 @@ Graphic3d_Vertex V3d_View::Compute (const Graphic3d_Vertex & AVertex) const
     Standard_Integer DN;
     Standard_Real Alpha;
     Handle(Aspect_CircularGrid) theGrid =
-      *(Handle(Aspect_CircularGrid) *) &MyGrid;
+      Handle(Aspect_CircularGrid)::DownCast (MyGrid);
     RS = theGrid->RadiusStep ();
     DN = theGrid->DivisionNumber ();
     Alpha = M_PI / Standard_Real (DN);
index fc76b2f5ff8fd1f0dcf3bc038e4b05629f19c704..095acb9c89a899e2da6320ac52e573c9ea90ace5 100644 (file)
@@ -387,7 +387,7 @@ Handle(ViewerTest_EventManager) ViewerTest::CurrentEventManager()
   Handle(ViewerTest_EventManager) EM;
   if(theEventMgrs.IsEmpty()) return EM;
   Handle(Standard_Transient) Tr =  theEventMgrs.First();
-  EM = *((Handle(ViewerTest_EventManager)*)&Tr);
+  EM = Handle(ViewerTest_EventManager)::DownCast (Tr);
   return EM;
 }
 
@@ -440,7 +440,7 @@ Handle(AIS_Shape) GetAISShapeFromName(const char* name)
     if (!IO.IsNull()) {
       if(IO->Type()==AIS_KOI_Shape) {
         if(IO->Signature()==0){
-          retsh = *((Handle(AIS_Shape)*)&IO);
+          retsh = Handle(AIS_Shape)::DownCast (IO);
         }
         else
           cout << "an Object which is not an AIS_Shape "
@@ -4569,7 +4569,7 @@ TopoDS_Shape ViewerTest::PickShape(const TopAbs_ShapeEnum TheType,
       result = TheAISContext()->SelectedShape();
     else{
       Handle(AIS_InteractiveObject) IO = TheAISContext()->SelectedInteractive();
-      result = (*((Handle(AIS_Shape)*) &IO))->Shape();
+      result = Handle(AIS_Shape)::DownCast (IO)->Shape();
     }
   }
 
@@ -4636,7 +4636,7 @@ Standard_Boolean ViewerTest::PickShapes (const TopAbs_ShapeEnum TheType,
       thearr->SetValue(i,TheAISContext()->SelectedShape());
     else{
       Handle(AIS_InteractiveObject) IO = TheAISContext()->SelectedInteractive();
-      thearr->SetValue(i,(*((Handle(AIS_Shape)*) &IO))->Shape());
+      thearr->SetValue(i,Handle(AIS_Shape)::DownCast (IO)->Shape());
     }
   }
 
@@ -4765,7 +4765,7 @@ static int VPickSelected (Draw_Interpretor& , Standard_Integer theArgNb, const c
     else
     {
       Handle(AIS_InteractiveObject) IO = TheAISContext()->SelectedInteractive();
-      aShape = (*((Handle(AIS_Shape)*) &IO))->Shape();
+      aShape = Handle(AIS_Shape)::DownCast (IO)->Shape();
     }
 
     TCollection_AsciiString aCurrentName = aName;
@@ -4916,7 +4916,7 @@ static int VEraseType( Draw_Interpretor& , Standard_Integer argc, const char** a
     if(dimension_status == -1)
       TheAISContext()->Erase(curio,Standard_False);
     else {
-      AIS_KindOfDimension KOD = (*((Handle(AIS_Relation)*)&curio))->KindOfDimension();
+      AIS_KindOfDimension KOD = Handle(AIS_Relation)::DownCast (curio)->KindOfDimension();
       if ((dimension_status==0 && KOD == AIS_KOD_NONE)||
          (dimension_status==1 && KOD != AIS_KOD_NONE))
        TheAISContext()->Erase(curio,Standard_False);
@@ -4949,7 +4949,7 @@ static int VDisplayType(Draw_Interpretor& , Standard_Integer argc, const char**
     if(dimension_status == -1)
       TheAISContext()->Display(curio,Standard_False);
     else {
-      AIS_KindOfDimension KOD = (*((Handle(AIS_Relation)*)&curio))->KindOfDimension();
+      AIS_KindOfDimension KOD = Handle(AIS_Relation)::DownCast (curio)->KindOfDimension();
       if ((dimension_status==0 && KOD == AIS_KOD_NONE)||
          (dimension_status==1 && KOD != AIS_KOD_NONE))
        TheAISContext()->Display(curio,Standard_False);
index a0f3a6b36013819d18928132be191158e6995536..62edac76ccaa716fcf1119ee3169d62b606e96de 100644 (file)
@@ -354,7 +354,7 @@ static int VSize (Draw_Interpretor& di, Standard_Integer argc, const char** argv
 
           // On downcast aShape  de AIS_InteractiveObject a AIS_Trihedron
           // pour lui appliquer la methode SetSize()
-          Handle(AIS_Trihedron) aTrihedron = *(Handle(AIS_Trihedron)*) &aShape;
+          Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast (aShape);
 
           // C'est bien un triedre,on chage sa valeur!
           aTrihedron->SetSize(value);
@@ -415,7 +415,7 @@ static int VSize (Draw_Interpretor& di, Standard_Integer argc, const char** argv
 
         // On downcast aShape de AIS_InteractiveObject a AIS_Trihedron
         // pour lui appliquer la methode SetSize()
-        Handle(AIS_Trihedron) aTrihedron = *(Handle(AIS_Trihedron)*) &aShape;
+        Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast (aShape);
 
         // C'est bien un triedre,on chage sa valeur
         aTrihedron->SetSize(value);
@@ -475,7 +475,7 @@ static int VPlaneTrihedron (Draw_Interpretor& di, Standard_Integer argc, const c
     if (!ShapeA.IsNull() &&
       ShapeA->Type()==AIS_KOI_Datum  && ShapeA->Signature()==3  ) {
         // on le downcast
-        Handle(AIS_Trihedron) TrihedronA =((*(Handle(AIS_Trihedron)*)&ShapeA));
+        Handle(AIS_Trihedron) TrihedronA =(Handle(AIS_Trihedron)::DownCast (ShapeA));
         // on le charge dans le contexte et on active le mode Plane.
         TheAISContext()->Load(TrihedronA,0,Standard_False);
         TheAISContext()->Activate(TrihedronA,3);
@@ -496,7 +496,7 @@ static int VPlaneTrihedron (Draw_Interpretor& di, Standard_Integer argc, const c
     theIOB = TheAISContext()->Interactive();
   }
   // on le downcast
-  Handle(AIS_Plane) PlaneB =((*(Handle(AIS_Plane)*)&theIOB));
+  Handle(AIS_Plane) PlaneB =(Handle(AIS_Plane)::DownCast (theIOB));
 
   // Fermeture du contexte local.
   TheAISContext()->CloseLocalContext(myCurrentIndex);
@@ -1796,15 +1796,15 @@ static int VLineBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
       }
     else {di <<"vline error: wrong type of 1st argument."<<"\n";return 1; }
     // Les deux parametres sont du bon type. On verifie que les points ne sont pas confondus
-    Handle(AIS_Point) theAISPointA= *(Handle(AIS_Point)*)& theShapeA;
-    Handle(AIS_Point) theAISPointB= *(Handle(AIS_Point)*)& theShapeB;
+    Handle(AIS_Point) theAISPointA= Handle(AIS_Point)::DownCast (theShapeA);
+    Handle(AIS_Point) theAISPointB= Handle(AIS_Point)::DownCast (theShapeB);
 
     Handle(Geom_Point ) myGeomPointBA=  theAISPointA->Component();
-    Handle(Geom_CartesianPoint ) myCartPointA= *((Handle(Geom_CartesianPoint)*)&  myGeomPointBA);
+    Handle(Geom_CartesianPoint ) myCartPointA= Handle(Geom_CartesianPoint)::DownCast (myGeomPointBA);
     //    Handle(Geom_CartesianPoint ) myCartPointA= *(Handle(Geom_CartesianPoint)*)& (theAISPointA->Component() ) ;
 
     Handle(Geom_Point ) myGeomPointB=  theAISPointB->Component();
-    Handle(Geom_CartesianPoint ) myCartPointB= *((Handle(Geom_CartesianPoint)*)&  myGeomPointB);
+    Handle(Geom_CartesianPoint ) myCartPointB= Handle(Geom_CartesianPoint)::DownCast (myGeomPointB);
     //    Handle(Geom_CartesianPoint ) myCartPointB= *(Handle(Geom_CartesianPoint)*)& (theAISPointB->Component() ) ;
 
     if (myCartPointB->X()==myCartPointA->X() && myCartPointB->Y()==myCartPointA->Y() && myCartPointB->Z()==myCartPointA->Z() ) {
index f1bac40a9b0cda159b154632f51bddfd0f74459d..2b10c5aa9e8617ff8bc0b40b9f736e485a8a6a25 100644 (file)
@@ -192,7 +192,7 @@ void Visual3d_ViewManager::ReCompute (const Handle(Graphic3d_Structure)& AStruct
 #ifdef DOWNCAST
   Handle(Visual3d_View) theView = Handle(Visual3d_View)::DownCast (AProjector);
 #else
-  Handle(Visual3d_View) theView = *(Handle(Visual3d_View) *) &AProjector;
+  Handle(Visual3d_View) theView = Handle(Visual3d_View)::DownCast (AProjector);
 #endif
   Standard_Integer ViewId = theView->Identification ();