From: asv Date: Thu, 4 Aug 2005 10:49:23 +0000 (+0000) Subject: removed ToolsGUI.h/cxx by mistake.. Moving them back. X-Git-Tag: T_3_0_2a1~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=819fc100033457fe1582b1b9506ee0893704dce1;p=modules%2Fgui.git removed ToolsGUI.h/cxx by mistake.. Moving them back. --- diff --git a/src/TOOLSGUI/Makefile.in b/src/TOOLSGUI/Makefile.in index eb2d6e7bf..7acf9fb58 100755 --- a/src/TOOLSGUI/Makefile.in +++ b/src/TOOLSGUI/Makefile.in @@ -35,7 +35,8 @@ VPATH=.:@srcdir@:@top_srcdir@/idl:@srcdir@/resources @COMMENCE@ # header files -EXPORT_HEADERS = ToolsGUI_RegWidget.h \ +EXPORT_HEADERS = ToolsGUI.h \ + ToolsGUI_RegWidget.h \ ToolsGUI_CatalogGeneratorDlg.h # .po files to transform in .qm @@ -48,7 +49,8 @@ LIB = libToolsGUI.la LIB_SRC = ToolsGUI_CatalogGeneratorDlg.cxx \ ToolsGUI_HelpWindow.cxx \ ToolsGUI_RegWidget.cxx \ - ToolsGUI_IntervalWindow.cxx + ToolsGUI_IntervalWindow.cxx \ + ToolsGUI.cxx LIB_MOC = ToolsGUI_CatalogGeneratorDlg.h \ ToolsGUI_RegWidget.h diff --git a/src/TOOLSGUI/ToolsGUI.cxx b/src/TOOLSGUI/ToolsGUI.cxx new file mode 100755 index 000000000..ac2ca02a7 --- /dev/null +++ b/src/TOOLSGUI/ToolsGUI.cxx @@ -0,0 +1,84 @@ +// SALOME TOOLSGUI : implementation of desktop "Tools" optioins +// +// 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 +// +// +// +// File : ToolsGUI.cxx +// Author : Nicolas REJNERI +// Module : SALOME +// $Header$ + +#include "ToolsGUI.h" + +//======================================================================= +// name : GetVisibility +// Purpose : Verify whether object is visible or not +//======================================================================= +bool ToolsGUI::GetVisibility( _PTR(Study) theStudy, + _PTR(SObject) theObj, + void* theId ) +{ + _PTR(GenericAttribute) anAttr; + if ( theObj && theObj->FindAttribute( anAttr, "AttributeGraphic" ) ) + { + _PTR(AttributeGraphic) aGraphic (anAttr); + return aGraphic->GetVisibility( (unsigned long)theId ); + } + + return false; +} + +//======================================================================= +// name : SetVisibility +// Purpose : Set flag visibility of object +//======================================================================= +bool ToolsGUI::SetVisibility( _PTR(Study) theStudy, + const char* theEntry, + const bool theValue, + void* theId ) +{ + _PTR(SObject) anObj ( theStudy->FindObjectID( theEntry ) ); + + if ( anObj ) + { + _PTR(GenericAttribute) aGAttr; + if ( anObj->FindAttribute( aGAttr, "AttributeGraphic" ) ) + { + _PTR(AttributeGraphic) anAttr ( aGAttr ); + anAttr->SetVisibility( (unsigned long)theId, theValue ); + } + else if ( theValue ) + { + _PTR(StudyBuilder) aBuilder (theStudy->NewBuilder()); + _PTR(AttributeGraphic) anAttr (aBuilder->FindOrCreateAttribute(anObj, "AttributeGraphic")); + anAttr->SetVisibility( (unsigned long)theId, theValue ); + } + return true; + } + + return false; +} + + + + + + diff --git a/src/TOOLSGUI/ToolsGUI.h b/src/TOOLSGUI/ToolsGUI.h new file mode 100755 index 000000000..cb54ffdfc --- /dev/null +++ b/src/TOOLSGUI/ToolsGUI.h @@ -0,0 +1,52 @@ +// SALOME TOOLSGUI : implementation of desktop "Tools" optioins +// +// 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 +// +// +// +// File : ToolsGUI.h +// Author : Nicolas REJNERI +// Module : SALOME +// $Header$ + +#ifndef ToolsGUI_HeaderFile +#define ToolsGUI_HeaderFile + +#include "utilities.h" + +#ifndef _Standard_HeaderFile +#include +#endif + +#include "SALOMEDSClient.hxx" + +class Standard_EXPORT ToolsGUI +{ +public : + static bool GetVisibility( _PTR(Study) theStudy, + _PTR(SObject) theObj, + void* theId ); + static bool SetVisibility( _PTR(Study) theStudy, + const char* theEntry, + const bool theValue, + void* theId ); +}; + +#endif