Salome HOME
Bug fix: don't set "Loading" state for MacroNodes in InitialState() function (called...
[modules/superv.git] / src / GraphEditor / DataFlowEditor_OutNode.hxx
index 351707ddef8fbc2376917364a52d05b49a1cea8f..0daf9307901bb339675d36315ea98489abd40182 100644 (file)
@@ -33,7 +33,6 @@
 
 namespace GraphEditor {
 
-//  class OutNode : public GraphBase::Graph {
   class OutNode : public GraphBase::Base {
     
     private :
@@ -55,18 +54,19 @@ namespace GraphEditor {
       bool Executable() ;
 
       bool LoadNodes( map< string , int > & aMapOfNodes ,
-                      const GraphBase::ListOfNodes &aNodes ) ;
+                      const GraphBase::ListOfSNodes &aNodes ) ;
       bool LoadLinks( map< string , int > & aMapOfNodes ,
-                      const GraphBase::ListOfLinks &aLinks ) ;
+                      const GraphBase::ListOfSLinks &aLinks ) ;
       bool LoadDatas( map< string , int > & aMapOfNodes ,
-                      const GraphBase::ListOfLinks &aDatas ) ;
+                      const GraphBase::ListOfSLinks &aDatas ) ;
 
 //      bool GraphEditor::OutNode::LinkSaveXML( ostream &f , char *Tabs ,
       bool GraphEditor::OutNode::LinkSaveXML( QDomDocument & Graph , QDomElement & link ,
                                               GraphBase::SLink aLink ,
                                               bool wdata ) const ;
 //      bool SaveXML(ostream &f ) ;QDomDocument & Graph 
-      bool SaveXML(QDomDocument & Graph ) ;
+      bool SaveXML( ostream & f , QDomDocument & Graph ,
+                    bool aSuperGraph , QDomElement & supergraph ) ;
 
       bool GraphEditor::OutNode::LinkSavePY( ostream &f ,
                                              const char *aGraphName ,
@@ -74,10 +74,22 @@ namespace GraphEditor {
                                              bool fromparam ,
                                              bool toparam ,
                                              bool wdata ) const;
-      bool SavePY(ostream &f ) ;
+      bool SavePY(ostream &f , bool importSuperV ) ;
 
       void DateModification() ;
 
+      // asv 20.09.04 added from GraphExecutor::FiniteStateMachine class (removed from there)
+//      static map< string , GraphBase::Graph * > _MapOfGraphs ;
+//      static map< string , int >                _MapOfGraphNames ;
+    
+//      GraphBase::Graph * MapGraph( const char * aGraphName ) ;
+//      bool MapGraph( GraphBase::Graph * aGraph , const char * aGraphName ) ;
+//      void EraseGraph( const char * aGraphName ) ;
+//      bool GraphName( const char * aGraphName ) ;
+//      string GraphInstanceName( const char * aGraphName ) ;
+      // end added from FiniteStateMachine
+
+
     public:
 
       OutNode();
@@ -102,6 +114,8 @@ namespace GraphEditor {
                const char * DebugFileName ) ;
       virtual ~OutNode();
 
+      bool Name( const char * aName ) ;
+
       void Set_prof_debug( CORBA::ORB_ptr ORB , const char * DebugFileName ) ;
       GraphBase::StreamGraph * StreamGraph() {
                                return _StreamGraph ; } ;
@@ -113,7 +127,8 @@ namespace GraphEditor {
                                return _Graph ; } ;
 
       bool LoadDataFlow( const GraphBase::SGraph *aDataFlow ) ;
-      bool LoadXml( const char* myFileName ) ;
+      bool LoadXml( const char* myFileName , GraphBase::ListOfSGraphs & aListOfDataFlows ) ;
+//      bool LoadXml( const char* myFileName ) ;
       bool LoadInfo( const GraphBase::SNode &aDataFlowInfo ) ;
 
       bool SaveXml(const char* myFileName ) ;
@@ -121,7 +136,7 @@ namespace GraphEditor {
       bool SavePy(const char* myFileName ) ;
 
 // get all DataFlow informations (for a .XML file) :
-      GraphBase::SGraph * GetDataFlow() ;
+      GraphBase::ListOfSGraphs * GetDataFlows( GraphBase::ListOfSGraphs * aListOfDataFlows ) ;
 
 //    void DateModification() ;
 
@@ -185,13 +200,13 @@ namespace GraphEditor {
       bool AddLink( const char* FromNodeName ,
                     const char* FromServiceParameterName ,
                    const char* ToNodeName ,
-                    const char* ToServiceParameterName ,
-                    const CORBA::Any aValue ) {
+                    const char* ToServiceParameterName ) {
+//                    , const CORBA::Any aValue ) {
            DateModification() ;
            _Valid = false ;
            return _Graph->AddLink( FromNodeName , FromServiceParameterName ,
-                                   ToNodeName , ToServiceParameterName ,
-                                   aValue ) ; } ;
+                                   ToNodeName , ToServiceParameterName ) ; } ;
+//                                   , aValue ) ; } ;
 
       bool RemoveLink( const char* FromNodeName ,
                        const char* FromServiceParameterName ,
@@ -256,10 +271,6 @@ namespace GraphEditor {
                          const char* ToServiceParameterName ,
                          const int index , long &X , long &Y ) ;
 
-      bool AddInputData( const char* ToNodeName1 ,
-                         const char* ToParameterName1 ,
-                         const char* ToNodeName2 ,
-                         const char* ToParameterName2 ) ;
 
       bool IsValid() {
            if ( !_Valid )
@@ -267,10 +278,7 @@ namespace GraphEditor {
            return _Valid ; } ;
       bool IsNotValid() const {
            return !_Valid ; } ;
-      bool UnValid() {
-           bool RetVal = _Valid ;
-           _Valid = false ;
-           return RetVal ; } ;
+      bool UnValid() ;
 
       bool IsExecutable() {
            if ( !_Valid )
@@ -285,6 +293,15 @@ namespace GraphEditor {
       bool IsNotExecutable() const {
            return !_Executable ; } ;
 
+      // iterate through ALL links (OutPort-InPort pairs) and check if their types are 
+      // compatible - IsCompatible(type1, type2).  
+      // Returns true if all are compatible.   
+      bool IsLinksCompatible();
+
+      // Returns true if an out-port of type "OutPortType" can be bound with 
+      // in-port of type "InPortType".  Called from IsLinksCompatible() and Link_Impl::IsValid().
+      bool IsCompatible( const char* OutPortType, const char* InPortType ) const;
+
       const CORBA::Any *GetInData( const char *ToNodeName ,
                                    const char *ToParameterName ) ;
       const CORBA::Any *GetOutData( const char *FromNodeName ,