1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +03:00

0024023: Revamp the OCCT Handle -- downcast (automatic)

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.
This commit is contained in:
abv 2015-07-02 16:41:05 +03:00
parent ce8b059af3
commit c5f3a42524
158 changed files with 863 additions and 888 deletions

View File

@ -188,30 +188,30 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge,
if (!anEdgeLoc.IsIdentity()) if (!anEdgeLoc.IsIdentity())
{ {
Handle(Geom_Geometry) aGeometry = theCurve->Transformed (anEdgeLoc.Transformation()); 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))) 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))) 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()); theFirstPnt = ElCLib::Value (aFirst, aLine->Lin());
theLastPnt = ElCLib::Value (aLast, aLine->Lin()); theLastPnt = ElCLib::Value (aLast, aLine->Lin());
} }
else if (theCurve->IsInstance (STANDARD_TYPE (Geom_Circle))) 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()); theFirstPnt = ElCLib::Value (aFirst, aCirc->Circ());
theLastPnt = ElCLib::Value (aLast, aCirc->Circ()); theLastPnt = ElCLib::Value (aLast, aCirc->Circ());
} }
else if (theCurve->IsInstance (STANDARD_TYPE (Geom_Ellipse))) 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()); theFirstPnt = ElCLib::Value (aFirst, anEllipse->Elips());
theLastPnt = ElCLib::Value (aLast, 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))) if (theCurve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve)))
{ {
theCurve = ((Handle(Geom_TrimmedCurve)&) theCurve)->BasisCurve(); theCurve = Handle(Geom_TrimmedCurve)::DownCast (theCurve)->BasisCurve();
} }
if (!theIsInfinite) if (!theIsInfinite)
@ -306,19 +306,19 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge,
theIsOnPlane = Standard_True; theIsOnPlane = Standard_True;
if (theExtCurve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve))) 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))) 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(), theIsOnPlane = thePlane->Pln().Contains (aLine->Lin(),
Precision::Confusion(), Precision::Confusion(),
Precision::Angular()); Precision::Angular());
} }
else if (theExtCurve->IsInstance (STANDARD_TYPE (Geom_Circle))) 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()); gp_Ax3 aCircPos (aCircle->Position());
theIsOnPlane = aCircPos.IsCoplanar (thePlane->Pln().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))) 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) if (!theIsInfinite)
{ {
theFirstPnt = ElCLib::Value (aFirst, aLine->Lin()); 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))) 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()); theFirstPnt = ElCLib::Value (aFirst, aCirc->Circ());
theLastPnt = ElCLib::Value (aLast, aCirc->Circ()); theLastPnt = ElCLib::Value (aLast, aCirc->Circ());
} }
else if (theCurve->IsInstance (STANDARD_TYPE (Geom_Ellipse))) 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()); theFirstPnt = ElCLib::Value (aFirst, anEllipse->Elips());
theLastPnt = ElCLib::Value (aLast, anEllipse->Elips()); theLastPnt = ElCLib::Value (aLast, anEllipse->Elips());
@ -404,13 +404,13 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
if (!aFirstEdgeLoc.IsIdentity()) if (!aFirstEdgeLoc.IsIdentity())
{ {
Handle(Geom_Geometry) aGeomGeometry = theFirstCurve->Transformed (aFirstEdgeLoc.Transformation()); Handle(Geom_Geometry) aGeomGeometry = theFirstCurve->Transformed (aFirstEdgeLoc.Transformation());
theFirstCurve = (Handle(Geom_Curve)&) aGeomGeometry; theFirstCurve = Handle(Geom_Curve)::DownCast (aGeomGeometry);
} }
if (!aSecondEdgeLoc.IsIdentity()) if (!aSecondEdgeLoc.IsIdentity())
{ {
Handle(Geom_Geometry) aGeomGeometry = theSecondCurve->Transformed (aSecondEdgeLoc.Transformation()); Handle(Geom_Geometry) aGeomGeometry = theSecondCurve->Transformed (aSecondEdgeLoc.Transformation());
theSecondCurve = (Handle(Geom_Curve)&) aGeomGeometry; theSecondCurve = Handle(Geom_Curve)::DownCast (aGeomGeometry);
} }
theFirstCurve = GeomProjLib::ProjectOnPlane (theFirstCurve, thePlane, theFirstCurve = GeomProjLib::ProjectOnPlane (theFirstCurve, thePlane,
@ -425,24 +425,24 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
if (theFirstCurve->IsInstance (STANDARD_TYPE(Geom_TrimmedCurve))) 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))) 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))) 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()); theFirstPnt1 = ElCLib::Value (aFirst1, aLine->Lin());
theLastPnt1 = ElCLib::Value (aLast1, aLine->Lin()); theLastPnt1 = ElCLib::Value (aLast1, aLine->Lin());
} }
else if (theFirstCurve->IsInstance(STANDARD_TYPE(Geom_Circle))) 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()); theFirstPnt1 = ElCLib::Value (aFirst1, aCirc->Circ());
theLastPnt1 = ElCLib::Value (aLast1, 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))) 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()); theFirstPnt2 = ElCLib::Value (aFirst2, aLine->Lin());
theLastPnt2 = ElCLib::Value (aLast2, aLine->Lin()); theLastPnt2 = ElCLib::Value (aLast2, aLine->Lin());
} }
else if (theSecondCurve->IsInstance (STANDARD_TYPE (Geom_Circle))) 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()); theFirstPnt2 = ElCLib::Value (aFirst2, aCirc->Circ());
theLastPnt2 = ElCLib::Value (aLast2, 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()) if (theFirstCurve->DynamicType() == theSecondCurve->DynamicType())
{ {
gp_Lin aLin1 = ((Handle(Geom_Line)&) theFirstCurve)->Lin(); gp_Lin aLin1 = Handle(Geom_Line)::DownCast (theFirstCurve)->Lin();
gp_Lin aLin2 = ((Handle(Geom_Line)&) theSecondCurve)->Lin(); gp_Lin aLin2 = Handle(Geom_Line)::DownCast (theSecondCurve)->Lin();
if (theIsInfinite1) if (theIsInfinite1)
{ {
@ -597,11 +597,11 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
if (theFirstCurve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve))) 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))) if (theSecondCurve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve)))
{ {
theSecondCurve = ((Handle(Geom_TrimmedCurve)&) theSecondCurve)->BasisCurve(); theSecondCurve = Handle(Geom_TrimmedCurve)::DownCast (theSecondCurve)->BasisCurve();
} }
aFirst1 = aFirstAdaptor.FirstParameter(); aFirst1 = aFirstAdaptor.FirstParameter();
@ -646,8 +646,8 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
{ {
if (theFirstCurve->DynamicType() == theSecondCurve->DynamicType()) if (theFirstCurve->DynamicType() == theSecondCurve->DynamicType())
{ {
gp_Lin aLin1 = ((Handle(Geom_Line)&) theFirstCurve)->Lin(); gp_Lin aLin1 = Handle(Geom_Line)::DownCast (theFirstCurve)->Lin();
gp_Lin aLin2 = ((Handle(Geom_Line)&) theSecondCurve)->Lin(); gp_Lin aLin2 = Handle(Geom_Line)::DownCast (theSecondCurve)->Lin();
if (theExtIndex == 1) if (theExtIndex == 1)
{ {
@ -735,7 +735,7 @@ Standard_Boolean AIS::ComputeGeomCurve (Handle(Geom_Curve)& aCurve,
aCurve = aGeomCurve; aCurve = aGeomCurve;
if (aCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) 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)) if (! Precision::IsInfinite(first1) && ! Precision::IsInfinite(last1))
{ {
@ -1426,8 +1426,8 @@ void AIS::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresen
// Calculate presentation of the edge // Calculate presentation of the edge
if (ProjCurve->IsInstance(STANDARD_TYPE(Geom_Line)) ) { if (ProjCurve->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
// CLE // CLE
// const Handle(Geom_Line) & gl = (Handle(Geom_Line)&) ProjCurve; // Handle(Geom_Line) gl (Handle(Geom_Line)::DownCast (ProjCurve));
Handle(Geom_Line) gl = (Handle(Geom_Line)&) ProjCurve; Handle(Geom_Line) gl = Handle(Geom_Line)::DownCast (ProjCurve);
// ENDCLE // ENDCLE
if ( !isInfinite) { if ( !isInfinite) {
pf = ElCLib::Parameter(gl->Lin(),FirstP); 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)) ) { else if (ProjCurve->IsInstance(STANDARD_TYPE(Geom_Circle)) ) {
// CLE // CLE
// const Handle(Geom_Circle) & gc = (Handle(Geom_Circle)&) ProjCurve; // Handle(Geom_Circle) gc (Handle(Geom_Circle)::DownCast (ProjCurve));
Handle(Geom_Circle) gc = (Handle(Geom_Circle)&) ProjCurve; Handle(Geom_Circle) gc = Handle(Geom_Circle)::DownCast (ProjCurve);
// ENDCLE // ENDCLE
pf = ElCLib::Parameter(gc->Circ(),FirstP); pf = ElCLib::Parameter(gc->Circ(),FirstP);
pl = ElCLib::Parameter(gc->Circ(),LastP); pl = ElCLib::Parameter(gc->Circ(),LastP);

View File

@ -43,19 +43,19 @@ Standard_Boolean AIS_AttributeFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
//#ifndef OCCT_DEBUG //#ifndef OCCT_DEBUG
Handle(SelectMgr_SelectableObject) aSelectable = anObj->Selectable() ; Handle(SelectMgr_SelectableObject) aSelectable = anObj->Selectable() ;
if( hasC && ((Handle(AIS_InteractiveObject)&) aSelectable)->HasColor() ) if( hasC && Handle(AIS_InteractiveObject)::DownCast (aSelectable)->HasColor() )
//#else //#else
// if(hasC && ((Handle(AIS_InteractiveObject)&) anObj->Selectable())->HasColor()) // if(hasC && ((Handle(AIS_InteractiveObject)&) anObj->Selectable())->HasColor())
//#endif //#endif
okstat = (myCol == ((Handle(AIS_InteractiveObject)&) anObj)->Color()); okstat = (myCol == Handle(AIS_InteractiveObject)::DownCast (anObj)->Color());
//#ifndef OCCT_DEBUG //#ifndef OCCT_DEBUG
aSelectable = anObj->Selectable() ; aSelectable = anObj->Selectable() ;
if( hasW && ((Handle(AIS_InteractiveObject)&) aSelectable)->HasWidth() ) if( hasW && Handle(AIS_InteractiveObject)::DownCast (aSelectable)->HasWidth() )
//#else //#else
// if(hasW && ((Handle(AIS_InteractiveObject)&) anObj->Selectable())->HasWidth()) // if(hasW && ((Handle(AIS_InteractiveObject)&) anObj->Selectable())->HasWidth())
//#endif //#endif
okstat = (myWid == ((Handle(AIS_InteractiveObject)&) anObj)->Width()) && okstat; okstat = (myWid == Handle(AIS_InteractiveObject)::DownCast (anObj)->Width()) && okstat;
return okstat; return okstat;

View File

@ -59,7 +59,7 @@ Standard_Boolean AIS_BadEdgeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& EO
if (myContour==0) if (myContour==0)
return Standard_True; 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)) { if (myBadEdges.IsBound(myContour)) {
TopTools_ListIteratorOfListOfShape it(myBadEdges.Find(myContour)); TopTools_ListIteratorOfListOfShape it(myBadEdges.Find(myContour));

View File

@ -80,7 +80,7 @@ Standard_Boolean AIS_C0RegularityFilter::IsOk(const Handle(SelectMgr_EntityOwner
if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull()) if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull())
return Standard_False; 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) if(aShape.ShapeType()!= TopAbs_EDGE)
return Standard_False; return Standard_False;

View File

@ -118,7 +118,7 @@ void AIS_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_Pres
gp_Pnt P; gp_Pnt P;
AIS::ComputeGeometry(V,P, myPlane, isOnPlanVertex); 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(); myCenter = CIRCLE->Location();
myRad = Min(CIRCLE->Radius()/5.,15.); myRad = Min(CIRCLE->Radius()/5.,15.);
gp_Dir vec(p1.XYZ() - myCenter.XYZ() ); gp_Dir vec(p1.XYZ() - myCenter.XYZ() );
@ -180,8 +180,8 @@ void AIS_ConcentricRelation::ComputeTwoEdgesConcentric(const Handle(Prs3d_Presen
return; return;
} }
const Handle(Geom_Circle)& gcirc1 = (Handle(Geom_Circle)&) geom1; Handle(Geom_Circle) gcirc1 (Handle(Geom_Circle)::DownCast (geom1));
const Handle(Geom_Circle)& gcirc2 = (Handle(Geom_Circle)&) geom2; Handle(Geom_Circle) gcirc2 (Handle(Geom_Circle)::DownCast (geom2));
myCenter = gcirc1->Location(); myCenter = gcirc1->Location();

View File

@ -401,8 +401,8 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
if (cu1.GetType() == GeomAbs_Line && cu2.GetType() == GeomAbs_Line) if (cu1.GetType() == GeomAbs_Line && cu2.GetType() == GeomAbs_Line)
{ {
const Handle(Geom_Line)& geom_lin1 = (Handle(Geom_Line)&) geom1; Handle(Geom_Line) geom_lin1 (Handle(Geom_Line)::DownCast (geom1));
const Handle(Geom_Line)& geom_lin2 = (Handle(Geom_Line)&) geom2; Handle(Geom_Line) geom_lin2 (Handle(Geom_Line)::DownCast (geom2));
const gp_Lin& l1 = geom_lin1->Lin(); const gp_Lin& l1 = geom_lin1->Lin();
const gp_Lin& l2 = geom_lin2->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){ if (cu1.GetType() == GeomAbs_Circle && cu2.GetType() == GeomAbs_Circle){
//Get first and last points of circles //Get first and last points of circles
const Handle(Geom_Circle)& aCir1 = Handle(Geom_Circle)::DownCast(geom1); Handle(Geom_Circle) aCir1 (Handle(Geom_Circle)::DownCast(geom1));
const Handle(Geom_Circle)& aCir2 = Handle(Geom_Circle)::DownCast(geom2); Handle(Geom_Circle) aCir2 (Handle(Geom_Circle)::DownCast(geom2));
gp_Circ aCirc1 = aCir1->Circ(); gp_Circ aCirc1 = aCir1->Circ();
gp_Circ aCirc2 = aCir2->Circ(); gp_Circ aCirc2 = aCir2->Circ();
@ -725,7 +725,7 @@ void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs
if ( aCurve->IsInstance(STANDARD_TYPE(Geom_Line)) ) 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(); const gp_Lin& l = geom_lin->Lin();
// computation of Val // computation of Val

View File

@ -420,7 +420,7 @@ void AIS_IdenticRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aS
if ( isCircle ) // case of Circles 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 udeb = ElCLib::Parameter(thecirc->Circ(),myFAttach);
Standard_Real ufin = ElCLib::Parameter(thecirc->Circ(),mySAttach); Standard_Real ufin = ElCLib::Parameter(thecirc->Circ(),mySAttach);
Handle(Geom_TrimmedCurve) thecu = new Geom_TrimmedCurve(thecirc,udeb,ufin); 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 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 udeb = ElCLib::Parameter(theEll->Elips(),myFAttach);
Standard_Real ufin = ElCLib::Parameter(theEll->Elips(),mySAttach); 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)) ) { if ( curv1->IsInstance(STANDARD_TYPE(Geom_Line)) && curv2->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
// we take the line curv1 like support // we take the line curv1 like support
Handle(Geom_Line) thelin; Handle(Geom_Line) thelin;
if (isInfinite1 && !isInfinite2) thelin = (Handle(Geom_Line)&) curv2; if (isInfinite1 && !isInfinite2) thelin = Handle(Geom_Line)::DownCast (curv2);
else if (!isInfinite1 && isInfinite2) thelin = (Handle(Geom_Line)&) curv1; else if (!isInfinite1 && isInfinite2) thelin = Handle(Geom_Line)::DownCast (curv1);
else thelin = (Handle(Geom_Line)&) curv1; else thelin = Handle(Geom_Line)::DownCast (curv1);
ComputeTwoLinesPresentation(aPrs, thelin, firstp1, lastp1, firstp2, lastp2, isInfinite1, isInfinite2); 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)) ) { else if ( curv1->IsInstance(STANDARD_TYPE(Geom_Circle)) && curv2->IsInstance(STANDARD_TYPE(Geom_Circle)) ) {
//gp_Pnt curpos; //gp_Pnt curpos;
isCircle = Standard_True; // useful for ComputeSelection 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); 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 // Treatement of the case of ellipses
else if ( curv1->IsInstance(STANDARD_TYPE(Geom_Ellipse)) && curv2->IsInstance(STANDARD_TYPE(Geom_Ellipse)) ) 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); ComputeTwoEllipsesPresentation(aPrs, theEll, firstp1, lastp1, firstp2, lastp2);
} }
// jfa 10/10/2000 end // jfa 10/10/2000 end
@ -1477,7 +1477,7 @@ void AIS_IdenticRelation::ComputeTwoVerticesPresentation(const Handle(Prs3d_Pres
TColStd_ListIteratorOfListOfTransient it(Users()); TColStd_ListIteratorOfListOfTransient it(Users());
if (it.More()) 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()) if (!USER.IsNull())
{ {
const TopoDS_Shape& SH =USER->Shape(); const TopoDS_Shape& SH =USER->Shape();
@ -1576,19 +1576,19 @@ Standard_Boolean AIS_IdenticRelation::ComputeDirection(const TopoDS_Wire& aWire,
gp_Dir d1, d2; gp_Dir d1, d2;
if ( curv1->IsInstance(STANDARD_TYPE(Geom_Circle)) ) { 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)) ) { else if (curv1->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
d1 = ComputeLineDirection((Handle(Geom_Line)&) curv1, firstp1); d1 = ComputeLineDirection(Handle(Geom_Line)::DownCast (curv1), firstp1);
} }
else else
return Standard_False; return Standard_False;
if ( curv2->IsInstance(STANDARD_TYPE(Geom_Circle)) ) { 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)) ) { else if (curv2->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
d2 =ComputeLineDirection( (Handle(Geom_Line)&) curv2, firstp2); d2 =ComputeLineDirection( Handle(Geom_Line)::DownCast (curv2), firstp2);
} }
else else
return Standard_False; return Standard_False;
@ -1613,10 +1613,10 @@ Standard_Boolean AIS_IdenticRelation::ComputeDirection(const TopoDS_Wire& aWire,
if ( !AIS::ComputeGeometry(VEdge, curv1, firstp1, lastp1) ) if ( !AIS::ComputeGeometry(VEdge, curv1, firstp1, lastp1) )
return Standard_False; return Standard_False;
if ( curv1->IsInstance(STANDARD_TYPE(Geom_Circle)) ) { 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)) ) { else if (curv1->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
dF = ComputeLineDirection( (Handle(Geom_Line)&) curv1, firstp1); dF = ComputeLineDirection( Handle(Geom_Line)::DownCast (curv1), firstp1);
} }
else else
return Standard_False; 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 // we take the median of the edges connected to vertices
gp_Dir myDir; gp_Dir myDir;
if ( aCurve->IsKind(STANDARD_TYPE(Geom_Line))) { 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()); myDir.Cross(myPlane->Pln().Axis().Direction());
} }
else if (aCurve->IsKind(STANDARD_TYPE(Geom_Circle))) { 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()); myDir.SetXYZ(myFAttach.XYZ() - CIR->Location().XYZ());
} }
// jfa 10/10/2000 // jfa 10/10/2000
else if (aCurve->IsKind(STANDARD_TYPE(Geom_Ellipse))) { 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()); myDir.SetXYZ(myFAttach.XYZ() - CIR->Location().XYZ());
} }
// jfa 10/10/2000 end // jfa 10/10/2000 end
@ -1735,7 +1735,7 @@ void AIS_IdenticRelation::ComputeOneEdgeOVertexPresentation(const Handle(Prs3d_P
curpos); curpos);
if (myExtShape != 0) { if (myExtShape != 0) {
if (!extCurv.IsNull()) { // the edge is not in the WP 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);
} }
} }
} }

View File

@ -213,7 +213,7 @@ void AIS_InteractiveContext::DisplayedObjects (AIS_ListOfInteractive& theListOfI
for (TColStd_MapIteratorOfMapOfTransient aDispMapIter (aDispMap); aDispMapIter.More(); aDispMapIter.Next()) for (TColStd_MapIteratorOfMapOfTransient aDispMapIter (aDispMap); aDispMapIter.More(); aDispMapIter.Next())
{ {
const Handle(Standard_Transient)& aTransient = aDispMapIter.Key(); const Handle(Standard_Transient)& aTransient = aDispMapIter.Key();
anObj = *((Handle(AIS_InteractiveObject)* )&aTransient); anObj = Handle(AIS_InteractiveObject)::DownCast (aTransient);
theListOfIO.Append (anObj); theListOfIO.Append (anObj);
} }
} }
@ -2821,15 +2821,13 @@ void AIS_InteractiveContext::Disconnect (const Handle(AIS_InteractiveObject)& th
{ {
if (theAssembly->IsInstance ("AIS_MultipleConnectedInteractive")) if (theAssembly->IsInstance ("AIS_MultipleConnectedInteractive"))
{ {
const Handle(AIS_MultipleConnectedInteractive)& theObj = Handle(AIS_MultipleConnectedInteractive) theObj (Handle(AIS_MultipleConnectedInteractive)::DownCast (theAssembly));
Handle(AIS_MultipleConnectedInteractive)::DownCast (theAssembly);
theObj->Disconnect (theObjToDisconnect); theObj->Disconnect (theObjToDisconnect);
mgrSelector->Remove (theObjToDisconnect); mgrSelector->Remove (theObjToDisconnect);
} }
else if (theAssembly->IsInstance ("AIS_ConnectedInteractive") && theObjToDisconnect.IsNull()) else if (theAssembly->IsInstance ("AIS_ConnectedInteractive") && theObjToDisconnect.IsNull())
{ {
const Handle(AIS_ConnectedInteractive)& theObj = Handle(AIS_ConnectedInteractive) theObj (Handle(AIS_ConnectedInteractive)::DownCast (theAssembly));
Handle(AIS_ConnectedInteractive)::DownCast (theAssembly);
theObj->Disconnect(); theObj->Disconnect();
mgrSelector->Remove (theObj); mgrSelector->Remove (theObj);
} }
@ -2855,8 +2853,7 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
AIS_MapOfObjectOwners anObjectOwnerMap; AIS_MapOfObjectOwners anObjectOwnerMap;
for (aSelection->Init(); aSelection->More(); aSelection->Next()) for (aSelection->Init(); aSelection->More(); aSelection->Next())
{ {
const Handle(AIS_InteractiveObject)& anObj = Handle(AIS_InteractiveObject) anObj (Handle(AIS_InteractiveObject)::DownCast (aSelection->Value()));
Handle(AIS_InteractiveObject)::DownCast (aSelection->Value());
if (!anObj.IsNull()) if (!anObj.IsNull())
{ {
if (anObj->IsInfinite()) if (anObj->IsInfinite())
@ -2868,8 +2865,7 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
} }
else else
{ {
const Handle(SelectMgr_EntityOwner)& anOwner = Handle(SelectMgr_EntityOwner) anOwner (Handle(SelectMgr_EntityOwner)::DownCast (aSelection->Value()));
Handle(SelectMgr_EntityOwner)::DownCast (aSelection->Value());
if (anOwner.IsNull()) if (anOwner.IsNull())
continue; continue;

View File

@ -541,7 +541,7 @@ void AIS_InteractiveContext::SetCurrentObject(const Handle(AIS_InteractiveObject
sel->Init(); sel->Init();
while (sel->More()) { while (sel->More()) {
TR = sel->Value(); TR = sel->Value();
IO = *((Handle(AIS_InteractiveObject)*)&TR); IO = Handle(AIS_InteractiveObject)::DownCast (TR);
Unhilight(IO,Standard_False); Unhilight(IO,Standard_False);
IO->State(0); IO->State(0);
sel->Next(); sel->Next();
@ -675,7 +675,7 @@ void AIS_InteractiveContext::NextCurrent()
Handle(AIS_InteractiveObject) AIS_InteractiveContext::Current() const Handle(AIS_InteractiveObject) AIS_InteractiveContext::Current() const
{ {
Handle(Standard_Transient) TR = AIS_Selection::Selection(myCurrentName.ToCString())->Value(); 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 IO;
} }
@ -718,7 +718,7 @@ void AIS_InteractiveContext::HilightCurrents(const Standard_Boolean updateviewer
sel->Init(); sel->Init();
while (sel->More()) { while (sel->More()) {
TR = sel->Value(); TR = sel->Value();
IO = *((Handle(AIS_InteractiveObject)*)&TR); IO = Handle(AIS_InteractiveObject)::DownCast (TR);
HilightWithColor(IO,mySelectionColor,Standard_False); HilightWithColor(IO,mySelectionColor,Standard_False);
sel->Next(); sel->Next();
} }
@ -740,7 +740,7 @@ void AIS_InteractiveContext::UnhilightCurrents(const Standard_Boolean updateview
sel->Init(); sel->Init();
while (sel->More()) { while (sel->More()) {
TR = sel->Value(); TR = sel->Value();
IO = *((Handle(AIS_InteractiveObject)*)&TR); IO = Handle(AIS_InteractiveObject)::DownCast (TR);
Unhilight(IO,Standard_False); Unhilight(IO,Standard_False);
sel->Next(); sel->Next();
} }
@ -762,7 +762,7 @@ void AIS_InteractiveContext::ClearCurrents(const Standard_Boolean updateviewer)
Handle(AIS_InteractiveObject) IO; Handle(AIS_InteractiveObject) IO;
for(S->Init();S->More();S->Next()){ for(S->Init();S->More();S->Next()){
Tr = S->Value(); Tr = S->Value();
IO = (*((Handle(AIS_InteractiveObject)*)&Tr)); IO = Handle(AIS_InteractiveObject)::DownCast (Tr);
IO->State(0); IO->State(0);
Unhilight(IO,Standard_False); Unhilight(IO,Standard_False);
} }
@ -787,7 +787,7 @@ void AIS_InteractiveContext::HilightSelected(const Standard_Boolean updateviewer
sel->Init(); sel->Init();
while (sel->More()) { while (sel->More()) {
TR = sel->Value(); TR = sel->Value();
IO = *((Handle(AIS_InteractiveObject)*)&TR); IO = Handle(AIS_InteractiveObject)::DownCast (TR);
HilightWithColor(IO,mySelectionColor,Standard_False); HilightWithColor(IO,mySelectionColor,Standard_False);
sel->Next(); sel->Next();
} }
@ -815,7 +815,7 @@ void AIS_InteractiveContext::UnhilightSelected(const Standard_Boolean updateview
sel->Init(); sel->Init();
while (sel->More()) { while (sel->More()) {
TR = sel->Value(); TR = sel->Value();
IO = *((Handle(AIS_InteractiveObject)*)&TR); IO = Handle(AIS_InteractiveObject)::DownCast (TR);
Unhilight(IO,Standard_False); Unhilight(IO,Standard_False);
sel->Next(); sel->Next();
} }
@ -1055,7 +1055,7 @@ Handle(AIS_InteractiveObject) AIS_InteractiveContext::SelectedInteractive() cons
if (AIS_Selection::Selection(myCurrentName.ToCString())->Extent() == 0) if (AIS_Selection::Selection(myCurrentName.ToCString())->Extent() == 0)
return NULL; return NULL;
Handle(Standard_Transient) TR =AIS_Selection::Selection(myCurrentName.ToCString())->Value(); 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 IO;}
return myLocalContexts(myCurLocalIndex)->SelectedInteractive(); return myLocalContexts(myCurLocalIndex)->SelectedInteractive();

View File

@ -633,7 +633,7 @@ void AIS_InteractiveObject::BoundingBox (Bnd_Box& theBndBox)
{ {
for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (Children()); aPrsIter.More(); aPrsIter.Next()) 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()) if (aChild.IsNull())
{ {
continue; continue;

View File

@ -411,7 +411,7 @@ Standard_Boolean AIS_LengthDimension::InitEdgeVertexLength (const TopoDS_Edge& t
myFirstPoint = BRep_Tool::Pnt (theVertex); 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(); const gp_Lin& aLin = aGeomLine->Lin();
// Get direction of edge to build plane automatically. // Get direction of edge to build plane automatically.

View File

@ -620,7 +620,7 @@ void AIS_LocalContext::Terminate (const Standard_Boolean theToUpdate)
Handle(Standard_Transient) Tr; Handle(Standard_Transient) Tr;
for(S->Init();S->More();S->Next()){ for(S->Init();S->More();S->Next()){
Tr = S->Value(); Tr = S->Value();
(*((Handle(SelectMgr_EntityOwner)*)&Tr))->SetSelected (Standard_False); Handle(SelectMgr_EntityOwner)::DownCast (Tr)->SetSelected (Standard_False);
} }

View File

@ -533,11 +533,11 @@ void AIS_LocalContext::HilightPicked(const Standard_Boolean updateviewer)
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(Ownr); Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(Ownr);
if(BROwnr.IsNull() || !BROwnr->ComesFromDecomposition()){ if(BROwnr.IsNull() || !BROwnr->ComesFromDecomposition()){
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable(); Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
IO = *((Handle(AIS_InteractiveObject)*)&SO); IO = Handle(AIS_InteractiveObject)::DownCast (SO);
} }
} }
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable(); 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() ) if ( Ownr->IsAutoHilight() )
Ownr->HilightWithColor(PM,myCTX->SelectionColor(),HM); Ownr->HilightWithColor(PM,myCTX->SelectionColor(),HM);
else if ( aMap.IsBound (SO) ) else if ( aMap.IsBound (SO) )
@ -585,7 +585,7 @@ void AIS_LocalContext::UnhilightPicked (const Standard_Boolean updateviewer)
Standard_Integer HM(0); Standard_Integer HM(0);
if(Ownr->HasSelectable()){ if(Ownr->HasSelectable()){
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable(); 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); anObjMap.Add (IO);
HM = GetHiMod(IO); HM = GetHiMod(IO);
@ -667,7 +667,7 @@ HasShape() const
{ {
Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value(); Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value();
if( Tr.IsNull() ) return Standard_False; 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); Handle(StdSelect_BRepOwner) BRO = Handle(StdSelect_BRepOwner)::DownCast(EO);
if(BRO.IsNull()) return Standard_False; if(BRO.IsNull()) return Standard_False;
Standard_Boolean hasshape = BRO->HasShape(); Standard_Boolean hasshape = BRO->HasShape();
@ -704,7 +704,7 @@ Standard_Boolean AIS_LocalContext::HasSelectedShape() const
TopoDS_Shape AIS_LocalContext::SelectedShape() const TopoDS_Shape AIS_LocalContext::SelectedShape() const
{ {
Handle(Standard_Transient) aTr = AIS_Selection::CurrentSelection()->Value(); 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); Handle(StdSelect_BRepOwner) aBRO = Handle(StdSelect_BRepOwner)::DownCast(anEO);
if( aBRO.IsNull() ) if( aBRO.IsNull() )
{ {
@ -724,11 +724,11 @@ SelectedInteractive() const
Handle(AIS_InteractiveObject) IO; Handle(AIS_InteractiveObject) IO;
Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value(); Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value();
if( !Tr.IsNull() ) { if( !Tr.IsNull() ) {
Handle(SelectMgr_EntityOwner) EO = *((Handle(SelectMgr_EntityOwner)*)&Tr); Handle(SelectMgr_EntityOwner) EO = Handle(SelectMgr_EntityOwner)::DownCast (Tr);
Handle(SelectMgr_SelectableObject) SO; Handle(SelectMgr_SelectableObject) SO;
if(EO->HasSelectable()){ if(EO->HasSelectable()){
SO = EO->Selectable(); SO = EO->Selectable();
IO = *((Handle(AIS_InteractiveObject)*)&SO); IO = Handle(AIS_InteractiveObject)::DownCast (SO);
} }
} }
return IO; return IO;
@ -743,7 +743,7 @@ SelectedOwner() const
Handle(SelectMgr_EntityOwner) EO; Handle(SelectMgr_EntityOwner) EO;
Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value(); Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value();
if( !Tr.IsNull() ) if( !Tr.IsNull() )
EO = *((Handle(SelectMgr_EntityOwner)*)&Tr); EO = Handle(SelectMgr_EntityOwner)::DownCast (Tr);
return EO; return EO;
} }
@ -1016,7 +1016,7 @@ void AIS_LocalContext::SetSelected(const Handle(AIS_InteractiveObject)& anIObj,
SIOBJ->Init(); SIOBJ->Init();
if(SIOBJ->More()){ if(SIOBJ->More()){
Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->BaseSensitive()->OwnerId(); Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->BaseSensitive()->OwnerId();
EO = *((Handle(SelectMgr_EntityOwner)*)&BO); EO = Handle(SelectMgr_EntityOwner)::DownCast (BO);
} }
} }
if(EO.IsNull()) if(EO.IsNull())
@ -1054,7 +1054,7 @@ void AIS_LocalContext::AddOrRemoveSelected(const Handle(AIS_InteractiveObject)&
SIOBJ->Init(); SIOBJ->Init();
if(SIOBJ->More()){ if(SIOBJ->More()){
Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->BaseSensitive()->OwnerId(); Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->BaseSensitive()->OwnerId();
EO = *((Handle(SelectMgr_EntityOwner)*)&BO); EO = Handle(SelectMgr_EntityOwner)::DownCast (BO);
} }
} }
if(EO.IsNull()) if(EO.IsNull())
@ -1242,7 +1242,7 @@ AIS_LocalContext::DetectedInteractive() const
Handle(AIS_InteractiveObject) Iobj; Handle(AIS_InteractiveObject) Iobj;
if(IsValidIndex(mylastindex)){ if(IsValidIndex(mylastindex)){
Handle(SelectMgr_SelectableObject) SO = myMapOfOwner->FindKey(mylastindex)->Selectable(); Handle(SelectMgr_SelectableObject) SO = myMapOfOwner->FindKey(mylastindex)->Selectable();
Iobj = *((Handle(AIS_InteractiveObject)*) &SO); Iobj = Handle(AIS_InteractiveObject)::DownCast (SO);
} }
return Iobj; return Iobj;
} }
@ -1420,7 +1420,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromIO
for(; anIter.More(); anIter.Next()){ for(; anIter.More(); anIter.Next()){
const Handle(Standard_Transient)& Tr = anIter.Value(); const Handle(Standard_Transient)& Tr = anIter.Value();
if(!Tr.IsNull()){ if(!Tr.IsNull()){
EO = *((Handle(SelectMgr_EntityOwner)*)&Tr); EO = Handle(SelectMgr_EntityOwner)::DownCast (Tr);
if(EO->HasSelectable()){ if(EO->HasSelectable()){
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(EO); Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(EO);
if(BROwnr.IsNull() || !BROwnr->ComesFromDecomposition()){ if(BROwnr.IsNull() || !BROwnr->ComesFromDecomposition()){

View 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 else if ( curv->IsInstance(STANDARD_TYPE(Geom_Circle)) ) // case of circle
{ {
// segment on 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 udeb = ElCLib::Parameter(thecirc->Circ(),myFirstPnt1);
Standard_Real ufin = ElCLib::Parameter(thecirc->Circ(),myFirstPnt2); Standard_Real ufin = ElCLib::Parameter(thecirc->Circ(),myFirstPnt2);
Handle(Geom_TrimmedCurve) thecu = new Geom_TrimmedCurve(thecirc,udeb,ufin); 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 else if ( curv->IsInstance(STANDARD_TYPE(Geom_Ellipse)) ) // case of ellipse
{ {
// segment on 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 udeb = ElCLib::Parameter(theEll->Elips(),myFirstPnt1);
Standard_Real ufin = ElCLib::Parameter(theEll->Elips(),myFirstPnt2); Standard_Real ufin = ElCLib::Parameter(theEll->Elips(),myFirstPnt2);
Handle(Geom_TrimmedCurve) thecu = new Geom_TrimmedCurve(theEll,udeb,ufin); 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 else if ( curv->IsInstance(STANDARD_TYPE(Geom_Circle)) ) // case of circle
{ {
// segment on 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 udeb = ElCLib::Parameter(thecirc->Circ(),mySecondPnt1);
Standard_Real ufin = ElCLib::Parameter(thecirc->Circ(),mySecondPnt2); Standard_Real ufin = ElCLib::Parameter(thecirc->Circ(),mySecondPnt2);
Handle(Geom_TrimmedCurve) thecu = new Geom_TrimmedCurve(thecirc,udeb,ufin); 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 else if ( curv->IsInstance(STANDARD_TYPE(Geom_Ellipse)) ) // case of ellipse
{ {
// segment on 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 udeb = ElCLib::Parameter(theEll->Elips(),mySecondPnt1);
Standard_Real ufin = ElCLib::Parameter(theEll->Elips(),mySecondPnt2); Standard_Real ufin = ElCLib::Parameter(theEll->Elips(),mySecondPnt2);
Handle(Geom_TrimmedCurve) thecu = new Geom_TrimmedCurve(theEll,udeb,ufin); 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); if ( !isInfinite ) ComputePointsOnLine(ptat1,ptat2,first);
else else
{ {
const gp_Lin& line = ((Handle(Geom_Line)&) geom)->Lin(); const gp_Lin& line = Handle(Geom_Line)::DownCast (geom)->Lin();
ComputePointsOnLine(line,first); ComputePointsOnLine(line,first);
} }
if ( first ) DsgPrs_MidPointPresentation::Add(aprs,myDrawer,ax,myMidPoint,myPosition, 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)) ) 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()); gp_Circ circ (geom_cir->Circ());
ComputePointsOnCirc(circ,ptat1,ptat2,first); ComputePointsOnCirc(circ,ptat1,ptat2,first);
if ( first ) DsgPrs_MidPointPresentation::Add(aprs,myDrawer,circ,myMidPoint,myPosition, 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)) ) 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()); gp_Elips elips (geom_ell->Elips());
ComputePointsOnElips(elips,ptat1,ptat2,first); ComputePointsOnElips(elips,ptat1,ptat2,first);
if ( first ) DsgPrs_MidPointPresentation::Add(aprs,myDrawer,elips,myMidPoint,myPosition, if ( first ) DsgPrs_MidPointPresentation::Add(aprs,myDrawer,elips,myMidPoint,myPosition,

View File

@ -248,7 +248,7 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
if (geom1->IsInstance(STANDARD_TYPE(Geom_Ellipse))) 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 // construct lines through focuses
gp_Ax1 elAx = geom_el1->XAxis(); gp_Ax1 elAx = geom_el1->XAxis();
l1 = gp_Lin(elAx); l1 = gp_Lin(elAx);
@ -260,14 +260,14 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
} }
else if (geom1->IsInstance(STANDARD_TYPE(Geom_Line))) 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(); l1 = geom_lin1->Lin();
} }
else return; else return;
if (geom2->IsInstance(STANDARD_TYPE(Geom_Ellipse))) 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 // construct lines through focuses
gp_Ax1 elAx = geom_el2->XAxis(); gp_Ax1 elAx = geom_el2->XAxis();
l2 = gp_Lin(elAx); l2 = gp_Lin(elAx);
@ -279,7 +279,7 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
} }
else if (geom2->IsInstance(STANDARD_TYPE(Geom_Line))) 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(); l2 = geom_lin2->Lin();
} }
else return; else return;

View File

@ -212,7 +212,7 @@ void AIS_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_
Handle(Geom_Line) geom_lin2; Handle(Geom_Line) geom_lin2;
if ( geom1->IsInstance(STANDARD_TYPE(Geom_Ellipse)) ) 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 // construct lines through focuses
gp_Ax1 elAx = geom_el->XAxis(); gp_Ax1 elAx = geom_el->XAxis();
gp_Lin ll (elAx); gp_Lin ll (elAx);
@ -225,13 +225,13 @@ void AIS_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_
} }
else if ( geom1->IsInstance(STANDARD_TYPE(Geom_Line)) ) else if ( geom1->IsInstance(STANDARD_TYPE(Geom_Line)) )
{ {
geom_lin1 = (Handle(Geom_Line)&) geom1; geom_lin1 = Handle(Geom_Line)::DownCast (geom1);
} }
else return; else return;
if (geom2->IsInstance(STANDARD_TYPE(Geom_Ellipse))) 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 // construct lines through focuses
gp_Ax1 elAx = geom_el->XAxis(); gp_Ax1 elAx = geom_el->XAxis();
gp_Lin ll (elAx); gp_Lin ll (elAx);
@ -244,7 +244,7 @@ void AIS_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_
} }
else if ( geom2->IsInstance(STANDARD_TYPE(Geom_Line)) ) else if ( geom2->IsInstance(STANDARD_TYPE(Geom_Line)) )
{ {
geom_lin2 = (Handle(Geom_Line)&) geom2; geom_lin2 = Handle(Geom_Line)::DownCast (geom2);
} }
else return; else return;
@ -255,9 +255,9 @@ void AIS_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_
// 2d lines => projection of 3d on current plane // 2d lines => projection of 3d on current plane
Handle(Geom2d_Curve) aGeom2dCurve = GeomAPI::To2d(geom_lin1,myPlane->Pln()); 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()); 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()); IntAna2d_AnaIntersection inter(lin1_2d->Lin2d(),lin2_2d->Lin2d());
if (!inter.IsDone()) return; if (!inter.IsDone()) return;
if (!inter.NbPoints()) return; if (!inter.NbPoints()) return;

View File

@ -251,7 +251,7 @@ void AIS_Plane::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
{ {
ComputeFrame(); ComputeFrame();
const Handle(Geom_Plane)& pl = myComponent; 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); GeomAdaptor_Surface surf(thegoodpl);
StdPrs_Plane::Add(aPresentation,surf,myDrawer); StdPrs_Plane::Add(aPresentation,surf,myDrawer);
} }
@ -531,8 +531,7 @@ void AIS_Plane::ComputeFrame()
pl->D0 (U, V, myCenter); pl->D0 (U, V, myCenter);
} }
else { else {
const Handle(Geom_Plane)& thegoodpl = Handle(Geom_Plane) thegoodpl (Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter)));
Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter));
ElSLib::Parameters(thegoodpl->Pln(),myPmin,U,V); ElSLib::Parameters(thegoodpl->Pln(),myPmin,U,V);
U = 2.4*Abs(U); U = 2.4*Abs(U);

View File

@ -101,7 +101,7 @@ void AIS_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)&
// Calcul de la presentation de l'edge // Calcul de la presentation de l'edge
if (ProjCurv->IsInstance(STANDARD_TYPE(Geom_Line)) ) { 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) { if ( !isInfinite) {
pf = ElCLib::Parameter(gl->Lin(),FirstP); pf = ElCLib::Parameter(gl->Lin(),FirstP);
pl = ElCLib::Parameter(gl->Lin(),LastP); 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)) ) { 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); pf = ElCLib::Parameter(gc->Circ(),FirstP);
pl = ElCLib::Parameter(gc->Circ(),LastP); pl = ElCLib::Parameter(gc->Circ(),LastP);
BRepBuilderAPI_MakeEdge MakEd(gc->Circ(),pf, pl); BRepBuilderAPI_MakeEdge MakEd(gc->Circ(),pf, pl);

View File

@ -79,7 +79,7 @@ Handle(AIS_Selection) AIS_Selection::Selection(const Standard_CString aName)
// Standard_Boolean found(Standard_False); // Standard_Boolean found(Standard_False);
for(Standard_Integer I =1; I<= AIS_Sel_GetSelections().Length();I++){ for(Standard_Integer I =1; I<= AIS_Sel_GetSelections().Length();I++){
curobj = AIS_Sel_GetSelections().Value(I); curobj = AIS_Sel_GetSelections().Value(I);
Sel = *((Handle(AIS_Selection)*)&curobj); Sel = Handle(AIS_Selection)::DownCast (curobj);
if(Sel->myName.IsEqual(aName)) if(Sel->myName.IsEqual(aName))
return Sel; return Sel;
} }
@ -274,7 +274,7 @@ Standard_Integer AIS_Selection::Index(const Standard_CString aName)
Handle (Standard_Transient) curobj; Handle (Standard_Transient) curobj;
for(Standard_Integer I =1; I<= AIS_Sel_GetSelections().Length();I++){ for(Standard_Integer I =1; I<= AIS_Sel_GetSelections().Length();I++){
curobj = AIS_Sel_GetSelections().Value(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 I;
} }
return 0; return 0;

View 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); // Handle(Geom_Circle) geom_circ1 = (Handle(Geom_Circle)&) BRep_Tool::Curve(TopoDS::Edge(myFShape),F,L);
//JR/Hp //JR/Hp
Handle(Geom_Curve) aGeomCurve = BRep_Tool::Curve(TopoDS::Edge(myFShape),F,L); 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); // Handle(Geom_Circle) geom_circ1 = (const Handle(Geom_Circle)&) BRep_Tool::Curve(TopoDS::Edge(myFShape),F,L);
gp_Circ circ1(geom_circ1->Circ()); gp_Circ circ1(geom_circ1->Circ());
gp_Pnt OffsetPnt(myPosition.X(),myPosition.Y(),myPosition.Z()); gp_Pnt OffsetPnt(myPosition.X(),myPosition.Y(),myPosition.Z());
@ -417,13 +417,13 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta
myAxisDirAttach = laxis.Direction(); myAxisDirAttach = laxis.Direction();
if(cu1.GetType() == GeomAbs_Line){ 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()); gp_Lin l1(geom_lin1->Lin());
myFDirAttach = l1.Direction(); myFDirAttach = l1.Direction();
} }
gp_Circ circ; gp_Circ circ;
if(cu1.GetType() == GeomAbs_Circle){ 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()); gp_Circ c(geom_cir1->Circ());
circ = c; circ = c;
} }
@ -444,13 +444,13 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta
*/ */
Standard_Boolean idem = Standard_False; Standard_Boolean idem = Standard_False;
if (isInfinite1 && isInfinite2) { // geom1 et geom2 sont des lignes 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) { 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); mySAttach = ElCLib::Value(ElCLib::Parameter(line2,myFAttach),line2);
} }
else { 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); myFAttach = ElCLib::Value(ElCLib::Parameter(line1,myPosition),line1);
mySAttach = ElCLib::Value(ElCLib::Parameter(line2,myFAttach),line2); 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 else if (isInfinite1) {// geom1 et geom2 sont des lignes
mySAttach = ptat21; 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); myFAttach = ElCLib::Value(ElCLib::Parameter(line1,mySAttach),line1);
} }
else if (isInfinite2) {// geom1 et geom2 sont des lignes else if (isInfinite2) {// geom1 et geom2 sont des lignes
myFAttach = ptat11; 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); 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); gp_Pnt PjFAttach = ElCLib::Value(ElCLib::Parameter(laxis,myFAttach),laxis);
if (PjFAttach.IsEqual(myFAttach,Precision::Confusion())){ 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()); gp_Lin l2(geom_lin2->Lin());
myFDirAttach = l2.Direction(); myFDirAttach = l2.Direction();
gp_Pnt PntTempo; gp_Pnt PntTempo;

