Salome HOME
NRI : Merge from V1_2.
[modules/superv.git] / src / GraphEditor / DataFlowEditor_DataFlow.cxx
1 //  SUPERV GraphEditor : contains classes that permit edition of graphs
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : DataFlowEditor_DataFlow.cxx
25 //  Module : SUPERV
26
27 using namespace std;
28 #include "DataFlowEditor_DataFlow.hxx"
29
30 // Implementation de la classe GraphEditor::Graph
31
32 GraphEditor::DataFlow::DataFlow() :
33   OutNode() {
34   cdebug_in << "GraphEditor::DataFlow::DataFlowEditor()" << endl;
35
36   _theNamingService = NULL ;
37   _DataFlowExecutor = NULL ;
38   _ReadOnly  = false ;
39   _Executing = false ;
40
41   cdebug_out << "GraphEditor::DataFlow::DataFlowEditor()" << endl;
42 }
43
44 GraphEditor::DataFlow::DataFlow( CORBA::ORB_ptr ORB,
45                                  SALOME_NamingService* ptrNamingService ,
46                                  const char *DataFlowName ,
47                                  const char * DebugFileName ) :
48   OutNode( ORB, ptrNamingService , DataFlowName , DebugFileName ) {
49   cdebug_in << "GraphEditor::DataFlow::DataFlow(" ;
50   if ( DataFlowName ) {
51     cdebug << DataFlowName ;
52   }
53   cdebug << ")" << endl;
54
55   _theNamingService = ptrNamingService ;
56   _DataFlowExecutor = NULL ;
57   _ReadOnly  = false ;
58   _Executing = false ;
59
60   cdebug_out << "GraphEditor::DataFlow::DataFlow" << endl;
61 }
62
63 GraphEditor::DataFlow::DataFlow(
64                      CORBA::ORB_ptr ORB,
65                      SALOME_NamingService* ptrNamingService ,
66                      const SALOME_ModuleCatalog::Service& DataFlowService ,
67                      const char *DataFlowComponentName ,
68                      const char *DataFlowInterfaceName ,
69                      const char *DataFlowName ,
70                      const SUPERV::KindOfNode DataFlowkind ,
71                      const SUPERV::SDate DataFlowFirstCreation ,
72                      const SUPERV::SDate DataFlowLastModification ,
73                      const char * DataFlowEditorRelease ,
74                      const char * DataFlowAuthor ,
75                      const char * DataFlowComputer ,
76                      const char * DataFlowComment ,
77                      const char * DebugFileName ) :
78      OutNode( ORB, ptrNamingService , DataFlowService , DataFlowComponentName ,
79               DataFlowInterfaceName , DataFlowName , DataFlowkind ,
80               DataFlowFirstCreation , DataFlowLastModification  ,
81               DataFlowEditorRelease , DataFlowAuthor ,
82               DataFlowComputer , DataFlowComment , DebugFileName ) {
83   cdebug_in << "GraphEditor::DataFlow::DataFlow(" << DataFlowName << ")" << endl;
84
85   _theNamingService = ptrNamingService ;
86   _DataFlowExecutor = NULL ;
87   _ReadOnly  = false ;
88   _Executing = false ;
89
90   cdebug_out << "GraphEditor::DataFlow::DataFlow" << endl;
91 } ;
92
93 GraphEditor::DataFlow::~DataFlow() {
94 //  delete _DataFlowNode ;
95 //  delete _DataFlowDatas ;
96 //  delete _GT ;
97 }
98
99 #if 0
100 GraphExecutor::DataFlow * GraphEditor::DataFlow::Run() {
101   cdebug_in << "GraphEditor::DataFlow::Run" << endl;
102   SUPERV::SGraph * theDataFlow ;
103   GraphExecutor::DataFlow * aDataFlowExecutor ;
104   theDataFlow = GetDataFlow() ;
105   aDataFlowExecutor = new GraphExecutor::DataFlow( NamingService() ,
106                                                    theDataFlow->Info.theName ) ;
107   if ( aDataFlowExecutor->LoadDataFlow( *theDataFlow ) ) {
108     aDataFlowExecutor->Run() ;
109   }
110   else {
111     MESSAGE( "GraphEditor::DataFlow::Run error while loading DataFlowExecutor")
112     delete aDataFlowExecutor ;
113   }
114   cdebug_out << "GraphEditor::DataFlow::Run" << endl;
115   return aDataFlowExecutor ;
116 }
117 #endif
118