Salome HOME
Merge from BR_PARAVIS_DEV 29Dec09
[modules/paravis.git] / src / ENGINE / PARAVIS_Engine_i.hh
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 #ifndef __PARAVIS_ENGINE_I_H__
23 #define __PARAVIS_ENGINE_I_H__
24
25 // IDL headers
26 #include "SALOMEconfig.h"
27 #include CORBA_SERVER_HEADER(PARAVIS_Gen)
28 #include CORBA_SERVER_HEADER(SALOME_Session)
29 #include CORBA_SERVER_HEADER(SALOMEDS)
30 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
31
32 #include "SALOME_Component_i.hxx"
33
34 namespace PARAVIS
35 {
36   /*!
37    * Implements PARAVIS_Gen interface. 
38    * Ativates corresponded interface in GUI main thread and redirects all calls to that interface.
39    */
40   class PARAVIS_Gen_i : public virtual POA_PARAVIS::PARAVIS_Gen,
41                      public virtual ::Engines_Component_i
42   {
43     //! Reference on corresponded interface in GUI thread
44     PARAVIS_Gen_var myParaVisGen;
45
46     //! Empty Constructor
47     PARAVIS_Gen_i();
48     //! Copy Constructor
49     PARAVIS_Gen_i(const PARAVIS::PARAVIS_Gen_i &);
50   public:
51     //! Constructor
52     PARAVIS_Gen_i(SALOME::Session_ptr session,
53                   CORBA::ORB_ptr orb,
54                   PortableServer::POA_ptr poa,
55                   PortableServer::ObjectId * contId, 
56                   const char *instanceName, 
57                   const char *interfaceName);
58     virtual ~PARAVIS_Gen_i();
59     
60     virtual char* GetIOR();
61
62     virtual void ImportFile(const char* theFileName);
63     
64     virtual char* GetTrace();
65     
66     virtual void SaveTrace(const char* theFileName);
67     
68     // inherited methods from SALOMEDS::Driver
69     virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent, 
70                                     const char* theURL, bool isMultiFile);
71     
72     virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
73                                          const char* theURL, bool isMultiFile);
74     
75     virtual bool Load(SALOMEDS::SComponent_ptr,  const SALOMEDS::TMPFile &,
76                       const char* theURL, bool isMultiFile);
77
78     virtual bool LoadASCII(SALOMEDS::SComponent_ptr, const SALOMEDS::TMPFile &,
79                            const char* theURL, bool isMultiFile);
80     
81     virtual void Close(SALOMEDS::SComponent_ptr IORSComponent);
82
83     virtual char* ComponentDataType();
84
85     virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, const char* IORString,
86                                          CORBA::Boolean isMultiFile, CORBA::Boolean isASCII);
87
88     virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, const char* aLocalPersistentID,
89                                          CORBA::Boolean isMultiFile, CORBA::Boolean isASCII);
90
91     virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR);
92
93     virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
94                                                  SALOMEDS::SObject_ptr theSObject, 
95                                                  CORBA::Object_ptr theObject,
96                                                  const char* theName) throw (SALOME::SALOME_Exception);
97
98     virtual CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
99
100     virtual SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
101
102     virtual CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
103
104     virtual SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
105                                             CORBA::Long theObjectID, SALOMEDS::SObject_ptr theObject);
106
107
108     virtual PARAVIS::string_array* GetClassesList();
109     virtual PARAVIS_Base_ptr CreateClass(const char* theClassName);
110     virtual void GetConnectionParameters(CORBA::Long& theId, 
111                                          CORBA::String_out theDHost, CORBA::Long& theDPort,
112                                          CORBA::String_out theRHost, CORBA::Long& theRPort,
113                                          CORBA::Long& theReversed);
114                                          
115     virtual void ActivateModule();
116
117   };
118 };
119 #endif