View File

@ -204,25 +204,25 @@ static Standard_Boolean ComputeTangencyPoint(const Handle(Geom_Curve)& GC1,
gp_Vec aVector1,aVector2; gp_Vec aVector1,aVector2;
if (GC1->IsInstance(STANDARD_TYPE(Geom_Circle))) 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); Standard_Real par_inter = ElCLib::Parameter(circle->Circ(), P1);
ElCLib::D1(par_inter,circle->Circ(),P1,aVector1); ElCLib::D1(par_inter,circle->Circ(),P1,aVector1);
} }
else if (GC1->IsInstance(STANDARD_TYPE(Geom_Ellipse))) 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); Standard_Real par_inter = ElCLib::Parameter(ellipse->Elips(), P1);
ElCLib::D1(par_inter,ellipse->Elips(),P1,aVector1); ElCLib::D1(par_inter,ellipse->Elips(),P1,aVector1);
} }
if (GC2->IsInstance(STANDARD_TYPE(Geom_Circle))) 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); Standard_Real par_inter = ElCLib::Parameter(circle->Circ(), P2);
ElCLib::D1(par_inter,circle->Circ(),P2,aVector2); ElCLib::D1(par_inter,circle->Circ(),P2,aVector2);
} }
else if (GC2->IsInstance(STANDARD_TYPE(Geom_Ellipse))) 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); Standard_Real par_inter = ElCLib::Parameter(ellipse->Elips(), P2);
ElCLib::D1(par_inter,ellipse->Elips(),P2,aVector2); ElCLib::D1(par_inter,ellipse->Elips(),P2,aVector2);
} }
@ -333,8 +333,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
{ {
case 12: // circle line case 12: // circle line
{ {
const Handle(Geom_Line)& line = (Handle(Geom_Line)&) copy1; Handle(Geom_Line) line (Handle(Geom_Line)::DownCast (copy1));
const Handle(Geom_Circle)& circle = (Handle(Geom_Circle)&) copy2; Handle(Geom_Circle) circle (Handle(Geom_Circle)::DownCast (copy2));
if ( !found ) if ( !found )
{ {
@ -355,8 +355,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
break; break;
case 21: // circle line case 21: // circle line
{ {
const Handle(Geom_Circle)& circle = (Handle(Geom_Circle)&) copy1; Handle(Geom_Circle) circle (Handle(Geom_Circle)::DownCast (copy1));
const Handle(Geom_Line)& line = (Handle(Geom_Line)&) copy2; Handle(Geom_Line) line (Handle(Geom_Line)::DownCast (copy2));
if (!found) if (!found)
{ {
@ -378,8 +378,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
// jfa 19/10/2000 begin // jfa 19/10/2000 begin
case 13: // line ellipse case 13: // line ellipse
{ {
const Handle(Geom_Line)& line = (Handle(Geom_Line)&) copy1; Handle(Geom_Line) line (Handle(Geom_Line)::DownCast (copy1));
const Handle(Geom_Ellipse)& ellipse = (Handle(Geom_Ellipse)&) copy2; Handle(Geom_Ellipse) ellipse (Handle(Geom_Ellipse)::DownCast (copy2));
if (!found) if (!found)
{ {
@ -399,8 +399,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
break; break;
case 31: // ellipse line case 31: // ellipse line
{ {
const Handle(Geom_Ellipse)& ellipse = (Handle(Geom_Ellipse)&) copy1; Handle(Geom_Ellipse) ellipse (Handle(Geom_Ellipse)::DownCast (copy1));
const Handle(Geom_Line)& line = (Handle(Geom_Line)&) copy2; Handle(Geom_Line) line (Handle(Geom_Line)::DownCast (copy2));
if (!found) if (!found)
{ {
@ -420,8 +420,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
break; break;
case 22: // circle circle case 22: // circle circle
{ {
const Handle(Geom_Circle)& circle1 = (Handle(Geom_Circle)&) copy1; Handle(Geom_Circle) circle1 (Handle(Geom_Circle)::DownCast (copy1));
const Handle(Geom_Circle)& circle2 = (Handle(Geom_Circle)&) copy2; Handle(Geom_Circle) circle2 (Handle(Geom_Circle)::DownCast (copy2));
Standard_Real R1 = circle1->Radius(); Standard_Real R1 = circle1->Radius();
Standard_Real R2 = circle2->Radius(); Standard_Real R2 = circle2->Radius();
myLength = Max(R1,R2)/5.0; myLength = Max(R1,R2)/5.0;
@ -462,8 +462,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
break; break;
case 23: // circle ellipse case 23: // circle ellipse
{ {
const Handle(Geom_Circle)& circle = (Handle(Geom_Circle)&) copy1; Handle(Geom_Circle) circle (Handle(Geom_Circle)::DownCast (copy1));
const Handle(Geom_Ellipse)& ellipse = (Handle(Geom_Ellipse)&) copy2; Handle(Geom_Ellipse) ellipse (Handle(Geom_Ellipse)::DownCast (copy2));
Standard_Real R1 = circle->Radius(); Standard_Real R1 = circle->Radius();
Standard_Real R2 = ellipse->MajorRadius(); Standard_Real R2 = ellipse->MajorRadius();
myLength = Max(R1,R2)/5.0; myLength = Max(R1,R2)/5.0;
@ -492,8 +492,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
break; break;
case 32: // ellipse circle case 32: // ellipse circle
{ {
const Handle(Geom_Ellipse)& ellipse = (Handle(Geom_Ellipse)&) copy1; Handle(Geom_Ellipse) ellipse (Handle(Geom_Ellipse)::DownCast (copy1));
const Handle(Geom_Circle)& circle = (Handle(Geom_Circle)&) copy2; Handle(Geom_Circle) circle (Handle(Geom_Circle)::DownCast (copy2));
Standard_Real R1 = ellipse->MajorRadius(); Standard_Real R1 = ellipse->MajorRadius();
Standard_Real R2 = circle->Radius(); Standard_Real R2 = circle->Radius();
myLength = Max(R1,R2)/5.0; myLength = Max(R1,R2)/5.0;
@ -522,8 +522,8 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
break; break;
case 33: // ellipse ellipse case 33: // ellipse ellipse
{ {
const Handle(Geom_Ellipse)& ellipse1 = (Handle(Geom_Ellipse)&) copy1; Handle(Geom_Ellipse) ellipse1 (Handle(Geom_Ellipse)::DownCast (copy1));
const Handle(Geom_Ellipse)& ellipse2 = (Handle(Geom_Ellipse)&) copy2; Handle(Geom_Ellipse) ellipse2 (Handle(Geom_Ellipse)::DownCast (copy2));
Standard_Real R1 = ellipse1->MajorRadius(); Standard_Real R1 = ellipse1->MajorRadius();
Standard_Real R2 = ellipse2->MajorRadius(); Standard_Real R2 = ellipse2->MajorRadius();
myLength = Max(R1,R2)/5.0; myLength = Max(R1,R2)/5.0;

View File

@ -27,7 +27,7 @@ Standard_Boolean AIS_TypeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& anObj
//#ifndef OCCT_DEBUG //#ifndef OCCT_DEBUG
Handle(SelectMgr_SelectableObject) aSelectableObject = anObj->Selectable() ; Handle(SelectMgr_SelectableObject) aSelectableObject = anObj->Selectable() ;
return ((Handle(AIS_InteractiveObject)&) aSelectableObject)->Type()== myKind; return Handle(AIS_InteractiveObject)::DownCast (aSelectableObject)->Type()== myKind;
//#else //#else
// return ((Handle(AIS_InteractiveObject)&)anObj->Selectable())->Type()== myKind; // return ((Handle(AIS_InteractiveObject)&)anObj->Selectable())->Type()== myKind;
//#endif //#endif

View File

@ -24,10 +24,10 @@
#include <TColgp_HArray1OfVec2d.hxx> #include <TColgp_HArray1OfVec2d.hxx>
#define tabTang (*(Handle(TColgp_HArray1OfVec)*)&ttabTang) #define tabTang Handle(TColgp_HArray1OfVec)::DownCast (ttabTang)
#define tabCurv (*(Handle(TColgp_HArray1OfVec)*)&ttabCurv) #define tabCurv Handle(TColgp_HArray1OfVec)::DownCast (ttabCurv)
#define tabTang2d (*(Handle(TColgp_HArray1OfVec2d)*)&ttabTang2d) #define tabTang2d Handle(TColgp_HArray1OfVec2d)::DownCast (ttabTang2d)
#define tabCurv2d (*(Handle(TColgp_HArray1OfVec2d)*)&ttabCurv2d) #define tabCurv2d Handle(TColgp_HArray1OfVec2d)::DownCast (ttabCurv2d)

View File

@ -2722,7 +2722,7 @@ void AppDef_Variational::AssemblingConstraints(const Handle(FEmTool_Curve)& Curv
Standard_Real t, R1, R2; Standard_Real t, R1, R2;
Handle(PLib_Base) myBase = Curve->Base(); 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_Integer Order = myHermitJacobi->NivConstr() + 1;
Standard_Real UFirst, ULast, coeff, c0, mfact, mfact1; Standard_Real UFirst, ULast, coeff, c0, mfact, mfact1;

View File

@ -18,8 +18,8 @@
#include <Standard_OutOfRange.hxx> #include <Standard_OutOfRange.hxx>
#define tabPoint (*(Handle(TColgp_HArray1OfPnt)*)&ttabPoint) #define tabPoint Handle(TColgp_HArray1OfPnt)::DownCast (ttabPoint)
#define tabPoint2d (*(Handle(TColgp_HArray1OfPnt2d)*)&ttabPoint2d) #define tabPoint2d Handle(TColgp_HArray1OfPnt2d)::DownCast (ttabPoint2d)
AppParCurves_MultiPoint::AppParCurves_MultiPoint() {} AppParCurves_MultiPoint::AppParCurves_MultiPoint() {}

View File

@ -302,7 +302,7 @@ Handle(Geom2d_Curve) CurveOnSurface(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l)) { 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); GC->Range(First,Last);
if (GC->IsCurveOnClosedSurface() && Eisreversed) if (GC->IsCurveOnClosedSurface() && Eisreversed)
return GC->PCurve2(); return GC->PCurve2();

View File

@ -793,7 +793,7 @@ Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,loc)) { 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); GC->Range(First,Last);
if (GC->IsCurveOnClosedSurface() && Eisreversed) if (GC->IsCurveOnClosedSurface() && Eisreversed)
return GC->PCurve2(); return GC->PCurve2();
@ -837,7 +837,7 @@ Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface
if (!LC.IsIdentity()) { if (!LC.IsIdentity()) {
const gp_Trsf& T = LC.Transformation(); const gp_Trsf& T = LC.Transformation();
Handle(Geom_Geometry) GPT = GP->Transformed(T); Handle(Geom_Geometry) GPT = GP->Transformed(T);
Plane = *((Handle(Geom_Plane)*)&GPT); Plane = Handle(Geom_Plane)::DownCast (GPT);
} }
GeomAdaptor_Surface& GAS = HS->ChangeSurface(); GeomAdaptor_Surface& GAS = HS->ChangeSurface();
GAS.Load(Plane); GAS.Load(Plane);
@ -856,7 +856,7 @@ Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface
if (pc->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) { if (pc->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
Handle(Geom2d_TrimmedCurve) TC = Handle(Geom2d_TrimmedCurve) TC =
(*((Handle(Geom2d_TrimmedCurve)*)&pc)); Handle(Geom2d_TrimmedCurve)::DownCast (pc);
pc = TC->BasisCurve(); pc = TC->BasisCurve();
} }
First = f; Last = l; First = f; Last = l;

View File

@ -491,7 +491,7 @@ void CheckEdge (const TopoDS_Edge& Ed,
// //
aOrV=aV.Orientation(); aOrV=aV.Orientation();
if (aOrV==TopAbs_FORWARD || aOrV==TopAbs_REVERSED) { 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) { if (aOrV==TopAbs_FORWARD) {
aPC=aC->Value(aGC->First()); aPC=aC->Value(aGC->First());
@ -725,8 +725,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape,
} }
if (!myCref.IsNull()) { if (!myCref.IsNull()) {
const Handle(BRep_GCurve)& GCref = Handle(BRep_GCurve) GCref (Handle(BRep_GCurve)::DownCast (myCref));
*((Handle(BRep_GCurve)*)&myCref);
Standard_Real First,Last; Standard_Real First,Last;
GCref->Range(First,Last); GCref->Range(First,Last);
if (Last<=First) { if (Last<=First) {
@ -786,7 +785,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape,
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr != myCref && cr->IsCurveOnSurface(Su,L)) { if (cr != myCref && cr->IsCurveOnSurface(Su,L)) {
pcurvefound = Standard_True; 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; Standard_Real f,l;
GC->Range(f,l); GC->Range(f,l);
if (SameRange && (f != First || l != Last)) { if (SameRange && (f != First || l != Last)) {

View File

@ -93,7 +93,7 @@ Handle(Geom_Surface) BRep_Tool::Surface(const TopoDS_Face& F)
Handle(Geom_Geometry) S1; Handle(Geom_Geometry) S1;
if (!L.IsIdentity()) { if (!L.IsIdentity()) {
S1 = S->Copy(); S1 = S->Copy();
S = *((Handle(Geom_Surface)*)&S1); S = Handle(Geom_Surface)::DownCast (S1);
S->Transform(L.Transformation()); S->Transform(L.Transformation());
} }
return S; return S;
@ -157,7 +157,7 @@ const Handle(Geom_Curve)& BRep_Tool::Curve(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurve3D()) { 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(); L = E.Location() * GC->Location();
GC->Range(First,Last); GC->Range(First,Last);
return GC->Curve3D(); return GC->Curve3D();
@ -185,7 +185,7 @@ Handle(Geom_Curve) BRep_Tool::Curve(const TopoDS_Edge& E,
Handle(Geom_Geometry) C1; Handle(Geom_Geometry) C1;
if ( !L.IsIdentity() ) { if ( !L.IsIdentity() ) {
C1 = C->Copy(); C1 = C->Copy();
C = *((Handle(Geom_Curve)*)&C1); C = Handle(Geom_Curve)::DownCast (C1);
C->Transform(L.Transformation()); C->Transform(L.Transformation());
} }
} }
@ -236,7 +236,7 @@ const Handle(Poly_Polygon3D)& BRep_Tool::Polygon3D(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsPolygon3D()) { 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(); L = E.Location() * GC->Location();
return GC->Polygon3D(); return GC->Polygon3D();
} }
@ -298,7 +298,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,loc)) { 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); GC->Range(First,Last);
if (GC->IsCurveOnClosedSurface() && Eisreversed) if (GC->IsCurveOnClosedSurface() && Eisreversed)
return GC->PCurve2(); return GC->PCurve2();
@ -344,7 +344,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
{ {
const gp_Trsf& T = aCurveLocation.Transformation(); const gp_Trsf& T = aCurveLocation.Transformation();
Handle(Geom_Geometry) GC3d = C3d->Transformed(T); Handle(Geom_Geometry) GC3d = C3d->Transformed(T);
C3d = *((Handle(Geom_Curve)*)&GC3d); C3d = Handle(Geom_Curve)::DownCast (GC3d);
f = C3d->TransformedParameter(f, T); f = C3d->TransformedParameter(f, T);
l = C3d->TransformedParameter(l, 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)) { if (pc->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
Handle(Geom2d_TrimmedCurve) TC = Handle(Geom2d_TrimmedCurve) TC =
(*((Handle(Geom2d_TrimmedCurve)*)&pc)); Handle(Geom2d_TrimmedCurve)::DownCast (pc);
pc = TC->BasisCurve(); pc = TC->BasisCurve();
} }
@ -394,7 +394,7 @@ void BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface()) { if (cr->IsCurveOnSurface()) {
const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr); Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
C = GC->PCurve(); C = GC->PCurve();
S = GC->Surface(); S = GC->Surface();
L = E.Location() * GC->Location(); L = E.Location() * GC->Location();
@ -432,7 +432,7 @@ void BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface()) { if (cr->IsCurveOnSurface()) {
const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr); Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
i++; i++;
if (i > Index) break; if (i > Index) break;
if (i == Index) { if (i == Index) {
@ -533,8 +533,7 @@ void BRep_Tool::PolygonOnSurface(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsPolygonOnSurface()) { if (cr->IsPolygonOnSurface()) {
const Handle(BRep_PolygonOnSurface)& PS = Handle(BRep_PolygonOnSurface) PS (Handle(BRep_PolygonOnSurface)::DownCast (cr));
*((Handle(BRep_PolygonOnSurface)*)&cr);
P = PS->Polygon(); P = PS->Polygon();
S = PS->Surface(); S = PS->Surface();
L = E.Location() * PS->Location(); L = E.Location() * PS->Location();
@ -568,8 +567,7 @@ void BRep_Tool::PolygonOnSurface(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsPolygonOnSurface()) { if (cr->IsPolygonOnSurface()) {
const Handle(BRep_PolygonOnSurface)& PS = Handle(BRep_PolygonOnSurface) PS (Handle(BRep_PolygonOnSurface)::DownCast (cr));
*((Handle(BRep_PolygonOnSurface)*)&cr);
i++; i++;
if (i > Index) break; if (i > Index) break;
if (i == Index) { if (i == Index) {
@ -640,8 +638,7 @@ BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsPolygonOnTriangulation()) { if (cr->IsPolygonOnTriangulation()) {
const Handle(BRep_PolygonOnTriangulation)& PT = Handle(BRep_PolygonOnTriangulation) PT (Handle(BRep_PolygonOnTriangulation)::DownCast (cr));
*((Handle(BRep_PolygonOnTriangulation)*)&cr);
P = PT->PolygonOnTriangulation(); P = PT->PolygonOnTriangulation();
T = PT->Triangulation(); T = PT->Triangulation();
L = E.Location() * PT->Location(); L = E.Location() * PT->Location();
@ -676,8 +673,7 @@ BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsPolygonOnTriangulation()) { if (cr->IsPolygonOnTriangulation()) {
const Handle(BRep_PolygonOnTriangulation)& PT = Handle(BRep_PolygonOnTriangulation) PT (Handle(BRep_PolygonOnTriangulation)::DownCast (cr));
*((Handle(BRep_PolygonOnTriangulation)*)&cr);
i++; i++;
if (i > Index) break; if (i > Index) break;
if (i == Index) { if (i == Index) {
@ -830,7 +826,7 @@ void BRep_Tool::Range(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurve3D()) { 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()) { if (!CR->Curve3D().IsNull()) {
First = CR->First(); First = CR->First();
Last = CR->Last(); Last = CR->Last();
@ -838,7 +834,7 @@ void BRep_Tool::Range(const TopoDS_Edge& E,
} }
} }
else if (cr->IsCurveOnSurface()) { 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(); First = CR->First();
Last = CR->Last(); Last = CR->Last();
break; break;
@ -867,7 +863,7 @@ void BRep_Tool::Range(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l)) { if (cr->IsCurveOnSurface(S,l)) {
(*((Handle(BRep_GCurve)*)&cr))->Range(First,Last); Handle(BRep_GCurve)::DownCast (cr)->Range(First,Last);
break; break;
} }
itcr.Next(); itcr.Next();
@ -915,9 +911,9 @@ void BRep_Tool::UVPoints(const TopoDS_Edge& E,
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l)) { if (cr->IsCurveOnSurface(S,l)) {
if (cr->IsCurveOnClosedSurface() && Eisreversed) if (cr->IsCurveOnClosedSurface() && Eisreversed)
(*((Handle(BRep_CurveOnClosedSurface)*)&cr))->UVPoints2(PFirst,PLast); Handle(BRep_CurveOnClosedSurface)::DownCast (cr)->UVPoints2(PFirst,PLast);
else else
(*((Handle(BRep_CurveOnSurface)*)&cr))->UVPoints(PFirst,PLast); Handle(BRep_CurveOnSurface)::DownCast (cr)->UVPoints(PFirst,PLast);
return; return;
} }
itcr.Next(); itcr.Next();
@ -1005,10 +1001,10 @@ void BRep_Tool::SetUVPoints(const TopoDS_Edge& E,
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l)) { if (cr->IsCurveOnSurface(S,l)) {
if (cr->IsCurveOnClosedSurface() && Eisreversed) if (cr->IsCurveOnClosedSurface() && Eisreversed)
(*((Handle(BRep_CurveOnClosedSurface)*) &cr))-> Handle(BRep_CurveOnClosedSurface)::DownCast (cr)->
SetUVPoints2(PFirst,PLast); SetUVPoints2(PFirst,PLast);
else else
(*((Handle(BRep_CurveOnSurface)*) &cr))-> Handle(BRep_CurveOnSurface)::DownCast (cr)->
SetUVPoints(PFirst,PLast); SetUVPoints(PFirst,PLast);
} }
itcr.Next(); itcr.Next();

View File

@ -175,7 +175,7 @@ void BRepCheck_Edge::Minimum()
} }
if (!myCref.IsNull()) { 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; Standard_Real First,Last;
GCref->Range(First,Last); GCref->Range(First,Last);
if (Last<=First) { if (Last<=First) {
@ -285,7 +285,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr != myCref && cr->IsCurveOnSurface(Su,L)) { if (cr != myCref && cr->IsCurveOnSurface(Su,L)) {
pcurvefound = Standard_True; 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; Standard_Real f,l;
GC->Range(f,l); GC->Range(f,l);
Standard_Real ff = f, ll = 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_CurveRepresentation) aCR = anITCR.Value();
const Handle(BRep_PolygonOnTriangulation)& aPT = Handle(BRep_PolygonOnTriangulation) aPT (Handle(BRep_PolygonOnTriangulation)::DownCast(aCR));
Handle(BRep_PolygonOnTriangulation)::DownCast(aCR);
const TopLoc_Location aLL = theEdge.Location() * aPT->Location(); const TopLoc_Location aLL = theEdge.Location() * aPT->Location();

View File

@ -174,7 +174,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
itpr.Next(); itpr.Next();
} }
if (orv == TopAbs_FORWARD || orv == TopAbs_REVERSED) { 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) { if (orv == TopAbs_FORWARD || multiple) {
Controlp = C->Value(GC->First()); Controlp = C->Value(GC->First());
Controlp.Transform(L.Transformation()); Controlp.Transform(L.Transformation());

View File

@ -1336,12 +1336,12 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
typS2 = S2->DynamicType(); typS2 = S2->DynamicType();
if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S1 = (*((Handle(Geom_RectangularTrimmedSurface)*)&S1))->BasisSurface(); S1 = Handle(Geom_RectangularTrimmedSurface)::DownCast (S1)->BasisSurface();
typS1 = S1->DynamicType(); typS1 = S1->DynamicType();
} }
if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S2 = (*((Handle(Geom_RectangularTrimmedSurface)*)&S2))->BasisSurface(); S2 = Handle(Geom_RectangularTrimmedSurface)::DownCast (S2)->BasisSurface();
typS2 = S2->DynamicType(); typS2 = S2->DynamicType();
} }
@ -1354,8 +1354,8 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
if (typS1 == STANDARD_TYPE(Geom_Plane)) { if (typS1 == STANDARD_TYPE(Geom_Plane)) {
S1 = BRep_Tool::Surface(F1); // to apply the location. S1 = BRep_Tool::Surface(F1); // to apply the location.
S2 = BRep_Tool::Surface(F2); S2 = BRep_Tool::Surface(F2);
gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln()); gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln());
gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln()); gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln());
if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) { if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) {
ValRet = Standard_True; ValRet = Standard_True;

View File

@ -1258,12 +1258,12 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
typS2 = S2->DynamicType(); typS2 = S2->DynamicType();
if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S1 = (*((Handle(Geom_RectangularTrimmedSurface)*)&S1))->BasisSurface(); S1 = Handle(Geom_RectangularTrimmedSurface)::DownCast (S1)->BasisSurface();
typS1 = S1->DynamicType(); typS1 = S1->DynamicType();
} }
if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S2 = (*((Handle(Geom_RectangularTrimmedSurface)*)&S2))->BasisSurface(); S2 = Handle(Geom_RectangularTrimmedSurface)::DownCast (S2)->BasisSurface();
typS2 = S2->DynamicType(); typS2 = S2->DynamicType();
} }
@ -1276,8 +1276,8 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
if (typS1 == STANDARD_TYPE(Geom_Plane)) { if (typS1 == STANDARD_TYPE(Geom_Plane)) {
S1 = BRep_Tool::Surface(F1); // to apply the location. S1 = BRep_Tool::Surface(F1); // to apply the location.
S2 = BRep_Tool::Surface(F2); S2 = BRep_Tool::Surface(F2);
gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln()); gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln());
gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln()); gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln());
if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) { if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) {
ValRet = Standard_True; ValRet = Standard_True;

View File

@ -961,12 +961,12 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
typS2 = S2->DynamicType(); typS2 = S2->DynamicType();
if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S1 = (*((Handle(Geom_RectangularTrimmedSurface)*)&S1))->BasisSurface(); S1 = Handle(Geom_RectangularTrimmedSurface)::DownCast (S1)->BasisSurface();
typS1 = S1->DynamicType(); typS1 = S1->DynamicType();
} }
if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S2 = (*((Handle(Geom_RectangularTrimmedSurface)*)&S2))->BasisSurface(); S2 = Handle(Geom_RectangularTrimmedSurface)::DownCast (S2)->BasisSurface();
typS2 = S2->DynamicType(); typS2 = S2->DynamicType();
} }
@ -979,8 +979,8 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
if (typS1 == STANDARD_TYPE(Geom_Plane)) { if (typS1 == STANDARD_TYPE(Geom_Plane)) {
S1 = BRep_Tool::Surface(F1); // to apply the location. S1 = BRep_Tool::Surface(F1); // to apply the location.
S2 = BRep_Tool::Surface(F2); S2 = BRep_Tool::Surface(F2);
gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln()); gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln());
gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln()); gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln());
if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) { if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) {
ValRet = Standard_True; ValRet = Standard_True;

View File

@ -917,13 +917,13 @@ void BRepFill_Pipe::DefineRealSegmax()
C->DynamicType() == STANDARD_TYPE(Geom_OffsetCurve)) C->DynamicType() == STANDARD_TYPE(Geom_OffsetCurve))
{ {
if (C->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) 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)) 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)) 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 NbKnots = BC->NbKnots();
Standard_Integer RealNbKnots = NbKnots; Standard_Integer RealNbKnots = NbKnots;
if (first > BC->FirstParameter()) if (first > BC->FirstParameter())

View File

@ -260,7 +260,7 @@ static Handle(Geom2d_Curve) Couture(const TopoDS_Edge& E,
while (itcr.More()) { while (itcr.More()) {
Handle(BRep_CurveRepresentation)& cr = itcr.Value(); Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l)) { 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) if (GC->IsCurveOnClosedSurface() && Eisreversed)
return GC->PCurve2(); return GC->PCurve2();
else else
@ -3379,7 +3379,7 @@ void BRepFill_Sweep::RebuildTopOrBottomEdge(const TopoDS_Edge& aNewEdge,
const Handle(BRep_CurveRepresentation)& CurveRep = itrep.Value(); const Handle(BRep_CurveRepresentation)& CurveRep = itrep.Value();
if (CurveRep->IsCurveOnSurface()) 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(Geom2d_Curve) aPCurve = GC->PCurve();
Handle(Geom_Surface) aSurf = GC->Surface(); Handle(Geom_Surface) aSurf = GC->Surface();
TopLoc_Location aLoc = aNewEdge.Location() * GC->Location(); TopLoc_Location aLoc = aNewEdge.Location() * GC->Location();

View File

@ -42,7 +42,7 @@ Standard_Integer BRepGProp_EdgeTool::IntegrationOrder(const BRepAdaptor_Curve&
{ {
const GeomAdaptor_Curve& GAC = BAC.Curve(); const GeomAdaptor_Curve& GAC = BAC.Curve();
const Handle(Geom_Curve)& GC = GAC.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; Standard_Integer n = 2*(GBZC->NbPoles()) - 1;
return n; return n;
} }
@ -51,7 +51,7 @@ Standard_Integer BRepGProp_EdgeTool::IntegrationOrder(const BRepAdaptor_Curve&
{ {
const GeomAdaptor_Curve& GAC = BAC.Curve(); const GeomAdaptor_Curve& GAC = BAC.Curve();
const Handle(Geom_Curve)& GC = GAC.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; Standard_Integer n = 2*(GBSC->NbPoles()) - 1;
return n; return n;
} }

View File

@ -617,7 +617,7 @@ void BRepGProp_Face::GetUKnots
GeomAdaptor_Curve aCurve; GeomAdaptor_Curve aCurve;
Handle(Geom_Surface) aSurf = mySurface.Surface().Surface(); 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; isCBSpline = aCurve.GetType() == GeomAbs_BSplineCurve;
} }
} }
@ -643,7 +643,7 @@ void BRepGProp_Face::GetUKnots
Handle(Geom_Surface) aSurf = mySurface.Surface().Surface(); Handle(Geom_Surface) aSurf = mySurface.Surface().Surface();
Handle(Geom_BSplineCurve) aBSplCurve; Handle(Geom_BSplineCurve) aBSplCurve;
aCurve.Load((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&aSurf))->BasisCurve()); aCurve.Load(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (aSurf)->BasisCurve());
aBSplCurve = aCurve.BSpline(); aBSplCurve = aCurve.BSpline();
aNbKnots = aBSplCurve->NbKnots(); aNbKnots = aBSplCurve->NbKnots();
aKnots = new TColStd_HArray1OfReal(1, aNbKnots); aKnots = new TColStd_HArray1OfReal(1, aNbKnots);

View File

@ -976,7 +976,7 @@ void BRepLib::SameParameter(const TopoDS_Edge& AnEdge,
Handle(Standard_Type) TheType = C3d->DynamicType(); Handle(Standard_Type) TheType = C3d->DynamicType();
if( TheType == STANDARD_TYPE(Geom_TrimmedCurve)) 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(); m_TrimmedPeriodical = gtC->IsPeriodic();
} }
// modified by NIZHNY-OCC486 Tue Aug 27 17:15:17 2002 . // modified by NIZHNY-OCC486 Tue Aug 27 17:15:17 2002 .
@ -1323,7 +1323,7 @@ void BRepLib::UpdateTolerances(const TopoDS_Shape& aShape,
aB.SetVoid(); aB.SetVoid();
BRepBndLib::Add(curf,aB); BRepBndLib::Add(curf,aB);
if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S = (*((Handle(Geom_RectangularTrimmedSurface)*)&S))->BasisSurface(); S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
} }
GeomAdaptor_Surface AS(S); GeomAdaptor_Surface AS(S);
switch (AS.GetType()) { switch (AS.GetType()) {
@ -1820,7 +1820,7 @@ void BRepLib::SortFaces (const TopoDS_Shape& Sh,
S = BRep_Tool::Surface(F, l); S = BRep_Tool::Surface(F, l);
if (!S.IsNull()) { if (!S.IsNull()) {
if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S = (*((Handle(Geom_RectangularTrimmedSurface)*)&S))->BasisSurface(); S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
} }
GeomAdaptor_Surface AS(S); GeomAdaptor_Surface AS(S);
switch (AS.GetType()) { switch (AS.GetType()) {
@ -1878,7 +1878,7 @@ void BRepLib::ReverseSortFaces (const TopoDS_Shape& Sh,
S = BRep_Tool::Surface(F, l); S = BRep_Tool::Surface(F, l);
if (!S.IsNull()) { if (!S.IsNull()) {
if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S = (*((Handle(Geom_RectangularTrimmedSurface)*)&S))->BasisSurface(); S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
} }
GeomAdaptor_Surface AS(S); GeomAdaptor_Surface AS(S);
switch (AS.GetType()) { switch (AS.GetType()) {

View File

@ -161,7 +161,7 @@ static void BCSmoothing(Handle(Geom_BSplineCurve)& theC,
static void MakeClosedCurve(Handle(Geom_Curve)& C, const gp_Pnt& PF, static void MakeClosedCurve(Handle(Geom_Curve)& C, const gp_Pnt& PF,
Standard_Real& f, Standard_Real& l) 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(); GeomAbs_Shape aCont = aBC->Continuity();
//Find new origin //Find new origin
aBC->SetPeriodic(); 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 // if the curve is trimmed we get the basis curve to fit the new vertices
// otherwise the makeedge will fail. // otherwise the makeedge will fail.
if (C->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) { if (C->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) {
C = (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve(); C = Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve();
} }
if(myConcatBSpl) { if(myConcatBSpl) {
@ -776,7 +776,7 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
if (!loc.IsIdentity()) { if (!loc.IsIdentity()) {
Handle(Geom_Geometry) GG1 = C1->Transformed(loc.Transformation()); 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); C2 = BRep_Tool::Curve(E2,loc,f2,l2);
//modified by NIZNHY-PKV Mon Nov 15 16:24:38 1999 //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()) { if (!loc.IsIdentity()) {
Handle(Geom_Geometry) GG2 = C2->Transformed(loc.Transformation()); Handle(Geom_Geometry) GG2 = C2->Transformed(loc.Transformation());
C2 = *((Handle(Geom_Curve)*)&GG2); C2 = Handle(Geom_Curve)::DownCast (GG2);
} }
typC1 = C1->DynamicType(); typC1 = C1->DynamicType();
typC2 = C2->DynamicType(); typC2 = C2->DynamicType();
if (typC1 == STANDARD_TYPE(Geom_TrimmedCurve)) { if (typC1 == STANDARD_TYPE(Geom_TrimmedCurve)) {
C1 = (*((Handle(Geom_TrimmedCurve)*)&C1))->BasisCurve(); C1 = Handle(Geom_TrimmedCurve)::DownCast (C1)->BasisCurve();
typC1 = C1->DynamicType(); typC1 = C1->DynamicType();
} }
if (typC2 == STANDARD_TYPE(Geom_TrimmedCurve)) { if (typC2 == STANDARD_TYPE(Geom_TrimmedCurve)) {
C2 = (*((Handle(Geom_TrimmedCurve)*)&C2))->BasisCurve(); C2 = Handle(Geom_TrimmedCurve)::DownCast (C2)->BasisCurve();
typC2 = C2->DynamicType(); 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 tollin = Precision::Confusion();
const Standard_Real tolang = Precision::Angular(); const Standard_Real tolang = Precision::Angular();
if (typC1 == STANDARD_TYPE(Geom_Line)) { if (typC1 == STANDARD_TYPE(Geom_Line)) {
gp_Lin li1( (*((Handle(Geom_Line)*)&C1))->Lin()); gp_Lin li1( Handle(Geom_Line)::DownCast (C1)->Lin());
gp_Lin li2( (*((Handle(Geom_Line)*)&C2))->Lin()); gp_Lin li2( Handle(Geom_Line)::DownCast (C2)->Lin());
gp_Dir dir1(li1.Direction()); gp_Dir dir1(li1.Direction());
gp_Dir dir2(li2.Direction()); gp_Dir dir2(li2.Direction());
@ -840,8 +840,8 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
return Standard_False; return Standard_False;
} }
else if (typC1 == STANDARD_TYPE(Geom_Circle)) { else if (typC1 == STANDARD_TYPE(Geom_Circle)) {
gp_Circ ci1 = (*((Handle(Geom_Circle)*)&C1))->Circ(); gp_Circ ci1 = Handle(Geom_Circle)::DownCast (C1)->Circ();
gp_Circ ci2 = (*((Handle(Geom_Circle)*)&C2))->Circ(); gp_Circ ci2 = Handle(Geom_Circle)::DownCast (C2)->Circ();
if (Abs(ci1.Radius()-ci2.Radius()) <= tollin && if (Abs(ci1.Radius()-ci2.Radius()) <= tollin &&
ci1.Location().SquareDistance(ci2.Location()) <= tollin*tollin && ci1.Location().SquareDistance(ci2.Location()) <= tollin*tollin &&
ci1.Axis().IsParallel(ci2.Axis(),tolang) ) { ci1.Axis().IsParallel(ci2.Axis(),tolang) ) {
@ -851,8 +851,8 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
return Standard_False; return Standard_False;
} }
else if (typC1 == STANDARD_TYPE(Geom_Ellipse)) { else if (typC1 == STANDARD_TYPE(Geom_Ellipse)) {
gp_Elips ci1 = (*((Handle(Geom_Ellipse)*)&C1))->Elips(); gp_Elips ci1 = Handle(Geom_Ellipse)::DownCast (C1)->Elips();
gp_Elips ci2 = (*((Handle(Geom_Ellipse)*)&C2))->Elips(); gp_Elips ci2 = Handle(Geom_Ellipse)::DownCast (C2)->Elips();
if (Abs(ci1.MajorRadius()-ci2.MajorRadius()) <= tollin && if (Abs(ci1.MajorRadius()-ci2.MajorRadius()) <= tollin &&
Abs(ci1.MinorRadius()-ci2.MinorRadius()) <= tollin && Abs(ci1.MinorRadius()-ci2.MinorRadius()) <= tollin &&
@ -889,8 +889,8 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
return Standard_False; return Standard_False;
} }
Handle(Geom_BSplineCurve) B1 = *((Handle(Geom_BSplineCurve)*)&C1); Handle(Geom_BSplineCurve) B1 = Handle(Geom_BSplineCurve)::DownCast (C1);
Handle(Geom_BSplineCurve) B2 = *((Handle(Geom_BSplineCurve)*)&C2); Handle(Geom_BSplineCurve) B2 = Handle(Geom_BSplineCurve)::DownCast (C2);
Standard_Integer nbpoles = B1->NbPoles(); Standard_Integer nbpoles = B1->NbPoles();
if (nbpoles != B2->NbPoles()) { if (nbpoles != B2->NbPoles()) {
@ -962,8 +962,8 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
return Standard_False; return Standard_False;
} }
Handle(Geom_BezierCurve) B1 = *((Handle(Geom_BezierCurve)*)&C1); Handle(Geom_BezierCurve) B1 = Handle(Geom_BezierCurve)::DownCast (C1);
Handle(Geom_BezierCurve) B2 = *((Handle(Geom_BezierCurve)*)&C2); Handle(Geom_BezierCurve) B2 = Handle(Geom_BezierCurve)::DownCast (C2);
Standard_Integer nbpoles = B1->NbPoles(); Standard_Integer nbpoles = B1->NbPoles();
if (nbpoles != B2->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, Handle(Geom2d_Curve) Curv2dR = BRep_Tool::CurveOnSurface(aFEdge,
aFFace,cf,cl); aFFace,cf,cl);
if (Curv2d->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) 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)) 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)); B.UpdateEdge (theNewEdge,Curv2d,Curv2dR,Surf,loc,BRep_Tool::Tolerance(theNewEdge));
} }
else { else {
// update the new edge // update the new edge
if (Curv2d->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) if (Curv2d->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
Curv2d = (*((Handle(Geom2d_TrimmedCurve)*)&Curv2d))->BasisCurve(); Curv2d = Handle(Geom2d_TrimmedCurve)::DownCast (Curv2d)->BasisCurve();
Standard_Real f, l; Standard_Real f, l;
f = Curv2d->FirstParameter(); f = Curv2d->FirstParameter();
l = Curv2d->LastParameter(); l = Curv2d->LastParameter();

View File

@ -570,7 +570,7 @@ GeomAbs_CurveType GetCurveType(const Handle(Geom2d_Curve)& theC2d)
GeomAbs_CurveType aTypeCurve = GeomAbs_OtherCurve; GeomAbs_CurveType aTypeCurve = GeomAbs_OtherCurve;
Handle(Standard_Type) TheType = theC2d->DynamicType(); Handle(Standard_Type) TheType = theC2d->DynamicType();
if ( TheType == STANDARD_TYPE(Geom2d_TrimmedCurve)) { 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)) { if ( TheType == STANDARD_TYPE(Geom2d_Circle)) {

View File

@ -847,7 +847,7 @@ static Standard_Boolean ExtendPCurve(const Handle(Geom2d_Curve)& aPCurve,
{ {
NewPCurve = aPCurve; NewPCurve = aPCurve;
if (NewPCurve->IsInstance(STANDARD_TYPE(Geom2d_TrimmedCurve))) 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 FirstPar = NewPCurve->FirstParameter();
Standard_Real LastPar = NewPCurve->LastParameter(); 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))) 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) if (aBezier->NbPoles() == 2)
{ {
TColgp_Array1OfPnt2d thePoles(1,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))) 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) if (aBSpline->NbKnots() == 2 && aBSpline->NbPoles() == 2)
{ {
TColgp_Array1OfPnt2d thePoles(1,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)) || else if (MinSurf->IsInstance(STANDARD_TYPE(Geom_CylindricalSurface)) ||
MinSurf->IsInstance(STANDARD_TYPE(Geom_ConicalSurface))) 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(); gp_Dir2d LineDir = theLine->Direction();
if (LineDir.IsParallel( gp::DY2d(), Precision::Angular() )) if (LineDir.IsParallel( gp::DY2d(), Precision::Angular() ))
IsLine = Standard_True; 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)) && if (theCurve->IsInstance(STANDARD_TYPE(Geom2d_Line)) &&
theSurf->IsKind(STANDARD_TYPE(Geom_BoundedSurface))) 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()) || if (theDir.IsParallel(gp::DX2d(), Precision::Angular()) ||
theDir.IsParallel(gp::DY2d(), Precision::Angular())) theDir.IsParallel(gp::DY2d(), Precision::Angular()))
{ {
Standard_Real U1, U2, V1, V2; Standard_Real U1, U2, V1, V2;
theSurf->Bounds(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() || if (Abs(Origin.X()-U1) <= Precision::Confusion() ||
Abs(Origin.X()-U2) <= Precision::Confusion() || Abs(Origin.X()-U2) <= Precision::Confusion() ||
Abs(Origin.Y()-V1) <= Precision::Confusion() || Abs(Origin.Y()-V1) <= Precision::Confusion() ||

View File

@ -580,7 +580,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face,
} }
if (TheSurf->DynamicType() == STANDARD_TYPE(Geom_ConicalSurface)) 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(); gp_Pnt apex = theCone.Apex();
Standard_Real Uapex, Vapex; Standard_Real Uapex, Vapex;
ElSLib::Parameters( theCone, apex, 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 ); Handle(Geom_Curve) uiso = TheSurf->UIso( uf1 );
if (BRepOffset_Tool::Gabarit( uiso ) > TolApex) 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; gp_Pnt Papex, Pfirst, Pquart, Pmid;
Papex = BasisSurf->Value( uf1, vf1 ); Papex = BasisSurf->Value( uf1, vf1 );
Pfirst = TheSurf->Value( uf1, vf1 ); Pfirst = TheSurf->Value( uf1, vf1 );
@ -621,7 +621,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face,
if (OffsetOutside) if (OffsetOutside)
{ {
TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); 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_True, Standard_False);
Standard_Real u1, u2, v1, v2; Standard_Real u1, u2, v1, v2;
TheSurf->Bounds( 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 ); Handle(Geom_Curve) uiso = TheSurf->UIso( uf2 );
if (BRepOffset_Tool::Gabarit( uiso ) > TolApex) 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; gp_Pnt Papex, Pfirst, Pquart, Pmid;
Papex = BasisSurf->Value( uf2, vf1 ); Papex = BasisSurf->Value( uf2, vf1 );
Pfirst = TheSurf->Value( uf2, vf1 ); Pfirst = TheSurf->Value( uf2, vf1 );
@ -660,7 +660,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face,
if (OffsetOutside) if (OffsetOutside)
{ {
TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); 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_True, Standard_True);
Standard_Real u1, u2, v1, v2; Standard_Real u1, u2, v1, v2;
TheSurf->Bounds( 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 ); Handle(Geom_Curve) viso = TheSurf->VIso( vf1 );
if (BRepOffset_Tool::Gabarit( viso ) > TolApex) 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; gp_Pnt Papex, Pfirst, Pquart, Pmid;
Papex = BasisSurf->Value( uf1, vf1 ); Papex = BasisSurf->Value( uf1, vf1 );
Pfirst = TheSurf->Value( uf1, vf1 ); Pfirst = TheSurf->Value( uf1, vf1 );
@ -699,7 +699,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face,
if (OffsetOutside) if (OffsetOutside)
{ {
TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); 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_False, Standard_False);
Standard_Real u1, u2, v1, v2; Standard_Real u1, u2, v1, v2;
TheSurf->Bounds( 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 ); Handle(Geom_Curve) viso = TheSurf->VIso( vf2 );
if (BRepOffset_Tool::Gabarit( viso ) > TolApex) 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; gp_Pnt Papex, Pfirst, Pquart, Pmid;
Papex = BasisSurf->Value( uf1, vf2 ); Papex = BasisSurf->Value( uf1, vf2 );
Pfirst = TheSurf->Value( uf1, vf2 ); Pfirst = TheSurf->Value( uf1, vf2 );
@ -740,7 +740,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face,
if (OffsetOutside) if (OffsetOutside)
{ {
TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2); 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_False, Standard_True);
Standard_Real u1, u2, v1, v2; Standard_Real u1, u2, v1, v2;
TheSurf->Bounds( u1, u2, v1, v2 ); TheSurf->Bounds( u1, u2, v1, v2 );

View File

@ -253,7 +253,7 @@ static void PutInBounds (const TopoDS_Face& F,
Handle (Geom_Surface) S = BRep_Tool::Surface(F,L); Handle (Geom_Surface) S = BRep_Tool::Surface(F,L);
if (S->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) { if (S->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
S = (*(Handle(Geom_RectangularTrimmedSurface)*)&S)->BasisSurface(); S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
} }
//--------------- //---------------
// Recadre en U. // Recadre en U.
@ -368,7 +368,7 @@ static void BuildPCurves (const TopoDS_Edge& E,
Handle( Geom_Surface ) theSurf = BRep_Tool::Surface( F ); Handle( Geom_Surface ) theSurf = BRep_Tool::Surface( F );
Handle( Standard_Type ) typS = theSurf->DynamicType(); Handle( Standard_Type ) typS = theSurf->DynamicType();
if (typS == STANDARD_TYPE(Geom_OffsetSurface)) 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)) if (typS == STANDARD_TYPE(Geom_BezierSurface) || typS == STANDARD_TYPE(Geom_BSplineSurface))
{ {
gp_Pnt fpoint = AC.Value( AC.FirstParameter() ); gp_Pnt fpoint = AC.Value( AC.FirstParameter() );
@ -902,18 +902,18 @@ static Standard_Boolean AreConnex(const TopoDS_Wire& W1,
Standard_Real f, l; Standard_Real f, l;
Handle(Geom_Curve) C1 = BRep_Tool::Curve( E1, f, l ); Handle(Geom_Curve) C1 = BRep_Tool::Curve( E1, f, l );
if (C1->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) 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 ); Handle(Geom_Curve) C2 = BRep_Tool::Curve( E2, f, l );
if (C2->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) 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)) && if (C1->IsInstance(STANDARD_TYPE(Geom_Line)) &&
C2->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(); 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(); gp_Ax1 Axis2 = L2->Position();
if (! Axis1.IsParallel( Axis2, Precision::Angular() )) if (! Axis1.IsParallel( Axis2, Precision::Angular() ))
return Standard_False; 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 ); Handle(Geom_Curve) C1 = BRep_Tool::Curve( E1, first1, last1 );
if (C1->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) 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 ); Handle(Geom_Curve) C2 = BRep_Tool::Curve( E2, first2, last2 );
if (C2->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) 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)) || if (!C1->IsInstance(STANDARD_TYPE(Geom_BSplineCurve)) ||
!C2->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 ); PCurve1 = BRep_Tool::CurveOnSurface( E1, F, first1, last1 );
if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_TrimmedCurve))) 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 ); PCurve2 = BRep_Tool::CurveOnSurface( E2, F, first2, last2 );
if (PCurve2->IsInstance(STANDARD_TYPE(Geom2d_TrimmedCurve))) if (PCurve2->IsInstance(STANDARD_TYPE(Geom2d_TrimmedCurve)))
PCurve2 = (*((Handle(Geom2d_TrimmedCurve)*)&PCurve2))->BasisCurve(); PCurve2 = Handle(Geom2d_TrimmedCurve)::DownCast (PCurve2)->BasisCurve();
if (PCurve1 == PCurve2) if (PCurve1 == PCurve2)
{ {
@ -1104,35 +1104,35 @@ static Handle(Geom2d_Curve) ConcatPCurves(const TopoDS_Edge& E1,
P2 = PCurve2->Value( last2 ); P2 = PCurve2->Value( last2 );
if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_Line))) 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(); gp_Lin2d theLin = Lin1->Lin2d();
first2 = ElCLib::Parameter( theLin, P1 ); first2 = ElCLib::Parameter( theLin, P1 );
last2 = ElCLib::Parameter( theLin, P2 ); last2 = ElCLib::Parameter( theLin, P2 );
} }
else if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_Circle))) 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(); gp_Circ2d theCirc = Circ1->Circ2d();
first2 = ElCLib::Parameter( theCirc, P1 ); first2 = ElCLib::Parameter( theCirc, P1 );
last2 = ElCLib::Parameter( theCirc, P2 ); last2 = ElCLib::Parameter( theCirc, P2 );
} }
else if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_Ellipse))) 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(); gp_Elips2d theElips = Ell1->Elips2d();
first2 = ElCLib::Parameter( theElips, P1 ); first2 = ElCLib::Parameter( theElips, P1 );
last2 = ElCLib::Parameter( theElips, P2 ); last2 = ElCLib::Parameter( theElips, P2 );
} }
else if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_Parabola))) 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(); gp_Parab2d theParab = Parab1->Parab2d();
first2 = ElCLib::Parameter( theParab, P1 ); first2 = ElCLib::Parameter( theParab, P1 );
last2 = ElCLib::Parameter( theParab, P2 ); last2 = ElCLib::Parameter( theParab, P2 );
} }
else if (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_Hyperbola))) 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(); gp_Hypr2d theHypr = Hypr1->Hypr2d();
first2 = ElCLib::Parameter( theHypr, P1 ); first2 = ElCLib::Parameter( theHypr, P1 );
last2 = ElCLib::Parameter( theHypr, P2 ); last2 = ElCLib::Parameter( theHypr, P2 );
@ -1187,11 +1187,11 @@ static TopoDS_Edge Glue(const TopoDS_Edge& E1,
C1 = BRep_Tool::Curve( E1, first1, last1 ); C1 = BRep_Tool::Curve( E1, first1, last1 );
if (C1->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) 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 ); C2 = BRep_Tool::Curve( E2, first2, last2 );
if (C2->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) if (C2->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
C2 = (*((Handle(Geom_TrimmedCurve)*)&C2))->BasisCurve(); C2 = Handle(Geom_TrimmedCurve)::DownCast (C2)->BasisCurve();
if (C1 == C2) if (C1 == C2)
{ {
@ -1302,7 +1302,7 @@ static Standard_Boolean CheckIntersFF(const BOPDS_PDS& pDS,
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F1); Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F1);
if (aSurf->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) 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))) if (aSurf->IsInstance(STANDARD_TYPE(Geom_Plane)))
isPlane1 = Standard_True; isPlane1 = Standard_True;
else if (aSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface))) 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); aSurf = BRep_Tool::Surface(F2);
if (aSurf->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) 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))) if (aSurf->IsInstance(STANDARD_TYPE(Geom_Plane)))
isPlane2 = Standard_True; isPlane2 = Standard_True;
else if (aSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface))) 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); Handle(Geom_Surface) aSurf = BRep_Tool::Surface(cpF1);
if (aSurf->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) 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))) if (aSurf->IsInstance(STANDARD_TYPE(Geom_Plane)))
addPCurve1 = Standard_False; addPCurve1 = Standard_False;
else if (aSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface))) 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); aSurf = BRep_Tool::Surface(cpF2);
if (aSurf->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) 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))) if (aSurf->IsInstance(STANDARD_TYPE(Geom_Plane)))
addPCurve2 = Standard_False; addPCurve2 = Standard_False;
else if (aSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface))) 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)) { if (S1->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
Handle(Geom_RectangularTrimmedSurface) RTS ; Handle(Geom_RectangularTrimmedSurface) RTS ;
RTS = *((Handle(Geom_RectangularTrimmedSurface)*) &S1); RTS = Handle(Geom_RectangularTrimmedSurface)::DownCast (S1);
if (RTS->BasisSurface()->DynamicType() == STANDARD_TYPE(Geom_Plane)) { if (RTS->BasisSurface()->DynamicType() == STANDARD_TYPE(Geom_Plane)) {
S1 = RTS->BasisSurface(); S1 = RTS->BasisSurface();
} }
} }
if (S2->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (S2->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
Handle(Geom_RectangularTrimmedSurface) RTS ; Handle(Geom_RectangularTrimmedSurface) RTS ;
RTS = *((Handle(Geom_RectangularTrimmedSurface)*) &S2); RTS = Handle(Geom_RectangularTrimmedSurface)::DownCast (S2);
if (RTS->BasisSurface()->DynamicType() == STANDARD_TYPE(Geom_Plane)) { if (RTS->BasisSurface()->DynamicType() == STANDARD_TYPE(Geom_Plane)) {
S2 = RTS->BasisSurface(); S2 = RTS->BasisSurface();
} }
@ -2582,7 +2582,7 @@ static void MakeFace(const Handle(Geom_Surface)& S,
Standard_Boolean IsSuclosed = S->IsUClosed(), IsSvclosed = S->IsVClosed(); Standard_Boolean IsSuclosed = S->IsUClosed(), IsSvclosed = S->IsVClosed();
if (S->DynamicType() == STANDARD_TYPE(Geom_OffsetSurface)) 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(); IsSuclosed = BasisSurf->IsUClosed();
IsSvclosed = BasisSurf->IsVClosed(); IsSvclosed = BasisSurf->IsVClosed();
} }
@ -2601,10 +2601,10 @@ static void MakeFace(const Handle(Geom_Surface)& S,
Standard_Boolean vmindegen = isVminDegen, vmaxdegen = isVmaxDegen; Standard_Boolean vmindegen = isVminDegen, vmaxdegen = isVmaxDegen;
Handle(Geom_Surface) theSurf = S; Handle(Geom_Surface) theSurf = S;
if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) 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)) 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_Cone theCone = ConicalS->Cone();
gp_Pnt theApex = theCone.Apex(); gp_Pnt theApex = theCone.Apex();
Standard_Real Uapex, Vapex; Standard_Real Uapex, Vapex;
@ -2837,7 +2837,7 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
Standard_Boolean SurfaceChange = Standard_False; Standard_Boolean SurfaceChange = Standard_False;
if ( S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { 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, EnlargeGeometry(BS,U1,U2,V1,V2,IsV1degen,IsV2degen,
uf1,uf2,vf1,vf2,GlobalEnlargeU,GlobalEnlargeVfirst,GlobalEnlargeVlast); uf1,uf2,vf1,vf2,GlobalEnlargeU,GlobalEnlargeVfirst,GlobalEnlargeVlast);
if (!GlobalEnlargeVfirst) if (!GlobalEnlargeVfirst)
@ -2845,14 +2845,14 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
if (!GlobalEnlargeVlast) if (!GlobalEnlargeVlast)
V2 = vf2; V2 = vf2;
if (!GlobalEnlargeVfirst || !GlobalEnlargeVlast) 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 ); S = new Geom_RectangularTrimmedSurface( BS, U1, U2, V1, V2 );
else else
S = BS; S = BS;
SurfaceChange = Standard_True; SurfaceChange = Standard_True;
} }
else if (S->DynamicType() == STANDARD_TYPE(Geom_OffsetSurface)) { 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, SurfaceChange = EnlargeGeometry(Surf,U1,U2,V1,V2,IsV1degen,IsV2degen,
uf1,uf2,vf1,vf2,GlobalEnlargeU,GlobalEnlargeVfirst,GlobalEnlargeVlast); uf1,uf2,vf1,vf2,GlobalEnlargeU,GlobalEnlargeVfirst,GlobalEnlargeVlast);
Handle(Geom_OffsetSurface)::DownCast(S)->SetBasisSurface(Surf); Handle(Geom_OffsetSurface)::DownCast(S)->SetBasisSurface(Surf);
@ -2919,16 +2919,16 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
if (enlargeU) if (enlargeU)
{ {
if (enlargeUfirst) 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) 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 (enlargeV)
{ {
if (enlargeVfirst) 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) 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 ); S->Bounds( U1, U2, V1, V2 );
SurfaceChange = Standard_True; SurfaceChange = Standard_True;
@ -2985,16 +2985,16 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
if (enlargeU) if (enlargeU)
{ {
if (enlargeUfirst && uf1-u1 < duf) 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) 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 (enlargeV)
{ {
if (enlargeVfirst && vf1-v1 < dvf) 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) 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 ); 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); Handle(Geom_Surface) theSurf = BRep_Tool::Surface(F);
if (theSurf->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) 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) || if (theSurf->DynamicType() == STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion) ||
theSurf->DynamicType() == STANDARD_TYPE(Geom_SurfaceOfRevolution) || theSurf->DynamicType() == STANDARD_TYPE(Geom_SurfaceOfRevolution) ||
@ -3136,11 +3136,11 @@ void BRepOffset_Tool::CheckBounds(const TopoDS_Face& F,
Standard_Real fpar, lpar; Standard_Real fpar, lpar;
Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(anEdge, F, fpar, lpar); Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(anEdge, F, fpar, lpar);
if (aCurve->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) if (aCurve->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
aCurve = (*((Handle(Geom2d_TrimmedCurve)*)&aCurve))->BasisCurve(); aCurve = Handle(Geom2d_TrimmedCurve)::DownCast (aCurve)->BasisCurve();
Handle(Geom2d_Line) theLine; Handle(Geom2d_Line) theLine;
if (aCurve->DynamicType() == STANDARD_TYPE(Geom2d_Line)) 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) || else if (aCurve->DynamicType() == STANDARD_TYPE(Geom2d_BezierCurve) ||
aCurve->DynamicType() == STANDARD_TYPE(Geom2d_BSplineCurve)) aCurve->DynamicType() == STANDARD_TYPE(Geom2d_BSplineCurve))
{ {
@ -3269,10 +3269,10 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
//Special treatment for conical surfaces //Special treatment for conical surfaces
Handle(Geom_Surface) theSurf = S; Handle(Geom_Surface) theSurf = S;
if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) 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)) 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_Cone theCone = ConicalS->Cone();
gp_Pnt theApex = theCone.Apex(); gp_Pnt theApex = theCone.Apex();
Standard_Real Uapex, Vapex; Standard_Real Uapex, Vapex;

