src/GraphEditor/DataFlowEditor_DataFlow.hxx

Go to the documentation of this file.
00001 //  SUPERV GraphEditor : contains classes that permit edition of graphs
00002 //
00003 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
00005 // 
00006 //  This library is free software; you can redistribute it and/or 
00007 //  modify it under the terms of the GNU Lesser General Public 
00008 //  License as published by the Free Software Foundation; either 
00009 //  version 2.1 of the License. 
00010 // 
00011 //  This library is distributed in the hope that it will be useful, 
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00014 //  Lesser General Public License for more details. 
00015 // 
00016 //  You should have received a copy of the GNU Lesser General Public 
00017 //  License along with this library; if not, write to the Free Software 
00018 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
00019 // 
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //
00023 //
00024 //  File   : DataFlowEditor_DataFlow.hxx
00025 //  Module : SUPERV
00026 
00027 #ifndef _DATAFLOWEDITOR_DATAFLOW_HXX
00028 #define _DATAFLOWEDITOR_DATAFLOW_HXX
00029 
00030 #include "DataFlowEditor_OutNode.hxx"
00031 
00032 namespace GraphExecutor {
00033   
00034   class DataFlow;
00035 
00036 } 
00037 
00038 namespace GraphEditor {
00039 
00040   class DataFlow : public GraphEditor::OutNode {
00041     
00042     private :
00043 
00044       SALOME_NamingService*     _theNamingService ;
00045       GraphExecutor::DataFlow * _DataFlowExecutor ;
00046       bool                      _ReadOnly ;
00047       bool                      _Executing ;
00048       bool                      _EditedAfterExecution ;
00049 
00050     public:
00051 
00052       DataFlow();
00053       DataFlow( CORBA::ORB_ptr ORB, SALOME_NamingService * ptrNamingService ,
00054                 const char * DataFlowName ,
00055                 const char * DebugFileName ,
00056                 const SUPERV::KindOfNode aKindOfNode );
00057       DataFlow( CORBA::ORB_ptr ORB, SALOME_NamingService * ptrNamingService ,
00058                 const SALOME_ModuleCatalog::Service& DataFlowService ,
00059                 const char * DataFlowComponentName ,
00060                 const char * DataFlowInterfaceName ,
00061                 const char * DataFlowName ,
00062                 const SUPERV::KindOfNode DataFlowkind = SUPERV::ComputingNode ,
00063                 const SUPERV::SDate DataFlowFirstCreation = SUPERV::SDate() ,
00064                 const SUPERV::SDate DataFlowLastModification = SUPERV::SDate() ,
00065                 const char * DataFlowEditorRelease = NULLSTRING ,
00066                 const char * DataFlowAuthor = NULLSTRING ,
00067                 const char * DataFlowComputer = NULLSTRING ,
00068                 const char * DataFlowComment = NULLSTRING ,
00069                 const char * DebugFileName = NULLSTRING ) ;
00070       virtual ~DataFlow();
00071 
00072       void ReadOnly() ;
00073       char * DataFlowInfo() ;
00074       char * DataNodeInfo() ;
00075       char * NodeInfo( const char * aNodeName ) ;
00076 
00077       bool LoadDataFlow( const GraphBase::SGraph * aDataFlow ) ;
00078 //      bool LoadXml( const char * myFileName ) ;
00079       bool LoadXml( const char * myFileName , GraphBase::ListOfSGraphs & aListOfDataFlows ) ;
00080       bool LoadInfo( const GraphBase::SNode &aDataFlowInfo ) ;
00081 
00082       bool SaveXml(const char * myFileName ) ;
00083       bool SavePy(const char * myFileName ) ;
00084 
00085 
00086 //      void DateModification() ;
00087 
00088       GraphBase::ListOfSGraphs * GetDataFlows() ;
00089       GraphBase::SNode * GetInfo() const ;
00090       GraphBase::ListOfSNodes * GetNodes() const ;
00091       GraphBase::ListOfSLinks * GetLinks() const ;
00092       GraphBase::ListOfSGraphs * GetGraphs() const ;
00093       GraphBase::ListOfSLinks * GetDatas() const ;
00094       const SALOME_ModuleCatalog::Service * GetService() ;
00095 
00096       GraphEditor::InNode * AddService (
00097                             SALOME_ModuleCatalog::Service& aService ,
00098                             const char * NodeComponentName ,
00099                             const char * NodeInterfaceName ) {
00100              return AddNode( aService , NodeComponentName ,
00101                              NodeInterfaceName ) ; } ;
00102       GraphEditor::InNode * AddNode(
00103                         const SALOME_ModuleCatalog::Service& NodeService ,
00104                         const char * NodeComponentName ,
00105                         const char * NodeInterfaceName ,
00106                         const char * NodeName = NULLSTRING ,
00107                         const SUPERV::KindOfNode NodeKindOfNode = SUPERV::ComputingNode ,
00108                         GraphBase::ListOfFuncName aFuncName = GraphBase::ListOfFuncName() ,
00109                         GraphBase::ListOfPythonFunctions aPythonFunction = GraphBase::ListOfPythonFunctions() ,
00110                         const SUPERV::SDate NodeFirstCreation = SUPERV::SDate() ,
00111                         const SUPERV::SDate NodeLastModification = SUPERV::SDate() ,
00112                         const char * NodeEditorRelease = NULLSTRING ,
00113                         const char * NodeAuthor = NULLSTRING ,
00114                         const char * NodeComputer = NULLSTRING ,
00115                         const char * NodeComment = NULLSTRING ,
00116                         const int NodeX = 0 ,
00117                         const int NodeY = 0 ) ;
00118       GraphEditor::InNode * GetNode( const char* NodeName ) ;
00119       bool RemoveNode( const char * NodeName ) ;
00120       bool ReNameNode( const char * OldNodeName ,
00121                        const char * NewNodeName ) ;
00122 
00123       const SALOME_ModuleCatalog::Service * NodeService( const char * NodeName ) ;
00124 
00125       void Coordinates( const int X , const int Y ) ;
00126       const int XCoordinate() ;
00127       const int YCoordinate() ;
00128       void Coordinates( const char * NodeName , const int X , const int Y ) ;
00129       const int XCoordinate( const char * NodeName ) ;
00130       const int YCoordinate( const char * NodeName ) ;
00131 
00132       const GraphBase::InPort * GetInPort( const char * name ) ;
00133       const GraphBase::OutPort * GetOutPort( const char * name ) ;
00134       GraphBase::InPort * GetChangeInPort( const char * name ) ;
00135       GraphBase::OutPort * GetChangeOutPort( const char * name ) ;
00136 
00137       bool HasInput(const char * ToServiceParameterName ) ;
00138 
00139 //      bool AddLinkValue( const char * FromNodeName ,
00140 //                         const char * FromServiceParameterName ,
00141 //                         const char * ToNodeName ,
00142 //                         const char * ToServiceParameterName ,
00143 //                         const CORBA::Any aValue ) {
00144 //           return AddLinkValue( FromNodeName, FromServiceParameterName , ToNodeName ,
00145 //                                ToServiceParameterName , aValue ) ; } ;
00146       bool AddLink( const char * FromNodeName ,
00147                     const char * FromServiceParameterName ,
00148                  const char * ToNodeName ,
00149                     const char * ToServiceParameterName ) ;
00150 
00151       bool RemoveLink( const char * FromNodeName ,
00152                        const char * FromServiceParameterName ,
00153                        const char * ToNodeName ,
00154                        const char * ToServiceParameterName ) ;
00155 
00156       bool GetLink(const char * ToNodeName ,
00157                    const char * ToServiceParameterName ,
00158                    char ** FromNodeName ,
00159                    char ** FromServiceParameterName ) ;
00160       GraphBase::SLink * GetLink( GraphBase::ComputingNode * aNode ,
00161                                   const char* ToServiceParameterName ) ;
00162 
00163       bool AddLinkCoord( const char * FromNodeName ,
00164                          const char * FromServiceParameterName ,
00165                          const char * ToNodeName ,
00166                          const char * ToServiceParameterName ,
00167                          const int nXY ,
00168                          const int * X ,
00169                          const int * Y ) ;
00170       bool AddLinkCoord( const char * FromNodeName ,
00171                          const char * FromServiceParameterName ,
00172                          const char * ToNodeName ,
00173                          const char * ToServiceParameterName ,
00174                          const int index ,
00175                          const int X ,
00176                          const int Y ) ;
00177       bool ChangeLinkCoord( const char * FromNodeName ,
00178                             const char * FromServiceParameterName ,
00179                             const char * ToNodeName ,
00180                             const char * ToServiceParameterName ,
00181                             const int index ,
00182                             const int X ,
00183                             const int Y ) ;
00184       bool RemoveLinkCoord( const char * FromNodeName ,
00185                             const char * FromServiceParameterName ,
00186                             const char * ToNodeName ,
00187                             const char * ToServiceParameterName ,
00188                             const int index ) ;
00189       int GetLinkCoordSize( const char * FromNodeName ,
00190                             const char * FromServiceParameterName ,
00191                             const char * ToNodeName ,
00192                             const char * ToServiceParameterName ) ;
00193       bool GetLinkCoord( const char * FromNodeName ,
00194                          const char * FromServiceParameterName ,
00195                          const char * ToNodeName ,
00196                          const char * ToServiceParameterName ,
00197                          int * X , int * Y ) ;
00198       bool GetLinkCoord( const char * FromNodeName ,
00199                          const char * FromServiceParameterName ,
00200                          const char * ToNodeName ,
00201                          const char * ToServiceParameterName ,
00202                          const int index , CORBA::Long &X , CORBA::Long &Y ) ;
00203 
00204       bool AddInputData( const char * ToNodeName ,
00205                          const char * ToParameterName ,
00206                          const CORBA::Any aValue = CORBA::Any() ) ;
00207 
00208 //JR 30.03.2005      const CORBA::Any * GetInData( const char * ToNodeName ,
00209       const CORBA::Any GetInData( const char * ToNodeName ,
00210                                   const char * ToParameterName ) ;
00211 //JR 30.03.2005      const CORBA::Any * GetOutData( const char * FromNodeName ,
00212       const CORBA::Any GetOutData( const char * FromNodeName ,
00213                                    const char * FromParameterName ) ;
00214 
00215 //      bool IsValid(bool kLoopSwitch = true ) ;
00216       bool IsValid() ;
00217       bool IsExecutable() ;
00218 
00219       void Executing() ; // asv : removed a bool parameter, use Editing() to set _Executing = false
00220       bool IsExecuting() ;
00221       void Editing() ;
00222       bool IsEditing() ;
00223       bool UnValid() ;
00224       void EditedAfterExecution(bool EditedAfterExecution ) ;
00225       bool EditedAfterExecution() ;
00226 
00227       bool IsReadOnly() ;
00228 
00229       long LevelMax() ;
00230       SUPERV::ListOfStrings * LevelNodes(long aLevel ) ;
00231       long ThreadsMax() ;
00232       long SubGraphsNumber() ;
00233       long SubStreamGraphsNumber() ;
00234 
00235       void Executor(GraphExecutor::DataFlow * DataFlowExecutor ) ;
00236       GraphExecutor::DataFlow * GraphEditor::DataFlow::Executor() const ;
00237 
00238   };
00239 
00240 };
00241 
00242 #include "DataFlowEditor_DataFlow.lxx"
00243 
00244 ostream & operator << (ostream &,const GraphEditor::DataFlow & G);
00245 ostream & operator << (ostream &,const SUPERV::SDate &);
00246 
00247 #endif
00248 
00249 
00250