src/GraphEditor/DataFlowEditor_InNode.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_InNode.hxx
00025 //  Module : SUPERV
00026 
00027 #ifndef _DATAFLOWEDITOR_INNODE_HXX
00028 #define _DATAFLOWEDITOR_INNODE_HXX
00029 
00030 #include "DataFlowBase_Graph.hxx"
00031 #include "DataFlowBase_FactoryNode.hxx"
00032 #include "DataFlowBase_GOTONode.hxx"
00033 #include "DataFlowBase_LoopNode.hxx"
00034 #include "DataFlowBase_EndOfLoopNode.hxx"
00035 #include "DataFlowBase_SwitchNode.hxx"
00036 #include "DataFlowBase_EndOfSwitchNode.hxx"
00037 
00038 namespace GraphEditor {
00039 
00040   class InNode : public GraphBase::Base {
00041 
00042     private:
00043 
00044       GraphBase::ComputingNode       * _ComputingNode ;
00045       GraphBase::FactoryNode         * _FactoryNode ;
00046       GraphBase::InLineNode          * _InLineNode ;
00047       GraphBase::GOTONode            * _GOTONode ;
00048       GraphBase::LoopNode            * _LoopNode ;
00049       GraphBase::EndOfLoopNode       * _EndOfLoopNode ;
00050       GraphBase::SwitchNode          * _SwitchNode ;
00051       GraphBase::EndOfSwitchNode     * _EndOfSwitchNode ;
00052       GraphBase::Graph               * _GraphMacroNode ;
00053     
00054     public:
00055 
00056       InNode() ;
00057 //      InNode(GraphBase::GOTONode * aGOTONode ) ;
00058       InNode( CORBA::ORB_ptr ORB, 
00059            SALOME_NamingService* ptrNamingService ,
00060               GraphBase::ListOfFuncName aFuncName ,
00061               GraphBase::ListOfPythonFunctions aPythonFunction ,
00062               const SALOME_ModuleCatalog::Service& NodeService ,
00063               const char *NodeComponentName ,
00064               const char* NodeInterfaceName ,
00065               const char *NodeName ,
00066               const SUPERV::KindOfNode akind ,
00067               const SUPERV::SDate NodeFirstCreation ,
00068               const SUPERV::SDate NodeLastModification ,
00069               const char * NodeEditorRelease ,
00070               const char * NodeAuthor ,
00071               const char * NodeComputer ,
00072               const char * NodeComment ,
00073               const bool   GeneratedName ,
00074               const int NodeX ,
00075               const int NodeY ,
00076               int * Graph_prof_debug = NULL ,
00077               ofstream * Graph_fdebug = NULL ) ;
00078       virtual ~InNode() ;
00079 
00080       char * Name() const { return _ComputingNode->Name() ; } ;
00081       const char *const * NamePtr() const {
00082                           return _ComputingNode->NamePtr() ; } ;
00083 
00084       SUPERV::KindOfNode Kind() const {
00085                          return _ComputingNode->Kind() ; } ;
00086       const bool IsComputingNode() const {
00087                  return _ComputingNode->IsComputingNode() ; } ;
00088       const bool IsFactoryNode() const {
00089                  return _ComputingNode->IsFactoryNode() ; } ;
00090       const bool IsInLineNode() const {
00091                  return _ComputingNode->IsInLineNode() ; } ;
00092       const bool IsOneOfInLineNodes() const {
00093                  return _ComputingNode->IsOneOfInLineNodes() ; } ;
00094       const bool IsOneOfGOTONodes() const {
00095                  return _ComputingNode->IsOneOfGOTONodes() ; } ;
00096       const bool IsMacroNode() const {
00097                  return _ComputingNode->IsMacroNode() ; } ;
00098       const bool IsDataFlowNode() const {
00099                  return _ComputingNode->IsDataFlowNode() ; } ;
00100       const bool IsDataStreamNode() const {
00101                  return _ComputingNode->IsDataStreamNode() ; } ;
00102       const bool IsGOTONode() const {
00103                  return _ComputingNode->IsGOTONode() ; } ;
00104       const bool IsLoopNode() const {
00105                  return _ComputingNode->IsLoopNode() ; } ;
00106       const bool IsEndLoopNode() const {
00107                  return _ComputingNode->IsEndLoopNode() ; } ;
00108       const bool IsSwitchNode() const {
00109                  return _ComputingNode->IsSwitchNode() ; } ;
00110       const bool IsEndSwitchNode() const {
00111                  return _ComputingNode->IsEndSwitchNode() ; } ;
00112       const bool IsHeadNode() const {
00113                  return _ComputingNode->IsHeadNode() ; } ;
00114       GraphBase::ComputingNode * ComputingNode() {
00115                                  return _ComputingNode ; } ;
00116       GraphBase::FactoryNode * FactoryNode() {
00117                                return _FactoryNode ; } ;
00118       GraphBase::GOTONode * GOTONode() {
00119                             if ( _GOTONode )
00120                               return _GOTONode ;
00121                             if ( _LoopNode )
00122                               return _LoopNode ;
00123                             if ( _EndOfLoopNode )
00124                               return _EndOfLoopNode ;
00125                             if ( _SwitchNode )
00126                               return _SwitchNode ;
00127                             if ( _EndOfSwitchNode )
00128                               return _EndOfSwitchNode ;
00129                             return NULL ;
00130                             } ;
00131       GraphBase::GOTONode * GOTONode() const {
00132                             if ( _GOTONode )
00133                               return _GOTONode ;
00134                             if ( _LoopNode )
00135                               return _LoopNode ;
00136                             if ( _EndOfLoopNode )
00137                               return _EndOfLoopNode ;
00138                             if ( _SwitchNode )
00139                               return _SwitchNode ;
00140                             if ( _EndOfSwitchNode )
00141                               return _EndOfSwitchNode ;
00142                             return NULL ;
00143                             } ;
00144       GraphBase::InLineNode * InLineNode() {
00145                               GraphBase::InLineNode * aNode = GOTONode() ;
00146                               if ( aNode == NULL )
00147                                 return _InLineNode ;
00148                               return aNode ;
00149                               } ;
00150       GraphBase::InLineNode * InLineNode() const {
00151                               GraphBase::InLineNode * aNode = GOTONode() ;
00152                               if ( aNode == NULL )
00153                                 return _InLineNode ;
00154                               return aNode ;
00155                               } ;
00156       GraphBase::LoopNode * LoopNode() {
00157                             return _LoopNode ; } ;
00158       GraphBase::EndOfLoopNode * EndOfLoopNode() {
00159                                  return _EndOfLoopNode ; } ;
00160       GraphBase::SwitchNode * SwitchNode() {
00161                               return _SwitchNode ; } ;
00162       GraphBase::EndOfSwitchNode * EndOfSwitchNode() {
00163                                    return _EndOfSwitchNode ; } ;
00164       GraphBase::Graph * GraphMacroNode() {
00165                          return _GraphMacroNode ; } ;
00166 
00167       SUPERV::CNode_var ObjRef() const { return _ComputingNode->ObjRef() ; } ;
00168       void SetObjRef(SUPERV::CNode_var aNode) {
00169                      _ComputingNode->SetObjRef( aNode ) ; } ;
00170 
00171       CNode_Impl * ObjImpl() const { return _ComputingNode->ObjImpl() ; } ;
00172       void SetObjImpl( CNode_Impl * aGraph ) {
00173                        _ComputingNode->SetObjImpl( aGraph ) ; } ;
00174 
00175       const SALOME_ModuleCatalog::Service * GetService() const {
00176             return _ComputingNode->GetService() ; } ;
00177 
00178       SUPERV::SDate FirstCreation() const {
00179                     return _ComputingNode->FirstCreation() ; } ;
00180       SUPERV::SDate LastModification() const {
00181                     return _ComputingNode->LastModification() ; } ;
00182       char* Author() const {
00183 //JR 17.02.2005 Memory Leak            return my_strdup( _ComputingNode->Author() ) ; }
00184             return _ComputingNode->Author() ; }
00185       char* EditorRelease() const {
00186 //JR 17.02.2005 Memory Leak            return my_strdup( _ComputingNode->EditorRelease() ) ; } ;
00187             return _ComputingNode->EditorRelease() ; } ;
00188       char * Comment() const {
00189 //JR 17.02.2005 Memory Leak             return my_strdup( _ComputingNode->Comment() ) ; } ;
00190              return _ComputingNode->Comment() ; } ;
00191       bool Author( const char * anAuthor ) {
00192            return _ComputingNode->Author( anAuthor ) ; } ;
00193       bool EditorRelease( const char* anEditorRelease ) {
00194            return _ComputingNode->EditorRelease( anEditorRelease ) ; } ;
00195       bool Comment( const char *c ) {
00196            return _ComputingNode->Comment( c ) ; };
00197 
00198       GraphBase::SNode * GetInfo() {
00199                          return _ComputingNode->GetInfo() ; } ;
00200 
00201       GraphBase::InPort * AddInPort( const char * InputParameterName ,
00202                                      const char * InputParameterType ,
00203                                      const SUPERV::KindOfPort aKindOfPort ) {
00204                           return _ComputingNode->AddInPort( InputParameterName ,
00205                                                             InputParameterType ,
00206                                                             aKindOfPort ) ; } ;
00207       GraphBase::OutPort * AddOutPort( const char * OutputParameterName ,
00208                                        const char * OutputParameterType ,
00209                                        const SUPERV::KindOfPort aKindOfPort ) {
00210                            return _ComputingNode->AddOutPort( OutputParameterName ,
00211                                                               OutputParameterType ,
00212                                                               aKindOfPort ) ; } ;
00213       int IncrDataStreamInPorts() {
00214         return _ComputingNode->IncrDataStreamInPorts() ;
00215       } ;
00216       int IncrDataStreamOutPorts() {
00217         return _ComputingNode->IncrDataStreamOutPorts() ;
00218       } ;
00219 
00220       void DelInPort( const char * InputParameterName ) {
00221            _ComputingNode->DelInPort( InputParameterName ) ; } ;
00222       void DelOutPort( const char * OutputParameterName ) {
00223            _ComputingNode->DelOutPort( OutputParameterName ) ; } ;
00224 
00225       bool IsLinked(const char * ToServiceParameterName, bool isInput ) {
00226            return _ComputingNode->IsLinked( ToServiceParameterName, isInput ) ; } ; // mkr : PAL8060
00227       bool HasInput(const char * ToServiceParameterName ) {
00228            return _ComputingNode->HasInput( ToServiceParameterName ) ; } ;
00229 
00230 //      void InOutPort( GraphBase::InPort * InputPort ,
00231 //                      GraphBase::OutPort * OutputPort ) {
00232 //           return _ComputingNode->InOutPort( InputPort , OutputPort ) ; } ;
00233 
00234       const int GetNodeInPortsSize() const {
00235                 return _ComputingNode->GetNodeInPortsSize() ; } ;
00236       const GraphBase::InPort *GetNodeInPort(int i) const {
00237                               return _ComputingNode->GetNodeInPort( i ) ; } ;
00238       GraphBase::InPort *GetChangeNodeInPort(int i) const {
00239                         return _ComputingNode->GetChangeNodeInPort( i ) ; } ;
00240       const int GetNodeOutPortsSize() const {
00241                 return _ComputingNode->GetNodeOutPortsSize() ; } ;
00242       const GraphBase::OutPort *GetNodeOutPort(int i) const {
00243                                return _ComputingNode->GetNodeOutPort( i ) ; } ;
00244       GraphBase::OutPort *GetChangeNodeOutPort(int i) const {
00245                          return _ComputingNode->GetChangeNodeOutPort( i ) ; } ;
00246 
00247       const GraphBase::InPort *GetInPort( const char *name ) {
00248             return _ComputingNode->GetInPort( name ) ; } ;
00249       const GraphBase::OutPort *GetOutPort( const char *name ) {
00250             return _ComputingNode->GetOutPort( name ) ; } ;
00251       GraphBase::InPort *GetChangeInPort( const char *name ) {
00252                         return _ComputingNode->GetChangeInPort( name ) ; } ;
00253       GraphBase::OutPort *GetChangeOutPort( const char *name ) {
00254                          return _ComputingNode->GetChangeOutPort( name ) ; } ;
00255 
00256       void SetPythonFunction( const char * aFuncName ,
00257                               const SUPERV::ListOfStrings & aPythonFunction ) {
00258            InLineNode()->SetPythonFunction( aFuncName , aPythonFunction ) ; }
00259       const SUPERV::ListOfStrings * PythonFunction() const {
00260             return InLineNode()->PythonFunction() ; } ;
00261       char * PyFuncName() const {
00262              return InLineNode()->PyFuncName() ; } ;
00263 
00264       void SetPyMorePythonFunction( const char * aMoreName ,
00265                                     const SUPERV::ListOfStrings & aMorePythonFunction ) {
00266            _LoopNode->SetMorePythonFunction( aMoreName , aMorePythonFunction ) ; }
00267       SUPERV::ListOfStrings * PyMorePythonFunction() const {
00268                     return _LoopNode->MorePythonFunction() ; } ;
00269       char * PyMoreName() {
00270              return _LoopNode->PyMoreName() ; };
00271 
00272       void SetPyNextPythonFunction( const char * aNextName ,
00273                                const SUPERV::ListOfStrings & aNextPythonFunction ) {
00274            _LoopNode->SetNextPythonFunction( aNextName , aNextPythonFunction ) ; }
00275       SUPERV::ListOfStrings * PyNextPythonFunction() const {
00276                     return _LoopNode->NextPythonFunction() ; } ;
00277       char * PyNextName() {
00278              return _LoopNode->PyNextName() ; } ;
00279 
00280       void CoupledNode( GraphBase::InLineNode * aCoupledNode ) {
00281            _GOTONode->CoupledNode( aCoupledNode ) ; } ;
00282       GraphBase::InLineNode * CoupledNode() {
00283                               return _GOTONode->CoupledNode() ; } ;
00284 
00285       int SubGraph() {
00286           return _ComputingNode->SubGraph() ; } ;
00287       int SubStreamGraph() {
00288           return _ComputingNode->SubStreamGraph() ; } ;
00289 
00290       char * ComponentName() const {
00291              return _FactoryNode->ComponentName() ; } ;
00292       char * InterfaceName() const {
00293              return _FactoryNode->InterfaceName() ; } ;
00294       char * Computer() const {
00295              return _FactoryNode->Computer() ; } ;
00296 
00297       bool ComponentName( const char * aComponentName ) {
00298            return _FactoryNode->ComponentName( aComponentName ) ; } ;
00299       bool InterfaceName( const char * anInterfaceName ) {
00300            return _FactoryNode->InterfaceName( anInterfaceName ) ; } ;
00301       bool Computer( const char *c ) {
00302            return _FactoryNode->Computer( c ) ; } ;
00303 
00304       void Coordinates( const int X , const int Y ) {
00305            _ComputingNode->Coordinates( X , Y ) ; } ;
00306       int XCoordinate () {
00307           return _ComputingNode->XCoordinate () ; } ;
00308       int YCoordinate () {
00309           return _ComputingNode->YCoordinate () ; } ;
00310   };
00311   
00312 
00313 };
00314 
00315 #endif