View File

@ -79,7 +79,7 @@ BRepOffsetAPI_DraftAngle::BRepOffsetAPI_DraftAngle (const TopoDS_Shape& S)
void BRepOffsetAPI_DraftAngle::Clear () void BRepOffsetAPI_DraftAngle::Clear ()
{ {
if (!myModification.IsNull()) { 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; myInitialShape = S;
NotDone(); NotDone();
if (!myModification.IsNull()) { if (!myModification.IsNull()) {
(*((Handle(Draft_Modification)*)&myModification))->Init(S); Handle(Draft_Modification)::DownCast (myModification)->Init(S);
} }
else { else {
myModification = new Draft_Modification(S); myModification = new Draft_Modification(S);
@ -117,7 +117,7 @@ void BRepOffsetAPI_DraftAngle::Add(const TopoDS_Face& F,
if ( Abs(Angle) <= 1.e-04 ) if ( Abs(Angle) <= 1.e-04 )
return; return;
Standard_NullObject_Raise_if(myInitialShape.IsNull(),""); 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_Boolean BRepOffsetAPI_DraftAngle::AddDone () const
{ {
Standard_NullObject_Raise_if(myInitialShape.IsNull(),""); Standard_NullObject_Raise_if(myInitialShape.IsNull(),"");
return (*((Handle(Draft_Modification)*)&myModification)) return Handle(Draft_Modification)::DownCast (myModification)
->ProblematicShape().IsNull(); ->ProblematicShape().IsNull();
} }
@ -142,7 +142,7 @@ Standard_Boolean BRepOffsetAPI_DraftAngle::AddDone () const
void BRepOffsetAPI_DraftAngle::Remove(const TopoDS_Face& F) void BRepOffsetAPI_DraftAngle::Remove(const TopoDS_Face& F)
{ {
Standard_NullObject_Raise_if(myInitialShape.IsNull(),""); 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 const TopoDS_Shape& BRepOffsetAPI_DraftAngle::ProblematicShape () const
{ {
Standard_NullObject_Raise_if(myInitialShape.IsNull(),""); 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 Draft_ErrorStatus BRepOffsetAPI_DraftAngle::Status () const
{ {
Standard_NullObject_Raise_if(myInitialShape.IsNull(),""); 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 (const TopoDS_Face& F) const
{ {
Standard_NullObject_Raise_if(myInitialShape.IsNull(),""); 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 const TopTools_ListOfShape& BRepOffsetAPI_DraftAngle::ModifiedFaces() const
{ {
Standard_NullObject_Raise_if(myInitialShape.IsNull(),""); 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(); myGenerated.Clear();
Standard_NullObject_Raise_if(myInitialShape.IsNull(),""); 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) { if (S.ShapeType() == TopAbs_FACE) {
Handle(Geom_Surface) Surf; Handle(Geom_Surface) Surf;
@ -227,7 +227,7 @@ const TopTools_ListOfShape& BRepOffsetAPI_DraftAngle::Modified(const TopoDS_Shap
{ {
myGenerated.Clear(); myGenerated.Clear();
Standard_NullObject_Raise_if(myInitialShape.IsNull(),""); 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) { if (S.ShapeType() == TopAbs_FACE) {
Handle(Geom_Surface) Surf; Handle(Geom_Surface) Surf;
@ -254,8 +254,8 @@ const TopTools_ListOfShape& BRepOffsetAPI_DraftAngle::Modified(const TopoDS_Shap
void BRepOffsetAPI_DraftAngle::Build() void BRepOffsetAPI_DraftAngle::Build()
{ {
(*((Handle(Draft_Modification)*)&myModification))->Perform(); Handle(Draft_Modification)::DownCast (myModification)->Perform();
if (!(*((Handle(Draft_Modification)*)&myModification))->IsDone()) { if (!Handle(Draft_Modification)::DownCast (myModification)->IsDone()) {
NotDone(); NotDone();
} }
else { else {

View File

@ -70,17 +70,17 @@ static Standard_Boolean IsLinear(const TopoDS_Edge& anEdge,
Standard_Real fpar, lpar; Standard_Real fpar, lpar;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar); Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
if (aCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) if (aCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
aCurve = ((Handle(Geom_TrimmedCurve)&) aCurve)->BasisCurve(); aCurve = Handle(Geom_TrimmedCurve)::DownCast (aCurve)->BasisCurve();
gp_Pnt Pnt1, Pnt2; gp_Pnt Pnt1, Pnt2;
if (aCurve->IsKind(STANDARD_TYPE(Geom_Line))) if (aCurve->IsKind(STANDARD_TYPE(Geom_Line)))
{ {
aLine = ((Handle(Geom_Line)&) aCurve)->Lin(); aLine = Handle(Geom_Line)::DownCast (aCurve)->Lin();
return Standard_True; return Standard_True;
} }
else if (aCurve->IsKind(STANDARD_TYPE(Geom_BezierCurve))) 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) if (theBezier->NbPoles() == 2)
{ {
Pnt1 = theBezier->Pole(1); Pnt1 = theBezier->Pole(1);
@ -91,7 +91,7 @@ static Standard_Boolean IsLinear(const TopoDS_Edge& anEdge,
} }
else if (aCurve->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) 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) if (theBSpline->NbPoles() == 2)
{ {
Pnt1 = theBSpline->Pole(1); Pnt1 = theBSpline->Pole(1);
@ -838,7 +838,7 @@ void BRepOffsetAPI_MiddlePath::Build()
Standard_Real fpar, lpar; Standard_Real fpar, lpar;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar); Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
if (aCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) if (aCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve)))
aCurve = ((Handle(Geom_TrimmedCurve)&) aCurve)->BasisCurve(); aCurve = Handle(Geom_TrimmedCurve)::DownCast (aCurve)->BasisCurve();
Pnt1 = aCurve->Value(fpar); Pnt1 = aCurve->Value(fpar);
Pnt2 = aCurve->Value(lpar); Pnt2 = aCurve->Value(lpar);
Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve); Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve);

View File

@ -199,10 +199,10 @@ void DrawCurve(const Handle(Geom2d_Curve)& aCurve,
Draw_Color Couleur; Draw_Color Couleur;
if (type == STANDARD_TYPE(Geom2d_TrimmedCurve)) { if (type == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
curve = (*(Handle(Geom2d_TrimmedCurve)*)&aCurve)->BasisCurve(); curve = Handle(Geom2d_TrimmedCurve)::DownCast (aCurve)->BasisCurve();
type = curve->DynamicType(); type = curve->DynamicType();
if (type == STANDARD_TYPE(Bisector_BisecAna)) { if (type == STANDARD_TYPE(Bisector_BisecAna)) {
curve =(*(Handle(Bisector_BisecAna)*)&curve)->Geom2dCurve(); curve =Handle(Bisector_BisecAna)::DownCast (curve)->Geom2dCurve();
type = curve->DynamicType(); type = curve->DynamicType();
} }
// PB of representation of semi_infinite curves. // PB of representation of semi_infinite curves.

View File

@ -54,8 +54,7 @@ void BinMDF_ADriverTable::AssignIds
myMapId.Clear(); myMapId.Clear();
Standard_Integer i; Standard_Integer i;
for (i=1; i <= theTypes.Extent(); i++) { for (i=1; i <= theTypes.Extent(); i++) {
const Handle(Standard_Type)& aType = Handle(Standard_Type) aType (Handle(Standard_Type)::DownCast (theTypes(i)));
Handle(Standard_Type)::DownCast (theTypes(i));
if (myMap.IsBound (aType)) { if (myMap.IsBound (aType)) {
myMapId.Bind (aType, i); myMapId.Bind (aType, i);
} }

View File

@ -822,7 +822,7 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
Handle(Standard_Type) type = afirstcurve->DynamicType(); Handle(Standard_Type) type = afirstcurve->DynamicType();
if (type == STANDARD_TYPE(Geom2d_TrimmedCurve)) { if (type == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
curve = (*(Handle(Geom2d_TrimmedCurve)*)&afirstcurve)->BasisCurve(); curve = Handle(Geom2d_TrimmedCurve)::DownCast (afirstcurve)->BasisCurve();
} }
else { else {
curve = afirstcurve; curve = afirstcurve;

View File

@ -137,7 +137,7 @@ void BndLib_Add3dCurve::Add( const Adaptor3d_Curve& C,
Abs(Bs->LastParameter() - U2) > Precision::Parametric(Tol)) { Abs(Bs->LastParameter() - U2) > Precision::Parametric(Tol)) {
Handle(Geom_Geometry) G = Bs->Copy(); 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; Standard_Real u1 = U1, u2 = U2;
//// modified by jgv, 24.10.01 for BUC61031 //// //// modified by jgv, 24.10.01 for BUC61031 ////
if (Bsaux->IsPeriodic()) if (Bsaux->IsPeriodic())

View File

@ -1702,7 +1702,7 @@ void ChFi3d_ComputeArete(const ChFiDS_CommonPoint& P1,
bs.Update(umin,vmin,umax,vmax); bs.Update(umin,vmin,umax,vmax);
Standard_Boolean aIN = Standard_True; Standard_Boolean aIN = Standard_True;
for(Standard_Integer ii = 1; ii <= 4 && aIN; ii++) { 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; aIN = Standard_False;
TColgp_Array1OfPnt2d qoles(1,2); TColgp_Array1OfPnt2d qoles(1,2);
qoles(1)=UV1; qoles(1)=UV1;
@ -2009,8 +2009,7 @@ static void QueryAddVertexInEdge(TopOpeBRepDS_ListOfInterference& LI,
TopOpeBRepDS_ListIteratorOfListOfInterference it(LI); TopOpeBRepDS_ListIteratorOfListOfInterference it(LI);
for (; it.More(); it.Next() ) { for (; it.More(); it.Next() ) {
const Handle(TopOpeBRepDS_Interference)& cur = it.Value(); const Handle(TopOpeBRepDS_Interference)& cur = it.Value();
const Handle(TopOpeBRepDS_CurvePointInterference)& cpi = Handle(TopOpeBRepDS_CurvePointInterference) cpi (Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(cur));
Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(cur);
if(!cpi.IsNull()) { if(!cpi.IsNull()) {
Standard_Integer newIV = cpi->Geometry(); Standard_Integer newIV = cpi->Geometry();
TopOpeBRepDS_Kind kv = cpi->GeometryType(); TopOpeBRepDS_Kind kv = cpi->GeometryType();

View File

@ -896,7 +896,7 @@ Standard_Boolean DNaming::ComputeSweepDir (const TopoDS_Shape& theShape,
cout<<"Surface Dynamic TYPE = "<<s<<endl; cout<<"Surface Dynamic TYPE = "<<s<<endl;
#endif #endif
if (aSurf->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) 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); aPlane = Handle(Geom_Plane)::DownCast(aSurf);
} }

View 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; if (!curve1->IsKind(STANDARD_TYPE(Geom_Line)) || !curve2->IsKind(STANDARD_TYPE(Geom_Line))) return;
Handle(Geom2d_Geometry) L1 = GeomAPI::To2d (curve1,plane); Handle(Geom2d_Geometry) L1 = GeomAPI::To2d (curve1,plane);
if (L1->IsInstance(STANDARD_TYPE(Geom2d_TrimmedCurve))) { 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); Handle(Geom2d_Geometry) L2 = GeomAPI::To2d (curve2,plane);
if (L2->IsInstance(STANDARD_TYPE(Geom2d_TrimmedCurve))) { 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; IntAna2d_AnaIntersection inter;
inter.Perform(l1,l2); inter.Perform(l1,l2);
@ -139,7 +139,7 @@ void DrawDim_PlanarAngle::DrawOn(Draw_Display& dis) const
// retour au plan // retour au plan
Handle(Geom_Curve) C = GeomAPI::To3d (new Geom2d_Circle(c),plane); 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.; Standard_Real p1=0., p2=0.;
angle = Abs(angle); angle = Abs(angle);

View File

@ -77,7 +77,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension,
Standard_Real stenor = (myKnots->Value(IndexOfElement + 1) - myKnots->Value(IndexOfElement)) / 2., Standard_Real stenor = (myKnots->Value(IndexOfElement + 1) - myKnots->Value(IndexOfElement)) / 2.,
mfact; mfact;
Handle(PLib_HermitJacobi) myHermitJacobi = (*((Handle(PLib_HermitJacobi)*)&myBase)); Handle(PLib_HermitJacobi) myHermitJacobi = Handle(PLib_HermitJacobi)::DownCast (myBase);
i1 = iBase; i1 = iBase;
i2 = iBase + (myHermitJacobi->NivConstr() + 1) * myDimension; 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)), Standard_Real stenor = 2. / (myKnots->Value(IndexOfElement + 1) - myKnots->Value(IndexOfElement)),
mfact; mfact;
Handle(PLib_HermitJacobi) myHermitJacobi = (*((Handle(PLib_HermitJacobi)*)&myBase)); Handle(PLib_HermitJacobi) myHermitJacobi = Handle(PLib_HermitJacobi)::DownCast (myBase);
i2 = Coeffs.LowerRow(); i2 = Coeffs.LowerRow();
Standard_Integer i3 = i2 + myHermitJacobi->NivConstr() + 1; 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->WorkDegree() + 1)*myDimension + 1;
myBase->ReduceDegree(myDimension, deg, Tol, myCoeff.ChangeValue(Ptr), NewDegree, MaxError); 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); NewDegree = Max(NewDegree, 2 * myHermitJacobi->NivConstr() + 1);

View File

@ -339,7 +339,7 @@ Standard_Boolean Geom_OsculatingSurface::UOscSurf
if (myBasisSurf->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) if (myBasisSurf->IsKind(STANDARD_TYPE(Geom_BSplineSurface)))
{ {
Handle(Geom_BSplineSurface) BSur = Handle(Geom_BSplineSurface) BSur =
*((Handle(Geom_BSplineSurface)*)& myBasisSurf); Handle(Geom_BSplineSurface)::DownCast (myBasisSurf);
NbUK = BSur->NbUKnots(); NbUK = BSur->NbUKnots();
NbVK = BSur->NbVKnots(); NbVK = BSur->NbVKnots();
TColStd_Array1OfReal UKnots(1,NbUK); TColStd_Array1OfReal UKnots(1,NbUK);
@ -398,7 +398,7 @@ Standard_Boolean Geom_OsculatingSurface::VOscSurf
if (myBasisSurf->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) if (myBasisSurf->IsKind(STANDARD_TYPE(Geom_BSplineSurface)))
{ {
Handle(Geom_BSplineSurface) BSur = Handle(Geom_BSplineSurface) BSur =
*((Handle(Geom_BSplineSurface)*)& myBasisSurf); Handle(Geom_BSplineSurface)::DownCast (myBasisSurf);
NbUK = BSur->NbUKnots(); NbUK = BSur->NbUKnots();
NbVK = BSur->NbVKnots(); NbVK = BSur->NbVKnots();
TColStd_Array1OfReal UKnots(1,NbUK); TColStd_Array1OfReal UKnots(1,NbUK);

View File

@ -53,7 +53,7 @@
#include <Standard_NullObject.hxx> #include <Standard_NullObject.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#define myBspl (*((Handle(Geom2d_BSplineCurve)*)&myCurve)) #define myBspl Handle(Geom2d_BSplineCurve)::DownCast (myCurve)
#define PosTol Precision::PConfusion()/2 #define PosTol Precision::PConfusion()/2
static const int maxDerivOrder = 3; static const int maxDerivOrder = 3;
@ -189,7 +189,7 @@ void Geom2dAdaptor_Curve::load(const Handle(Geom2d_Curve)& C,
Handle(Standard_Type) TheType = C->DynamicType(); Handle(Standard_Type) TheType = C->DynamicType();
if ( TheType == STANDARD_TYPE(Geom2d_TrimmedCurve)) { if ( TheType == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
Load((*((Handle(Geom2d_TrimmedCurve)*)&C))->BasisCurve(), Load(Handle(Geom2d_TrimmedCurve)::DownCast (C)->BasisCurve(),
UFirst,ULast); UFirst,ULast);
} }
else if ( TheType == STANDARD_TYPE(Geom2d_Circle)) { 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)){ else if (myCurve->DynamicType() == STANDARD_TYPE(Geom2d_OffsetCurve)){
GeomAbs_Shape S = GeomAbs_Shape S =
(*((Handle(Geom2d_OffsetCurve)*)&myCurve))->GetBasisCurveContinuity(); Handle(Geom2d_OffsetCurve)::DownCast (myCurve)->GetBasisCurveContinuity();
switch(S){ switch(S){
case GeomAbs_CN: return GeomAbs_CN; case GeomAbs_CN: return GeomAbs_CN;
case GeomAbs_C3: return GeomAbs_C2; case GeomAbs_C3: return GeomAbs_C2;
@ -1002,23 +1002,23 @@ Standard_Real Geom2dAdaptor_Curve::Resolution(const Standard_Real Ruv) const {
case GeomAbs_Line : case GeomAbs_Line :
return Ruv; return Ruv;
case GeomAbs_Circle: { 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.) if ( R > Ruv/2.)
return 2*ASin(Ruv/(2*R)); return 2*ASin(Ruv/(2*R));
else else
return 2*M_PI; return 2*M_PI;
} }
case GeomAbs_Ellipse: { case GeomAbs_Ellipse: {
return Ruv / (*((Handle(Geom2d_Ellipse)*)&myCurve))->MajorRadius(); return Ruv / Handle(Geom2d_Ellipse)::DownCast (myCurve)->MajorRadius();
} }
case GeomAbs_BezierCurve: { case GeomAbs_BezierCurve: {
Standard_Real res; Standard_Real res;
(*((Handle(Geom2d_BezierCurve)*)&myCurve))->Resolution(Ruv,res); Handle(Geom2d_BezierCurve)::DownCast (myCurve)->Resolution(Ruv,res);
return res; return res;
} }
case GeomAbs_BSplineCurve: { case GeomAbs_BSplineCurve: {
Standard_Real res; Standard_Real res;
(*((Handle(Geom2d_BSplineCurve)*)&myCurve))->Resolution(Ruv,res); Handle(Geom2d_BSplineCurve)::DownCast (myCurve)->Resolution(Ruv,res);
return res; return res;
} }
default: default:
@ -1040,7 +1040,7 @@ Standard_Real Geom2dAdaptor_Curve::Resolution(const Standard_Real Ruv) const {
gp_Lin2d Geom2dAdaptor_Curve::Line() const gp_Lin2d Geom2dAdaptor_Curve::Line() const
{ {
Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Line, ""); 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 gp_Circ2d Geom2dAdaptor_Curve::Circle() const
{ {
Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Circle, ""); 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 gp_Elips2d Geom2dAdaptor_Curve::Ellipse() const
{ {
Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Ellipse, ""); 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 gp_Hypr2d Geom2dAdaptor_Curve::Hyperbola() const
{ {
Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Hyperbola, ""); 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 gp_Parab2d Geom2dAdaptor_Curve::Parabola() const
{ {
Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Parabola, ""); 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 Standard_Integer Geom2dAdaptor_Curve::Degree() const
{ {
if (myTypeCurve == GeomAbs_BezierCurve) if (myTypeCurve == GeomAbs_BezierCurve)
return (*((Handle(Geom2d_BezierCurve)*)&myCurve))->Degree(); return Handle(Geom2d_BezierCurve)::DownCast (myCurve)->Degree();
else if (myTypeCurve == GeomAbs_BSplineCurve) else if (myTypeCurve == GeomAbs_BSplineCurve)
return (*((Handle(Geom2d_BSplineCurve)*)&myCurve))->Degree(); return Handle(Geom2d_BSplineCurve)::DownCast (myCurve)->Degree();
else else
Standard_NoSuchObject::Raise(); Standard_NoSuchObject::Raise();
// portage WNT // portage WNT
@ -1112,9 +1112,9 @@ Standard_Integer Geom2dAdaptor_Curve::Degree() const
Standard_Boolean Geom2dAdaptor_Curve::IsRational() const { Standard_Boolean Geom2dAdaptor_Curve::IsRational() const {
switch( myTypeCurve) { switch( myTypeCurve) {
case GeomAbs_BSplineCurve: case GeomAbs_BSplineCurve:
return (*((Handle(Geom2d_BSplineCurve)*)&myCurve))->IsRational(); return Handle(Geom2d_BSplineCurve)::DownCast (myCurve)->IsRational();
case GeomAbs_BezierCurve: case GeomAbs_BezierCurve:
return (*((Handle(Geom2d_BezierCurve)*)&myCurve))->IsRational(); return Handle(Geom2d_BezierCurve)::DownCast (myCurve)->IsRational();
default: default:
return Standard_False; return Standard_False;
} }
@ -1128,9 +1128,9 @@ Standard_Boolean Geom2dAdaptor_Curve::IsRational() const {
Standard_Integer Geom2dAdaptor_Curve::NbPoles() const Standard_Integer Geom2dAdaptor_Curve::NbPoles() const
{ {
if (myTypeCurve == GeomAbs_BezierCurve) if (myTypeCurve == GeomAbs_BezierCurve)
return (*((Handle(Geom2d_BezierCurve)*)&myCurve))->NbPoles(); return Handle(Geom2d_BezierCurve)::DownCast (myCurve)->NbPoles();
else if (myTypeCurve == GeomAbs_BSplineCurve) else if (myTypeCurve == GeomAbs_BSplineCurve)
return (*((Handle(Geom2d_BSplineCurve)*)&myCurve))->NbPoles(); return Handle(Geom2d_BSplineCurve)::DownCast (myCurve)->NbPoles();
else else
Standard_NoSuchObject::Raise(); Standard_NoSuchObject::Raise();
// portage WNT // portage WNT
@ -1145,7 +1145,7 @@ Standard_Integer Geom2dAdaptor_Curve::NbPoles() const
Standard_Integer Geom2dAdaptor_Curve::NbKnots() const { Standard_Integer Geom2dAdaptor_Curve::NbKnots() const {
if ( myTypeCurve != GeomAbs_BSplineCurve) if ( myTypeCurve != GeomAbs_BSplineCurve)
Standard_NoSuchObject::Raise("Geom2dAdaptor_Curve::NbKnots"); 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 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 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) static Standard_Integer nbPoints(const Handle(Geom2d_Curve)& theCurve)
@ -1178,22 +1178,22 @@ static Standard_Integer nbPoints(const Handle(Geom2d_Curve)& theCurve)
nbs = 2; nbs = 2;
else if(theCurve->IsKind(STANDARD_TYPE( Geom2d_BezierCurve))) 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))) { else if(theCurve->IsKind(STANDARD_TYPE( Geom2d_BSplineCurve))) {
nbs = (*((Handle(Geom2d_BSplineCurve)*)&theCurve))->NbKnots(); nbs = Handle(Geom2d_BSplineCurve)::DownCast (theCurve)->NbKnots();
nbs*= (*((Handle(Geom2d_BSplineCurve)*)&theCurve))->Degree(); nbs*= Handle(Geom2d_BSplineCurve)::DownCast (theCurve)->Degree();
if(nbs < 2.0) nbs=2; if(nbs < 2.0) nbs=2;
} }
else if (theCurve->IsKind(STANDARD_TYPE(Geom2d_OffsetCurve))) 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)); return Max(nbs, nbPoints(aCurve));
} }
else if (theCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) 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)); return Max(nbs, nbPoints(aCurve));
} }
if(nbs>300) if(nbs>300)

View File

@ -51,7 +51,7 @@
#include <Geom_OffsetCurve.hxx> #include <Geom_OffsetCurve.hxx>
#include <CSLib_Offset.hxx> #include <CSLib_Offset.hxx>
#define myBspl (*((Handle(Geom_BSplineCurve)*)&myCurve)) #define myBspl Handle(Geom_BSplineCurve)::DownCast (myCurve)
#define PosTol Precision::PConfusion()/2 #define PosTol Precision::PConfusion()/2
static const int maxDerivOrder = 3; 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(); const Handle(Standard_Type)& TheType = C->DynamicType();
if ( TheType == STANDARD_TYPE(Geom_TrimmedCurve)) { 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)) { else if ( TheType == STANDARD_TYPE(Geom_Circle)) {
myTypeCurve = GeomAbs_Circle; myTypeCurve = GeomAbs_Circle;
@ -201,7 +201,7 @@ GeomAbs_Shape GeomAdaptor_Curve::Continuity() const
if (myCurve->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) if (myCurve->IsKind(STANDARD_TYPE(Geom_OffsetCurve)))
{ {
const GeomAbs_Shape S = const GeomAbs_Shape S =
(*((Handle(Geom_OffsetCurve)*)&myCurve))->GetBasisCurveContinuity(); Handle(Geom_OffsetCurve)::DownCast (myCurve)->GetBasisCurveContinuity();
switch(S) switch(S)
{ {
case GeomAbs_CN: return GeomAbs_CN; case GeomAbs_CN: return GeomAbs_CN;
@ -322,7 +322,7 @@ Standard_Integer GeomAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const
default: BaseS = GeomAbs_CN; default: BaseS = GeomAbs_CN;
} }
GeomAdaptor_Curve C 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 // akm 05/04/02 (OCC278) If our curve is trimmed we must recalculate
// the number of intervals obtained from the basis to // the number of intervals obtained from the basis to
// vvv reflect parameter bounds // vvv reflect parameter bounds
@ -460,7 +460,7 @@ void GeomAdaptor_Curve::Intervals(TColStd_Array1OfReal& T,
default: BaseS = GeomAbs_CN; default: BaseS = GeomAbs_CN;
} }
GeomAdaptor_Curve C 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 // akm 05/04/02 (OCC278) If our curve is trimmed we must recalculate
// the array of intervals obtained from the basis to // the array of intervals obtained from the basis to
// vvv reflect parameter bounds // vvv reflect parameter bounds
@ -946,23 +946,23 @@ Standard_Real GeomAdaptor_Curve::Resolution(const Standard_Real R3D) const
case GeomAbs_Line : case GeomAbs_Line :
return R3D; return R3D;
case GeomAbs_Circle: { 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. ) if ( R > R3D/2. )
return 2*ASin(R3D/(2*R)); return 2*ASin(R3D/(2*R));
else else
return 2*M_PI; return 2*M_PI;
} }
case GeomAbs_Ellipse: { case GeomAbs_Ellipse: {
return R3D / (*((Handle(Geom_Ellipse)*)&myCurve))->MajorRadius(); return R3D / Handle(Geom_Ellipse)::DownCast (myCurve)->MajorRadius();
} }
case GeomAbs_BezierCurve: { case GeomAbs_BezierCurve: {
Standard_Real res; Standard_Real res;
(*((Handle(Geom_BezierCurve)*)&myCurve))->Resolution(R3D,res); Handle(Geom_BezierCurve)::DownCast (myCurve)->Resolution(R3D,res);
return res; return res;
} }
case GeomAbs_BSplineCurve: { case GeomAbs_BSplineCurve: {
Standard_Real res; Standard_Real res;
(*((Handle(Geom_BSplineCurve)*)&myCurve))->Resolution(R3D,res); Handle(Geom_BSplineCurve)::DownCast (myCurve)->Resolution(R3D,res);
return res; return res;
} }
default: default:
@ -984,7 +984,7 @@ Standard_Real GeomAdaptor_Curve::Resolution(const Standard_Real R3D) const
gp_Lin GeomAdaptor_Curve::Line() const gp_Lin GeomAdaptor_Curve::Line() const
{ {
Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Line, ""); 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 gp_Circ GeomAdaptor_Curve::Circle() const
{ {
Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Circle, ""); 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 gp_Elips GeomAdaptor_Curve::Ellipse() const
{ {
Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Ellipse, ""); 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 gp_Hypr GeomAdaptor_Curve::Hyperbola() const
{ {
Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Hyperbola, ""); 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 gp_Parab GeomAdaptor_Curve::Parabola() const
{ {
Standard_NoSuchObject_Raise_if(myTypeCurve != GeomAbs_Parabola, ""); 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 Standard_Integer GeomAdaptor_Curve::Degree() const
{ {
if (myTypeCurve == GeomAbs_BezierCurve) if (myTypeCurve == GeomAbs_BezierCurve)
return (*((Handle(Geom_BezierCurve)*)&myCurve))->Degree(); return Handle(Geom_BezierCurve)::DownCast (myCurve)->Degree();
else if (myTypeCurve == GeomAbs_BSplineCurve) else if (myTypeCurve == GeomAbs_BSplineCurve)
return (*((Handle(Geom_BSplineCurve)*)&myCurve))->Degree(); return Handle(Geom_BSplineCurve)::DownCast (myCurve)->Degree();
else else
Standard_NoSuchObject::Raise(); Standard_NoSuchObject::Raise();
// portage WNT // portage WNT
@ -1056,9 +1056,9 @@ Standard_Integer GeomAdaptor_Curve::Degree() const
Standard_Boolean GeomAdaptor_Curve::IsRational() const { Standard_Boolean GeomAdaptor_Curve::IsRational() const {
switch( myTypeCurve) { switch( myTypeCurve) {
case GeomAbs_BSplineCurve: case GeomAbs_BSplineCurve:
return (*((Handle(Geom_BSplineCurve)*)&myCurve))->IsRational(); return Handle(Geom_BSplineCurve)::DownCast (myCurve)->IsRational();
case GeomAbs_BezierCurve: case GeomAbs_BezierCurve:
return (*((Handle(Geom_BezierCurve)*)&myCurve))->IsRational(); return Handle(Geom_BezierCurve)::DownCast (myCurve)->IsRational();
default: default:
return Standard_False; return Standard_False;
} }
@ -1072,9 +1072,9 @@ Standard_Boolean GeomAdaptor_Curve::IsRational() const {
Standard_Integer GeomAdaptor_Curve::NbPoles() const Standard_Integer GeomAdaptor_Curve::NbPoles() const
{ {
if (myTypeCurve == GeomAbs_BezierCurve) if (myTypeCurve == GeomAbs_BezierCurve)
return (*((Handle(Geom_BezierCurve)*)&myCurve))->NbPoles(); return Handle(Geom_BezierCurve)::DownCast (myCurve)->NbPoles();
else if (myTypeCurve == GeomAbs_BSplineCurve) else if (myTypeCurve == GeomAbs_BSplineCurve)
return (*((Handle(Geom_BSplineCurve)*)&myCurve))->NbPoles(); return Handle(Geom_BSplineCurve)::DownCast (myCurve)->NbPoles();
else else
Standard_NoSuchObject::Raise(); Standard_NoSuchObject::Raise();
// portage WNT // portage WNT
@ -1090,7 +1090,7 @@ Standard_Integer GeomAdaptor_Curve::NbKnots() const
{ {
if ( myTypeCurve != GeomAbs_BSplineCurve) if ( myTypeCurve != GeomAbs_BSplineCurve)
Standard_NoSuchObject::Raise("GeomAdaptor_Curve::NbKnots"); 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) if ( myTypeCurve != GeomAbs_BezierCurve)
Standard_NoSuchObject::Raise("GeomAdaptor_Curve::Bezier"); 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) if ( myTypeCurve != GeomAbs_BSplineCurve)
Standard_NoSuchObject::Raise("GeomAdaptor_Curve::BSpline"); Standard_NoSuchObject::Raise("GeomAdaptor_Curve::BSpline");
return *((Handle(Geom_BSplineCurve)*)&myCurve); return Handle(Geom_BSplineCurve)::DownCast (myCurve);
} }

View File

@ -56,10 +56,10 @@
#include <Standard_NoSuchObject.hxx> #include <Standard_NoSuchObject.hxx>
#include <Standard_NullObject.hxx> #include <Standard_NullObject.hxx>
#define myBspl (*((Handle(Geom_BSplineSurface)*)&mySurface)) #define myBspl Handle(Geom_BSplineSurface)::DownCast (mySurface)
#define myExtSurf (*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface)) #define myExtSurf Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)
#define myRevSurf (*((Handle(Geom_SurfaceOfRevolution)*)&mySurface)) #define myRevSurf Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)
#define myOffSurf (*((Handle(Geom_OffsetSurface)*)&mySurface)) #define myOffSurf Handle(Geom_OffsetSurface)::DownCast (mySurface)
//======================================================================= //=======================================================================
//function : LocalContinuity //function : LocalContinuity
@ -131,7 +131,7 @@ void GeomAdaptor_Surface::load(const Handle(Geom_Surface)& S,
if ( TheType == STANDARD_TYPE(Geom_BezierSurface)) if ( TheType == STANDARD_TYPE(Geom_BezierSurface))
mySurfaceType = GeomAbs_BezierSurface; mySurfaceType = GeomAbs_BezierSurface;
else if (TheType == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { else if (TheType == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
Load((*((Handle(Geom_RectangularTrimmedSurface)*)&S))->BasisSurface(), Load(Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface(),
UFirst,ULast,VFirst,VLast); UFirst,ULast,VFirst,VLast);
} }
else if ( TheType == STANDARD_TYPE(Geom_Plane)) else if ( TheType == STANDARD_TYPE(Geom_Plane))
@ -150,7 +150,7 @@ void GeomAdaptor_Surface::load(const Handle(Geom_Surface)& S,
mySurfaceType = GeomAbs_SurfaceOfExtrusion; mySurfaceType = GeomAbs_SurfaceOfExtrusion;
else if ( TheType == STANDARD_TYPE(Geom_BSplineSurface)) { else if ( TheType == STANDARD_TYPE(Geom_BSplineSurface)) {
mySurfaceType = GeomAbs_BSplineSurface; mySurfaceType = GeomAbs_BSplineSurface;
myBspl = *((Handle(Geom_BSplineSurface)*)&mySurface); myBspl = Handle(Geom_BSplineSurface)::DownCast (mySurface);
// Create cache for B-spline // Create cache for B-spline
mySurfaceCache = new BSplSLib_Cache( mySurfaceCache = new BSplSLib_Cache(
myBspl->UDegree(), myBspl->IsUPeriodic(), myBspl->UKnotSequence(), myBspl->UDegree(), myBspl->IsUPeriodic(), myBspl->UKnotSequence(),
@ -206,7 +206,7 @@ GeomAbs_Shape GeomAdaptor_Surface::UContinuity() const
case GeomAbs_SurfaceOfExtrusion: case GeomAbs_SurfaceOfExtrusion:
{ {
GeomAdaptor_Curve GC GeomAdaptor_Curve GC
((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast); (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return GC.Continuity(); return GC.Continuity();
} }
case GeomAbs_OtherSurface: case GeomAbs_OtherSurface:
@ -259,7 +259,7 @@ GeomAbs_Shape GeomAdaptor_Surface::VContinuity() const
case GeomAbs_SurfaceOfRevolution: case GeomAbs_SurfaceOfRevolution:
{ {
GeomAdaptor_Curve GC GeomAdaptor_Curve GC
((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myVFirst,myVLast); (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myVFirst,myVLast);
return GC.Continuity(); return GC.Continuity();
} }
case GeomAbs_OtherSurface: case GeomAbs_OtherSurface:
@ -293,7 +293,7 @@ Standard_Integer GeomAdaptor_Surface::NbUIntervals(const GeomAbs_Shape S) const
case GeomAbs_SurfaceOfExtrusion: case GeomAbs_SurfaceOfExtrusion:
{ {
GeomAdaptor_Curve myBasisCurve GeomAdaptor_Curve myBasisCurve
((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast); (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
if (myBasisCurve.GetType() == GeomAbs_BSplineCurve) if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
return myBasisCurve.NbIntervals(S); return myBasisCurve.NbIntervals(S);
break; break;
@ -311,7 +311,7 @@ Standard_Integer GeomAdaptor_Surface::NbUIntervals(const GeomAbs_Shape S) const
case GeomAbs_C3: case GeomAbs_C3:
case GeomAbs_CN: break; 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); return Sur.NbUIntervals(BaseS);
} }
case GeomAbs_Plane: case GeomAbs_Plane:
@ -344,7 +344,7 @@ Standard_Integer GeomAdaptor_Surface::NbVIntervals(const GeomAbs_Shape S) const
case GeomAbs_SurfaceOfRevolution: case GeomAbs_SurfaceOfRevolution:
{ {
GeomAdaptor_Curve myBasisCurve GeomAdaptor_Curve myBasisCurve
((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myVFirst,myVLast); (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myVFirst,myVLast);
if (myBasisCurve.GetType() == GeomAbs_BSplineCurve) if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
return myBasisCurve.NbIntervals(S); return myBasisCurve.NbIntervals(S);
break; break;
@ -362,7 +362,7 @@ Standard_Integer GeomAdaptor_Surface::NbVIntervals(const GeomAbs_Shape S) const
case GeomAbs_C3: case GeomAbs_C3:
case GeomAbs_CN: break; 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); return Sur.NbVIntervals(BaseS);
} }
case GeomAbs_Plane: case GeomAbs_Plane:
@ -399,7 +399,7 @@ void GeomAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
case GeomAbs_SurfaceOfExtrusion: case GeomAbs_SurfaceOfExtrusion:
{ {
GeomAdaptor_Curve myBasisCurve GeomAdaptor_Curve myBasisCurve
((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast); (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
if (myBasisCurve.GetType() == GeomAbs_BSplineCurve) if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
{ {
myNbUIntervals = myBasisCurve.NbIntervals(S); myNbUIntervals = myBasisCurve.NbIntervals(S);
@ -420,7 +420,7 @@ void GeomAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
case GeomAbs_C3: case GeomAbs_C3:
case GeomAbs_CN: break; 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); myNbUIntervals = Sur.NbUIntervals(BaseS);
Sur.UIntervals(T, BaseS); Sur.UIntervals(T, BaseS);
} }
@ -460,7 +460,7 @@ void GeomAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
case GeomAbs_SurfaceOfRevolution: case GeomAbs_SurfaceOfRevolution:
{ {
GeomAdaptor_Curve myBasisCurve GeomAdaptor_Curve myBasisCurve
((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myVFirst,myVLast); (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myVFirst,myVLast);
if (myBasisCurve.GetType() == GeomAbs_BSplineCurve) if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
{ {
myNbVIntervals = myBasisCurve.NbIntervals(S); myNbVIntervals = myBasisCurve.NbIntervals(S);
@ -481,7 +481,7 @@ void GeomAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
case GeomAbs_C3: case GeomAbs_C3:
case GeomAbs_CN: break; 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); myNbVIntervals = Sur.NbVIntervals(BaseS);
Sur.VIntervals(T, BaseS); Sur.VIntervals(T, BaseS);
} }
@ -908,12 +908,12 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const
case GeomAbs_SurfaceOfExtrusion: case GeomAbs_SurfaceOfExtrusion:
{ {
GeomAdaptor_Curve myBasisCurve GeomAdaptor_Curve myBasisCurve
((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast); (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.Resolution(R3d); return myBasisCurve.Resolution(R3d);
} }
case GeomAbs_Torus: 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(); const Standard_Real R = S->MajorRadius() + S->MinorRadius();
if(R>Precision::Confusion()) if(R>Precision::Confusion())
Res = R3d/(2.*R); Res = R3d/(2.*R);
@ -921,7 +921,7 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const
} }
case GeomAbs_Sphere: 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(); const Standard_Real R = S->Radius();
if(R>Precision::Confusion()) if(R>Precision::Confusion())
Res = R3d/(2.*R); Res = R3d/(2.*R);
@ -929,7 +929,7 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const
} }
case GeomAbs_Cylinder: 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(); const Standard_Real R = S->Radius();
if(R>Precision::Confusion()) if(R>Precision::Confusion())
Res = R3d/(2.*R); Res = R3d/(2.*R);
@ -941,11 +941,11 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const
// Pas vraiment borne => resolution inconnue // Pas vraiment borne => resolution inconnue
return Precision::Parametric(R3d); 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); 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); 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; const Standard_Real R = (Rayon1 > Rayon2)? Rayon1 : Rayon2;
return (R>Precision::Confusion()? (R3d / R) : 0.); return (R>Precision::Confusion()? (R3d / R) : 0.);
} }
@ -956,18 +956,18 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const
case GeomAbs_BezierSurface: case GeomAbs_BezierSurface:
{ {
Standard_Real Ures,Vres; Standard_Real Ures,Vres;
(*((Handle(Geom_BezierSurface)*)&mySurface))->Resolution(R3d,Ures,Vres); Handle(Geom_BezierSurface)::DownCast (mySurface)->Resolution(R3d,Ures,Vres);
return Ures; return Ures;
} }
case GeomAbs_BSplineSurface: case GeomAbs_BSplineSurface:
{ {
Standard_Real Ures,Vres; Standard_Real Ures,Vres;
(*((Handle(Geom_BSplineSurface)*)&mySurface))->Resolution(R3d,Ures,Vres); Handle(Geom_BSplineSurface)::DownCast (mySurface)->Resolution(R3d,Ures,Vres);
return Ures; return Ures;
} }
case GeomAbs_OffsetSurface: 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); GeomAdaptor_Surface gabase(base,myUFirst,myULast,myVFirst,myVLast);
return gabase.UResolution(R3d); return gabase.UResolution(R3d);
} }
@ -994,12 +994,12 @@ Standard_Real GeomAdaptor_Surface::VResolution(const Standard_Real R3d) const
case GeomAbs_SurfaceOfRevolution: case GeomAbs_SurfaceOfRevolution:
{ {
GeomAdaptor_Curve myBasisCurve GeomAdaptor_Curve myBasisCurve
((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myUFirst,myULast); (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.Resolution(R3d); return myBasisCurve.Resolution(R3d);
} }
case GeomAbs_Torus: 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(); const Standard_Real R = S->MinorRadius();
if(R>Precision::Confusion()) if(R>Precision::Confusion())
Res = R3d/(2.*R); Res = R3d/(2.*R);
@ -1007,7 +1007,7 @@ Standard_Real GeomAdaptor_Surface::VResolution(const Standard_Real R3d) const
} }
case GeomAbs_Sphere: 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(); const Standard_Real R = S->Radius();
if(R>Precision::Confusion()) if(R>Precision::Confusion())
Res = R3d/(2.*R); Res = R3d/(2.*R);
@ -1023,18 +1023,18 @@ Standard_Real GeomAdaptor_Surface::VResolution(const Standard_Real R3d) const
case GeomAbs_BezierSurface: case GeomAbs_BezierSurface:
{ {
Standard_Real Ures,Vres; Standard_Real Ures,Vres;
(*((Handle(Geom_BezierSurface)*)&mySurface))->Resolution(R3d,Ures,Vres); Handle(Geom_BezierSurface)::DownCast (mySurface)->Resolution(R3d,Ures,Vres);
return Vres; return Vres;
} }
case GeomAbs_BSplineSurface: case GeomAbs_BSplineSurface:
{ {
Standard_Real Ures,Vres; Standard_Real Ures,Vres;
(*((Handle(Geom_BSplineSurface)*)&mySurface))->Resolution(R3d,Ures,Vres); Handle(Geom_BSplineSurface)::DownCast (mySurface)->Resolution(R3d,Ures,Vres);
return Vres; return Vres;
} }
case GeomAbs_OffsetSurface: 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); GeomAdaptor_Surface gabase(base,myUFirst,myULast,myVFirst,myVLast);
return gabase.VResolution(R3d); return gabase.VResolution(R3d);
} }
@ -1056,7 +1056,7 @@ gp_Pln GeomAdaptor_Surface::Plane() const
{ {
if (mySurfaceType != GeomAbs_Plane) if (mySurfaceType != GeomAbs_Plane)
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::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) if (mySurfaceType != GeomAbs_Cylinder)
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::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) if (mySurfaceType != GeomAbs_Cone)
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::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) if (mySurfaceType != GeomAbs_Sphere)
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::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) if (mySurfaceType != GeomAbs_Torus)
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::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 Standard_Integer GeomAdaptor_Surface::UDegree() const
{ {
if (mySurfaceType == GeomAbs_BSplineSurface) if (mySurfaceType == GeomAbs_BSplineSurface)
return (*((Handle(Geom_BSplineSurface)*)&mySurface))->UDegree(); return Handle(Geom_BSplineSurface)::DownCast (mySurface)->UDegree();
if ( mySurfaceType == GeomAbs_BezierSurface) if ( mySurfaceType == GeomAbs_BezierSurface)
return (*((Handle(Geom_BezierSurface)*)&mySurface))->UDegree(); return Handle(Geom_BezierSurface)::DownCast (mySurface)->UDegree();
if ( mySurfaceType == GeomAbs_SurfaceOfExtrusion) if ( mySurfaceType == GeomAbs_SurfaceOfExtrusion)
{ {
GeomAdaptor_Curve myBasisCurve GeomAdaptor_Curve myBasisCurve
((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast); (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.Degree(); return myBasisCurve.Degree();
} }
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::UDegree"); Standard_NoSuchObject::Raise("GeomAdaptor_Surface::UDegree");
@ -1136,13 +1136,13 @@ Standard_Integer GeomAdaptor_Surface::UDegree() const
Standard_Integer GeomAdaptor_Surface::NbUPoles() const Standard_Integer GeomAdaptor_Surface::NbUPoles() const
{ {
if (mySurfaceType == GeomAbs_BSplineSurface) if (mySurfaceType == GeomAbs_BSplineSurface)
return (*((Handle(Geom_BSplineSurface)*)&mySurface))->NbUPoles(); return Handle(Geom_BSplineSurface)::DownCast (mySurface)->NbUPoles();
if ( mySurfaceType == GeomAbs_BezierSurface) if ( mySurfaceType == GeomAbs_BezierSurface)
return (*((Handle(Geom_BezierSurface)*)&mySurface))->NbUPoles(); return Handle(Geom_BezierSurface)::DownCast (mySurface)->NbUPoles();
if ( mySurfaceType == GeomAbs_SurfaceOfExtrusion) if ( mySurfaceType == GeomAbs_SurfaceOfExtrusion)
{ {
GeomAdaptor_Curve myBasisCurve GeomAdaptor_Curve myBasisCurve
((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast); (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.NbPoles(); return myBasisCurve.NbPoles();
} }
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbUPoles"); Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbUPoles");
@ -1157,13 +1157,13 @@ Standard_Integer GeomAdaptor_Surface::NbUPoles() const
Standard_Integer GeomAdaptor_Surface::VDegree() const Standard_Integer GeomAdaptor_Surface::VDegree() const
{ {
if (mySurfaceType == GeomAbs_BSplineSurface) if (mySurfaceType == GeomAbs_BSplineSurface)
return (*((Handle(Geom_BSplineSurface)*)&mySurface))->VDegree(); return Handle(Geom_BSplineSurface)::DownCast (mySurface)->VDegree();
if ( mySurfaceType == GeomAbs_BezierSurface) if ( mySurfaceType == GeomAbs_BezierSurface)
return (*((Handle(Geom_BezierSurface)*)&mySurface))->VDegree(); return Handle(Geom_BezierSurface)::DownCast (mySurface)->VDegree();
if ( mySurfaceType == GeomAbs_SurfaceOfRevolution) if ( mySurfaceType == GeomAbs_SurfaceOfRevolution)
{ {
GeomAdaptor_Curve myBasisCurve GeomAdaptor_Curve myBasisCurve
((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myUFirst,myULast); (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.Degree(); return myBasisCurve.Degree();
} }
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::VDegree"); Standard_NoSuchObject::Raise("GeomAdaptor_Surface::VDegree");
@ -1178,13 +1178,13 @@ Standard_Integer GeomAdaptor_Surface::VDegree() const
Standard_Integer GeomAdaptor_Surface::NbVPoles() const Standard_Integer GeomAdaptor_Surface::NbVPoles() const
{ {
if (mySurfaceType == GeomAbs_BSplineSurface) if (mySurfaceType == GeomAbs_BSplineSurface)
return (*((Handle(Geom_BSplineSurface)*)&mySurface))->NbVPoles(); return Handle(Geom_BSplineSurface)::DownCast (mySurface)->NbVPoles();
if ( mySurfaceType == GeomAbs_BezierSurface) if ( mySurfaceType == GeomAbs_BezierSurface)
return (*((Handle(Geom_BezierSurface)*)&mySurface))->NbVPoles(); return Handle(Geom_BezierSurface)::DownCast (mySurface)->NbVPoles();
if ( mySurfaceType == GeomAbs_SurfaceOfRevolution) if ( mySurfaceType == GeomAbs_SurfaceOfRevolution)
{ {
GeomAdaptor_Curve myBasisCurve GeomAdaptor_Curve myBasisCurve
((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myUFirst,myULast); (Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.NbPoles(); return myBasisCurve.NbPoles();
} }
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbVPoles"); Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbVPoles");
@ -1199,11 +1199,11 @@ Standard_Integer GeomAdaptor_Surface::NbVPoles() const
Standard_Integer GeomAdaptor_Surface::NbUKnots() const Standard_Integer GeomAdaptor_Surface::NbUKnots() const
{ {
if (mySurfaceType == GeomAbs_BSplineSurface) if (mySurfaceType == GeomAbs_BSplineSurface)
return (*((Handle(Geom_BSplineSurface)*)&mySurface))->NbUKnots(); return Handle(Geom_BSplineSurface)::DownCast (mySurface)->NbUKnots();
if ( mySurfaceType == GeomAbs_SurfaceOfExtrusion) if ( mySurfaceType == GeomAbs_SurfaceOfExtrusion)
{ {
GeomAdaptor_Curve myBasisCurve GeomAdaptor_Curve myBasisCurve
((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast); (Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.NbKnots(); return myBasisCurve.NbKnots();
} }
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbUKnots"); Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbUKnots");
@ -1218,7 +1218,7 @@ Standard_Integer GeomAdaptor_Surface::NbUKnots() const
Standard_Integer GeomAdaptor_Surface::NbVKnots() const Standard_Integer GeomAdaptor_Surface::NbVKnots() const
{ {
if (mySurfaceType == GeomAbs_BSplineSurface) if (mySurfaceType == GeomAbs_BSplineSurface)
return (*((Handle(Geom_BSplineSurface)*)&mySurface))->NbVKnots(); return Handle(Geom_BSplineSurface)::DownCast (mySurface)->NbVKnots();
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbVKnots"); Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbVKnots");
return 0; return 0;
} }
@ -1230,9 +1230,9 @@ Standard_Integer GeomAdaptor_Surface::NbVKnots() const
Standard_Boolean GeomAdaptor_Surface::IsURational() const Standard_Boolean GeomAdaptor_Surface::IsURational() const
{ {
if (mySurfaceType == GeomAbs_BSplineSurface) if (mySurfaceType == GeomAbs_BSplineSurface)
return (*((Handle(Geom_BSplineSurface)*)&mySurface))->IsURational(); return Handle(Geom_BSplineSurface)::DownCast (mySurface)->IsURational();
if (mySurfaceType == GeomAbs_BezierSurface) if (mySurfaceType == GeomAbs_BezierSurface)
return (*((Handle(Geom_BezierSurface)*)&mySurface))->IsURational(); return Handle(Geom_BezierSurface)::DownCast (mySurface)->IsURational();
return Standard_False; return Standard_False;
} }
@ -1244,9 +1244,9 @@ Standard_Boolean GeomAdaptor_Surface::IsURational() const
Standard_Boolean GeomAdaptor_Surface::IsVRational() const Standard_Boolean GeomAdaptor_Surface::IsVRational() const
{ {
if (mySurfaceType == GeomAbs_BSplineSurface) if (mySurfaceType == GeomAbs_BSplineSurface)
return (*((Handle(Geom_BSplineSurface)*)&mySurface))->IsVRational(); return Handle(Geom_BSplineSurface)::DownCast (mySurface)->IsVRational();
if (mySurfaceType == GeomAbs_BezierSurface) if (mySurfaceType == GeomAbs_BezierSurface)
return (*((Handle(Geom_BezierSurface)*)&mySurface))->IsVRational(); return Handle(Geom_BezierSurface)::DownCast (mySurface)->IsVRational();
return Standard_False; return Standard_False;
} }
@ -1259,7 +1259,7 @@ Handle(Geom_BezierSurface) GeomAdaptor_Surface::Bezier() const
{ {
if (mySurfaceType != GeomAbs_BezierSurface) if (mySurfaceType != GeomAbs_BezierSurface)
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Bezier"); 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) if (mySurfaceType != GeomAbs_BSplineSurface)
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BSpline"); 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) if (mySurfaceType != GeomAbs_SurfaceOfRevolution)
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::AxeOfRevolution"); 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) if (mySurfaceType != GeomAbs_SurfaceOfExtrusion)
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Direction"); 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; Handle(Geom_Curve) C;
if (mySurfaceType == GeomAbs_SurfaceOfExtrusion) if (mySurfaceType == GeomAbs_SurfaceOfExtrusion)
C = (*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(); C = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve();
else if (mySurfaceType == GeomAbs_SurfaceOfRevolution) else if (mySurfaceType == GeomAbs_SurfaceOfRevolution)
C = (*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(); C = Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve();
else else
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisCurve"); Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisCurve");
return Handle(GeomAdaptor_HCurve)(new GeomAdaptor_HCurve(C)); return Handle(GeomAdaptor_HCurve)(new GeomAdaptor_HCurve(C));
@ -1325,7 +1325,7 @@ Handle(Adaptor3d_HSurface) GeomAdaptor_Surface::BasisSurface() const
if (mySurfaceType != GeomAbs_OffsetSurface) if (mySurfaceType != GeomAbs_OffsetSurface)
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisSurface"); Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisSurface");
return new GeomAdaptor_HSurface return new GeomAdaptor_HSurface
((*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface(), (Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface(),
myUFirst,myULast,myVFirst,myVLast); myUFirst,myULast,myVFirst,myVLast);
} }
@ -1338,7 +1338,7 @@ Standard_Real GeomAdaptor_Surface::OffsetValue() const
{ {
if (mySurfaceType != GeomAbs_OffsetSurface) if (mySurfaceType != GeomAbs_OffsetSurface)
Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisSurface"); Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisSurface");
return (*((Handle(Geom_OffsetSurface)*)&mySurface))->Offset(); return Handle(Geom_OffsetSurface)::DownCast (mySurface)->Offset();
} }
//======================================================================= //=======================================================================

View File

@ -355,7 +355,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
Handle(Geom_Surface) S; Handle(Geom_Surface) S;
Handle(Geom_OffsetSurface) OffsetSur; Handle(Geom_OffsetSurface) OffsetSur;
if (Sr->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) { if (Sr->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) {
OffsetSur = *((Handle(Geom_OffsetSurface)*)& Sr); OffsetSur = Handle(Geom_OffsetSurface)::DownCast (Sr);
S = OffsetSur->Surface(); S = OffsetSur->Surface();
if (!S.IsNull()) { // Convert the equivalent surface. if (!S.IsNull()) { // Convert the equivalent surface.
return SurfaceToBSplineSurface(S); return SurfaceToBSplineSurface(S);

View File

@ -175,7 +175,7 @@ void GeomFill_BoundWithSurf::Reparametrize(const Standard_Real First,
HasDF,HasDL,DF,DL, HasDF,HasDL,DF,DL,
Rev,30); Rev,30);
myPar = new Law_BSpFunc(); myPar = new Law_BSpFunc();
(*((Handle(Law_BSpFunc)*) &myPar))->SetCurve(curve); Handle(Law_BSpFunc)::DownCast (myPar)->SetCurve(curve);
} }
//======================================================================= //=======================================================================

View File

@ -395,8 +395,8 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1,
if(!CheckTgte(i)) { if(!CheckTgte(i)) {
Handle(Law_Function) fu1,fu2; Handle(Law_Function) fu1,fu2;
ptch->Func(fu1,fu2); ptch->Func(fu1,fu2);
fu1 = Law::MixBnd(*((Handle(Law_Linear)*) &fu1)); fu1 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu1));
fu2 = Law::MixBnd(*((Handle(Law_Linear)*) &fu2)); fu2 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu2));
ptch->Func(fu1,fu2); ptch->Func(fu1,fu2);
break; break;
} }
@ -476,8 +476,8 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1,
if(!CheckTgte(i)) { if(!CheckTgte(i)) {
Handle(Law_Function) fu1,fu2; Handle(Law_Function) fu1,fu2;
ptch->Func(fu1,fu2); ptch->Func(fu1,fu2);
Handle(Law_Function) ffu1 = Law::MixBnd(*((Handle(Law_Linear)*) &fu1)); Handle(Law_Function) ffu1 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu1));
Handle(Law_Function) ffu2 = Law::MixBnd(*((Handle(Law_Linear)*) &fu2)); Handle(Law_Function) ffu2 = Law::MixBnd(Handle(Law_Linear)::DownCast (fu2));
ptch->SetFunc(ffu1,ffu2); ptch->SetFunc(ffu1,ffu2);
break; break;
} }

View File

@ -142,7 +142,7 @@ void GeomFill_Profiler::AddCurve(const Handle(Geom_Curve)& Curve)
//// modified by jgv, 19.01.05 for OCC7354 //// //// modified by jgv, 19.01.05 for OCC7354 ////
Handle(Geom_Curve) theCurve = Curve; Handle(Geom_Curve) theCurve = Curve;
if (theCurve->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) 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))) if (theCurve->IsKind(STANDARD_TYPE(Geom_Conic)))
{ {
GeomConvert_ApproxCurve appr(Curve, Precision::Confusion(), GeomAbs_C1, 16, 14); GeomConvert_ApproxCurve appr(Curve, Precision::Confusion(), GeomAbs_C1, 16, 14);

View File

@ -77,7 +77,7 @@ void GeomFill_SimpleBound::Reparametrize(const Standard_Real First,
HasDF,HasDL,DF,DL, HasDF,HasDL,DF,DL,
Rev,30); Rev,30);
myPar = new Law_BSpFunc(); myPar = new Law_BSpFunc();
(*((Handle(Law_BSpFunc)*) &myPar))->SetCurve(curve); Handle(Law_BSpFunc)::DownCast (myPar)->SetCurve(curve);
} }
//======================================================================= //=======================================================================

View File

@ -325,8 +325,7 @@ GeomFill_Sweep::GeomFill_Sweep(const Handle(GeomFill_LocationLaw)& Location,
myCurve2d = new (TColGeom2d_HArray1OfCurve) (1, 2); myCurve2d = new (TColGeom2d_HArray1OfCurve) (1, 2);
CError = new (TColStd_HArray2OfReal) (1,2, 1,2); CError = new (TColStd_HArray2OfReal) (1,2, 1,2);
const Handle(Geom_BSplineSurface)& BSplSurf = Handle(Geom_BSplineSurface) BSplSurf (Handle(Geom_BSplineSurface)::DownCast(mySurface));
Handle(Geom_BSplineSurface)::DownCast(mySurface);
gp_Dir2d D(0., 1.); gp_Dir2d D(0., 1.);
gp_Pnt2d P(BSplSurf->UKnot(1), 0); gp_Pnt2d P(BSplSurf->UKnot(1), 0);

View File

@ -145,7 +145,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L)
const IntPatch_IType typl = L->ArcType(); const IntPatch_IType typl = L->ArcType();
if(typl == IntPatch_Analytic) { if(typl == IntPatch_Analytic) {
Standard_Real u1,v1,u2,v2; 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(); seqp.Clear();
nbvtx = GeomInt_LineTool::NbVertex(L); nbvtx = GeomInt_LineTool::NbVertex(L);
for(i=1;i<nbvtx;i++) { for(i=1;i<nbvtx;i++) {
@ -171,7 +171,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L)
} // if(typl == IntPatch_Analytic) { } // if(typl == IntPatch_Analytic) {
else if(typl == IntPatch_Walking) { else if(typl == IntPatch_Walking) {
Standard_Real u1,v1,u2,v2; 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(); seqp.Clear();
nbvtx = GeomInt_LineTool::NbVertex(L); nbvtx = GeomInt_LineTool::NbVertex(L);
for(i=1;i<nbvtx;i++) { for(i=1;i<nbvtx;i++) {
@ -287,7 +287,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L)
else if (typl != IntPatch_Restriction) { else if (typl != IntPatch_Restriction) {
seqp.Clear(); 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) { if(typl == IntPatch_Circle || typl == IntPatch_Ellipse) {
TreatCircle(L, Tol); TreatCircle(L, Tol);
@ -726,7 +726,7 @@ void GeomInt_LineConstructor::TreatCircle(const Handle(IntPatch_Line)& aLine,
IntPatch_IType aType; IntPatch_IType aType;
// //
aType=aLine->ArcType(); 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); bRejected=RejectMicroCircle(aGLine, aType, aTol);
if (bRejected) { if (bRejected) {

View File

@ -1057,10 +1057,8 @@ void GeomLib::BuildCurve3d(const Standard_Real Tolerance,
Standard_Integer curve_not_computed = 1 ; Standard_Integer curve_not_computed = 1 ;
MaxDeviation = 0.0e0 ; MaxDeviation = 0.0e0 ;
AverageDeviation = 0.0e0 ; AverageDeviation = 0.0e0 ;
const Handle(GeomAdaptor_HSurface) & geom_adaptor_surface_ptr = Handle(GeomAdaptor_HSurface) geom_adaptor_surface_ptr (Handle(GeomAdaptor_HSurface)::DownCast(Curve.GetSurface()) );
Handle(GeomAdaptor_HSurface)::DownCast(Curve.GetSurface()) ; Handle(Geom2dAdaptor_HCurve) geom_adaptor_curve_ptr (Handle(Geom2dAdaptor_HCurve)::DownCast(Curve.GetCurve()) );
const Handle(Geom2dAdaptor_HCurve) & geom_adaptor_curve_ptr =
Handle(Geom2dAdaptor_HCurve)::DownCast(Curve.GetCurve()) ;
if (! geom_adaptor_curve_ptr.IsNull() && if (! geom_adaptor_curve_ptr.IsNull() &&
! geom_adaptor_surface_ptr.IsNull()) { ! geom_adaptor_surface_ptr.IsNull()) {

View File

@ -1341,7 +1341,7 @@ static Standard_Integer mypoints (Draw_Interpretor& di, Standard_Integer /*n*/,
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]); Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
defl = Draw::Atof(a[3]); 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; if(aBS.IsNull()) return 1;

View File

@ -91,7 +91,7 @@ TopoDS_Edge HLRBRep::MakeEdge (const HLRBRep_Curve& ec,
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar); Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve))
aCurve = (Handle(Geom_TrimmedCurve)::DownCast(aCurve))->BasisCurve(); 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()); Handle(Geom_BSplineCurve) theCurve = Handle(Geom_BSplineCurve)::DownCast(BSplCurve->Copy());
if (theCurve->IsPeriodic() && !GAcurve.IsClosed()) if (theCurve->IsPeriodic() && !GAcurve.IsClosed())
{ {

View File

@ -530,10 +530,10 @@ void PutPointsOnLine(const Handle(Adaptor3d_HSurface)& S1,
solpnt.SetArc(OnFirst,currentarc, currentparameter, solpnt.SetArc(OnFirst,currentarc, currentparameter,
Transline,Transarc); Transline,Transarc);
if (TheType == IntPatch_Analytic) { if (TheType == IntPatch_Analytic) {
(*((Handle(IntPatch_ALine)*)&lin))->AddVertex(solpnt); Handle(IntPatch_ALine)::DownCast (lin)->AddVertex(solpnt);
} }
else { else {
(*((Handle(IntPatch_GLine)*)&lin))->AddVertex(solpnt); Handle(IntPatch_GLine)::DownCast (lin)->AddVertex(solpnt);
} }
Done(i) = 1; Done(i) = 1;
@ -564,10 +564,10 @@ void PutPointsOnLine(const Handle(Adaptor3d_HSurface)& S1,
solpnt.SetArc(OnFirst,currentarc,currentparameter, solpnt.SetArc(OnFirst,currentarc,currentparameter,
Transline,Transarc); Transline,Transarc);
if (TheType == IntPatch_Analytic) { if (TheType == IntPatch_Analytic) {
(*((Handle(IntPatch_ALine)*)&lin))->AddVertex(solpnt); Handle(IntPatch_ALine)::DownCast (lin)->AddVertex(solpnt);
} }
else { else {
(*((Handle(IntPatch_GLine)*)&lin))->AddVertex(solpnt); Handle(IntPatch_GLine)::DownCast (lin)->AddVertex(solpnt);
} }
Done(k) = 1; Done(k) = 1;
} }
@ -639,18 +639,18 @@ Standard_Boolean MultiplePoint (const IntPatch_SequenceOfPathPointOfTheSOnBound
const Handle(IntPatch_Line)& slinValueii = slin.Value(ii); const Handle(IntPatch_Line)& slinValueii = slin.Value(ii);
TheType = slinValueii->ArcType(); TheType = slinValueii->ArcType();
if (TheType == IntPatch_Analytic) { if (TheType == IntPatch_Analytic) {
nbvtx = (*((Handle(IntPatch_ALine)*)&slinValueii))->NbVertex(); nbvtx = Handle(IntPatch_ALine)::DownCast (slinValueii)->NbVertex();
} }
else { else {
nbvtx = (*((Handle(IntPatch_GLine)*)&slinValueii))->NbVertex(); nbvtx = Handle(IntPatch_GLine)::DownCast (slinValueii)->NbVertex();
} }
jj = 1; jj = 1;
while (jj <= nbvtx) { while (jj <= nbvtx) {
if (TheType == IntPatch_Analytic) { if (TheType == IntPatch_Analytic) {
intpt = (*((Handle(IntPatch_ALine)*)&slinValueii))->Vertex(jj); intpt = Handle(IntPatch_ALine)::DownCast (slinValueii)->Vertex(jj);
} }
else { else {
intpt = (*((Handle(IntPatch_GLine)*)&slinValueii))->Vertex(jj); intpt = Handle(IntPatch_GLine)::DownCast (slinValueii)->Vertex(jj);
} }
if (intpt.IsMultiple() && if (intpt.IsMultiple() &&
(( OnFirst && !intpt.IsOnDomS1()) || (( OnFirst && !intpt.IsOnDomS1()) ||
@ -696,10 +696,10 @@ Standard_Boolean MultiplePoint (const IntPatch_SequenceOfPathPointOfTheSOnBound
if (TheType == IntPatch_Analytic) { if (TheType == IntPatch_Analytic) {
(*((Handle(IntPatch_ALine)*)&slinValueii))->Replace(jj,intpt); Handle(IntPatch_ALine)::DownCast (slinValueii)->Replace(jj,intpt);
} }
else { else {
(*((Handle(IntPatch_GLine)*)&slinValueii))->Replace(jj,intpt); Handle(IntPatch_GLine)::DownCast (slinValueii)->Replace(jj,intpt);
} }
localdone(Index) = 1; localdone(Index) = 1;
if (goon) { if (goon) {
@ -726,10 +726,10 @@ Standard_Boolean MultiplePoint (const IntPatch_SequenceOfPathPointOfTheSOnBound
intpt.SetArc(OnFirst,currentarc,currentparameter, intpt.SetArc(OnFirst,currentarc,currentparameter,
Transline,Transarc); Transline,Transarc);
if (TheType == IntPatch_Analytic) { if (TheType == IntPatch_Analytic) {
(*((Handle(IntPatch_ALine)*)&slinValueii))->AddVertex(intpt); Handle(IntPatch_ALine)::DownCast (slinValueii)->AddVertex(intpt);
} }
else { else {
(*((Handle(IntPatch_GLine)*)&slinValueii))->AddVertex(intpt); Handle(IntPatch_GLine)::DownCast (slinValueii)->AddVertex(intpt);
} }
UsedLine(ii) = 1; UsedLine(ii) = 1;
Retvalue = Standard_True; Retvalue = Standard_True;
@ -799,18 +799,18 @@ Standard_Boolean PointOnSecondDom (const IntPatch_SequenceOfPathPointOfTheSOnBou
TheType = lin->ArcType(); TheType = lin->ArcType();
if (TheType == IntPatch_Analytic) { if (TheType == IntPatch_Analytic) {
nbvtx = (*((Handle(IntPatch_ALine)*)&lin))->NbVertex(); nbvtx = Handle(IntPatch_ALine)::DownCast (lin)->NbVertex();
} }
else { else {
nbvtx = (*((Handle(IntPatch_GLine)*)&lin))->NbVertex(); nbvtx = Handle(IntPatch_GLine)::DownCast (lin)->NbVertex();
} }
jj = 1; jj = 1;
while (jj <= nbvtx) { while (jj <= nbvtx) {
if (TheType == IntPatch_Analytic) { if (TheType == IntPatch_Analytic) {
intpt = (*((Handle(IntPatch_ALine)*)&lin))->Vertex(jj); intpt = Handle(IntPatch_ALine)::DownCast (lin)->Vertex(jj);
} }
else { else {
intpt = (*((Handle(IntPatch_GLine)*)&lin))->Vertex(jj); intpt = Handle(IntPatch_GLine)::DownCast (lin)->Vertex(jj);
} }
if (!intpt.IsOnDomS2()) { if (!intpt.IsOnDomS2()) {
if (currentpointonrst.Value().Distance(intpt.Value()) <= if (currentpointonrst.Value().Distance(intpt.Value()) <=
@ -839,10 +839,10 @@ Standard_Boolean PointOnSecondDom (const IntPatch_SequenceOfPathPointOfTheSOnBou
intpt.SetArc(Standard_False,currentarc,currentparameter, intpt.SetArc(Standard_False,currentarc,currentparameter,
Transline,Transarc); Transline,Transarc);
if (TheType == IntPatch_Analytic) { if (TheType == IntPatch_Analytic) {
(*((Handle(IntPatch_ALine)*)&lin))->Replace(jj,intpt); Handle(IntPatch_ALine)::DownCast (lin)->Replace(jj,intpt);
} }
else { else {
(*((Handle(IntPatch_GLine)*)&lin))->Replace(jj,intpt); Handle(IntPatch_GLine)::DownCast (lin)->Replace(jj,intpt);
} }
Done(Index) = 1; Done(Index) = 1;
@ -869,10 +869,10 @@ Standard_Boolean PointOnSecondDom (const IntPatch_SequenceOfPathPointOfTheSOnBou
intpt.SetArc(Standard_False,currentarc,currentparameter, intpt.SetArc(Standard_False,currentarc,currentparameter,
Transline,Transarc); Transline,Transarc);
if (TheType == IntPatch_Analytic) { if (TheType == IntPatch_Analytic) {
(*((Handle(IntPatch_ALine)*)&lin))->AddVertex(intpt); Handle(IntPatch_ALine)::DownCast (lin)->AddVertex(intpt);
} }
else { else {
(*((Handle(IntPatch_GLine)*)&lin))->AddVertex(intpt); Handle(IntPatch_GLine)::DownCast (lin)->AddVertex(intpt);
} }
Done(k) = 1; Done(k) = 1;
} }
@ -891,10 +891,10 @@ Standard_Boolean PointOnSecondDom (const IntPatch_SequenceOfPathPointOfTheSOnBou
jj = jj+1; jj = jj+1;
} }
if (TheType == IntPatch_Analytic) { if (TheType == IntPatch_Analytic) {
nbvtx = (*((Handle(IntPatch_ALine)*)&lin))->NbVertex(); nbvtx = Handle(IntPatch_ALine)::DownCast (lin)->NbVertex();
} }
else { else {
nbvtx = (*((Handle(IntPatch_GLine)*)&lin))->NbVertex(); nbvtx = Handle(IntPatch_GLine)::DownCast (lin)->NbVertex();
} }
} }
return Retvalue; return Retvalue;
@ -934,18 +934,18 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
typarc = lin->ArcType(); typarc = lin->ArcType();
if (typarc == IntPatch_Analytic) { if (typarc == IntPatch_Analytic) {
Standard_Boolean foo; Standard_Boolean foo;
lower = (*((Handle(IntPatch_ALine)*)&lin))->FirstParameter(foo); lower = Handle(IntPatch_ALine)::DownCast (lin)->FirstParameter(foo);
upper = (*((Handle(IntPatch_ALine)*)&lin))->LastParameter(foo); upper = Handle(IntPatch_ALine)::DownCast (lin)->LastParameter(foo);
} }
else { else {
if ((*((Handle(IntPatch_GLine)*)&lin))->HasFirstPoint()) { if (Handle(IntPatch_GLine)::DownCast (lin)->HasFirstPoint()) {
lower = (*((Handle(IntPatch_GLine)*)&lin))->FirstPoint().ParameterOnLine(); lower = Handle(IntPatch_GLine)::DownCast (lin)->FirstPoint().ParameterOnLine();
} }
else { else {
lower = RealFirst(); lower = RealFirst();
} }
if ((*((Handle(IntPatch_GLine)*)&lin))->HasLastPoint()) { if (Handle(IntPatch_GLine)::DownCast (lin)->HasLastPoint()) {
upper = (*((Handle(IntPatch_GLine)*)&lin))->LastPoint().ParameterOnLine(); upper = Handle(IntPatch_GLine)::DownCast (lin)->LastPoint().ParameterOnLine();
} }
else { else {
upper = RealLast(); upper = RealLast();
@ -955,9 +955,9 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
switch (typarc) { switch (typarc) {
case IntPatch_Lin : 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) { 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); dist = Psurf.Distance(pt);
if (dist< distmin) { if (dist< distmin) {
distmin = dist; distmin = dist;
@ -969,11 +969,11 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
break; break;
case IntPatch_Circle : 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) || 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) ||
(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); dist = Psurf.Distance(pt);
if (dist< distmin) { if (dist< distmin) {
distmin = dist; distmin = dist;
@ -985,11 +985,11 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
break; break;
case IntPatch_Ellipse : 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) || 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) ||
(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); dist = Psurf.Distance(pt);
if (dist< distmin) { if (dist< distmin) {
distmin = dist; distmin = dist;
@ -1003,9 +1003,9 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
{ {
#if 0 #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) { 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); dist = Psurf.Distance(pt);
if (dist< distmin) { if (dist< distmin) {
distmin = dist; 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 //-- 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. ) //-- 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. ... //-- 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); para = ElCLib::Parameter(Parab,Psurf);
if (para <= upper && para >= lower) { if (para <= upper && para >= lower) {
Standard_Integer amelioration=0; Standard_Integer amelioration=0;
@ -1059,9 +1059,9 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
break; break;
case IntPatch_Hyperbola : 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) { 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); dist = Psurf.Distance(pt);
if (dist< distmin) { if (dist< distmin) {
distmin = dist; distmin = dist;
@ -1074,7 +1074,7 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
case IntPatch_Analytic : 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); Standard_Boolean ok = alin->FindParameter(Psurf,para);
if (ok) { if (ok) {
pt = alin->Value(para); pt = alin->Value(para);
@ -1238,28 +1238,28 @@ Standard_Boolean SingleLine (const gp_Pnt& Psurf,
switch (typarc) { switch (typarc) {
case IntPatch_Lin : case IntPatch_Lin :
parproj = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Line(),Psurf); parproj = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Line(),Psurf);
ElCLib::D1(parproj,(*((Handle(IntPatch_GLine)*)&lin))->Line(),ptproj,tgint); ElCLib::D1(parproj,Handle(IntPatch_GLine)::DownCast (lin)->Line(),ptproj,tgint);
break; break;
case IntPatch_Circle : case IntPatch_Circle :
parproj = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Circle(),Psurf); parproj = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Circle(),Psurf);
ElCLib::D1(parproj,(*((Handle(IntPatch_GLine)*)&lin))->Circle(),ptproj,tgint); ElCLib::D1(parproj,Handle(IntPatch_GLine)::DownCast (lin)->Circle(),ptproj,tgint);
break; break;
case IntPatch_Ellipse : case IntPatch_Ellipse :
parproj = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Ellipse(),Psurf); parproj = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Ellipse(),Psurf);
ElCLib::D1(parproj,(*((Handle(IntPatch_GLine)*)&lin))->Ellipse(),ptproj,tgint); ElCLib::D1(parproj,Handle(IntPatch_GLine)::DownCast (lin)->Ellipse(),ptproj,tgint);
break; break;
case IntPatch_Parabola : case IntPatch_Parabola :
parproj = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Parabola(),Psurf); parproj = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Parabola(),Psurf);
ElCLib::D1(parproj,(*((Handle(IntPatch_GLine)*)&lin))->Parabola(),ptproj,tgint); ElCLib::D1(parproj,Handle(IntPatch_GLine)::DownCast (lin)->Parabola(),ptproj,tgint);
break; break;
case IntPatch_Hyperbola : case IntPatch_Hyperbola :
parproj = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Hyperbola(),Psurf); parproj = ElCLib::Parameter(Handle(IntPatch_GLine)::DownCast (lin)->Hyperbola(),Psurf);
ElCLib::D1(parproj,(*((Handle(IntPatch_GLine)*)&lin))->Hyperbola(),ptproj,tgint); ElCLib::D1(parproj,Handle(IntPatch_GLine)::DownCast (lin)->Hyperbola(),ptproj,tgint);
break; break;
case IntPatch_Analytic : 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); Standard_Boolean ok = alin->FindParameter(Psurf,parproj);
if (ok) { if (ok) {
gp_Pnt ptbid; gp_Pnt ptbid;
@ -1460,36 +1460,36 @@ void ProcessSegments (const IntPatch_SequenceOfSegmentOfTheSOnBounds& listedg,
const Handle(IntPatch_Line)& slinj = slin(j); const Handle(IntPatch_Line)& slinj = slin(j);
typ = slinj->ArcType(); typ = slinj->ArcType();
if (typ == IntPatch_Analytic) { if (typ == IntPatch_Analytic) {
Nbpts = (*((Handle(IntPatch_ALine)*)&slinj))->NbVertex(); Nbpts = Handle(IntPatch_ALine)::DownCast (slinj)->NbVertex();
} }
else if (typ == IntPatch_Restriction) { else if (typ == IntPatch_Restriction) {
Nbpts = (*((Handle(IntPatch_RLine)*)&slinj))->NbVertex(); Nbpts = Handle(IntPatch_RLine)::DownCast (slinj)->NbVertex();
} }
else { else {
Nbpts = (*((Handle(IntPatch_GLine)*)&slinj))->NbVertex(); Nbpts = Handle(IntPatch_GLine)::DownCast (slinj)->NbVertex();
} }
for (k=1; k<=Nbpts;k++) { for (k=1; k<=Nbpts;k++) {
if (typ == IntPatch_Analytic) { if (typ == IntPatch_Analytic) {
ptvtx = (*((Handle(IntPatch_ALine)*)&slinj))->Vertex(k); ptvtx = Handle(IntPatch_ALine)::DownCast (slinj)->Vertex(k);
} }
else if (typ == IntPatch_Restriction) { else if (typ == IntPatch_Restriction) {
ptvtx = (*((Handle(IntPatch_RLine)*)&slinj))->Vertex(k); ptvtx = Handle(IntPatch_RLine)::DownCast (slinj)->Vertex(k);
} }
else { else {
ptvtx = (*((Handle(IntPatch_GLine)*)&slinj))->Vertex(k); ptvtx = Handle(IntPatch_GLine)::DownCast (slinj)->Vertex(k);
} }
if (EdgeDegenere==Standard_False && dofirst) { if (EdgeDegenere==Standard_False && dofirst) {
if (ptvtx.Value().Distance(PStartf.Value()) <=TolArc) { if (ptvtx.Value().Distance(PStartf.Value()) <=TolArc) {
ptvtx.SetMultiple(Standard_True); ptvtx.SetMultiple(Standard_True);
if (typ == IntPatch_Analytic) { if (typ == IntPatch_Analytic) {
(*((Handle(IntPatch_ALine)*)&slinj))->Replace(k,ptvtx); Handle(IntPatch_ALine)::DownCast (slinj)->Replace(k,ptvtx);
} }
else if (typ == IntPatch_Restriction) { else if (typ == IntPatch_Restriction) {
(*((Handle(IntPatch_RLine)*)&slinj))->Replace(k,ptvtx); Handle(IntPatch_RLine)::DownCast (slinj)->Replace(k,ptvtx);
} }
else { else {
(*((Handle(IntPatch_GLine)*)&slinj))->Replace(k,ptvtx); Handle(IntPatch_GLine)::DownCast (slinj)->Replace(k,ptvtx);
} }
newptvtx = ptvtx; newptvtx = ptvtx;
newptvtx.SetParameter(paramf); newptvtx.SetParameter(paramf);
@ -1547,13 +1547,13 @@ void ProcessSegments (const IntPatch_SequenceOfSegmentOfTheSOnBounds& listedg,
if (ptvtx.Value().Distance(PStartl.Value()) <=TolArc) { if (ptvtx.Value().Distance(PStartl.Value()) <=TolArc) {
ptvtx.SetMultiple(Standard_True); ptvtx.SetMultiple(Standard_True);
if (typ == IntPatch_Analytic) { if (typ == IntPatch_Analytic) {
(*((Handle(IntPatch_ALine)*)&slinj))->Replace(k,ptvtx); Handle(IntPatch_ALine)::DownCast (slinj)->Replace(k,ptvtx);
} }
else if (typ == IntPatch_Restriction) { else if (typ == IntPatch_Restriction) {
(*((Handle(IntPatch_RLine)*)&slinj))->Replace(k,ptvtx); Handle(IntPatch_RLine)::DownCast (slinj)->Replace(k,ptvtx);
} }
else { else {
(*((Handle(IntPatch_GLine)*)&slinj))->Replace(k,ptvtx); Handle(IntPatch_GLine)::DownCast (slinj)->Replace(k,ptvtx);
} }
newptvtx = ptvtx; newptvtx = ptvtx;
@ -1858,27 +1858,27 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
Nbpt = seq_Pnt3d.Length(); // important que ce soit ici Nbpt = seq_Pnt3d.Length(); // important que ce soit ici
typ2 = slinj->ArcType(); typ2 = slinj->ArcType();
if (typ2 != IntPatch_Restriction) { if (typ2 != IntPatch_Restriction) {
//-- arcref = (*((Handle(IntPatch_RLine)*)&slini))->Arc(); //-- arcref = Handle(IntPatch_RLine)::DownCast (slini)->Arc();
//-- OnFirst = (*((Handle(IntPatch_RLine)*)&slini))->IsOnFirstSurface(); //-- OnFirst = Handle(IntPatch_RLine)::DownCast (slini)->IsOnFirstSurface();
//-- DES CHOSES A FAIRE ICI //-- DES CHOSES A FAIRE ICI
if((*((Handle(IntPatch_RLine)*)&slini))->IsArcOnS1()) { if(Handle(IntPatch_RLine)::DownCast (slini)->IsArcOnS1()) {
OnFirst=Standard_True; OnFirst=Standard_True;
arcref= (*((Handle(IntPatch_RLine)*)&slini))->ArcOnS1(); arcref= Handle(IntPatch_RLine)::DownCast (slini)->ArcOnS1();
} }
else if((*((Handle(IntPatch_RLine)*)&slini))->IsArcOnS2()) { else if(Handle(IntPatch_RLine)::DownCast (slini)->IsArcOnS2()) {
arcref= (*((Handle(IntPatch_RLine)*)&slini))->ArcOnS2(); arcref= Handle(IntPatch_RLine)::DownCast (slini)->ArcOnS2();
OnFirst=Standard_False; OnFirst=Standard_False;
} }
if ((*((Handle(IntPatch_RLine)*)&slini))->HasFirstPoint()) { if (Handle(IntPatch_RLine)::DownCast (slini)->HasFirstPoint()) {
paramf = (*((Handle(IntPatch_RLine)*)&slini))->FirstPoint().ParameterOnLine(); paramf = Handle(IntPatch_RLine)::DownCast (slini)->FirstPoint().ParameterOnLine();
} }
else { else {
// cout << "Pas de param debut sur rst solution" << endl; // cout << "Pas de param debut sur rst solution" << endl;
paramf = RealFirst(); paramf = RealFirst();
} }
if ((*((Handle(IntPatch_RLine)*)&slini))->HasLastPoint()) { if (Handle(IntPatch_RLine)::DownCast (slini)->HasLastPoint()) {
paraml = (*((Handle(IntPatch_RLine)*)&slini))->LastPoint().ParameterOnLine(); paraml = Handle(IntPatch_RLine)::DownCast (slini)->LastPoint().ParameterOnLine();
} }
else { else {
// cout << "Pas de param debut sur rst solution" << endl; // cout << "Pas de param debut sur rst solution" << endl;
@ -1886,10 +1886,10 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
} }
if (typ2 == IntPatch_Analytic) { if (typ2 == IntPatch_Analytic) {
Nbvtx = (*((Handle(IntPatch_ALine)*)&slinj))->NbVertex(); Nbvtx = Handle(IntPatch_ALine)::DownCast (slinj)->NbVertex();
} }
else { 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++) { for (k=1; EdgeDegenere==Standard_False && k<=Nbvtx; k++) {
if (typ2 == IntPatch_Analytic) { if (typ2 == IntPatch_Analytic) {
Ptvtx = (*((Handle(IntPatch_ALine)*)&slinj))->Vertex(k); Ptvtx = Handle(IntPatch_ALine)::DownCast (slinj)->Vertex(k);
} }
else { else {
Ptvtx = (*((Handle(IntPatch_GLine)*)&slinj))->Vertex(k); Ptvtx = Handle(IntPatch_GLine)::DownCast (slinj)->Vertex(k);
} }
if ((OnFirst && !Ptvtx.IsOnDomS1()) || if ((OnFirst && !Ptvtx.IsOnDomS1()) ||
(!OnFirst && !Ptvtx.IsOnDomS2())) { (!OnFirst && !Ptvtx.IsOnDomS2())) {
@ -1960,15 +1960,15 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
for (int ri=1; ri<=Nblin; ri++) { for (int ri=1; ri<=Nblin; ri++) {
const Handle(IntPatch_Line)& slinri = slin(ri); const Handle(IntPatch_Line)& slinri = slin(ri);
if (slinri->ArcType() == IntPatch_Restriction) { if (slinri->ArcType() == IntPatch_Restriction) {
if(OnFirst && (*((Handle(IntPatch_RLine)*)&slinri))->IsArcOnS1()) { if(OnFirst && Handle(IntPatch_RLine)::DownCast (slinri)->IsArcOnS1()) {
if(arcref == (*((Handle(IntPatch_RLine)*)&slinri))->ArcOnS1()) { if(arcref == Handle(IntPatch_RLine)::DownCast (slinri)->ArcOnS1()) {
(*((Handle(IntPatch_RLine)*)&slinri))->AddVertex(newptvtx); Handle(IntPatch_RLine)::DownCast (slinri)->AddVertex(newptvtx);
//printf("\n ImpImpIntersection_0.gxx CAS1 \n"); //printf("\n ImpImpIntersection_0.gxx CAS1 \n");
} }
} }
else if(OnFirst==Standard_False && (*((Handle(IntPatch_RLine)*)&slinri))->IsArcOnS2()) { else if(OnFirst==Standard_False && Handle(IntPatch_RLine)::DownCast (slinri)->IsArcOnS2()) {
if(arcref == (*((Handle(IntPatch_RLine)*)&slinri))->ArcOnS2()) { if(arcref == Handle(IntPatch_RLine)::DownCast (slinri)->ArcOnS2()) {
(*((Handle(IntPatch_RLine)*)&slinri))->AddVertex(newptvtx); Handle(IntPatch_RLine)::DownCast (slinri)->AddVertex(newptvtx);
//printf("\n ImpImpIntersection_0.gxx CAS2 \n"); //printf("\n ImpImpIntersection_0.gxx CAS2 \n");
} }
} }
@ -1988,10 +1988,10 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
newptvtx.SetMultiple(Standard_True); newptvtx.SetMultiple(Standard_True);
if (typ2 == IntPatch_Analytic) { if (typ2 == IntPatch_Analytic) {
(*((Handle(IntPatch_ALine)*)&slinj))->Replace(k,Ptvtx); Handle(IntPatch_ALine)::DownCast (slinj)->Replace(k,Ptvtx);
} }
else { else {
(*((Handle(IntPatch_GLine)*)&slinj))->Replace(k,Ptvtx); Handle(IntPatch_GLine)::DownCast (slinj)->Replace(k,Ptvtx);
} }
if (Ptvtx.IsOnDomS1() || Ptvtx.IsOnDomS2()) { if (Ptvtx.IsOnDomS1() || Ptvtx.IsOnDomS2()) {
@ -2039,7 +2039,7 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
} }
} //-- if (Ptvtx.IsOnDomS1() || Ptvtx.IsOnDomS2()) } //-- if (Ptvtx.IsOnDomS1() || Ptvtx.IsOnDomS2())
(*((Handle(IntPatch_RLine)*)&slini))->AddVertex(newptvtx); Handle(IntPatch_RLine)::DownCast (slini)->AddVertex(newptvtx);
} //-- if (keeppoint) } //-- if (keeppoint)
} //-- if ((OnFirst && !Ptvtx.IsOnDomS1())||(!OnFirst && !Ptvtx.IsOnDomS2())) } //-- if ((OnFirst && !Ptvtx.IsOnDomS1())||(!OnFirst && !Ptvtx.IsOnDomS2()))

View File

@ -2893,8 +2893,7 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
{ {
for(Standard_Integer aNbLin = 1; aNbLin <= theSlin.Length(); aNbLin++) for(Standard_Integer aNbLin = 1; aNbLin <= theSlin.Length(); aNbLin++)
{ {
const Handle(IntPatch_WLine)& aWLine1 = Handle(IntPatch_WLine) aWLine1 (Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNbLin)));
Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNbLin));
const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1); const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1);
const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aWLine1->NbPnts()); const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aWLine1->NbPnts());

View File

@ -966,7 +966,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
for (Standard_Integer j=1; j<=Nblines-1; j++) { for (Standard_Integer j=1; j<=Nblines-1; j++) {
dofirst = dolast = Standard_False; dofirst = dolast = Standard_False;
const Handle(IntPatch_Line)& slinj = slin(j); 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()) { if (wlin1->HasFirstPoint()) {
ptdeb = wlin1->FirstPoint(indfirst); ptdeb = wlin1->FirstPoint(indfirst);
if (ptdeb.IsTangencyPoint()) { if (ptdeb.IsTangencyPoint()) {
@ -983,7 +983,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
if (dofirst || dolast) { if (dofirst || dolast) {
for (Standard_Integer k=j+1; k<=Nblines;k++) { for (Standard_Integer k=j+1; k<=Nblines;k++) {
const Handle(IntPatch_Line)& slink = slin(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()) { if (wlin2->HasFirstPoint()) {
ptbis = wlin2->FirstPoint(ind2); ptbis = wlin2->FirstPoint(ind2);
if (ptbis.IsTangencyPoint()) { if (ptbis.IsTangencyPoint()) {
@ -1281,27 +1281,27 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
const Handle(IntPatch_Line)& slinj = slin(j); const Handle(IntPatch_Line)& slinj = slin(j);
typ = slinj->ArcType(); typ = slinj->ArcType();
if (typ == IntPatch_Walking) { if (typ == IntPatch_Walking) {
Nbpts = (*((Handle(IntPatch_WLine)*)&slinj))->NbVertex(); Nbpts = Handle(IntPatch_WLine)::DownCast (slinj)->NbVertex();
} }
else { else {
Nbpts = (*((Handle(IntPatch_RLine)*)&slinj))->NbVertex(); Nbpts = Handle(IntPatch_RLine)::DownCast (slinj)->NbVertex();
} }
for (Standard_Integer k=1; k<=Nbpts;k++) { for (Standard_Integer k=1; k<=Nbpts;k++) {
if (typ == IntPatch_Walking) { if (typ == IntPatch_Walking) {
ptdeb = (*((Handle(IntPatch_WLine)*)&slinj))->Vertex(k); ptdeb = Handle(IntPatch_WLine)::DownCast (slinj)->Vertex(k);
} }
else { else {
ptdeb = (*((Handle(IntPatch_RLine)*)&slinj))->Vertex(k); ptdeb = Handle(IntPatch_RLine)::DownCast (slinj)->Vertex(k);
} }
if (dofirst) { if (dofirst) {
if (ptdeb.Value().Distance(PStartf.Value()) <=TolArc) { if (ptdeb.Value().Distance(PStartf.Value()) <=TolArc) {
ptdeb.SetMultiple(Standard_True); ptdeb.SetMultiple(Standard_True);
if (typ == IntPatch_Walking) { if (typ == IntPatch_Walking) {
(*((Handle(IntPatch_WLine)*)&slinj))->Replace(k,ptdeb); Handle(IntPatch_WLine)::DownCast (slinj)->Replace(k,ptdeb);
} }
else { else {
(*((Handle(IntPatch_RLine)*)&slinj))->Replace(k,ptdeb); Handle(IntPatch_RLine)::DownCast (slinj)->Replace(k,ptdeb);
} }
ptdeb.SetParameter(paramf); ptdeb.SetParameter(paramf);
rline->AddVertex(ptdeb); rline->AddVertex(ptdeb);
@ -1314,19 +1314,19 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
if (dolast) { if (dolast) {
if(dofirst) { //-- on recharge le ptdeb if(dofirst) { //-- on recharge le ptdeb
if (typ == IntPatch_Walking) { if (typ == IntPatch_Walking) {
ptdeb = (*((Handle(IntPatch_WLine)*)&slinj))->Vertex(k); ptdeb = Handle(IntPatch_WLine)::DownCast (slinj)->Vertex(k);
} }
else { else {
ptdeb = (*((Handle(IntPatch_RLine)*)&slinj))->Vertex(k); ptdeb = Handle(IntPatch_RLine)::DownCast (slinj)->Vertex(k);
} }
} }
if (ptdeb.Value().Distance(PStartl.Value()) <=TolArc) { if (ptdeb.Value().Distance(PStartl.Value()) <=TolArc) {
ptdeb.SetMultiple(Standard_True); ptdeb.SetMultiple(Standard_True);
if (typ == IntPatch_Walking) { if (typ == IntPatch_Walking) {
(*((Handle(IntPatch_WLine)*)&slinj))->Replace(k,ptdeb); Handle(IntPatch_WLine)::DownCast (slinj)->Replace(k,ptdeb);
} }
else { else {
(*((Handle(IntPatch_RLine)*)&slinj))->Replace(k,ptdeb); Handle(IntPatch_RLine)::DownCast (slinj)->Replace(k,ptdeb);
} }
ptdeb.SetParameter(paraml); ptdeb.SetParameter(paraml);
rline->AddVertex(ptdeb); rline->AddVertex(ptdeb);
@ -2244,7 +2244,7 @@ static void PutIntVertices(Handle(IntPatch_Line)& Line,
if(nbp < 3) if(nbp < 3)
return; return;
Handle(IntPatch_WLine)& WLine = (*((Handle(IntPatch_WLine)*)&Line)); Handle(IntPatch_WLine)& WLine = Handle(IntPatch_WLine)::DownCast (Line);
Standard_Integer ip = 0, iv = 0; Standard_Integer ip = 0, iv = 0;
gp_Pnt aPnt; gp_Pnt aPnt;
IntPatch_Point thePnt; IntPatch_Point thePnt;
@ -2388,7 +2388,7 @@ static Standard_Boolean DecomposeResult(const Handle(IntPatch_Line)& theLine,
return Standard_False; 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(); const Handle(IntSurf_LineOn2S)& aSLine = aWLine->Curve();
if(aSLine->NbPoints() <= 2) if(aSLine->NbPoints() <= 2)

View File

@ -104,7 +104,7 @@ static void JoinWLines(IntPatch_SequenceOfLine& theSlin,
for(Standard_Integer aNumOfLine1 = 1; aNumOfLine1 <= theSlin.Length(); aNumOfLine1++) 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()) if(aWLine1.IsNull())
{//We must have failed to join not-point-lines {//We must have failed to join not-point-lines
@ -130,7 +130,7 @@ static void JoinWLines(IntPatch_SequenceOfLine& theSlin,
Standard_Boolean hasBeenRemoved = Standard_False; Standard_Boolean hasBeenRemoved = Standard_False;
for(Standard_Integer aNumOfLine2 = aNumOfLine1 + 1; aNumOfLine2 <= theSlin.Length(); aNumOfLine2++) 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 aNbPntsWL1 = aWLine1->NbPnts();
const Standard_Integer aNbPntsWL2 = aWLine2->NbPnts(); const Standard_Integer aNbPntsWL2 = aWLine2->NbPnts();
@ -518,7 +518,7 @@ static void FUN_GetUiso(const Handle(Geom_Surface)& GS,
} }
else//OffsetSurface 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(); const Handle(Geom_Surface) bs = gos->BasisSurface();
Handle(Geom_Curve) gcbs = bs->UIso(U); Handle(Geom_Curve) gcbs = bs->UIso(U);
GeomAdaptor_Curve gac(gcbs); GeomAdaptor_Curve gac(gcbs);
@ -588,7 +588,7 @@ static void FUN_GetViso(const Handle(Geom_Surface)& GS,
} }
else//OffsetSurface 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(); const Handle(Geom_Surface) bs = gos->BasisSurface();
Handle(Geom_Curve) gcbs = bs->VIso(V); Handle(Geom_Curve) gcbs = bs->VIso(V);
GeomAdaptor_Curve gac(gcbs); GeomAdaptor_Curve gac(gcbs);
@ -663,7 +663,7 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1,
else if(!S1->IsVPeriodic() && !S1->IsVClosed()) { else if(!S1->IsVPeriodic() && !S1->IsVClosed()) {
if(T1 != GeomAbs_OffsetSurface) C1 = gs1->UIso(MS1[0]); if(T1 != GeomAbs_OffsetSurface) C1 = gs1->UIso(MS1[0]);
else { 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(); const Handle(Geom_Surface) bs = gos->BasisSurface();
C1 = bs->UIso(MS1[0]); 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(!S1->IsUPeriodic() && !S1->IsUClosed()) {
if(T1 != GeomAbs_OffsetSurface) C1 = gs1->VIso(MS1[1]); if(T1 != GeomAbs_OffsetSurface) C1 = gs1->VIso(MS1[1]);
else { 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(); const Handle(Geom_Surface) bs = gos->BasisSurface();
C1 = bs->VIso(MS1[1]); 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()) { else if(!S2->IsVPeriodic() && !S2->IsVClosed()) {
if(T2 != GeomAbs_OffsetSurface) C2 = gs2->UIso(MS2[0]); if(T2 != GeomAbs_OffsetSurface) C2 = gs2->UIso(MS2[0]);
else { 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(); const Handle(Geom_Surface) bs = gos->BasisSurface();
C2 = bs->UIso(MS2[0]); 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(!S2->IsUPeriodic() && !S2->IsUClosed()) {
if(T2 != GeomAbs_OffsetSurface) C2 = gs2->VIso(MS2[1]); if(T2 != GeomAbs_OffsetSurface) C2 = gs2->VIso(MS2[1]);
else { 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(); const Handle(Geom_Surface) bs = gos->BasisSurface();
C2 = bs->VIso(MS2[1]); 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); GeomProjLib::ProjectOnPlane(C2,GPln,gp_Dir(DV),Standard_True);
if(C1Prj.IsNull() || C2Prj.IsNull()) return; if(C1Prj.IsNull() || C2Prj.IsNull()) return;
Handle(Geom2d_Curve) C1Prj2d = Handle(Geom2d_Curve) C1Prj2d =
GeomProjLib::Curve2d(C1Prj,*(Handle(Geom_Surface) *)&GPln); GeomProjLib::Curve2d(C1Prj,Handle(Geom_Surface)::DownCast (GPln));
Handle(Geom2d_Curve) C2Prj2d = 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); Geom2dAPI_InterCurveCurve ICC(C1Prj2d,C2Prj2d,1.0e-7);
if(ICC.NbPoints() > 0 ) 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); } if(T1 != GeomAbs_OffsetSurface){ visoS1 = gs1->VIso(VM1); uisoS1 = gs1->UIso(UM1); }
else 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(); const Handle(Geom_Surface) bs = gos->BasisSurface();
visoS1 = bs->VIso(VM1); uisoS1 = bs->UIso(UM1); visoS1 = bs->VIso(VM1); uisoS1 = bs->UIso(UM1);
} }
if(T2 != GeomAbs_OffsetSurface){ visoS2 = gs2->VIso(VM2); uisoS2 = gs2->UIso(UM2); } if(T2 != GeomAbs_OffsetSurface){ visoS2 = gs2->VIso(VM2); uisoS2 = gs2->UIso(UM2); }
else 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(); const Handle(Geom_Surface) bs = gos->BasisSurface();
visoS2 = bs->VIso(VM2); uisoS2 = bs->UIso(UM2); 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)); gp_Lin lin(sop.Value(ip),gp_Dir(v));
Handle(IntPatch_GLine) gl = new IntPatch_GLine(lin,Standard_False); 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; done = Standard_True;
@ -1635,7 +1635,7 @@ void IntPatch_Intersection::
{ {
gp_Lin lin(sop.Value(ip),gp_Dir(v)); gp_Lin lin(sop.Value(ip),gp_Dir(v));
Handle(IntPatch_GLine) gl = new IntPatch_GLine(lin,Standard_False); 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; done = Standard_True;
@ -1901,7 +1901,7 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
else if(IType == IntPatch_Restriction) { else if(IType == IntPatch_Restriction) {
nbr++; nbr++;
Handle(IntPatch_RLine)& rlin = Handle(IntPatch_RLine)& rlin =
*((Handle(IntPatch_RLine) *)&line); Handle(IntPatch_RLine)::DownCast (line);
if(rlin->IsArcOnS1()) nbr1++; if(rlin->IsArcOnS1()) nbr1++;
if(rlin->IsArcOnS2()) nbr2++; if(rlin->IsArcOnS2()) nbr2++;
} }
@ -1938,7 +1938,7 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
const Handle(IntPatch_Line)& LineK = LineConstructor.Line(k); const Handle(IntPatch_Line)& LineK = LineConstructor.Line(k);
if (LineK->ArcType() == IntPatch_Analytic) { if (LineK->ArcType() == IntPatch_Analytic) {
Handle(IntPatch_ALine)& alin = Handle(IntPatch_ALine)& alin =
*((Handle(IntPatch_ALine) *)&LineK); Handle(IntPatch_ALine)::DownCast (LineK);
nbvtx=alin->NbVertex(); nbvtx=alin->NbVertex();
nbva+=nbvtx; nba++; nbva+=nbvtx; nba++;
for(v=1;v<=nbvtx;v++) { for(v=1;v<=nbvtx;v++) {
@ -1947,7 +1947,7 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
} }
else if (LineK->ArcType() == IntPatch_Restriction) { else if (LineK->ArcType() == IntPatch_Restriction) {
Handle(IntPatch_RLine)& rlin = Handle(IntPatch_RLine)& rlin =
*((Handle(IntPatch_RLine) *)&LineK); Handle(IntPatch_RLine)::DownCast (LineK);
nbvtx=rlin->NbVertex(); nbvtx=rlin->NbVertex();
nbvr+=nbvtx; nbr++; nbvr+=nbvtx; nbr++;
for(v=1;v<=nbvtx;v++) { for(v=1;v<=nbvtx;v++) {
@ -1956,7 +1956,7 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
} }
else if (LineK->ArcType() == IntPatch_Walking) { else if (LineK->ArcType() == IntPatch_Walking) {
Handle(IntPatch_WLine)& wlin = Handle(IntPatch_WLine)& wlin =
*((Handle(IntPatch_WLine) *)&LineK); Handle(IntPatch_WLine)::DownCast (LineK);
nbvtx=wlin->NbVertex(); nbvtx=wlin->NbVertex();
nbvw+=nbvtx; nbw++; nbvw+=nbvtx; nbw++;
for(v=1;v<=nbvtx;v++) { for(v=1;v<=nbvtx;v++) {
@ -1965,7 +1965,7 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
} }
else { else {
Handle(IntPatch_GLine)& glin = Handle(IntPatch_GLine)& glin =
*((Handle(IntPatch_GLine) *)&LineK); Handle(IntPatch_GLine)::DownCast (LineK);
nbvtx=glin->NbVertex(); nbvtx=glin->NbVertex();
nbvg+=nbvtx; nbg++; nbvg+=nbvtx; nbg++;
for(v=1;v<=nbvtx;v++) { for(v=1;v<=nbvtx;v++) {

View File

@ -199,7 +199,7 @@ static Standard_Real LocalFirstParameter (const Handle(IntPatch_Line)& L)
switch (typl) { switch (typl) {
case IntPatch_Analytic: case IntPatch_Analytic:
{ {
Handle(IntPatch_ALine)& alin = *((Handle(IntPatch_ALine) *)&L); Handle(IntPatch_ALine)& alin = Handle(IntPatch_ALine)::DownCast (L);
if (alin->HasFirstPoint()) { if (alin->HasFirstPoint()) {
firstp = alin->FirstPoint().ParameterOnLine(); firstp = alin->FirstPoint().ParameterOnLine();
} }
@ -215,7 +215,7 @@ static Standard_Real LocalFirstParameter (const Handle(IntPatch_Line)& L)
case IntPatch_Restriction: case IntPatch_Restriction:
{ {
Handle(IntPatch_RLine)& rlin = *((Handle(IntPatch_RLine) *)&L); Handle(IntPatch_RLine)& rlin = Handle(IntPatch_RLine)::DownCast (L);
if (rlin->HasFirstPoint()) { if (rlin->HasFirstPoint()) {
firstp = rlin->FirstPoint().ParameterOnLine(); firstp = rlin->FirstPoint().ParameterOnLine();
} }
@ -227,7 +227,7 @@ static Standard_Real LocalFirstParameter (const Handle(IntPatch_Line)& L)
case IntPatch_Walking: case IntPatch_Walking:
{ {
Handle(IntPatch_WLine)& wlin = *((Handle(IntPatch_WLine) *) &L); Handle(IntPatch_WLine)& wlin = Handle(IntPatch_WLine)::DownCast (L);
if (wlin->HasFirstPoint()) { if (wlin->HasFirstPoint()) {
firstp = wlin->FirstPoint().ParameterOnLine(); firstp = wlin->FirstPoint().ParameterOnLine();
} }
@ -239,7 +239,7 @@ static Standard_Real LocalFirstParameter (const Handle(IntPatch_Line)& L)
default: default:
{ {
Handle(IntPatch_GLine)& glin = *((Handle(IntPatch_GLine) *)&L); Handle(IntPatch_GLine)& glin = Handle(IntPatch_GLine)::DownCast (L);
if (glin->HasFirstPoint()) { if (glin->HasFirstPoint()) {
firstp = glin->FirstPoint().ParameterOnLine(); firstp = glin->FirstPoint().ParameterOnLine();
} }
@ -278,7 +278,7 @@ static Standard_Real LocalLastParameter (const Handle(IntPatch_Line)& L)
switch (typl) { switch (typl) {
case IntPatch_Analytic: case IntPatch_Analytic:
{ {
Handle(IntPatch_ALine)& alin = *((Handle(IntPatch_ALine) *)&L); Handle(IntPatch_ALine)& alin = Handle(IntPatch_ALine)::DownCast (L);
if (alin->HasLastPoint()) { if (alin->HasLastPoint()) {
lastp = alin->LastPoint().ParameterOnLine(); lastp = alin->LastPoint().ParameterOnLine();
@ -295,7 +295,7 @@ static Standard_Real LocalLastParameter (const Handle(IntPatch_Line)& L)
case IntPatch_Restriction: case IntPatch_Restriction:
{ {
Handle(IntPatch_RLine)& rlin = *((Handle(IntPatch_RLine) *)&L); Handle(IntPatch_RLine)& rlin = Handle(IntPatch_RLine)::DownCast (L);
if (rlin->HasLastPoint()) { if (rlin->HasLastPoint()) {
lastp = rlin->LastPoint().ParameterOnLine(); lastp = rlin->LastPoint().ParameterOnLine();
@ -307,7 +307,7 @@ static Standard_Real LocalLastParameter (const Handle(IntPatch_Line)& L)
} }
case IntPatch_Walking: case IntPatch_Walking:
{ {
Handle(IntPatch_WLine)& wlin = *((Handle(IntPatch_WLine) *)&L); Handle(IntPatch_WLine)& wlin = Handle(IntPatch_WLine)::DownCast (L);
if (wlin->HasLastPoint()) { if (wlin->HasLastPoint()) {
lastp = wlin->LastPoint().ParameterOnLine(); lastp = wlin->LastPoint().ParameterOnLine();
@ -320,7 +320,7 @@ static Standard_Real LocalLastParameter (const Handle(IntPatch_Line)& L)
default: default:
{ {
Handle(IntPatch_GLine)& glin = *((Handle(IntPatch_GLine) *)&L); Handle(IntPatch_GLine)& glin = Handle(IntPatch_GLine)::DownCast (L);
if (glin->HasLastPoint()) { if (glin->HasLastPoint()) {
lastp = glin->LastPoint().ParameterOnLine(); lastp = glin->LastPoint().ParameterOnLine();
@ -562,7 +562,7 @@ static void AddLine(const Handle(IntPatch_Line)& L,
IntPatch_IType typl = L->ArcType(); IntPatch_IType typl = L->ArcType();
switch (typl) { switch (typl) {
case IntPatch_Analytic: { case IntPatch_Analytic: {
Handle(IntPatch_ALine)& ALine = *((Handle(IntPatch_ALine) *)&L); Handle(IntPatch_ALine)& ALine = Handle(IntPatch_ALine)::DownCast (L);
Handle(IntPatch_ALine) alig; Handle(IntPatch_ALine) alig;
if(L->TransitionOnS1() == IntSurf_Undecided) if(L->TransitionOnS1() == IntSurf_Undecided)
alig = new IntPatch_ALine(ALine->Curve(),L->IsTangent()); alig = new IntPatch_ALine(ALine->Curve(),L->IsTangent());
@ -582,7 +582,7 @@ static void AddLine(const Handle(IntPatch_Line)& L,
break; break;
} }
case IntPatch_Walking: { //-- **************************************** 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(); const Handle(IntSurf_LineOn2S)& Lori = WLine->Curve();
Handle(IntSurf_LineOn2S) LineOn2S = new IntSurf_LineOn2S(); Handle(IntSurf_LineOn2S) LineOn2S = new IntSurf_LineOn2S();
Standard_Integer ParamMinOnLine = (Standard_Integer) WLine->Vertex(i).ParameterOnLine(); Standard_Integer ParamMinOnLine = (Standard_Integer) WLine->Vertex(i).ParameterOnLine();
@ -623,7 +623,7 @@ static void AddLine(const Handle(IntPatch_Line)& L,
break; break;
} }
case IntPatch_Restriction: { case IntPatch_Restriction: {
Handle(IntPatch_RLine)& RLine = *((Handle(IntPatch_RLine) *)&L); Handle(IntPatch_RLine)& RLine = Handle(IntPatch_RLine)::DownCast (L);
IndexLastVertex=2; IndexLastVertex=2;
IndexFirstVertex=1; IndexFirstVertex=1;
Handle(IntPatch_RLine) rlig; Handle(IntPatch_RLine) rlig;
@ -661,7 +661,7 @@ static void AddLine(const Handle(IntPatch_Line)& L,
case IntPatch_Hyperbola: case IntPatch_Hyperbola:
case IntPatch_Circle: case IntPatch_Circle:
case IntPatch_Ellipse: { case IntPatch_Ellipse: {
Handle(IntPatch_GLine)& GLine = *((Handle(IntPatch_GLine) *)&L); Handle(IntPatch_GLine)& GLine = Handle(IntPatch_GLine)::DownCast (L);
Handle(IntPatch_GLine) glig; Handle(IntPatch_GLine) glig;
switch (typl) { switch (typl) {
case IntPatch_Lin: case IntPatch_Lin:
@ -1195,7 +1195,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref,
if(typl == IntPatch_Analytic) { if(typl == IntPatch_Analytic) {
Standard_Real u1,v1,u2,v2; Standard_Real u1,v1,u2,v2;
Handle(IntPatch_ALine)& ALine Handle(IntPatch_ALine)& ALine
= *((Handle(IntPatch_ALine) *)&L); = Handle(IntPatch_ALine)::DownCast (L);
slin.Clear(); slin.Clear();
nbvtx = ALine->NbVertex(); nbvtx = ALine->NbVertex();
//-- ------------------------------------------------------------------- //-- -------------------------------------------------------------------
@ -1248,7 +1248,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref,
else if(typl == IntPatch_Walking) { else if(typl == IntPatch_Walking) {
Standard_Real u1,v1,u2,v2; Standard_Real u1,v1,u2,v2;
Handle(IntPatch_WLine)& WLine Handle(IntPatch_WLine)& WLine
= *((Handle(IntPatch_WLine) *)&L); = Handle(IntPatch_WLine)::DownCast (L);
slin.Clear(); slin.Clear();
nbvtx = WLine->NbVertex(); nbvtx = WLine->NbVertex();
//-- ------------------------------------------------------------------- //-- -------------------------------------------------------------------
@ -1408,7 +1408,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref,
else if (typl != IntPatch_Restriction) { // JAG 01.07.96 else if (typl != IntPatch_Restriction) { // JAG 01.07.96
Standard_Real u1,v1,u2,v2; Standard_Real u1,v1,u2,v2;
Handle(IntPatch_GLine)& GLine Handle(IntPatch_GLine)& GLine
= *((Handle(IntPatch_GLine) *)&L); = Handle(IntPatch_GLine)::DownCast (L);
slin.Clear(); slin.Clear();
nbvtx = GLine->NbVertex(); nbvtx = GLine->NbVertex();
//-- ------------------------------------------------------------------- //-- -------------------------------------------------------------------
@ -1540,7 +1540,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref,
} }
else { //-- Restriction else { //-- Restriction
Handle(IntPatch_RLine)& RLine Handle(IntPatch_RLine)& RLine
= *((Handle(IntPatch_RLine) *)&L); = Handle(IntPatch_RLine)::DownCast (L);
slin.Clear(); slin.Clear();
Standard_Integer NbVtx = RLine->NbVertex(); Standard_Integer NbVtx = RLine->NbVertex();
Standard_Boolean RestOnS1 = RLine->IsArcOnS1(); Standard_Boolean RestOnS1 = RLine->IsArcOnS1();

View File

@ -1621,7 +1621,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
IntPatch_IType aType = aSLine->ArcType(); IntPatch_IType aType = aSLine->ArcType();
if( aType != IntPatch_Walking) if( aType != IntPatch_Walking)
continue; 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 tnbV = aWLine->NbVertex();
Standard_Integer tiV; Standard_Integer tiV;
for( tiV = 1; tiV <= tnbV; tiV++ ) { for( tiV = 1; tiV <= tnbV; tiV++ ) {
@ -1645,7 +1645,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
if( VDMin != 0 ) { if( VDMin != 0 ) {
const Handle(IntPatch_Line)& aSLine = SLin.Value(WLDMin); 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 tiVpar = (Standard_Integer)aWLine->Vertex(VDMin).ParameterOnLine();
Standard_Integer ciVpar = (Standard_Integer)wline->Vertex(ciV).ParameterOnLine(); Standard_Integer ciVpar = (Standard_Integer)wline->Vertex(ciV).ParameterOnLine();
Standard_Real u11 = 0., u12 = 0., v11 = 0., v12 = 0.; 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(); IntPatch_IType aType = aSLine->ArcType();
if( aType != IntPatch_Walking) if( aType != IntPatch_Walking)
continue; 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 tnbV = aWLine->NbVertex();
Standard_Integer tiV; Standard_Integer tiV;
for( tiV = 1; tiV <= tnbV; tiV++ ) for( tiV = 1; tiV <= tnbV; tiV++ )
@ -2469,7 +2469,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
if( VDMin != 0 ) if( VDMin != 0 )
{ {
const Handle(IntPatch_Line)& aSLine = SLin.Value(WLDMin); 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 tiVpar = (Standard_Integer)aWLine->Vertex(VDMin).ParameterOnLine();
Standard_Integer ciVpar = (Standard_Integer)wline->Vertex(ciV).ParameterOnLine(); Standard_Integer ciVpar = (Standard_Integer)wline->Vertex(ciV).ParameterOnLine();
Standard_Real u11 = 0., u12 = 0., v11 = 0., v12 = 0.; Standard_Real u11 = 0., u12 = 0., v11 = 0., v12 = 0.;

View 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 // Dans le cas d une ligne de cheminement, il faudrait voir la projection
// et le calcul de la tangente. // et le calcul de la tangente.
const Handle(IntPatch_RLine)& rlin = (*((Handle(IntPatch_RLine)*)&L)); //-- aucune verification n est Handle(IntPatch_RLine) rlin (Handle(IntPatch_RLine)::DownCast (L)); //-- aucune verification n est
const Handle(IntPatch_WLine)& wlin = (*((Handle(IntPatch_WLine)*)&L)); //-- faite au cast. Handle(IntPatch_WLine) wlin (Handle(IntPatch_WLine)::DownCast (L)); //-- faite au cast.
gp_Pnt ptbid; gp_Pnt ptbid;
gp_Vec d1u,d1v; gp_Vec d1u,d1v;
gp_Pnt2d p2d; gp_Pnt2d p2d;
@ -462,8 +462,8 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
Standard_Integer i,j,k; Standard_Integer i,j,k;
TColgp_SequenceOfPnt locpt; TColgp_SequenceOfPnt locpt;
TColgp_SequenceOfPnt2d locpt2; TColgp_SequenceOfPnt2d locpt2;
const Handle(IntPatch_RLine)& rlin = (*((Handle(IntPatch_RLine)*)&L)); //-- aucune verification n est Handle(IntPatch_RLine) rlin (Handle(IntPatch_RLine)::DownCast (L)); //-- aucune verification n est
const Handle(IntPatch_WLine)& wlin = (*((Handle(IntPatch_WLine)*)&L)); //-- faite au cast. Handle(IntPatch_WLine) wlin (Handle(IntPatch_WLine)::DownCast (L)); //-- faite au cast.
Standard_Integer Nbvtx =0; Standard_Integer Nbvtx =0;
Standard_Integer Nbptlin =0; Standard_Integer Nbptlin =0;
Standard_Real tolPLin = Surf->UResolution(Precision::Confusion()); Standard_Real tolPLin = Surf->UResolution(Precision::Confusion());

View File

@ -1303,10 +1303,10 @@ Standard_Real ResolutionCoeff(const BRepAdaptor_Curve& theBAC,
// //
switch (aCurveType) { switch (aCurveType) {
case GeomAbs_Circle : case GeomAbs_Circle :
aResCoeff = 1. / (2 * (*((Handle(Geom_Circle)*)&aCurve))->Circ().Radius()); aResCoeff = 1. / (2 * Handle(Geom_Circle)::DownCast (aCurve)->Circ().Radius());
break; break;
case GeomAbs_Ellipse : case GeomAbs_Ellipse :
aResCoeff = 1. / (*((Handle(Geom_Ellipse)*)&aCurve))->MajorRadius(); aResCoeff = 1. / Handle(Geom_Ellipse)::DownCast (aCurve)->MajorRadius();
break; break;
case GeomAbs_Hyperbola : case GeomAbs_Hyperbola :
case GeomAbs_Parabola : case GeomAbs_Parabola :
@ -1365,10 +1365,10 @@ Standard_Real Resolution(const Handle(Geom_Curve)& theCurve,
break; break;
} }
case GeomAbs_BezierCurve: case GeomAbs_BezierCurve:
(*((Handle(Geom_BezierCurve)*)&theCurve))->Resolution(theR3D, aRes); Handle(Geom_BezierCurve)::DownCast (theCurve)->Resolution(theR3D, aRes);
break; break;
case GeomAbs_BSplineCurve: case GeomAbs_BSplineCurve:
(*((Handle(Geom_BSplineCurve)*)&theCurve))->Resolution(theR3D, aRes); Handle(Geom_BSplineCurve)::DownCast (theCurve)->Resolution(theR3D, aRes);
break; break;
default: default:
aRes = theResCoeff * theR3D; aRes = theResCoeff * theR3D;

View File

@ -963,8 +963,7 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
// //
const IntTools_Curve& aIC=mySeqOfCurve(1); const IntTools_Curve& aIC=mySeqOfCurve(1);
const Handle(Geom_Curve)& aC3D=aIC.Curve(); const Handle(Geom_Curve)& aC3D=aIC.Curve();
const Handle(Geom_BSplineCurve)& aBS= Handle(Geom_BSplineCurve) aBS (Handle(Geom_BSplineCurve)::DownCast(aC3D));
Handle(Geom_BSplineCurve)::DownCast(aC3D);
if (aBS.IsNull()) { if (aBS.IsNull()) {
return; return;
} }
@ -1061,8 +1060,7 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
if(typl==IntPatch_Walking) { if(typl==IntPatch_Walking) {
Handle(IntPatch_Line) anewL; Handle(IntPatch_Line) anewL;
// //
const Handle(IntPatch_WLine)& aWLine= Handle(IntPatch_WLine) aWLine (Handle(IntPatch_WLine)::DownCast(L));
Handle(IntPatch_WLine)::DownCast(L);
//DumpWLine(aWLine); //DumpWLine(aWLine);
anewL = ComputePurgedWLine(aWLine); anewL = ComputePurgedWLine(aWLine);
@ -1071,7 +1069,7 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
} }
L = anewL; L = anewL;
//const Handle(IntPatch_WLine)& aWLineX = Handle(IntPatch_WLine)::DownCast(L); //Handle(IntPatch_WLine) aWLineX (Handle(IntPatch_WLine)::DownCast(L));
//DumpWLine(aWLineX); //DumpWLine(aWLineX);
// //

View File

@ -61,11 +61,11 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
Cf = BRep_Tool::Curve(edgf,Loc,ff,lf); Cf = BRep_Tool::Curve(edgf,Loc,ff,lf);
if (!Loc.IsIdentity()) { if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GGf = Cf->Transformed(Loc.Transformation()); Handle(Geom_Geometry) GGf = Cf->Transformed(Loc.Transformation());
Cf = *((Handle(Geom_Curve)*)&GGf); Cf = Handle(Geom_Curve)::DownCast (GGf);
} }
Tf = Cf->DynamicType(); Tf = Cf->DynamicType();
if (Tf == STANDARD_TYPE(Geom_TrimmedCurve)) { if (Tf == STANDARD_TYPE(Geom_TrimmedCurve)) {
Cf = (*((Handle(Geom_TrimmedCurve)*)&Cf))->BasisCurve(); Cf = Handle(Geom_TrimmedCurve)::DownCast (Cf)->BasisCurve();
Tf = Cf->DynamicType(); Tf = Cf->DynamicType();
} }
if (Tf != STANDARD_TYPE(Geom_Line) && Tf != STANDARD_TYPE(Geom_Circle) && 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); Ct = BRep_Tool::Curve(edgt,Loc,ft,lt);
if (!Loc.IsIdentity()) { if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GGt = Ct->Transformed(Loc.Transformation()); Handle(Geom_Geometry) GGt = Ct->Transformed(Loc.Transformation());
Ct = *((Handle(Geom_Curve)*)&GGt); Ct = Handle(Geom_Curve)::DownCast (GGt);
} }
Tt = Ct->DynamicType(); Tt = Ct->DynamicType();
if (Tt == STANDARD_TYPE(Geom_TrimmedCurve)) { if (Tt == STANDARD_TYPE(Geom_TrimmedCurve)) {
Ct = (*((Handle(Geom_TrimmedCurve)*)&Ct))->BasisCurve(); Ct = Handle(Geom_TrimmedCurve)::DownCast (Ct)->BasisCurve();
Tt = Ct->DynamicType(); Tt = Ct->DynamicType();
} }
if (Tt != Tf) { if (Tt != Tf) {
@ -91,8 +91,8 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
// On a presomption de confusion // On a presomption de confusion
Standard_Real Tol = Precision::Confusion(); Standard_Real Tol = Precision::Confusion();
if (Tt == STANDARD_TYPE(Geom_Line)) { if (Tt == STANDARD_TYPE(Geom_Line)) {
gp_Lin lif = (*((Handle(Geom_Line)*)&Cf))->Lin(); gp_Lin lif = Handle(Geom_Line)::DownCast (Cf)->Lin();
gp_Lin lit = (*((Handle(Geom_Line)*)&Ct))->Lin(); gp_Lin lit = Handle(Geom_Line)::DownCast (Ct)->Lin();
gp_Pnt p1 = ElCLib::Value(ff,lif); gp_Pnt p1 = ElCLib::Value(ff,lif);
gp_Pnt p2 = ElCLib::Value(lf,lif); gp_Pnt p2 = ElCLib::Value(lf,lif);
Standard_Real prm1 = ElCLib::Parameter(lit,p1); 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)) { else if (Tt == STANDARD_TYPE(Geom_Circle)) {
gp_Circ cif = (*((Handle(Geom_Circle)*)&Cf))->Circ(); gp_Circ cif = Handle(Geom_Circle)::DownCast (Cf)->Circ();
gp_Circ cit = (*((Handle(Geom_Circle)*)&Ct))->Circ(); gp_Circ cit = Handle(Geom_Circle)::DownCast (Ct)->Circ();
if (Abs(cif.Radius()-cit.Radius()) <= Tol && if (Abs(cif.Radius()-cit.Radius()) <= Tol &&
cif.Location().SquareDistance(cit.Location()) <= Tol*Tol) { cif.Location().SquareDistance(cit.Location()) <= Tol*Tol) {
// Point debut, calage dans periode, et detection meme sens // 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)) { else if (Tt == STANDARD_TYPE(Geom_Ellipse)) {
gp_Elips cif = (*((Handle(Geom_Ellipse)*)&Cf))->Elips(); gp_Elips cif = Handle(Geom_Ellipse)::DownCast (Cf)->Elips();
gp_Elips cit = (*((Handle(Geom_Ellipse)*)&Ct))->Elips(); gp_Elips cit = Handle(Geom_Ellipse)::DownCast (Ct)->Elips();
if (Abs(cif.MajorRadius()-cit.MajorRadius()) <= Tol && 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)) { else if (Tt == STANDARD_TYPE(Geom_BSplineCurve)) {
Handle(Geom_BSplineCurve) Bf = *((Handle(Geom_BSplineCurve)*)&Cf); Handle(Geom_BSplineCurve) Bf = Handle(Geom_BSplineCurve)::DownCast (Cf);
Handle(Geom_BSplineCurve) Bt = *((Handle(Geom_BSplineCurve)*)&Ct); Handle(Geom_BSplineCurve) Bt = Handle(Geom_BSplineCurve)::DownCast (Ct);
Standard_Boolean IsSame = Standard_True; Standard_Boolean IsSame = Standard_True;
@ -299,8 +299,8 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom,
} }
} }
else if (Tt == STANDARD_TYPE(Geom_BezierCurve)) { else if (Tt == STANDARD_TYPE(Geom_BezierCurve)) {
Handle(Geom_BezierCurve) Bf = *((Handle(Geom_BezierCurve)*)&Cf); Handle(Geom_BezierCurve) Bf = Handle(Geom_BezierCurve)::DownCast (Cf);
Handle(Geom_BezierCurve) Bt = *((Handle(Geom_BezierCurve)*)&Ct); Handle(Geom_BezierCurve) Bt = Handle(Geom_BezierCurve)::DownCast (Ct);
Standard_Boolean IsSame = Standard_True; Standard_Boolean IsSame = Standard_True;

View File

@ -472,7 +472,7 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G)
newface.Orientation(TopAbs_FORWARD); newface.Orientation(TopAbs_FORWARD);
S = BRep_Tool::Surface(fac); S = BRep_Tool::Surface(fac);
if (S->DynamicType()== STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { 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); P = Handle(Geom_Plane)::DownCast(S);
TopoDS_Wire wir; TopoDS_Wire wir;
@ -548,10 +548,10 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G)
C = BRep_Tool::Curve(edg,loc,f,l); C = BRep_Tool::Curve(edg,loc,f,l);
if (!loc.IsIdentity()) { if (!loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(loc.Transformation()); 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)) { 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); 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); C = BRep_Tool::Curve(newedg,loc,f,l);
if (!loc.IsIdentity()) { if (!loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(loc.Transformation()); 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)) { 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 if (P.IsNull()) { // on met les courbes 2d si on n`est pas
// sur un plan // sur un plan
@ -707,10 +707,10 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G)
C = BRep_Tool::Curve(edgbis,loc,f,l); C = BRep_Tool::Curve(edgbis,loc,f,l);
if (!loc.IsIdentity()) { if (!loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(loc.Transformation()); 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)) { if (C->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) {
C = (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve(); C = Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve();
} }
prmvt = prmvt =
BRep_Tool::Parameter(TopoDS::Vertex(it1.Value()),edgbis); 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); C = BRep_Tool::Curve(edg,loc,f,l);
if (!loc.IsIdentity()) { if (!loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(loc.Transformation()); 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)) { 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); C2d = GeomProjLib::Curve2d(C,f,l,S,tol);
@ -1074,12 +1074,12 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
typS2 = S2->DynamicType(); typS2 = S2->DynamicType();
if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S1 = (*((Handle(Geom_RectangularTrimmedSurface)*)&S1))->BasisSurface(); S1 = Handle(Geom_RectangularTrimmedSurface)::DownCast (S1)->BasisSurface();
typS1 = S1->DynamicType(); typS1 = S1->DynamicType();
} }
if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S2 = (*((Handle(Geom_RectangularTrimmedSurface)*)&S2))->BasisSurface(); S2 = Handle(Geom_RectangularTrimmedSurface)::DownCast (S2)->BasisSurface();
typS2 = S2->DynamicType(); typS2 = S2->DynamicType();
} }
@ -1091,8 +1091,8 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
Standard_Boolean ValRet = Standard_False; Standard_Boolean ValRet = Standard_False;
if (typS1 == STANDARD_TYPE(Geom_Plane)) { if (typS1 == STANDARD_TYPE(Geom_Plane)) {
gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln()); gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln());
gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln()); gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln());
pl1.Transform(loc1.Transformation()); pl1.Transform(loc1.Transformation());
pl2.Transform(loc2.Transformation()); pl2.Transform(loc2.Transformation());
@ -1129,24 +1129,24 @@ Standard_Boolean ToFuse(const TopoDS_Edge& E1,
C1 = BRep_Tool::Curve(E1,loc1,f,l); C1 = BRep_Tool::Curve(E1,loc1,f,l);
if (!loc1.IsIdentity()) { if (!loc1.IsIdentity()) {
Handle(Geom_Geometry) CC1 = C1->Transformed(loc1.Transformation()); 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); C2 = BRep_Tool::Curve(E2,loc2,f,l);
if (!loc2.IsIdentity()) { if (!loc2.IsIdentity()) {
Handle(Geom_Geometry) CC2 = C2->Transformed(loc2.Transformation()); Handle(Geom_Geometry) CC2 = C2->Transformed(loc2.Transformation());
C2 = *((Handle(Geom_Curve)*)&CC2); C2 = Handle(Geom_Curve)::DownCast (CC2);
} }
typC1 = C1->DynamicType(); typC1 = C1->DynamicType();
typC2 = C2->DynamicType(); typC2 = C2->DynamicType();
if (typC1 == STANDARD_TYPE(Geom_TrimmedCurve)) { if (typC1 == STANDARD_TYPE(Geom_TrimmedCurve)) {
C1 = (*((Handle(Geom_TrimmedCurve)*)&C1))->BasisCurve(); C1 = Handle(Geom_TrimmedCurve)::DownCast (C1)->BasisCurve();
typC1 = C1->DynamicType(); typC1 = C1->DynamicType();
} }
if (typC2 == STANDARD_TYPE(Geom_TrimmedCurve)) { if (typC2 == STANDARD_TYPE(Geom_TrimmedCurve)) {
C2 = (*((Handle(Geom_TrimmedCurve)*)&C2))->BasisCurve(); C2 = Handle(Geom_TrimmedCurve)::DownCast (C2)->BasisCurve();
typC2 = C2->DynamicType(); typC2 = C2->DynamicType();
} }
@ -1156,8 +1156,8 @@ Standard_Boolean ToFuse(const TopoDS_Edge& E1,
Standard_Boolean ValRet = Standard_False; Standard_Boolean ValRet = Standard_False;
if (typC1 == STANDARD_TYPE(Geom_Line)) { if (typC1 == STANDARD_TYPE(Geom_Line)) {
gp_Lin li1( (*((Handle(Geom_Line)*)&C1))->Lin()); gp_Lin li1( Handle(Geom_Line)::DownCast (C1)->Lin());
gp_Lin li2( (*((Handle(Geom_Line)*)&C2))->Lin()); gp_Lin li2( Handle(Geom_Line)::DownCast (C2)->Lin());
if (li1.Position().IsCoaxial(li2.Position(),tolang,tollin)) { if (li1.Position().IsCoaxial(li2.Position(),tolang,tollin)) {
ValRet = Standard_True; ValRet = Standard_True;
@ -1216,20 +1216,20 @@ Standard_Real NewParameter(const TopoDS_Edge& Edg,
C = BRep_Tool::Curve(Edg,loc,f,l); C = BRep_Tool::Curve(Edg,loc,f,l);
if (!loc.IsIdentity()) { if (!loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(loc.Transformation()); Handle(Geom_Geometry) GG = C->Transformed(loc.Transformation());
C = *((Handle(Geom_Curve)*)&GG); C = Handle(Geom_Curve)::DownCast (GG);
} }
typC = C->DynamicType(); typC = C->DynamicType();
if (typC == STANDARD_TYPE(Geom_TrimmedCurve)) { if (typC == STANDARD_TYPE(Geom_TrimmedCurve)) {
C = (*((Handle(Geom_TrimmedCurve)*)&C))->BasisCurve(); C = Handle(Geom_TrimmedCurve)::DownCast (C)->BasisCurve();
typC = C->DynamicType(); typC = C->DynamicType();
} }
if (typC == STANDARD_TYPE(Geom_Line)) { 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)) { else if (typC == STANDARD_TYPE(Geom_Circle)) {
Standard_Real prm = ElCLib::Parameter 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 // Vtx vient d`une exploration de Edg orientee FORWARD
TopAbs_Orientation orient = TopAbs::Reverse(Vtx.Orientation()); TopAbs_Orientation orient = TopAbs::Reverse(Vtx.Orientation());

View File

@ -602,7 +602,7 @@ static void Select(const TopoDS_Edge& Ebase,
if (!Loc.IsIdentity()) { if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation()); 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.)); 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); C = BRep_Tool::Curve(edg,Loc,f,l);
if (!Loc.IsIdentity()) { if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation()); 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); proj.Init(Pt,C,f,l);
if (proj.NbPoints() > 0) { if (proj.NbPoints() > 0) {

View File

@ -541,7 +541,7 @@ Standard_Real Project(const TopoDS_Vertex& V,
C = BRep_Tool::Curve(theEdge,Loc,f,l); C = BRep_Tool::Curve(theEdge,Loc,f,l);
if (!Loc.IsIdentity()) { if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation()); 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); proj.Init(toproj,C,f,l);
@ -570,7 +570,7 @@ Standard_Real Project(const TopoDS_Vertex&,
/* /*
if (!Loc.IsIdentity()) { if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation()); 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); 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); Handle(Geom_Curve) C = BRep_Tool::Curve(Edg,Loc,f,l);
if (!Loc.IsIdentity()) { if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation()); 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)) { 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); C = BRep_Tool::Curve(Efrom,Loc,f,l);
if (!Loc.IsIdentity()) { if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation()); 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)) { 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); C = BRep_Tool::Curve(Efrom,Loc,f,l);
if (!Loc.IsIdentity()) { if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation()); Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
C = *((Handle(Geom_Curve)*)&GG); C = Handle(Geom_Curve)::DownCast (GG);
} }
gp_Pnt pt; gp_Pnt pt;
@ -1019,7 +1019,7 @@ void PutPCurves(const TopoDS_Edge& Efrom,
C = BRep_Tool::Curve(Eto,Loc,f,l); C = BRep_Tool::Curve(Eto,Loc,f,l);
if (!Loc.IsIdentity()) { if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation()); Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
C = *((Handle(Geom_Curve)*)&GG); C = Handle(Geom_Curve)::DownCast (GG);
} }
C->D1(prmproj,pt,d1t); C->D1(prmproj,pt,d1t);
@ -1038,7 +1038,7 @@ void PutPCurves(const TopoDS_Edge& Efrom,
C = BRep_Tool::Curve(Efrom,Loc,f,l); C = BRep_Tool::Curve(Efrom,Loc,f,l);
if (!Loc.IsIdentity()) { if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation()); 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)) { if (C->DynamicType() != STANDARD_TYPE(Geom_TrimmedCurve)) {

View File

@ -71,7 +71,7 @@ Handle(Storage_Schema) PCDM::Schema(const TCollection_ExtendedString& aSchemaNam
Standard_NoSuchObject::Raise(aMsg); Standard_NoSuchObject::Raise(aMsg);
} }
Handle(Standard_Transient) t = Plugin::Load(UTL::GUID(UTL::Value(r,aSchemaName))); Handle(Standard_Transient) t = Plugin::Load(UTL::GUID(UTL::Value(r,aSchemaName)));
return *((Handle(Storage_Schema)*)&t); return Handle(Storage_Schema)::DownCast (t);
} }

View File

@ -173,7 +173,7 @@ void PCDM_RetrievalDriver::Read(const TCollection_ExtendedString& theFileName,
Standard_Failure::Raise(aMsg); Standard_Failure::Raise(aMsg);
} }
Handle(Standard_Persistent) theObject=theDocument->Object(); Handle(Standard_Persistent) theObject=theDocument->Object();
Handle(PCDM_Document) thePDocument = *((Handle(PCDM_Document)*)&theObject); Handle(PCDM_Document) thePDocument = Handle(PCDM_Document)::DownCast (theObject);
{ {

View File

@ -146,7 +146,7 @@ Standard_Boolean Prs3d_ShapeTool::IsPlanarFace() const
if (TheType == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { if (TheType == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
Handle(Geom_RectangularTrimmedSurface) Handle(Geom_RectangularTrimmedSurface)
RTS = *((Handle(Geom_RectangularTrimmedSurface)*)&S); RTS = Handle(Geom_RectangularTrimmedSurface)::DownCast (S);
TheType = RTS->BasisSurface()->DynamicType(); TheType = RTS->BasisSurface()->DynamicType();
} }
return (TheType == STANDARD_TYPE(Geom_Plane)); return (TheType == STANDARD_TYPE(Geom_Plane));

View File

@ -307,7 +307,7 @@ void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)&
const Handle(Graphic3d_Structure)& theStructToFill) const Handle(Graphic3d_Structure)& theStructToFill)
{ {
theStructToFill->Clear(); 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); myPresentableObject->Compute (Projector (theProjector), aPrs);
} }
@ -356,7 +356,7 @@ void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)&
const Handle(Graphic3d_Structure)& theStructToFill) const Handle(Graphic3d_Structure)& theStructToFill)
{ {
// recompute HLR after transformation in all the case // 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(); theStructToFill->Clear();
myPresentableObject->Compute (Projector (theProjector), theTrsf, aPrs); 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) 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_Dir aDir = aCamera->Direction().Reversed();
const gp_Pnt anAt = aCamera->Center(); const gp_Pnt anAt = aCamera->Center();
const gp_Dir anUp = aCamera->Up(); const gp_Dir anUp = aCamera->Up();

View File

@ -325,7 +325,7 @@ static Standard_Integer OCC10bug (Draw_Interpretor& di, Standard_Integer argc, c
// un AIS_PlaneTrihedron // un AIS_PlaneTrihedron
if (aShape->Type()==AIS_KOI_Datum && aShape->Signature()==4) { if (aShape->Type()==AIS_KOI_Datum && aShape->Signature()==4) {
// On downcast aShape de AIS_InteractiveObject a AIS_PlaneTrihedron // On downcast aShape de AIS_InteractiveObject a AIS_PlaneTrihedron
theAISPlaneTri = *(Handle(AIS_PlaneTrihedron)*) &aShape; theAISPlaneTri = Handle(AIS_PlaneTrihedron)::DownCast (aShape);
theAISPlaneTri->SetLength(Length); theAISPlaneTri->SetLength(Length);

View File

@ -290,7 +290,7 @@ static Standard_Integer OCC218bug (Draw_Interpretor& di, Standard_Integer argc,
// un AIS_PlaneTrihedron // un AIS_PlaneTrihedron
if (aShape->Type()==AIS_KOI_Datum && aShape->Signature()==4) { if (aShape->Type()==AIS_KOI_Datum && aShape->Signature()==4) {
// On downcast aShape de AIS_InteractiveObject a AIS_PlaneTrihedron // On downcast aShape de AIS_InteractiveObject a AIS_PlaneTrihedron
theAISPlaneTri = *(Handle(AIS_PlaneTrihedron)*) &aShape; theAISPlaneTri = Handle(AIS_PlaneTrihedron)::DownCast (aShape);
theAISPlaneTri->SetXLabel(Xlabel); theAISPlaneTri->SetXLabel(Xlabel);
theAISPlaneTri->SetYLabel(Ylabel); theAISPlaneTri->SetYLabel(Ylabel);

View File

@ -18,7 +18,7 @@
#include <Interface_Macros.hxx> #include <Interface_Macros.hxx>
//#define DeclareAndCast(atype,result,start) \ NON car Name //#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_GeneralLib.hxx>
#include <Interface_Category.hxx> #include <Interface_Category.hxx>

View File

@ -25,7 +25,7 @@
#define DeclareAndCast(atype,result,start) \ #define DeclareAndCast(atype,result,start) \
Handle(atype) result = *((Handle(atype)*) &start) Handle(atype) result = Handle(atype)::DownCast (start)
#include <StepBasic_Address.hxx> #include <StepBasic_Address.hxx>
#include <StepShape_AdvancedBrepShapeRepresentation.hxx> #include <StepShape_AdvancedBrepShapeRepresentation.hxx>

View File

@ -491,7 +491,7 @@ Standard_Boolean SelectMgr_SelectionManager::IsActivated (const Handle(SelectMgr
{ {
for (TColStd_MapIteratorOfMapOfTransient aSelectorIter (mySelectors); aSelectorIter.More(); aSelectorIter.Next()) 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) if (aSelector->Status (aSelection) == SelectMgr_SOS_Activated)
return Standard_True; return Standard_True;
} }
@ -692,7 +692,7 @@ void SelectMgr_SelectionManager::RecomputeSelection (const Handle(SelectMgr_Sele
for (TColStd_MapIteratorOfMapOfTransient aSelectorIter (mySelectors); aSelectorIter.More(); aSelectorIter.Next()) 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) if (aCurSelector->Status (aSelection) == SelectMgr_SOS_Activated)
{ {
ClearSelectionStructures (theObject, aSelMode, aCurSelector); 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()) 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); Update (theObject, aSelector, Standard_False);
} }
} }

View File

@ -106,8 +106,7 @@ Standard_Real SelectMgr_SensitiveEntitySet::Center (const Standard_Integer theIn
{ {
const Handle(SelectBasics_SensitiveEntity)& aBasicEntity = const Handle(SelectBasics_SensitiveEntity)& aBasicEntity =
GetSensitiveById (theIndex)->BaseSensitive(); GetSensitiveById (theIndex)->BaseSensitive();
const Handle(Select3D_SensitiveEntity)& aSensitive = Handle(Select3D_SensitiveEntity) aSensitive (Handle(Select3D_SensitiveEntity)::DownCast (aBasicEntity));
Handle(Select3D_SensitiveEntity)::DownCast (aBasicEntity);
const gp_Pnt aCenter = aSensitive->CenterOfGeometry(); const gp_Pnt aCenter = aSensitive->CenterOfGeometry();
Standard_Real aCenterCoord = 0.0; Standard_Real aCenterCoord = 0.0;
aCenterCoord = theAxis == 0 ? aCenter.X() : aCenterCoord = theAxis == 0 ? aCenter.X() :

View File

@ -264,8 +264,7 @@ void SelectMgr_ViewerSelector::checkOverlap (const Handle(SelectBasics_Sensitive
const Standard_Integer theEntityIdx, const Standard_Integer theEntityIdx,
SelectMgr_SelectingVolumeManager& theMgr) SelectMgr_SelectingVolumeManager& theMgr)
{ {
const Handle(SelectMgr_EntityOwner)& anOwner = Handle(SelectMgr_EntityOwner) anOwner (Handle(SelectMgr_EntityOwner)::DownCast (theEntity->OwnerId()));
Handle(SelectMgr_EntityOwner)::DownCast (theEntity->OwnerId());
SelectBasics_PickResult aPickResult; SelectBasics_PickResult aPickResult;
if (theEntity->Matches (theMgr, aPickResult)) if (theEntity->Matches (theMgr, aPickResult))
@ -490,7 +489,7 @@ Handle(SelectMgr_EntityOwner) SelectMgr_ViewerSelector
{ {
Standard_Integer RankInMap = myIndexes->Value (myCurRank); Standard_Integer RankInMap = myIndexes->Value (myCurRank);
const Handle(SelectBasics_EntityOwner)& toto = mystored.FindKey(RankInMap); 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; return Ownr;
} }
@ -521,7 +520,7 @@ Handle(SelectMgr_EntityOwner) SelectMgr_ViewerSelector
if(More()){ if(More()){
Standard_Integer RankInMap = myIndexes->Value (myIndexes->Lower()); Standard_Integer RankInMap = myIndexes->Value (myIndexes->Lower());
const Handle(SelectBasics_EntityOwner)& toto = mystored.FindKey(RankInMap); 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; return Ownr;
} }

View File

@ -776,7 +776,7 @@ static void AppendControlPoles (TColgp_SequenceOfPnt& seq,
seq.Append(curve->Value(M_PI)); seq.Append(curve->Value(M_PI));
} else if ( curve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) { } else if ( curve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
//DeclareAndCast(Geom_TrimmedCurve, Trimmed, curve); //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()); // AppendControlPoles(seq,Trimmed->BasisCurve());
Handle(Geom_Curve) aBaseCrv = Trimmed->BasisCurve(); Handle(Geom_Curve) aBaseCrv = Trimmed->BasisCurve();
Standard_Boolean done = Standard_False; Standard_Boolean done = Standard_False;
@ -811,14 +811,14 @@ static void AppendControlPoles (TColgp_SequenceOfPnt& seq,
} }
} else if ( curve->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) { } else if ( curve->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) {
//DeclareAndCast(Geom_OffsetCurve, OffsetC, curve); //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()); // AppendControlPoles(seq,OffsetC->BasisCurve());
seq.Append(curve->Value(curve->FirstParameter())); seq.Append(curve->Value(curve->FirstParameter()));
seq.Append(curve->Value((curve->FirstParameter() + curve->LastParameter())/2.)); seq.Append(curve->Value((curve->FirstParameter() + curve->LastParameter())/2.));
seq.Append(curve->Value(curve->LastParameter())); seq.Append(curve->Value(curve->LastParameter()));
} else if ( curve->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) { } else if ( curve->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) {
//DeclareAndCast(Geom_BSplineCurve, BSpline, curve); //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()); TColgp_Array1OfPnt Poles(1,BSpline->NbPoles());
BSpline->Poles(Poles); BSpline->Poles(Poles);
for(Standard_Integer i = 1; i <= BSpline->NbPoles(); i++) 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))) { } else if ( curve->IsKind(STANDARD_TYPE(Geom_BezierCurve))) {
//DeclareAndCast(Geom_BezierCurve, Bezier, curve); //DeclareAndCast(Geom_BezierCurve, Bezier, curve);
//Handle(Geom_BezierCurve) Bezier = Handle(Geom_BezierCurve)::DownCast(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()); TColgp_Array1OfPnt Poles(1,Bezier->NbPoles());
Bezier->Poles(Poles); Bezier->Poles(Poles);
for(Standard_Integer i = 1; i <= Bezier->NbPoles(); i++) 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))) { if (curve->IsKind(STANDARD_TYPE(Geom_Line))) {
//DeclareAndCast(Geom_Line, Line, curve); //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(); gp_XYZ N1 = Line->Position().Direction().XYZ();
if (noNorm) { if (noNorm) {
Normal = GetAnyNormal(N1); Normal = GetAnyNormal(N1);
@ -926,7 +926,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsPlanar (const TColgp_Array1OfPnt& pnts,
if (curve->IsKind(STANDARD_TYPE(Geom_Conic))) { if (curve->IsKind(STANDARD_TYPE(Geom_Conic))) {
//DeclareAndCast(Geom_Conic, Conic, curve); //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(); gp_XYZ N1 = Conic->Axis().Direction().XYZ();
if (noNorm) { if (noNorm) {
Normal = N1; Normal = N1;
@ -938,19 +938,19 @@ Standard_Boolean ShapeAnalysis_Curve::IsPlanar (const TColgp_Array1OfPnt& pnts,
if (curve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) { if (curve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
//DeclareAndCast(Geom_TrimmedCurve, Trimmed, curve); //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); return IsPlanar(Trimmed->BasisCurve(),Normal,precision);
} }
if (curve->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) { if (curve->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) {
//DeclareAndCast(Geom_OffsetCurve, OffsetC, curve); //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); return IsPlanar(OffsetC->BasisCurve(),Normal,precision);
} }
if (curve->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) { if (curve->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) {
//DeclareAndCast(Geom_BSplineCurve, BSpline, curve); //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()); TColgp_Array1OfPnt Poles(1,BSpline->NbPoles());
BSpline->Poles(Poles); BSpline->Poles(Poles);
return IsPlanar(Poles,Normal,precision); 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))) { if (curve->IsKind(STANDARD_TYPE(Geom_BezierCurve))) {
//DeclareAndCast(Geom_BezierCurve, Bezier, curve); //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()); TColgp_Array1OfPnt Poles(1,Bezier->NbPoles());
Bezier->Poles(Poles); Bezier->Poles(Poles);
return IsPlanar(Poles,Normal,precision); 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))) { if (curve->IsKind(STANDARD_TYPE(ShapeExtend_ComplexCurve))) {
//DeclareAndCast(ShapeExtend_ComplexCurve, Complex, curve); //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; TColgp_SequenceOfPnt sequence;
Standard_Integer i; // svv Jan11 2000 : porting on DEC Standard_Integer i; // svv Jan11 2000 : porting on DEC
for (i = 1; i <= Complex->NbCurves(); i++) for (i = 1; i <= Complex->NbCurves(); i++)

View File

@ -81,7 +81,7 @@ void StdSelect_BRepSelectionTool::preBuildBVH (const Handle(SelectMgr_Selection)
if (aSensitive->IsInstance ("Select3D_SensitiveGroup")) 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(); const Select3D_EntitySequence& aSubEntities = aGroup->GetEntities();
for (Select3D_EntitySequenceIter aSubEntitiesIter (aSubEntities); aSubEntitiesIter.More(); aSubEntitiesIter.Next()) for (Select3D_EntitySequenceIter aSubEntitiesIter (aSubEntities); aSubEntitiesIter.More(); aSubEntitiesIter.Next())
{ {

View File

@ -64,7 +64,7 @@ Standard_Boolean StdSelect_EdgeFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
{ {
if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull()) return Standard_False; 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; if(sh.ShapeType()!= TopAbs_EDGE) return Standard_False;
switch(mytype){ switch(mytype){

View File

@ -51,7 +51,7 @@ Standard_Boolean StdSelect_FaceFilter::
IsOk(const Handle(SelectMgr_EntityOwner)& EO) const IsOk(const Handle(SelectMgr_EntityOwner)& EO) const
{ {
if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull()) return Standard_False; 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; if(anobj.ShapeType()!= TopAbs_FACE)return Standard_False;
switch(mytype) { switch(mytype) {
case StdSelect_AnyFace: case StdSelect_AnyFace:

View File

@ -517,16 +517,15 @@ void StdSelect_ViewerSelector3d::ComputeSensitivePrs (const Handle(SelectMgr_Sel
//========================================================== //==========================================================
else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveTriangulation)) else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveTriangulation))
{ {
const Handle(Poly_Triangulation)& PT = Handle(Poly_Triangulation) PT (Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->Triangulation());
(*((Handle(Select3D_SensitiveTriangulation)*) &Ent))->Triangulation();
const Poly_Array1OfTriangle& triangles = PT->Triangles(); const Poly_Array1OfTriangle& triangles = PT->Triangles();
const TColgp_Array1OfPnt& Nodes = PT->Nodes(); const TColgp_Array1OfPnt& Nodes = PT->Nodes();
Standard_Integer n[3]; Standard_Integer n[3];
TopLoc_Location iloc, bidloc; TopLoc_Location iloc, bidloc;
if ((*((Handle(Select3D_SensitiveTriangulation)*) &Ent))->HasInitLocation()) if (Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->HasInitLocation())
bidloc = (*((Handle(Select3D_SensitiveTriangulation)*) &Ent))->GetInitLocation(); bidloc = Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->GetInitLocation();
if (bidloc.IsIdentity()) if (bidloc.IsIdentity())
iloc = theLoc; iloc = theLoc;

View File

@ -49,16 +49,16 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve))) { if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve))) {
const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)
Bspli = Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC); Bspli = Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC);
return StepToGeom_MakeBSplineCurve::Convert(Bspli,*((Handle(Geom_BSplineCurve)*)&CC)); return StepToGeom_MakeBSplineCurve::Convert(Bspli,Handle(Geom_BSplineCurve)::DownCast (CC));
} }
if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnots))) { if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnots))) {
const Handle(StepGeom_BSplineCurveWithKnots) const Handle(StepGeom_BSplineCurveWithKnots)
Bspli = Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC); Bspli = Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC);
return StepToGeom_MakeBSplineCurve::Convert(Bspli,*((Handle(Geom_BSplineCurve)*)&CC)); return StepToGeom_MakeBSplineCurve::Convert(Bspli,Handle(Geom_BSplineCurve)::DownCast (CC));
} }
if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve))) { if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve))) {
const Handle(StepGeom_TrimmedCurve) L = Handle(StepGeom_TrimmedCurve)::DownCast(SC); const Handle(StepGeom_TrimmedCurve) L = Handle(StepGeom_TrimmedCurve)::DownCast(SC);
return StepToGeom_MakeTrimmedCurve::Convert(L,*((Handle(Geom_TrimmedCurve)*)&CC)); return StepToGeom_MakeTrimmedCurve::Convert(L,Handle(Geom_TrimmedCurve)::DownCast (CC));
} }
// STEP BezierCurve, UniformCurve and QuasiUniformCurve are transformed into // STEP BezierCurve, UniformCurve and QuasiUniformCurve are transformed into
// STEP BSplineCurve before being mapped onto CAS.CADE/SF // STEP BSplineCurve before being mapped onto CAS.CADE/SF
@ -82,7 +82,7 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
Knots->SetValue(2, 1.); Knots->SetValue(2, 1.);
BSPL->SetKnotMultiplicities(Kmult); BSPL->SetKnotMultiplicities(Kmult);
BSPL->SetKnots(Knots); BSPL->SetKnots(Knots);
return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC)); return StepToGeom_MakeBSplineCurve::Convert(BSPL,Handle(Geom_BSplineCurve)::DownCast (CC));
} }
if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurve))) { if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurve))) {
const Handle(StepGeom_UniformCurve) UC = Handle(StepGeom_UniformCurve)::DownCast(SC); const Handle(StepGeom_UniformCurve) UC = Handle(StepGeom_UniformCurve)::DownCast(SC);
@ -105,7 +105,7 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
} }
BSPL->SetKnotMultiplicities(Kmult); BSPL->SetKnotMultiplicities(Kmult);
BSPL->SetKnots(Knots); BSPL->SetKnots(Knots);
return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC)); return StepToGeom_MakeBSplineCurve::Convert(BSPL,Handle(Geom_BSplineCurve)::DownCast (CC));
} }
if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurve))) { if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurve))) {
const Handle(StepGeom_QuasiUniformCurve) QUC = const Handle(StepGeom_QuasiUniformCurve) QUC =
@ -131,7 +131,7 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
Kmult->SetValue(nbK, BSPL->Degree() + 1); Kmult->SetValue(nbK, BSPL->Degree() + 1);
BSPL->SetKnotMultiplicities(Kmult); BSPL->SetKnotMultiplicities(Kmult);
BSPL->SetKnots(Knots); BSPL->SetKnots(Knots);
return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC)); return StepToGeom_MakeBSplineCurve::Convert(BSPL,Handle(Geom_BSplineCurve)::DownCast (CC));
} }
if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurveAndRationalBSplineCurve))) { if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurveAndRationalBSplineCurve))) {
const Handle(StepGeom_UniformCurveAndRationalBSplineCurve) RUC = const Handle(StepGeom_UniformCurveAndRationalBSplineCurve) RUC =
@ -153,7 +153,7 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
RBSPL->Init(RUC->Name(), aDegree, RUC->ControlPointsList(), RUC->CurveForm(), RBSPL->Init(RUC->Name(), aDegree, RUC->ControlPointsList(), RUC->CurveForm(),
RUC->ClosedCurve(), RUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified, RUC->ClosedCurve(), RUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified,
RUC->WeightsData()); RUC->WeightsData());
return StepToGeom_MakeBSplineCurve::Convert(RBSPL,*((Handle(Geom_BSplineCurve)*)&CC)); return StepToGeom_MakeBSplineCurve::Convert(RBSPL,Handle(Geom_BSplineCurve)::DownCast (CC));
} }
if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurveAndRationalBSplineCurve))) { if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurveAndRationalBSplineCurve))) {
const Handle(StepGeom_QuasiUniformCurveAndRationalBSplineCurve) RQUC = const Handle(StepGeom_QuasiUniformCurveAndRationalBSplineCurve) RQUC =
@ -177,11 +177,11 @@ Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
RBSPL->Init(RQUC->Name(), aDegree, RQUC->ControlPointsList(), RQUC->CurveForm(), RBSPL->Init(RQUC->Name(), aDegree, RQUC->ControlPointsList(), RQUC->CurveForm(),
RQUC->ClosedCurve(), RQUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified, RQUC->ClosedCurve(), RQUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified,
RQUC->WeightsData()); RQUC->WeightsData());
return StepToGeom_MakeBSplineCurve::Convert(RBSPL,*((Handle(Geom_BSplineCurve)*)&CC)); return StepToGeom_MakeBSplineCurve::Convert(RBSPL,Handle(Geom_BSplineCurve)::DownCast (CC));
} }
if (SC->IsKind(STANDARD_TYPE(StepGeom_Polyline))) { //:n6 abv 15 Feb 99 if (SC->IsKind(STANDARD_TYPE(StepGeom_Polyline))) { //:n6 abv 15 Feb 99
const Handle(StepGeom_Polyline) PL = Handle(StepGeom_Polyline)::DownCast (SC); const Handle(StepGeom_Polyline) PL = Handle(StepGeom_Polyline)::DownCast (SC);
return StepToGeom_MakePolyline::Convert(PL,*((Handle(Geom_BSplineCurve)*)&CC)); return StepToGeom_MakePolyline::Convert(PL,Handle(Geom_BSplineCurve)::DownCast (CC));
} }
return Standard_False; return Standard_False;
} }

View File

@ -35,20 +35,20 @@ Standard_Boolean StepToGeom_MakeBoundedCurve2d::Convert (const Handle(StepGeom_B
if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve))) { if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve))) {
const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)
Bspli = Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC); Bspli = Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC);
return StepToGeom_MakeBSplineCurve2d::Convert(Bspli,*((Handle(Geom2d_BSplineCurve)*)&CC)); return StepToGeom_MakeBSplineCurve2d::Convert(Bspli,Handle(Geom2d_BSplineCurve)::DownCast (CC));
} }
if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnots))) { if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnots))) {
const Handle(StepGeom_BSplineCurveWithKnots) const Handle(StepGeom_BSplineCurveWithKnots)
Bspli = Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC); Bspli = Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC);
return StepToGeom_MakeBSplineCurve2d::Convert(Bspli,*((Handle(Geom2d_BSplineCurve)*)&CC)); return StepToGeom_MakeBSplineCurve2d::Convert(Bspli,Handle(Geom2d_BSplineCurve)::DownCast (CC));
} }
if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve))) { if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve))) {
const Handle(StepGeom_TrimmedCurve) TC = Handle(StepGeom_TrimmedCurve)::DownCast(SC); const Handle(StepGeom_TrimmedCurve) TC = Handle(StepGeom_TrimmedCurve)::DownCast(SC);
return StepToGeom_MakeTrimmedCurve2d::Convert(TC,*((Handle(Geom2d_BSplineCurve)*)&CC)); return StepToGeom_MakeTrimmedCurve2d::Convert(TC,Handle(Geom2d_BSplineCurve)::DownCast (CC));
} }
if (SC->IsKind(STANDARD_TYPE(StepGeom_Polyline))) { //:n6 abv 15 Feb 99 if (SC->IsKind(STANDARD_TYPE(StepGeom_Polyline))) { //:n6 abv 15 Feb 99
const Handle(StepGeom_Polyline) PL = Handle(StepGeom_Polyline)::DownCast(SC); const Handle(StepGeom_Polyline) PL = Handle(StepGeom_Polyline)::DownCast(SC);
return StepToGeom_MakePolyline2d::Convert(PL,*((Handle(Geom2d_BSplineCurve)*)&CC)); return StepToGeom_MakePolyline2d::Convert(PL,Handle(Geom2d_BSplineCurve)::DownCast (CC));
} }
return Standard_False; return Standard_False;
} }

View File

@ -52,17 +52,17 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface))) { if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface))) {
const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) BS = const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) BS =
Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)::DownCast(SS); Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)::DownCast(SS);
return StepToGeom_MakeBSplineSurface::Convert(BS,*((Handle(Geom_BSplineSurface)*)&CS)); return StepToGeom_MakeBSplineSurface::Convert(BS,Handle(Geom_BSplineSurface)::DownCast (CS));
} }
if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnots))) { if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnots))) {
const Handle(StepGeom_BSplineSurfaceWithKnots) BS const Handle(StepGeom_BSplineSurfaceWithKnots) BS
= Handle(StepGeom_BSplineSurfaceWithKnots)::DownCast(SS); = Handle(StepGeom_BSplineSurfaceWithKnots)::DownCast(SS);
return StepToGeom_MakeBSplineSurface::Convert(BS,*((Handle(Geom_BSplineSurface)*)&CS)); return StepToGeom_MakeBSplineSurface::Convert(BS,Handle(Geom_BSplineSurface)::DownCast (CS));
} }
if (SS->IsKind(STANDARD_TYPE(StepGeom_RectangularTrimmedSurface))) { if (SS->IsKind(STANDARD_TYPE(StepGeom_RectangularTrimmedSurface))) {
const Handle(StepGeom_RectangularTrimmedSurface) Sur = const Handle(StepGeom_RectangularTrimmedSurface) Sur =
Handle(StepGeom_RectangularTrimmedSurface)::DownCast(SS); Handle(StepGeom_RectangularTrimmedSurface)::DownCast(SS);
return StepToGeom_MakeRectangularTrimmedSurface::Convert(Sur,*((Handle(Geom_RectangularTrimmedSurface)*)&CS)); return StepToGeom_MakeRectangularTrimmedSurface::Convert(Sur,Handle(Geom_RectangularTrimmedSurface)::DownCast (CS));
} }
// STEP BezierSurface, UniformSurface and QuasiUniformSurface are transformed // STEP BezierSurface, UniformSurface and QuasiUniformSurface are transformed
// into STEP BSplineSurface before being mapped onto CAS.CADE/SF // into STEP BSplineSurface before being mapped onto CAS.CADE/SF
@ -93,7 +93,7 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
BSPL->SetVMultiplicities(VKmult); BSPL->SetVMultiplicities(VKmult);
BSPL->SetUKnots(UKnots); BSPL->SetUKnots(UKnots);
BSPL->SetVKnots(VKnots); BSPL->SetVKnots(VKnots);
return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS)); return StepToGeom_MakeBSplineSurface::Convert(BSPL,Handle(Geom_BSplineSurface)::DownCast (CS));
} }
if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurface))) { if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurface))) {
const Handle(StepGeom_UniformSurface) US = Handle(StepGeom_UniformSurface)::DownCast(SS); const Handle(StepGeom_UniformSurface) US = Handle(StepGeom_UniformSurface)::DownCast(SS);
@ -125,7 +125,7 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
} }
BSPL->SetVMultiplicities(VKmult); BSPL->SetVMultiplicities(VKmult);
BSPL->SetVKnots(VKnots); BSPL->SetVKnots(VKnots);
return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS)); return StepToGeom_MakeBSplineSurface::Convert(BSPL,Handle(Geom_BSplineSurface)::DownCast (CS));
} }
if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurface))) { if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurface))) {
const Handle(StepGeom_QuasiUniformSurface) QUS = const Handle(StepGeom_QuasiUniformSurface) QUS =
@ -162,7 +162,7 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
VKmult->SetValue(nbKV, BSPL->VDegree() + 1); VKmult->SetValue(nbKV, BSPL->VDegree() + 1);
BSPL->SetVMultiplicities(VKmult); BSPL->SetVMultiplicities(VKmult);
BSPL->SetVKnots(VKnots); BSPL->SetVKnots(VKnots);
return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS)); return StepToGeom_MakeBSplineSurface::Convert(BSPL,Handle(Geom_BSplineSurface)::DownCast (CS));
} }
if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurfaceAndRationalBSplineSurface))) { if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurfaceAndRationalBSplineSurface))) {
const Handle(StepGeom_UniformSurfaceAndRationalBSplineSurface) RUS = const Handle(StepGeom_UniformSurfaceAndRationalBSplineSurface) RUS =
@ -191,7 +191,7 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
RUS->UClosed(), RUS->VClosed(), RUS->SelfIntersect(), RUS->UClosed(), RUS->VClosed(), RUS->SelfIntersect(),
UKmult, VKmult, UKnots, VKnots, StepGeom_ktUnspecified, UKmult, VKmult, UKnots, VKnots, StepGeom_ktUnspecified,
RUS->WeightsData()); RUS->WeightsData());
return StepToGeom_MakeBSplineSurface::Convert(RBSPL,*((Handle(Geom_BSplineSurface)*)&CS)); return StepToGeom_MakeBSplineSurface::Convert(RBSPL,Handle(Geom_BSplineSurface)::DownCast (CS));
} }
if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface))) { if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface))) {
const Handle(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface) RQUS = const Handle(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface) RQUS =
@ -223,7 +223,7 @@ Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_B
RQUS->SurfaceForm(), RQUS->UClosed(), RQUS->VClosed(), RQUS->SurfaceForm(), RQUS->UClosed(), RQUS->VClosed(),
RQUS->SelfIntersect(), UKmult, VKmult, UKnots, VKnots, StepGeom_ktUnspecified, RQUS->SelfIntersect(), UKmult, VKmult, UKnots, VKnots, StepGeom_ktUnspecified,
RQUS->WeightsData()); RQUS->WeightsData());
return StepToGeom_MakeBSplineSurface::Convert(RBSPL,*((Handle(Geom_BSplineSurface)*)&CS)); return StepToGeom_MakeBSplineSurface::Convert(RBSPL,Handle(Geom_BSplineSurface)::DownCast (CS));
} }
/* //:S4136: ass-tol2.stp #9861 /* //:S4136: ass-tol2.stp #9861
// UPDATE FMA 15-03-96 // UPDATE FMA 15-03-96

Some files were not shown because too many files have changed in this diff Show More