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 a5d3ed2..7bd61b9 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 a5eed56..78b5b9d 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 a8cfd10..0a0b2fc 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 f22155d..8e2562f 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 f209345..ee87e19 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 e4c7bcc..a72181f 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 6031f37..3b6cbcc 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 1111281..ff0cad7 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 3e583dd..4b7b25e 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 0b52a52..65a284b 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 005f9d5..ac481c0 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 1b77cfd..b9f6b74 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 4b3ad35..2d57d56 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 f17c0cf..89eac2c 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 0a9fbe7..f1c60ac 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 d964b2f..b636bdd 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 a72c8f2..ecadb66 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 c8185d0..2b771b4 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 0ea8f3a..cc0583a 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 0f51dce..b3eff3d 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 e656533..24c987b 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 deaedcf..1e4b16e 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 f397fcd..90731d5 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 25a3184..0788f51 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 96964b6..f18aedd 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 205fe05..ff16fcd 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 c371bd7..b951a20 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 10efe77..68b4669 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 b20853c..2db772b 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 e726349..a23283d 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 d7a9cf7..304ec00 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 775d3e8..06f62bd 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 99f237e..51382da 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 b93279d..39976e3 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 3f17c63..6dd7d44 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 d35de2d..8f1674f 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 4d6280b..f243338 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 d694054..a9486dc 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 bb2d97b..d9934bf 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 00eb929..9bb7d40 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 42c38e0..0f5ef89 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 ee39bcc..7534583 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 c566583..ef738d2 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 b84c773..c6bb537 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 357e7d3..06ac3b3 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 a18ba9a..aef4d6c 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 c8ae4e4..11083e4 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 f59eb2f..bd8511d 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 7255407..9bd55d4 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 5940790..c5fb584 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 6915f65..445f22a 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 9a7d3e8..93a8898 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 adba0e3..220796c 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 eb55106..a08d6b8 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 a31398e..48dd343 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 e1869eb..f544e31 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 5f9ea8d..9757ac9 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 ee4e2d6..d558995 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 6903378..049f7fb 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 6433714..b94d862 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 b0f7b5f..51d5b90 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 0aa3448..c30431e 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 3eb8f09..487d2ee 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 7c4bed3..6922ec7 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 bc32606..f35b14c 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 2908a16..dc3ec85 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 74e64f4..03004ff 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 c3b1008..80e09a7 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 957fd4e..741fc34 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 398a33e..b9e7530 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 4f9c2b0..916f6b8 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 c9a02f4..a9ceb76 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 c388b2a..fa0191b 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 8d07c7b..5b0fef3 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 2b34977..bae5084 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 580a271..6f44247 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 40cebc2..0785460 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 ffb99f0..4c0237b 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 d2088d5..4afda27 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 5a4b757..51d1585 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 013428b..edc1af1 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 0fec97c..a9ff522 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 c019708..6bd0395 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 cb67429..96feda1 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 33d6c60..8514341 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 def28ea..c5644ca 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 852a840..ce65c74 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 5f89ee2..e263b22 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 4cd96ce..0255255 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 1138f57..4e7c93e 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 32326e0..0b8bfd3 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 5b41ac7..d264e44 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 54bb54e..7062de7 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 c214fa8..80da39f 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 e984dc5..796885b 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 b913a7e..dfef5a0 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 2493640..a645173 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))