1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : SALOMEDSImpl_StudyHandle.cxx
21 // Author : Sergey LITONIN
24 #include "SALOMEDSImpl_StudyHandle.hxx"
27 Class : SALOMEDSImpl_StudyHandle
28 Description : This class is intended for storing information about
29 graphic representation of objects in dirrent views
33 //=======================================================================
35 //purpose : Get GUID of this attribute
36 //=======================================================================
37 const std::string& SALOMEDSImpl_StudyHandle::GetID()
39 static std::string SALOMEDSImpl_StudyHandleID( "050C9555-4BA8-49bf-8F1C-086F0469A40B" );
40 return SALOMEDSImpl_StudyHandleID;
43 //=======================================================================
44 //function : SALOMEDSImpl_StudyHandle
45 //purpose : Empty Constructor
46 //=======================================================================
47 SALOMEDSImpl_StudyHandle::SALOMEDSImpl_StudyHandle()
52 //=======================================================================
55 //=======================================================================
56 SALOMEDSImpl_StudyHandle* SALOMEDSImpl_StudyHandle::Set(const DF_Label& theLabel,
57 SALOMEDSImpl_Study* theStudy)
59 SALOMEDSImpl_StudyHandle* A = NULL;
60 if (!(A=(SALOMEDSImpl_StudyHandle*)theLabel.FindAttribute(GetID()))) {
61 A = new SALOMEDSImpl_StudyHandle;
62 theLabel.AddAttribute(A);
70 //=======================================================================
72 //purpose : Get GUID of this attribute
73 //=======================================================================
74 const std::string& SALOMEDSImpl_StudyHandle::ID () const
80 //=======================================================================
82 //purpose : Create new empty attribute
83 //=======================================================================
84 DF_Attribute* SALOMEDSImpl_StudyHandle::NewEmpty () const
86 return new SALOMEDSImpl_StudyHandle ();
90 //=======================================================================
92 //purpose : Restore value of attribute with value of theWith one
93 //=======================================================================
94 void SALOMEDSImpl_StudyHandle::Restore( DF_Attribute* theWith )
96 SALOMEDSImpl_StudyHandle* anAttr = dynamic_cast<SALOMEDSImpl_StudyHandle*>( theWith );
97 if ( anAttr ) Set ( anAttr->Get() );
100 //=======================================================================
102 //purpose : Paste value of current attribute to the value of entry one
103 //=======================================================================
104 void SALOMEDSImpl_StudyHandle::Paste( DF_Attribute* theInto)
106 SALOMEDSImpl_StudyHandle* anAttr = dynamic_cast<SALOMEDSImpl_StudyHandle*>( theInto );
107 if ( anAttr ) anAttr->Set ( myHandle );