Salome HOME
cf662b61c41629f76754f6c0cf87a9dda962dfe1
[modules/kernel.git] / src / KernelHelpers / SALOMEDS_DriverDefaultImpl.cxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author: Guillaume Boulant (EDF/R&D)
20
21 #include <utilities.h>
22 #include "SALOMEDS_DriverDefaultImpl.hxx"
23
24
25 //===========================================================================
26     SALOMEDS_DriverDefaultImpl::SALOMEDS_DriverDefaultImpl(CORBA::ORB_ptr orb,
27                                          PortableServer::POA_ptr poa,
28                                          PortableServer::ObjectId * contId,
29                                          const char *instanceName,
30                                          const char *interfaceName) 
31 //     :Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
32   {
33     MESSAGE("SALOMEDS_DriverDefaultImpl::SALOMEDS_DriverDefaultImpl : ");
34   };
35
36 //===========================================================================
37   SALOMEDS_DriverDefaultImpl::~SALOMEDS_DriverDefaultImpl()
38   {
39     MESSAGE("SALOMEDS_DriverDefaultImpl::~SALOMEDS_DriverDefaultImpl");
40   };
41
42 //===========================================================================
43   CORBA::Boolean SALOMEDS_DriverDefaultImpl::Load(SALOMEDS::SComponent_ptr theComponent,
44                                   const SALOMEDS::TMPFile & theStream,
45                                   const char* theURL,
46                                   bool isMultiFile)
47   {
48     MESSAGE("--------------------------------------");
49     MESSAGE("--------------------------------------");
50     MESSAGE("--------------------------------------");
51     MESSAGE("SALOMEDS_DriverDefaultImpl::Load");
52     MESSAGE("Should be implemented");
53     MESSAGE("--------------------------------------");
54     MESSAGE("--------------------------------------");
55     MESSAGE("--------------------------------------");
56     return false;
57   };
58
59 //===========================================================================
60   CORBA::Boolean SALOMEDS_DriverDefaultImpl::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
61                                        const SALOMEDS::TMPFile & theStream,
62                                        const char* theURL,
63                                        bool isMultiFile)
64   {
65     MESSAGE("--------------------------------------");
66     MESSAGE("--------------------------------------");
67     MESSAGE("--------------------------------------");
68     MESSAGE("SALOMEDS_DriverDefaultImpl::LoadASCII");
69     MESSAGE("Should be implemented");
70     MESSAGE("--------------------------------------");
71     MESSAGE("--------------------------------------");
72     MESSAGE("--------------------------------------");
73     return false;
74   };
75
76 //===========================================================================
77   char* SALOMEDS_DriverDefaultImpl::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
78                                            const char* aLocalPersistentID,
79                                            CORBA::Boolean isMultiFile,
80                                            CORBA::Boolean isASCII)
81   {
82     MESSAGE("--------------------------------------");
83     MESSAGE("--------------------------------------");
84     MESSAGE("--------------------------------------");
85     MESSAGE("SALOMEDS_DriverDefaultImpl::LocalPersistentIDToIOR");
86     MESSAGE("Should be implemented");
87     MESSAGE("--------------------------------------");
88     MESSAGE("--------------------------------------");
89     MESSAGE("--------------------------------------");
90     CORBA::String_var aString("");
91     return aString._retn();
92   };
93
94 //===========================================================================
95   SALOMEDS::TMPFile* SALOMEDS_DriverDefaultImpl::Save(SALOMEDS::SComponent_ptr theComponent,
96                                       const char* theURL,
97                                       bool isMultiFile)
98   {
99     MESSAGE("--------------------------------------");
100     MESSAGE("--------------------------------------");
101     MESSAGE("--------------------------------------");
102     MESSAGE("SALOMEDS_DriverDefaultImpl::Save");
103     MESSAGE("Should be implemented");
104     MESSAGE("--------------------------------------");
105     MESSAGE("--------------------------------------");
106     MESSAGE("--------------------------------------");
107     SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
108     return aStreamFile._retn();
109   };
110
111 //===========================================================================
112   SALOMEDS::TMPFile* SALOMEDS_DriverDefaultImpl::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
113                                            const char* theURL,
114                                            bool isMultiFile)
115   {
116     MESSAGE("--------------------------------------");
117     MESSAGE("--------------------------------------");
118     MESSAGE("--------------------------------------");
119     MESSAGE("SALOMEDS_DriverDefaultImpl::SaveASCII");
120     MESSAGE("Should be implemented");
121     MESSAGE("--------------------------------------");
122     MESSAGE("--------------------------------------");
123     MESSAGE("--------------------------------------");
124     SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
125     return aStreamFile._retn();
126   };
127
128 //===========================================================================
129   char* SALOMEDS_DriverDefaultImpl::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
130                                            const char* IORString,
131                                            CORBA::Boolean isMultiFile,
132                                            CORBA::Boolean isASCII)
133   {
134     MESSAGE("-----------------------------------------");
135     MESSAGE("-----------------------------------------");
136     MESSAGE("-----------------------------------------");
137     MESSAGE("SALOMEDS_DriverDefaultImpl::IORToLocalPersistentID");
138     MESSAGE("Should be implemented");
139     MESSAGE("-----------------------------------------");
140     MESSAGE("-----------------------------------------");
141     MESSAGE("-----------------------------------------");
142     CORBA::String_var aString("");
143     return aString._retn();
144   };
145
146
147 //===========================================================================
148   void SALOMEDS_DriverDefaultImpl::Close(SALOMEDS::SComponent_ptr theComponent)
149   {
150     MESSAGE("------------------------");
151     MESSAGE("SALOMEDS_DriverDefaultImpl::Close");
152     MESSAGE("------------------------");
153   };
154
155 //===========================================================================
156   char* SALOMEDS_DriverDefaultImpl::ComponentDataType()
157   {
158     MESSAGE("-----------------------------------------");
159     MESSAGE("-----------------------------------------");
160     MESSAGE("-----------------------------------------");
161     MESSAGE("SALOMEDS_DriverDefaultImpl::ComponentDataType");
162     MESSAGE("Should be implemented");
163     MESSAGE("-----------------------------------------");
164     MESSAGE("-----------------------------------------");
165     MESSAGE("-----------------------------------------");
166     return CORBA::string_dup("J aurais du nommer mon type prefere");
167   };
168
169 //===========================================================================
170   bool SALOMEDS_DriverDefaultImpl::CanPublishInStudy(CORBA::Object_ptr theIOR) 
171   {
172     MESSAGE("-----------------------------------------");
173     MESSAGE("-----------------------------------------");
174     MESSAGE("-----------------------------------------");
175     MESSAGE("SALOMEDS_DriverDefaultImpl::CanPublishInStudy");
176     MESSAGE("Should be implemented");
177     MESSAGE("-----------------------------------------");
178     MESSAGE("-----------------------------------------");
179     MESSAGE("-----------------------------------------");
180     return false;
181   };
182
183 //===========================================================================
184   SALOMEDS::SObject_ptr SALOMEDS_DriverDefaultImpl::PublishInStudy(SALOMEDS::Study_ptr theStudy,
185                                                    SALOMEDS::SObject_ptr theSObject,
186                                                    CORBA::Object_ptr theObject,
187                                                    const char* theName)
188     throw (SALOME::SALOME_Exception)
189   {
190     MESSAGE("-----------------------------------------");
191     MESSAGE("-----------------------------------------");
192     MESSAGE("-----------------------------------------");
193     MESSAGE("SALOMEDS_DriverDefaultImpl::PublishInStudy");
194     MESSAGE("Should be implemented");
195     MESSAGE("-----------------------------------------");
196     MESSAGE("-----------------------------------------");
197     MESSAGE("-----------------------------------------");
198     SALOMEDS::SObject_var aResultSO;
199     return aResultSO._retn();
200   };
201
202 //===========================================================================
203   CORBA::Boolean SALOMEDS_DriverDefaultImpl::CanCopy(SALOMEDS::SObject_ptr theObject) 
204   {
205     MESSAGE("-----------------------------------------");
206     MESSAGE("-----------------------------------------");
207     MESSAGE("-----------------------------------------");
208     MESSAGE("SALOMEDS_DriverDefaultImpl::CanCopy");
209     MESSAGE("Should be implemented");
210     MESSAGE("-----------------------------------------");
211     MESSAGE("-----------------------------------------");
212     MESSAGE("-----------------------------------------");
213     //return false;
214     return true;
215   };
216
217 //===========================================================================
218   SALOMEDS::TMPFile* SALOMEDS_DriverDefaultImpl::CopyFrom(SALOMEDS::SObject_ptr theObject,
219                                              CORBA::Long& theObjectID)
220 {
221     MESSAGE("--------------------------------------");
222     MESSAGE("--------------------------------------");
223     MESSAGE("--------------------------------------");
224     MESSAGE("SALOMEDS_DriverDefaultImpl::CopyFrom");
225     MESSAGE("Should be implemented");
226     MESSAGE("--------------------------------------");
227     MESSAGE("--------------------------------------");
228     MESSAGE("--------------------------------------");
229     SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
230     return aStreamFile._retn();
231 };
232
233 //===========================================================================
234   SALOMEDS::SObject_ptr SALOMEDS_DriverDefaultImpl::PasteInto( const SALOMEDS::TMPFile & theStream,
235                                                       CORBA::Long theObjectID,
236                                                       SALOMEDS::SObject_ptr theSObject)
237   {
238     MESSAGE("-----------------------------------------");
239     MESSAGE("-----------------------------------------");
240     MESSAGE("-----------------------------------------");
241     MESSAGE("SALOMEDS_DriverDefaultImpl::PasteInto");
242     MESSAGE("Should be implemented");
243     MESSAGE("-----------------------------------------");
244     MESSAGE("-----------------------------------------");
245     MESSAGE("-----------------------------------------");
246     SALOMEDS::SObject_var aResultSO;
247     return aResultSO._retn();
248   };
249
250 //===========================================================================
251    CORBA::Boolean  SALOMEDS_DriverDefaultImpl::CanPaste ( const char *theComponentName,
252                                                  CORBA::Long theObjectID)
253   {
254     MESSAGE("-----------------------------------------");
255     MESSAGE("-----------------------------------------");
256     MESSAGE("-----------------------------------------");
257     MESSAGE("SALOMEDS_DriverDefaultImpl::CanPaste");
258     MESSAGE("Should be implemented");
259     MESSAGE("-----------------------------------------");
260     MESSAGE("-----------------------------------------");
261     MESSAGE("-----------------------------------------");
262     return false;
263   };
264
265