1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
23 // File : DataFlowBase_LoopNode.hxx
24 // Author : Jean Rahuel, CEA
27 #ifndef _DATAFLOWBASE_LOOPNODE_HXX
28 #define _DATAFLOWBASE_LOOPNODE_HXX
30 #include "DataFlowBase_GOTONode.hxx"
34 class LoopNode : public GOTONode {
39 SUPERV::ListOfStrings * _MorePythonFunction ;
40 PyObject * _MyPyMoreMethod ;
42 SUPERV::ListOfStrings * _NextPythonFunction ;
43 PyObject * _MyPyNextMethod ;
48 LoopNode( CORBA::ORB_ptr ORB ,
49 SALOME_NamingService* ptrNamingService ,
50 const char * InitName ,
51 const SUPERV::ListOfStrings & aInitPythonFunction ,
52 const char * MoreName ,
53 const SUPERV::ListOfStrings & aMorePythonFunction ,
54 const char * NextName ,
55 const SUPERV::ListOfStrings & aNextPythonFunction ,
56 const char *NodeName ,
57 const SUPERV::KindOfNode akind ,
58 const SUPERV::SDate NodeFirstCreation ,
59 const SUPERV::SDate NodeLastModification ,
60 const char * NodeEditorRelease ,
61 const char * NodeAuthor ,
62 const char * NodeComment ,
63 const bool GeneratedName ,
66 int * Graph_prof_debug = NULL ,
67 ofstream * Graph_fdebug = NULL ) ;
70 void SetMorePythonFunction( const char * MoreName ,
71 const SUPERV::ListOfStrings & aMorePythonFunction ) {
72 _MoreName = my_strblkdup( MoreName ) ;
73 cdebug << "GraphBase::LoopNode::SetMorePythonFunction MoreName '" << MoreName << "' --> '"
74 << _MoreName << "'" << endl ;
75 _MorePythonFunction = new SUPERV::ListOfStrings( aMorePythonFunction ) ; } ;
77 SUPERV::ListOfStrings * MorePythonFunction() const {
78 SUPERV::ListOfStrings * aMorePythonFunction ;
79 aMorePythonFunction = new SUPERV::ListOfStrings( *_MorePythonFunction ) ;
80 return aMorePythonFunction ; } ;
83 //JR 17.02.2005 Memory Leak return my_strdup( _MoreName ) ; } ;
84 return _MoreName ; } ;
86 void PyMoreMethod( PyObject * MyPyMoreMethod ) {
87 _MyPyMoreMethod = MyPyMoreMethod ; } ;
89 PyObject * PyMoreMethod() {
90 return _MyPyMoreMethod ; } ;
92 void SetNextPythonFunction( const char * NextName ,
93 const SUPERV::ListOfStrings & aNextPythonFunction ) {
94 _NextName = my_strblkdup( NextName ) ;
95 cdebug << "GraphBase::LoopNode::SetNextPythonFunction NextName '" << NextName << "' --> '"
96 << _NextName << "'" << endl ;
97 _NextPythonFunction = new SUPERV::ListOfStrings( aNextPythonFunction ) ; } ;
99 SUPERV::ListOfStrings * NextPythonFunction() const {
100 SUPERV::ListOfStrings * aNextPythonFunction ;
101 aNextPythonFunction = new SUPERV::ListOfStrings( *_NextPythonFunction ) ;
102 return aNextPythonFunction ; } ;
104 char * PyNextName() {
105 //JR 17.02.2005 Memory Leak return my_strdup( _NextName ) ; } ;
106 return _NextName ; } ;
107 void PyNextMethod( PyObject * MyPyNextMethod ) {
108 _MyPyNextMethod = MyPyNextMethod ; } ;
110 PyObject * PyNextMethod() {
111 return _MyPyNextMethod ; } ;
113 // bool SaveXML(ostream &f , char *Tabs , int X , int Y ) ;
114 bool SaveXML(QDomDocument & Graph , QDomElement & info , int X , int Y ) ;
116 bool SavePY(ostream &f , const char * aGraphName , int X , int Y ) ;