Salome HOME
0021672: [CEA 565] Dump Study from script
[modules/geom.git] / src / GEOM / GEOM_Object.cxx
index fc2170a8612e7ca8c488741c3a90da6023f3ada3..19c7b7ebb3a1f06d53f0ce9148b9d012f566f62d 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include <Standard_Stream.hxx>
 
 #include "utilities.h"
@@ -327,7 +328,7 @@ char* GEOM_Object::GetName()
  *  SetColor
  */
 //=============================================================================
-void GEOM_Object::SetColor(const SALOMEDS::Color& theColor)
+void GEOM_Object::SetColor(const GEOM_Object::Color& theColor)
 {
   Handle(TDataStd_RealArray) anArray = new TDataStd_RealArray();
   anArray->Init( 1, 3 );
@@ -345,12 +346,12 @@ void GEOM_Object::SetColor(const SALOMEDS::Color& theColor)
  *  GetColor
  */
 //=============================================================================
-SALOMEDS::Color GEOM_Object::GetColor()
+GEOM_Object::Color GEOM_Object::GetColor()
 {
   Handle(TDataStd_RealArray) anArray;
   bool isFound = _label.FindChild(COLOR_LABEL).FindAttribute(TDataStd_RealArray::GetID(), anArray);
 
-  SALOMEDS::Color aColor;
+  GEOM_Object::Color aColor;
   aColor.R = isFound ? anArray->Value( 1 ) : -1;
   aColor.G = isFound ? anArray->Value( 2 ) : -1;
   aColor.B = isFound ? anArray->Value( 3 ) : -1;
@@ -363,7 +364,7 @@ SALOMEDS::Color GEOM_Object::GetColor()
  *  SetAutoColor
  */
 //=============================================================================
-void GEOM_Object::SetAutoColor(CORBA::Boolean theAutoColor)
+void GEOM_Object::SetAutoColor(bool theAutoColor)
 {
   TDataStd_Integer::Set(_label.FindChild(AUTO_COLOR_LABEL), (int)theAutoColor);
 }
@@ -373,12 +374,12 @@ void GEOM_Object::SetAutoColor(CORBA::Boolean theAutoColor)
  *  GetAutoColor
  */
 //=============================================================================
-CORBA::Boolean GEOM_Object::GetAutoColor()
+bool GEOM_Object::GetAutoColor()
 {
   Handle(TDataStd_Integer) anAutoColor;
   if(!_label.FindChild(AUTO_COLOR_LABEL).FindAttribute(TDataStd_Integer::GetID(), anAutoColor)) return false;
 
-  return anAutoColor->Get();
+  return bool(anAutoColor->Get());
 }
 
 //=============================================================================
@@ -544,7 +545,7 @@ bool GEOM_Object::IsMainShape()
 Handle(GEOM_Function) GEOM_Object::AddFunction(const Standard_GUID& theGUID, int theFunctionType)
 {
   Standard_Integer nb = GetNbFunctions();
-  if(nb == 1 && theGUID == GetSubShapeID()) return NULL; //It's impossible to add a function to sub shape
+  if(nb == 1 && theGUID == GetSubShapeID()) return NULL; //It's impossible to add a function to sub-shape
   nb++;
   TDF_Label aChild = FUNCTION_LABEL(nb);