1 // SUPERV GraphEditor : contains classes that permit edition of graphs
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : DataFlowEditor_DataFlow.cxx
28 #include "DataFlowEditor_DataFlow.hxx"
30 // Implementation de la classe GraphEditor::Graph
32 GraphEditor::DataFlow::DataFlow() :
34 cdebug_in << "GraphEditor::DataFlow::DataFlowEditor()" << endl;
36 _theNamingService = NULL ;
37 _DataFlowExecutor = NULL ;
41 cdebug_out << "GraphEditor::DataFlow::DataFlowEditor()" << endl;
44 //extern ostream * fdebug ;
46 GraphEditor::DataFlow::DataFlow( CORBA::ORB_ptr ORB,
47 SALOME_NamingService* ptrNamingService ,
48 const char *DataFlowName ,
49 const char * DebugFileName ) :
50 OutNode( ORB, ptrNamingService , DataFlowName , DebugFileName ) {
51 // cout << "GraphEditor::DataFlow::DataFlow(" ;
52 cdebug_in << "GraphEditor::DataFlow::DataFlow(" ;
54 // cout << DataFlowName << " , " << DebugFileName ;
55 cdebug << DataFlowName << " , " << DebugFileName;
57 // cout << ")" << endl;
58 cdebug << ")" << endl;
60 _theNamingService = ptrNamingService ;
61 _DataFlowExecutor = NULL ;
65 cdebug_out << "GraphEditor::DataFlow::DataFlow" << endl;
66 // fdebug = new ofstream( DebugFileName ); // GraphBase::Base::_fdebug ;
69 GraphEditor::DataFlow::DataFlow(
71 SALOME_NamingService* ptrNamingService ,
72 const SALOME_ModuleCatalog::Service& DataFlowService ,
73 const char *DataFlowComponentName ,
74 const char *DataFlowInterfaceName ,
75 const char *DataFlowName ,
76 const SUPERV::KindOfNode DataFlowkind ,
77 const SUPERV::SDate DataFlowFirstCreation ,
78 const SUPERV::SDate DataFlowLastModification ,
79 const char * DataFlowEditorRelease ,
80 const char * DataFlowAuthor ,
81 const char * DataFlowComputer ,
82 const char * DataFlowComment ,
83 const char * DebugFileName ) :
84 OutNode( ORB, ptrNamingService , DataFlowService , DataFlowComponentName ,
85 DataFlowInterfaceName , DataFlowName , DataFlowkind ,
86 DataFlowFirstCreation , DataFlowLastModification ,
87 DataFlowEditorRelease , DataFlowAuthor ,
88 DataFlowComputer , DataFlowComment , DebugFileName ) {
89 cdebug_in << "GraphEditor::DataFlow::DataFlow(" << DataFlowName << ")" << endl;
91 _theNamingService = ptrNamingService ;
92 _DataFlowExecutor = NULL ;
96 cdebug_out << "GraphEditor::DataFlow::DataFlow" << endl;
99 GraphEditor::DataFlow::~DataFlow() {
100 // delete _DataFlowNode ;
101 // delete _DataFlowDatas ;
106 GraphExecutor::DataFlow * GraphEditor::DataFlow::Run() {
107 cdebug_in << "GraphEditor::DataFlow::Run" << endl;
108 SUPERV::SGraph * theDataFlow ;
109 GraphExecutor::DataFlow * aDataFlowExecutor ;
110 theDataFlow = GetDataFlow() ;
111 aDataFlowExecutor = new GraphExecutor::DataFlow( NamingService() ,
112 theDataFlow->Info.theName ) ;
113 if ( aDataFlowExecutor->LoadDataFlow( *theDataFlow ) ) {
114 aDataFlowExecutor->Run() ;
117 MESSAGE( "GraphEditor::DataFlow::Run error while loading DataFlowExecutor")
118 delete aDataFlowExecutor ;
120 cdebug_out << "GraphEditor::DataFlow::Run" << endl;
121 return aDataFlowExecutor ;