#ifndef _DATAFLOWEDITOR_OUTNODE_HXX
#define _DATAFLOWEDITOR_OUTNODE_HXX
-#include "DataFlowBase_Graph.hxx"
+#include "DataFlowBase_StreamGraph.hxx"
#include "DataFlowEditor_InNode.hxx"
namespace GraphEditor {
- class OutNode : public GraphBase::Graph {
+ class OutNode : public GraphBase::Base {
private :
+ GraphBase::StreamGraph * _StreamGraph ;
+ GraphBase::Graph * _Graph ;
+
+ int _Graph_prof_debug ;
+
bool _Imported ;
bool _Valid ;
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 ,
GraphBase::SLink aLink ,
- bool intervar ,
+ 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();
OutNode( CORBA::ORB_ptr ORB,
SALOME_NamingService* ptrNamingService ,
const char *DataFlowName ,
- const char * DebugFileName );
+ const char * DebugFileName ,
+ const SUPERV::KindOfNode aKindOfNode );
OutNode( CORBA::ORB_ptr ORB,
SALOME_NamingService* ptrNamingService ,
const SALOME_ModuleCatalog::Service& DataFlowService ,
const char * DebugFileName ) ;
virtual ~OutNode();
-// SALOME_NamingService* NamingService() const {
-// return _theNamingService ; } ;
+ bool Name( const char * aName ) ;
+
+ void Set_prof_debug( CORBA::ORB_ptr ORB , const char * DebugFileName ) ;
+ GraphBase::StreamGraph * StreamGraph() {
+ return _StreamGraph ; } ;
+ GraphBase::StreamGraph * StreamGraph() const {
+ return _StreamGraph ; } ;
+ GraphBase::Graph * Graph() {
+ return _Graph ; } ;
+ const GraphBase::Graph * Graph() const {
+ 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 ) ;
bool SavePy(const char* myFileName ) ;
// get all DataFlow informations (for a .XML file) :
- GraphBase::SGraph * GetDataFlow() ;
+ GraphBase::ListOfSGraphs * GetDataFlows( GraphBase::ListOfSGraphs * aListOfDataFlows ) ;
// void DateModification() ;
const int NodeX ,
const int NodeY ) ;
GraphEditor::InNode * GetNode( const char* NodeName ) {
- const GraphBase::Graph::ComputingNode * aNode = GraphBase::Graph::GetGraphNode( NodeName ) ;
+ const GraphBase::Graph::ComputingNode * aNode = _Graph->GetGraphNode( NodeName ) ;
if ( aNode ) {
return (GraphEditor::InNode * ) (aNode->GetInNode()) ;
}
bool RemoveNode( const char* NodeName ) {
DateModification() ;
_Valid = false ;
- return GraphBase::Graph::RemoveNode( NodeName ) ; } ;
+ return _Graph->RemoveNode( NodeName ) ; } ;
bool ReNameNode( const char* OldNodeName ,
const char* NewNodeName ) {
DateModification() ;
_Valid = false ;
- return GraphBase::Graph::ReNameNode( OldNodeName , NewNodeName ) ; } ;
+ return _Graph->ReNameNode( OldNodeName , NewNodeName ) ; } ;
void Coordinates( const int X , const int Y ) {
- return GraphBase::Graph::Coordinates( X , Y ) ; } ;
+ return _Graph->Coordinates( X , Y ) ; } ;
const int XCoordinate() {
- return GraphBase::Graph::XCoordinate() ; } ;
+ return _Graph->XCoordinate() ; } ;
const int YCoordinate() {
- return GraphBase::Graph::YCoordinate() ; } ;
+ return _Graph->YCoordinate() ; } ;
void Coordinates( const char* NodeName , const int X , const int Y ) ;
const int XCoordinate( const char* NodeName ) ;
const int YCoordinate( const char* NodeName ) ;
- const GraphBase::InPort *GetInPort( const char *name ) {
- return GraphBase::PortsOfNode::GetInPort( name ) ; } ;
- const GraphBase::OutPort *GetOutPort( const char *name ) {
- return GraphBase::PortsOfNode::GetOutPort( name ) ; } ;
- GraphBase::InPort *GetChangeInPort( const char *name ) {
- return GraphBase::PortsOfNode::GetChangeInPort( name ) ; } ;
- GraphBase::OutPort *GetChangeOutPort( const char *name ) {
- return GraphBase::PortsOfNode::GetChangeOutPort( name ) ; } ;
+ const GraphBase::InPort *GetInPort( const char * InPortName ) {
+ return _Graph->GetInPort( InPortName ) ; } ;
+ const GraphBase::OutPort *GetOutPort( const char * OutPortName ) {
+ return _Graph->GetOutPort( OutPortName ) ; } ;
+ GraphBase::InPort *GetChangeInPort( const char * InPortName ) {
+ return _Graph->GetChangeInPort( InPortName ) ; } ;
+ GraphBase::OutPort *GetChangeOutPort( const char * OutPortName ) {
+ return _Graph->GetChangeOutPort( OutPortName ) ; } ;
bool HasInput(const char * ToServiceParameterName ) {
- return GraphBase::ComputingNode::HasInput( ToServiceParameterName ) ;
+ return _Graph->HasInput( ToServiceParameterName ) ;
}
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 GraphBase::Graph::AddLink(
- FromNodeName , FromServiceParameterName ,
- ToNodeName , ToServiceParameterName ,
- aValue ) ; } ;
+ return _Graph->AddLink( FromNodeName , FromServiceParameterName ,
+ ToNodeName , ToServiceParameterName ) ; } ;
+// , aValue ) ; } ;
bool RemoveLink( const char* FromNodeName ,
const char* FromServiceParameterName ,
const char* ToNodeName ,
const char* ToServiceParameterName ) {
- bool RetVal = GraphBase::Graph::RemoveLink(
- FromNodeName ,
- FromServiceParameterName ,
- ToNodeName ,
- ToServiceParameterName ) ;
+ bool RetVal = _Graph->RemoveLink( FromNodeName ,
+ FromServiceParameterName ,
+ ToNodeName ,
+ ToServiceParameterName ) ;
if ( RetVal )
DateModification() ;
_Valid = false ;
const char* ToServiceParameterName ,
char** FromNodeName ,
char** FromServiceParameterName ) {
- return GraphBase::Graph::GetLink( ToNodeName ,
- ToServiceParameterName ,
- FromNodeName ,
- FromServiceParameterName ) ; } ;
+ return _Graph->GetLink( ToNodeName ,
+ ToServiceParameterName ,
+ FromNodeName ,
+ FromServiceParameterName ) ; } ;
bool AddLinkCoord( const char* FromNodeName ,
const char* FromServiceParameterName ,
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 )
return _Valid ; } ;
bool IsNotValid() const {
return !_Valid ; } ;
- bool UnValid() {
- bool RetVal = _Valid ;
- _Valid = false ;
- return RetVal ; } ;
+ bool UnValid() ;
bool IsExecutable() {
if ( !_Valid )
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 ,