X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOMEDS%2FSALOMEDS_AttributeDrawable_i.cxx;h=76e807552d510a8d7718fe04b8ca4d9c7448f899;hb=48d150b078ab63d77fbed4de1f8dbd7d3a8767da;hp=dc23dcd37c96b7cd70fffe03a4b96d14d2c7fd06;hpb=89d8cdd476c5f4d65bc3fd1089f092af42e2841c;p=modules%2Fkernel.git diff --git a/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx index dc23dcd37..76e807552 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx @@ -1,50 +1,41 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server +// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003 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 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 -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// 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, or (at your option) any later version. // +// 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 +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + // File : SALOMEDS_AttributeDrawable_i.cxx -// Author : Yves FRICAUD +// Author : Sergey RUIN // Module : SALOME -// $Header$ - +// #include "SALOMEDS_AttributeDrawable_i.hxx" -#include "SALOMEDS_SObject_i.hxx" -using namespace std; +#include "SALOMEDS.hxx" -CORBA::Boolean SALOMEDS_AttributeDrawable_i::IsDrawable() { - return (Handle(SALOMEDS_DrawableAttribute)::DownCast(_myAttr)->Get() == 1); -} - -void SALOMEDS_AttributeDrawable_i::SetDrawable(CORBA::Boolean value) { - CheckLocked(); - Standard_Integer val = 0; - if (value != 0) val = 1; - Handle(TDataStd_Integer)::DownCast(_myAttr)->Set(val); +CORBA::Boolean SALOMEDS_AttributeDrawable_i::IsDrawable() +{ + SALOMEDS::Locker lock; + return (dynamic_cast(_impl)->IsDrawable() == 1); } -char* SALOMEDS_AttributeDrawable_i::Store() { - return CORBA::string_dup(IsDrawable()?"1":"0"); -} - -void SALOMEDS_AttributeDrawable_i::Restore(const char* value) { - SetDrawable(value[0] == '1'); +void SALOMEDS_AttributeDrawable_i::SetDrawable(CORBA::Boolean value) +{ + SALOMEDS::Locker lock; + CheckLocked(); + dynamic_cast(_impl)->SetDrawable(value); }