0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / AIS / AIS_EqualRadiusRelation.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 95b03ea..08921b1
@@ -1,36 +1,49 @@
-// File:       AIS_EqualRadiusRelation.cxx
-// Created:    Tue Jan 20 19:19:54 1998
-// Author:     Julia GERASIMOVA
-//             <jgv@orthodox.nnov.matra-dtv.fr>
+// Created on: 1998-01-20
+// Created by: Julia GERASIMOVA
+// Copyright (c) 1998-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 <Standard_NotImplemented.hxx>
-
-#include <AIS_EqualRadiusRelation.ixx>
 
 #include <AIS.hxx>
-#include <DsgPrs_EqualRadiusPresentation.hxx>
+#include <AIS_EqualRadiusRelation.hxx>
 #include <BRepAdaptor_Curve.hxx>
-#include <TopoDS.hxx>
-#include <gp_Circ.hxx>
-#include <Geom_Circle.hxx>
+#include <DsgPrs_EqualRadiusPresentation.hxx>
 #include <ElCLib.hxx>
-#include <SelectMgr_EntityOwner.hxx>
-#include <Select3D_SensitiveSegment.hxx>
-#include <Select3D_SensitiveBox.hxx>
-#include <Precision.hxx>
+#include <Geom_Circle.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_Transformation.hxx>
 #include <GeomAPI_ProjectPointOnSurf.hxx>
-#include <Prs3d_LengthAspect.hxx>
+#include <gp_Circ.hxx>
+#include <Precision.hxx>
 #include <Prs3d_ArrowAspect.hxx>
-#include <AIS_Drawer.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_NotImplemented.hxx>
+#include <Standard_Type.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
 
 //=======================================================================
 //function : AIS_EqualRadiusRelation
 //purpose  : 
 //=======================================================================
-
 AIS_EqualRadiusRelation::AIS_EqualRadiusRelation( const TopoDS_Edge& aFirstEdge,
                                                  const TopoDS_Edge& aSecondEdge,
                                                  const Handle( Geom_Plane )& aPlane )
@@ -84,8 +97,8 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3
     }
   else {
     Standard_Real aPar =  ElCLib::Parameter(FirstCirc, myFirstPoint);
-    if (IntegerPart(0.5*LastPar1/PI) != 0 &&  aPar < FirstPar1 )
-      aPar +=2*PI*IntegerPart(0.5*LastPar1/PI);
+    if (IntegerPart(0.5*LastPar1/M_PI) != 0 &&  aPar < FirstPar1 )
+      aPar +=2*M_PI*IntegerPart(0.5*LastPar1/M_PI);
     Standard_Real aRadius = FirstCirc.Radius();
 
     if (Abs(myFirstPoint.Distance(myFirstCenter) - aRadius) >= Precision::Confusion())
@@ -104,8 +117,8 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3
   
     
     aPar =  ElCLib::Parameter(SecondCirc, mySecondPoint);
-    if (IntegerPart(0.5*LastPar2/PI) != 0 &&  aPar < FirstPar2 )
-      aPar +=2*PI*IntegerPart(0.5*LastPar2/PI);
+    if (IntegerPart(0.5*LastPar2/M_PI) != 0 &&  aPar < FirstPar2 )
+      aPar +=2*M_PI*IntegerPart(0.5*LastPar2/M_PI);
     
     aRadius = SecondCirc.Radius();
     if (Abs(mySecondPoint.Distance(mySecondCenter) - aRadius) >= Precision::Confusion())
@@ -120,14 +133,12 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3
        }
     }
   }
-#ifdef BUC60915
   if( !myArrowSizeIsDefined )
-#endif
     myArrowSize = (Min(myFirstCenter.Distance(myFirstPoint),
                     mySecondCenter.Distance(mySecondPoint)))*0.05;
   
-  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);
   
   //ota -- end --
@@ -148,29 +159,16 @@ void AIS_EqualRadiusRelation::Compute( const Handle( Prs3d_Projector )& /*aProje
 // PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
 }
 
-//=======================================================================
-//function : Compute
-//purpose  : to avoid warning at compilation (SUN)
-//=======================================================================
-
-void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager2d )& /*aPresentationManager2d*/,
-                                      const Handle( Graphic2d_GraphicObject )& /*aGraphicObject*/,
-                                      const Standard_Integer /*anInteger*/)
-{
-// Standard_NotImplemented::Raise("AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager2d )&,const Handle( Graphic2d_GraphicObject )&,const Standard_Integer )");
-// PrsMgr_PresentableObject::Compute( aPresentationManager2d ,aGraphicObject,anInteger) ;
-}
-
 //=======================================================================
 //function : Compute
 //purpose  : 
 //=======================================================================
 
-void AIS_EqualRadiusRelation::Compute(const Handle_Prs3d_Projector& aProjector,
-                                      const Handle_Geom_Transformation& aTransformation,
-                                      const Handle_Prs3d_Presentation& aPresentation)
+void AIS_EqualRadiusRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
+                                      const Handle(Geom_Transformation)& aTransformation,
+                                      const Handle(Prs3d_Presentation)& aPresentation)
 {
-// Standard_NotImplemented::Raise("AIS_EqualRadiusRelation::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");
+// Standard_NotImplemented::Raise("AIS_EqualRadiusRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
  PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
 }