Salome HOME
Update copyright information
[modules/smesh.git] / src / SMESH_I / SMESH_Hypothesis_i.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
23 //  File   : SMESH_Hypothesis_i.cxx
24 //  Author : Paul RASCLE, EDF
25 //  Module : SMESH
26 //  $Header$
27 //
28 #include <iostream>
29 #include <sstream>
30 #include "SMESH_Hypothesis_i.hxx"
31 #include "utilities.h"
32
33 using namespace std;
34
35 //=============================================================================
36 /*!
37  *  SMESH_Hypothesis_i::SMESH_Hypothesis_i
38  * 
39  *  Constructor
40  */
41 //=============================================================================
42
43 SMESH_Hypothesis_i::SMESH_Hypothesis_i( PortableServer::POA_ptr thePOA )
44      : SALOME::GenericObj_i( thePOA )
45 {
46   MESSAGE( "SMESH_Hypothesis_i::SMESH_Hypothesis_i / Début" );
47   myBaseImpl = 0;
48   
49   MESSAGE( "SMESH_Hypothesis_i::SMESH_Hypothesis_i / Fin" );
50 };
51
52 //=============================================================================
53 /*!
54  *  SMESH_Hypothesis_i::~SMESH_Hypothesis_i
55  *
56  *  Destructor
57  */
58 //=============================================================================
59
60 SMESH_Hypothesis_i::~SMESH_Hypothesis_i()
61 {
62   MESSAGE( "SMESH_Hypothesis_i::~SMESH_Hypothesis_i" );
63   if ( myBaseImpl )
64     delete myBaseImpl;
65 };
66
67 //=============================================================================
68 /*!
69  *  SMESH_Hypothesis_i::GetName
70  *
71  *  Get type name of hypothesis
72  */
73 //=============================================================================
74
75 char* SMESH_Hypothesis_i::GetName()
76 {
77   //MESSAGE( "SMESH_Hypothesis_i::GetName" );
78   return CORBA::string_dup( myBaseImpl->GetName() );
79 };
80
81 //=============================================================================
82 /*!
83  *  SMESH_Hypothesis_i::GetLibName
84  *
85  *  Get plugin library name of hypothesis (required by persistency mechanism)
86  */
87 //=============================================================================
88
89 char* SMESH_Hypothesis_i::GetLibName()
90 {
91   MESSAGE( "SMESH_Hypothesis_i::GetLibName" );
92   return CORBA::string_dup( myBaseImpl->GetLibName() );
93 };
94
95 //=============================================================================
96 /*!
97  *  SMESH_Hypothesis_i::SetLibName
98  *
99  *  Set plugin library name of hypothesis (required by persistency mechanism)
100  */
101 //=============================================================================
102
103 void SMESH_Hypothesis_i::SetLibName(const char* theLibName)
104 {
105   MESSAGE( "SMESH_Hypothesis_i::SetLibName" );
106   myBaseImpl->SetLibName( theLibName );
107 };
108
109 //=============================================================================
110 /*!
111  *  SMESH_Hypothesis_i::GetId
112  *
113  *  Get unique id of hypothesis
114  */
115 //=============================================================================
116
117 CORBA::Long SMESH_Hypothesis_i::GetId()
118 {
119   MESSAGE( "SMESH_Hypothesis_i::GetId" );
120   return myBaseImpl->GetID();
121 }
122
123 //=============================================================================
124 /*!
125  *  SMESH_Hypothesis_i::GetImpl
126  *
127  *  Get implementation
128  */
129 //=============================================================================
130
131 ::SMESH_Hypothesis* SMESH_Hypothesis_i::GetImpl()
132 {
133   //MESSAGE( "SMESH_Hypothesis_i::GetImpl" );
134   return myBaseImpl;
135 }
136
137 //=============================================================================
138 /*!
139  *  SMESH_Hypothesis_i::SaveTo
140  *
141  *  Persistence: Dumps parameters to the string stream
142  */
143 //=============================================================================
144
145 char* SMESH_Hypothesis_i::SaveTo()
146 {
147   MESSAGE( "SMESH_Hypothesis_i::SaveTo" );
148   std::ostringstream os;
149   myBaseImpl->SaveTo( os );
150   return CORBA::string_dup( os.str().c_str() );
151 }
152
153 //=============================================================================
154 /*!
155 *  SMESH_Hypothesis_i::LoadFrom
156 *
157 *  Persistence: Restores parameters from string
158 */
159 //=============================================================================
160
161 void SMESH_Hypothesis_i::LoadFrom( const char* theStream )
162 {
163   MESSAGE( "SMESH_Hypothesis_i::LoadFrom" );
164   std::istringstream is( theStream );
165   myBaseImpl->LoadFrom( is );
166 }