0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / AIS / AIS_Axis.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 9941641..05b1fb3
@@ -1,32 +1,46 @@
-// File:       AIS_Axis.cxx
-// Created:    Wed Aug  9 16:28:42 1995
-// Author:     Arnaud BOUZY/Odile Olivier
-//             <adn>
-
-#define GER61351               //GG_171199     Enable to set an object RGB color
-//                                               instead a restricted object NameOfColor.
-
-#include <AIS_Axis.ixx>
+// Created on: 1995-08-09
+// Created by: Arnaud BOUZY/Odile Olivier
+// Copyright (c) 1995-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.
+
+
+#include <AIS_Axis.hxx>
 #include <Aspect_TypeOfLine.hxx>
-#include <Prs3d_Drawer.hxx>
-#include <Prs3d_LineAspect.hxx>
-#include <Prs3d_DatumAspect.hxx>
-#include <Graphic3d_ArrayOfPrimitives.hxx>
+#include <DsgPrs_XYZAxisPresentation.hxx>
+#include <Geom_Axis1Placement.hxx>
+#include <Geom_Axis2Placement.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_Transformation.hxx>
+#include <GeomAdaptor_Curve.hxx>
+#include <gp_Ax1.hxx>
+#include <gp_Ax2.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Graphic3d_Structure.hxx>
-#include <TColgp_Array1OfPnt.hxx>
-#include <SelectMgr_EntityOwner.hxx>
-#include <SelectBasics_EntityOwner.hxx>
+#include <Prs3d_DatumAspect.hxx>
+#include <Prs3d_Drawer.hxx>
+#include <Prs3d_LineAspect.hxx>
+#include <Prs3d_Presentation.hxx>
+#include <Prs3d_Projector.hxx>
+#include <Quantity_Color.hxx>
 #include <Select3D_SensitiveSegment.hxx>
+#include <SelectBasics_EntityOwner.hxx>
+#include <SelectMgr_EntityOwner.hxx>
+#include <SelectMgr_Selection.hxx>
+#include <Standard_Type.hxx>
 #include <StdPrs_Curve.hxx>
+#include <TColgp_Array1OfPnt.hxx>
 #include <TopoDS.hxx>
-#include <Geom_Axis1Placement.hxx>
-#include <gp_Ax1.hxx>
-#include <gp_Ax2.hxx>
-#include <Geom_Line.hxx>
-#include <GeomAdaptor_Curve.hxx>
-#include <AIS_Drawer.hxx>
-#include <DsgPrs_XYZAxisPresentation.hxx>
 #include <UnitsAPI.hxx>
 
 //=======================================================================
@@ -161,10 +175,7 @@ void AIS_Axis::Compute(const Handle(PrsMgr_PresentationManager3d)&,
   aPresentation->SetDisplayPriority(5);
   if (!myIsXYZAxis ){
     GeomAdaptor_Curve curv(myComponent);
-    Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
-    if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
     StdPrs_Curve::Add(aPresentation,curv,myDrawer);
-    if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
   }
   else {
     DsgPrs_XYZAxisPresentation::Add(aPresentation,myLineAspect,myDir,myVal,myText,myPfirst,myPlast);
@@ -172,9 +183,9 @@ void AIS_Axis::Compute(const Handle(PrsMgr_PresentationManager3d)&,
 
 }
 
-void AIS_Axis::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
+void AIS_Axis::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
 {
-// Standard_NotImplemented::Raise("AIS_Axis::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");
+// Standard_NotImplemented::Raise("AIS_Axis::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
   PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
 }
 
@@ -201,13 +212,11 @@ void AIS_Axis::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
 
 
 void AIS_Axis::SetColor(const Quantity_NameOfColor aCol)
-#ifdef GER61351
 {
   SetColor(Quantity_Color(aCol));
 }
 
 void AIS_Axis::SetColor(const Quantity_Color &aCol)
-#endif
 {
   hasOwnColor=Standard_True;
   myOwnColor=aCol;
@@ -239,16 +248,6 @@ void AIS_Axis::SetWidth(const Standard_Real aValue)
 }
 
 
-//=======================================================================
-//function : Compute
-//purpose  : to avoid warning
-//=======================================================================
-void AIS_Axis::Compute(const Handle(PrsMgr_PresentationManager2d)&, 
-                         const Handle(Graphic2d_GraphicObject)&,
-                         const Standard_Integer)
-{
-}
-
 //=======================================================================
 //function : Compute
 //purpose  : to avoid warning
@@ -267,11 +266,12 @@ void AIS_Axis::ComputeFields()
   if (myIsXYZAxis){
     // calcul de myPFirst,myPlast
     Handle(Prs3d_DatumAspect) DA = myDrawer->DatumAspect();
-    gp_Pnt Orig = myAx2->Ax2().Location();
-    gp_Dir oX = myAx2->Ax2().XDirection();
-    gp_Dir oY = myAx2->Ax2().YDirection();
-    gp_Dir oZ = myAx2->Ax2().Direction();
-    Quantity_Length xo,yo,zo,x,y,z;
+    gp_Ax2 anAxis = myAx2->Ax2();
+    const gp_Pnt& Orig = anAxis.Location();
+    const gp_Dir& oX   = anAxis.XDirection();
+    const gp_Dir& oY   = anAxis.YDirection();
+    const gp_Dir& oZ   = anAxis.Direction();
+    Quantity_Length xo,yo,zo,x = 0.,y = 0.,z = 0.;
     Orig.Coord(xo,yo,zo);
     myPfirst.SetCoord(xo,yo,zo);