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