1 // Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : SALOMEDSImpl_StudyHandle.cxx
24 // Author : Sergey LITONIN
27 #include "SALOMEDSImpl_StudyHandle.hxx"
30 Class : SALOMEDSImpl_StudyHandle
31 Description : This class is intended for storing information about
32 graphic representation of objects in dirrent views
36 //=======================================================================
38 //purpose : Get GUID of this attribute
39 //=======================================================================
40 const std::string& SALOMEDSImpl_StudyHandle::GetID()
42 static std::string SALOMEDSImpl_StudyHandleID( "050C9555-4BA8-49bf-8F1C-086F0469A40B" );
43 return SALOMEDSImpl_StudyHandleID;
46 //=======================================================================
47 //function : SALOMEDSImpl_StudyHandle
48 //purpose : Empty Constructor
49 //=======================================================================
50 SALOMEDSImpl_StudyHandle::SALOMEDSImpl_StudyHandle()
55 //=======================================================================
58 //=======================================================================
59 SALOMEDSImpl_StudyHandle* SALOMEDSImpl_StudyHandle::Set(const DF_Label& theLabel,
60 SALOMEDSImpl_Study* theStudy)
62 SALOMEDSImpl_StudyHandle* A = NULL;
63 if (!(A=(SALOMEDSImpl_StudyHandle*)theLabel.FindAttribute(GetID()))) {
64 A = new SALOMEDSImpl_StudyHandle;
65 theLabel.AddAttribute(A);
73 //=======================================================================
75 //purpose : Get GUID of this attribute
76 //=======================================================================
77 const std::string& SALOMEDSImpl_StudyHandle::ID () const
83 //=======================================================================
85 //purpose : Create new empty attribute
86 //=======================================================================
87 DF_Attribute* SALOMEDSImpl_StudyHandle::NewEmpty () const
89 return new SALOMEDSImpl_StudyHandle ();
93 //=======================================================================
95 //purpose : Restore value of attribute with value of theWith one
96 //=======================================================================
97 void SALOMEDSImpl_StudyHandle::Restore( DF_Attribute* theWith )
99 SALOMEDSImpl_StudyHandle* anAttr = dynamic_cast<SALOMEDSImpl_StudyHandle*>( theWith );
100 if ( anAttr ) Set ( anAttr->Get() );
103 //=======================================================================
105 //purpose : Paste value of current attribute to the value of entry one
106 //=======================================================================
107 void SALOMEDSImpl_StudyHandle::Paste( DF_Attribute* theInto)
109 SALOMEDSImpl_StudyHandle* anAttr = dynamic_cast<SALOMEDSImpl_StudyHandle*>( theInto );
110 if ( anAttr ) anAttr->Set ( myHandle );