0024023: Revamp the OCCT Handle -- general
[occt.git] / src / AIS / AIS_GraphicTool.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 4a0e532..dbaead1
@@ -1,12 +1,18 @@
-// File:       AIS_GraphicTool.cxx
-// Created:    Mon Feb 10 16:39:03 1997
-// Author:     Robert COUBLANC
-//             <rob@robox.paris1.matra-dtv.fr>
-
-#define GER61351 //GG_171199     Enable to get an object RGB color
-//              instead a restricted object NameOfColor.
-
-
+// Created on: 1997-02-10
+// Created by: Robert COUBLANC
+// Copyright (c) 1997-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_GraphicTool.ixx>
 
 #include <Prs3d_LineAspect.hxx>
 #include <Aspect_AspectLine.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
-#include <Prs3d_AngleAspect.hxx>
+#include <Prs3d_DimensionAspect.hxx>
 #include <Prs3d_PlaneAspect.hxx>
 #include <Prs3d_DatumAspect.hxx>
 #include <Graphic3d_AspectFillArea3d.hxx>
 #include <Aspect_InteriorStyle.hxx>
 
 #include <Prs3d_ShadingAspect.hxx>
-
+#include <Prs3d_IsoAspect.hxx>
 
 static Handle(Prs3d_LineAspect) GetLineAspect(const Handle(Prs3d_Drawer)& Dr,
                                              const AIS_TypeOfAttribute Att)
@@ -31,8 +37,8 @@ static Handle(Prs3d_LineAspect) GetLineAspect(const Handle(Prs3d_Drawer)& Dr,
   case AIS_TOA_Line:
     return Dr->LineAspect();
     break;
-  case AIS_TOA_Angle:
-    return Dr->AngleAspect()->LineAspect();
+  case AIS_TOA_Dimension:
+    return Dr->DimensionAspect()->LineAspect();
     break;
   case AIS_TOA_Wire:
     return Dr->WireAspect();
@@ -76,7 +82,6 @@ static Handle(Prs3d_LineAspect) GetLineAspect(const Handle(Prs3d_Drawer)& Dr,
 }
 
 Quantity_NameOfColor AIS_GraphicTool::GetLineColor (const Handle(Prs3d_Drawer)& Dr, const AIS_TypeOfAttribute Att)
-#ifdef GER61351
 {
   Quantity_Color color;
   GetLineColor(Dr,Att,color);
@@ -84,20 +89,10 @@ Quantity_NameOfColor AIS_GraphicTool::GetLineColor (const Handle(Prs3d_Drawer)&
 }
 
 void AIS_GraphicTool::GetLineColor (const Handle(Prs3d_Drawer)& Dr, const AIS_TypeOfAttribute Att, Quantity_Color &aColor)
-#endif
 {
   Standard_Real W;
   Aspect_TypeOfLine TYP;
-  
-  Handle(Prs3d_LineAspect) LA = GetLineAspect(Dr,Att);
-  
-#ifdef GER61351
-  LA->Aspect()->Values(aColor,TYP,W);
-#else
-  Quantity_Color QCol;
-  LA->Aspect()->Values(QCol,TYP,W);
-  return QCol.Name();
-#endif
+  GetLineAspect(Dr,Att)->Aspect()->Values(aColor,TYP,W);
 }
 
 Standard_Real AIS_GraphicTool::GetLineWidth (const Handle(Prs3d_Drawer)& Dr,
@@ -143,7 +138,6 @@ void AIS_GraphicTool::GetLineAtt(const Handle(Prs3d_Drawer)& Dr,
 }
 
 Quantity_NameOfColor AIS_GraphicTool::GetInteriorColor(const Handle(Prs3d_Drawer)& Dr)
-#ifdef GER61351
 {
   Quantity_Color color;
   GetInteriorColor(Dr,color);
@@ -151,24 +145,16 @@ Quantity_NameOfColor AIS_GraphicTool::GetInteriorColor(const Handle(Prs3d_Drawer
 }
 
 void AIS_GraphicTool::GetInteriorColor(const Handle(Prs3d_Drawer)& Dr, Quantity_Color &aColor)
-#endif
 {
   Handle(Graphic3d_AspectFillArea3d) AFA = Dr->ShadingAspect()->Aspect();
   Aspect_InteriorStyle IS;
   Aspect_TypeOfLine T;
   Standard_Real W;
-#ifdef GER61351
   Quantity_Color EC;
   AFA->Values(IS,aColor,EC,T,W);
-#else
-  Quantity_Color IC,EC;
-  AFA->Values(IS,IC,EC,T,W);
-  return IC.Name();
-#endif
 }
 
 Graphic3d_MaterialAspect AIS_GraphicTool::GetMaterial(const Handle(Prs3d_Drawer)& Dr)
 {
   return Dr->ShadingAspect()->Aspect()->BackMaterial();
-
 }