mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027104: DownCast() cannot return null for mismatched handle
Method DownCast() is made template, to be available only when argument is actually a pointer or handle to a base class. For compatibility with existing code, method DownCast() that can be used for the same type, derived, or unrelated class (i.e. where there is no actual down casting) is still available, its use shall cause "deprecated" compiler warning. OCCT code is updated to remove meaningless DownCast()s; a few places where DownCast() was used with argument of unrelated type are corrected. DRAW command QAHandleCast is removed (it was useful only during redesign of handles).
This commit is contained in:
@@ -554,10 +554,8 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1,
|
||||
Handle(Geom_Curve) C2Prj =
|
||||
GeomProjLib::ProjectOnPlane(C2,GPln,gp_Dir(DV),Standard_True);
|
||||
if(C1Prj.IsNull() || C2Prj.IsNull()) return;
|
||||
Handle(Geom2d_Curve) C1Prj2d =
|
||||
GeomProjLib::Curve2d(C1Prj,Handle(Geom_Surface)::DownCast (GPln));
|
||||
Handle(Geom2d_Curve) C2Prj2d =
|
||||
GeomProjLib::Curve2d(C2Prj,Handle(Geom_Surface)::DownCast (GPln));
|
||||
Handle(Geom2d_Curve) C1Prj2d = GeomProjLib::Curve2d (C1Prj,GPln);
|
||||
Handle(Geom2d_Curve) C2Prj2d = GeomProjLib::Curve2d (C2Prj,GPln);
|
||||
Geom2dAPI_InterCurveCurve ICC(C1Prj2d,C2Prj2d,1.0e-7);
|
||||
if(ICC.NbPoints() > 0 )
|
||||
{
|
||||
@@ -1286,8 +1284,8 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_HSurface)&
|
||||
for(Standard_Integer ip = 1; ip <= sop.Length(); ip++)
|
||||
{
|
||||
gp_Lin lin(sop.Value(ip),gp_Dir(v));
|
||||
Handle(IntPatch_GLine) gl = new IntPatch_GLine(lin,Standard_False);
|
||||
slin.Append(Handle(IntPatch_Line)::DownCast (gl));
|
||||
Handle(IntPatch_Line) gl = new IntPatch_GLine(lin,Standard_False);
|
||||
slin.Append(gl);
|
||||
}
|
||||
|
||||
done = Standard_True;
|
||||
@@ -1470,8 +1468,8 @@ void IntPatch_Intersection::
|
||||
for(Standard_Integer ip = 1; ip <= sop.Length(); ip++)
|
||||
{
|
||||
gp_Lin lin(sop.Value(ip),gp_Dir(v));
|
||||
Handle(IntPatch_GLine) gl = new IntPatch_GLine(lin,Standard_False);
|
||||
slin.Append(Handle(IntPatch_Line)::DownCast (gl));
|
||||
Handle(IntPatch_Line) gl = new IntPatch_GLine(lin,Standard_False);
|
||||
slin.Append(gl);
|
||||
}
|
||||
|
||||
done = Standard_True;
|
||||
|
Reference in New Issue
Block a user