1 // Copyright (C) 2007-2008 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.
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
22 // File : SALOMEDSImpl_StudyHandle.cxx
23 // Author : Sergey LITONIN
26 #include "SALOMEDSImpl_StudyHandle.hxx"
29 Class : SALOMEDSImpl_StudyHandle
30 Description : This class is intended for storing information about
31 graphic representation of objects in dirrent views
35 //=======================================================================
37 //purpose : Get GUID of this attribute
38 //=======================================================================
39 const std::string& SALOMEDSImpl_StudyHandle::GetID()
41 static std::string SALOMEDSImpl_StudyHandleID( "050C9555-4BA8-49bf-8F1C-086F0469A40B" );
42 return SALOMEDSImpl_StudyHandleID;
45 //=======================================================================
46 //function : SALOMEDSImpl_StudyHandle
47 //purpose : Empty Constructor
48 //=======================================================================
49 SALOMEDSImpl_StudyHandle::SALOMEDSImpl_StudyHandle()
54 //=======================================================================
57 //=======================================================================
58 SALOMEDSImpl_StudyHandle* SALOMEDSImpl_StudyHandle::Set(const DF_Label& theLabel,
59 SALOMEDSImpl_Study* theStudy)
61 SALOMEDSImpl_StudyHandle* A = NULL;
62 if (!(A=(SALOMEDSImpl_StudyHandle*)theLabel.FindAttribute(GetID()))) {
63 A = new SALOMEDSImpl_StudyHandle;
64 theLabel.AddAttribute(A);
72 //=======================================================================
74 //purpose : Get GUID of this attribute
75 //=======================================================================
76 const std::string& SALOMEDSImpl_StudyHandle::ID () const
82 //=======================================================================
84 //purpose : Create new empty attribute
85 //=======================================================================
86 DF_Attribute* SALOMEDSImpl_StudyHandle::NewEmpty () const
88 return new SALOMEDSImpl_StudyHandle ();
92 //=======================================================================
94 //purpose : Restore value of attribute with value of theWith one
95 //=======================================================================
96 void SALOMEDSImpl_StudyHandle::Restore( DF_Attribute* theWith )
98 SALOMEDSImpl_StudyHandle* anAttr = dynamic_cast<SALOMEDSImpl_StudyHandle*>( theWith );
99 if ( anAttr ) Set ( anAttr->Get() );
102 //=======================================================================
104 //purpose : Paste value of current attribute to the value of entry one
105 //=======================================================================
106 void SALOMEDSImpl_StudyHandle::Paste( DF_Attribute* theInto)
108 SALOMEDSImpl_StudyHandle* anAttr = dynamic_cast<SALOMEDSImpl_StudyHandle*>( theInto );
109 if ( anAttr ) anAttr->Set ( myHandle );