0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / AIS / AIS_ParallelRelation.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 6bb6d6e..d3a594c
@@ -1,53 +1,56 @@
-// File:       AIS_ParallelRelation.cdl
-// Created:    Tue Dec  5 15:09:04 1996
-// Author:     Jean-Pierre COMBE/Odile Olivier
-//              <ODL>
+// Created on: 1996-12-05
+// Created by: Jean-Pierre COMBE/Odile Olivier
+// Copyright (c) 1996-1999 Matra Datavision
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// 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>
-#include <Standard_DomainError.hxx>
-
-#include <Precision.hxx>
-
-#include <TCollection_AsciiString.hxx>
-#include <TCollection_ExtendedString.hxx>
-
-#include <DsgPrs_LengthPresentation.hxx>
-
-#include <Prs3d_Drawer.hxx>
-#include <Prs3d_ArrowAspect.hxx>
-#include <Prs3d_LengthAspect.hxx>
 
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
-
-#include <SelectMgr_EntityOwner.hxx>
-#include <Select3D_SensitiveSegment.hxx>
-#include <Select3D_SensitiveBox.hxx>
-
-#include <TopoDS.hxx>
-#include <TopExp_Explorer.hxx>
+#include <AIS_ParallelRelation.hxx>
 #include <BRep_Tool.hxx>
-#include <BRepAdaptor_Surface.hxx>
 #include <BRepAdaptor_Curve.hxx>
-
-#include <gp_Lin.hxx>
-#include <gp_Pnt.hxx>
+#include <BRepAdaptor_Surface.hxx>
+#include <DsgPrs_LengthPresentation.hxx>
 #include <ElCLib.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Ax1.hxx>
-#include <gp_Ax2.hxx>
-
 #include <gce_MakeLin.hxx>
-
-#include <Geom_Plane.hxx>
-#include <Geom_Line.hxx>
 #include <Geom_Ellipse.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_Transformation.hxx>
+#include <gp_Ax1.hxx>
+#include <gp_Ax2.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Pnt.hxx>
+#include <Precision.hxx>
+#include <Prs3d_ArrowAspect.hxx>
+#include <Prs3d_DimensionAspect.hxx>
+#include <Prs3d_Drawer.hxx>
+#include <Prs3d_Presentation.hxx>
+#include <Prs3d_Projector.hxx>
+#include <Select3D_SensitiveBox.hxx>
+#include <Select3D_SensitiveSegment.hxx>
+#include <SelectMgr_EntityOwner.hxx>
+#include <SelectMgr_Selection.hxx>
+#include <Standard_DomainError.hxx>
+#include <Standard_NotImplemented.hxx>
+#include <Standard_Type.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TCollection_ExtendedString.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
 
 //=======================================================================
 //function : Constructor
@@ -80,11 +83,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;
 }
@@ -129,21 +128,9 @@ void AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
   PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
 }
 
-//=======================================================================
-//function : Compute
-//purpose  : to avoid warning
-//=======================================================================
-void AIS_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager2d, 
-                                  const Handle(Graphic2d_GraphicObject)& aGraphicObject,
-                                  const Standard_Integer anInteger)
-{
-// Standard_NotImplemented::Raise("AIS_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager2d)&,const Handle(Graphic2d_GraphicObject)&,const Standard_Integer)");
-  PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
-}
-
-void AIS_ParallelRelation::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
+void AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
 {
-// Standard_NotImplemented::Raise("AIS_ParallelRelation::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");
+// Standard_NotImplemented::Raise("AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
   PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
 }
 
@@ -256,7 +243,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);
@@ -268,14 +255,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);
@@ -287,7 +274,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;
@@ -297,17 +284,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 )
     {    
@@ -375,10 +358,10 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
     {
       myArrowSize = 0.;
     }
-  Handle(Prs3d_LengthAspect) la = myDrawer->LengthAspect();
-  Handle(Prs3d_ArrowAspect) arr = la->Arrow1Aspect();
+  Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect();
+  Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect();
   arr->SetLength(myArrowSize);
-  arr = la->Arrow2Aspect();
+  arr = la->ArrowAspect();
   arr->SetLength(myArrowSize);
   if ( myExtShape == 1)
     mySymbolPrs = DsgPrs_AS_FIRSTPT_LASTAR;