0024023: Revamp the OCCT Handle -- downcast (automatic)
[occt.git] / src / AIS / AIS_ParallelRelation.cxx
index da77758..f1c60ac 100644 (file)
@@ -14,9 +14,6 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#define BUC60915        //GG 05/06/01 Enable to compute the requested arrow size
-//                      if any in all dimensions.
-
 #include <AIS_ParallelRelation.ixx>
 
 #include <Standard_NotImplemented.hxx>
@@ -34,9 +31,9 @@
 #include <Prs3d_DimensionAspect.hxx>
 
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 
 #include <SelectMgr_EntityOwner.hxx>
+#include <SelectMgr_Selection.hxx>
 #include <Select3D_SensitiveSegment.hxx>
 #include <Select3D_SensitiveBox.hxx>
 
@@ -91,11 +88,7 @@ AIS_ParallelRelation::AIS_ParallelRelation(const TopoDS_Shape& aFShape,
   mySShape = aSShape;
   myPlane = aPlane;
   myAutomaticPosition = Standard_False;
-#ifdef BUC60915
   SetArrowSize( anArrowSize );
-#else
-  myArrowSize = anArrowSize;
-#endif
   myPosition = aPosition;
   mySymbolPrs = aSymbolPrs;
 }
@@ -255,7 +248,7 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
 
   if (geom1->IsInstance(STANDARD_TYPE(Geom_Ellipse)))
     {
-      const Handle(Geom_Ellipse)& geom_el1 = (Handle(Geom_Ellipse)&) geom1;
+      Handle(Geom_Ellipse) geom_el1 (Handle(Geom_Ellipse)::DownCast (geom1));
       // construct lines through focuses
       gp_Ax1 elAx = geom_el1->XAxis();
       l1 = gp_Lin(elAx);
@@ -267,14 +260,14 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
     }
   else if (geom1->IsInstance(STANDARD_TYPE(Geom_Line)))
     {
-      const Handle(Geom_Line)& geom_lin1 = (Handle(Geom_Line)&) geom1;
+      Handle(Geom_Line) geom_lin1 (Handle(Geom_Line)::DownCast (geom1));
       l1 = geom_lin1->Lin();
     }
   else return;
 
   if (geom2->IsInstance(STANDARD_TYPE(Geom_Ellipse)))
     {
-      const Handle(Geom_Ellipse)& geom_el2 = (Handle(Geom_Ellipse)&) geom2;
+      Handle(Geom_Ellipse) geom_el2 (Handle(Geom_Ellipse)::DownCast (geom2));
       // construct lines through focuses
       gp_Ax1 elAx = geom_el2->XAxis();
       l2 = gp_Lin(elAx);
@@ -286,7 +279,7 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
     }
   else if (geom2->IsInstance(STANDARD_TYPE(Geom_Line)))
     {
-      const Handle(Geom_Line)& geom_lin2 = (Handle(Geom_Line)&) geom2;
+      Handle(Geom_Line) geom_lin2 (Handle(Geom_Line)::DownCast (geom2));
       l2 = geom_lin2->Lin();
     }
   else return;
@@ -296,17 +289,13 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
 
   myDirAttach = l1.Direction();
   // size
-#ifdef BUC60915
   if( !myArrowSizeIsDefined ) {
-#endif
     Standard_Real arrSize1 (myArrowSize), arrSize2 (myArrowSize);
     if (!isInfinite1) arrSize1 = ptat11.Distance(ptat12)/50.;
     if (!isInfinite2) arrSize2 = ptat21.Distance(ptat22)/50.;
     myArrowSize = Max(myArrowSize,Max(arrSize1,arrSize2));
 //  myArrowSize = Min(myArrowSize,Min(arrSize1,arrSize2));
-#ifdef BUC60915
   }
-#endif
 
   if ( myAutomaticPosition )
     {