From 819fc100033457fe1582b1b9506ee0893704dce1 Mon Sep 17 00:00:00 2001 From: asv Date: Thu, 4 Aug 2005 10:49:23 +0000 Subject: [PATCH] removed ToolsGUI.h/cxx by mistake.. Moving them back. --- src/TOOLSGUI/Makefile.in | 6 ++- src/TOOLSGUI/ToolsGUI.cxx | 84 +++++++++++++++++++++++++++++++++++++++ src/TOOLSGUI/ToolsGUI.h | 52 ++++++++++++++++++++++++ 3 files changed, 140 insertions(+), 2 deletions(-) create mode 100755 src/TOOLSGUI/ToolsGUI.cxx create mode 100755 src/TOOLSGUI/ToolsGUI.h 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 -- 2.39.2