From 7a79ac62ecf2e080aa07398449d70ddcbcef618c Mon Sep 17 00:00:00 2001 From: smh Date: Fri, 3 Jun 2005 06:08:38 +0000 Subject: [PATCH] SMH: Remove implementation dependency --- src/TOOLSDS/SALOMEDS_Tool.cxx | 95 ----------------------------------- src/TOOLSDS/SALOMEDS_Tool.hxx | 17 ------- 2 files changed, 112 deletions(-) diff --git a/src/TOOLSDS/SALOMEDS_Tool.cxx b/src/TOOLSDS/SALOMEDS_Tool.cxx index 7a133efcb..23ded1040 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.cxx +++ b/src/TOOLSDS/SALOMEDS_Tool.cxx @@ -407,98 +407,3 @@ void SALOMEDS_Tool::GetAllChildren( SALOMEDS::Study_var theStudy, -//======================================================================= -// name : GetFlag -// Purpose : Retrieve specified flaf from "AttributeFlags" attribute -//======================================================================= -bool SALOMEDS_Tool::GetFlag( const int theFlag, - _PTR(Study) theStudy, - _PTR(SObject) theObj ) -{ - _PTR(GenericAttribute) anAttr; - if ( theObj && theObj->FindAttribute( anAttr, "AttributeFlags" ) ) - { - _PTR(AttributeFlags) aFlags( anAttr ); - bool ret = aFlags->Get( theFlag ); - return ret; - } - - return false; -} - -//======================================================================= -// name : SetFlag -// Purpose : Set/Unset specified flaf from "AttributeFlags" attribute -//======================================================================= -bool SALOMEDS_Tool::SetFlag( const int theFlag, - _PTR(Study) theStudy, - const std::string& theEntry, - const bool theValue ) -{ - _PTR(SObject) anObj (theStudy->FindObjectID(theEntry.c_str())); - - if ( anObj ) - { - _PTR(GenericAttribute) aGAttr; - if ( anObj->FindAttribute( aGAttr, "AttributeFlags" ) ) - { - _PTR(AttributeFlags) anAttr ( aGAttr ); - anAttr->Set( theFlag, theValue ); - } - else if ( theValue ) - { - _PTR(StudyBuilder) aBuilder ( theStudy->NewBuilder() ); - _PTR(AttributeFlags) anAttr = aBuilder->FindOrCreateAttribute( anObj, "AttributeFlags" ); - anAttr->Set( theFlag, theValue ); - } - return true; - } - - return false; -} - -//======================================================================= -// name : getAllChildren -// Purpose : Get all entries of children of object. -// If theObj is null all entries of objects of study are returned -//======================================================================= -void SALOMEDS_Tool::GetAllChildren( _PTR(Study) theStudy, - _PTR(SObject) theObj, - std::list& theList ) -{ - if ( !theObj ) - { - _PTR(SComponentIterator) anIter (theStudy->NewComponentIterator()); - for ( ; anIter->More(); anIter->Next() ) - { - _PTR(SObject) anObj ( anIter->Value() ); - if ( anObj ) - { - theList.push_back( anObj->GetID() ); - GetAllChildren( theStudy, anObj, theList ); - } - } - } - else - { - _PTR(ChildIterator) anIter ( theStudy->NewChildIterator( theObj ) ); - for ( ; anIter->More(); anIter->Next() ) - { - _PTR(SObject) anObj ( anIter->Value() ); - _PTR(SObject) aRef; - if ( !anObj->ReferencedObject( aRef ) ) - { - theList.push_back( anObj->GetID() ); - GetAllChildren( theStudy, anObj, theList ); - } - } - } -} - - - - - - - - diff --git a/src/TOOLSDS/SALOMEDS_Tool.hxx b/src/TOOLSDS/SALOMEDS_Tool.hxx index b3f898902..e8813673b 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.hxx +++ b/src/TOOLSDS/SALOMEDS_Tool.hxx @@ -69,23 +69,6 @@ public: SALOMEDS::SObject_var theObj, std::list& theList ); - - // Retrieves specified flaf from "AttributeFlags" attribute - static bool GetFlag( const int theFlag, - _PTR(Study) theStudy, - _PTR(SObject) theObj ); - - // Sets/Unsets specified flaf from "AttributeFlags" attribute - static bool SetFlag( const int theFlag, - _PTR(Study) theStudy, - const std::string& theEntry, - const bool theValue ); - - // Get all entries of children of object. If theObj is null all entries of objects of study are returned - static void GetAllChildren( _PTR(Study) theStudy, - _PTR(SObject) theObj, - std::list& theList ); - }; #endif -- 2.39.2