newntui/discovermdi/src/disgraphnode.cpp
//------------------------------------------------------------------------------------
// This function will determine the source and destionation nodes for this edge,
// will analyse the graph orientation, will create the appropriate amount of the  
// ports of source and destination node and will connect the edge to the appropriate 
// ports
//------------------------------------------------------------------------------------
This function will determine the source and destionation nodes for this edge,
will analyse the graph orientation, will create the appropriate amount of the
ports of source and destination node and will connect the edge to the appropriate
ports
This function will determine the source and destionation nodes for this edge will analyse the graph orientation will create the appropriate amount of the ports of source and destination node and will connect the edge to the appropriate ports
void CDisGraphEdge::Port(void) {
int side;
CPoint sourceConnection;
CPoint targetConnection;
CDisGraphNode* pSource;
CDisGraphNode* pTarget;
    if(m_ParentGraph->m_HeaderPortCallback!=NULL) {
        pSource=(CDisGraphNode *)pFromNode();
        pTarget=(CDisGraphNode *)pToNode();
		if(pSource!=NULL && pTarget!=NULL) {
            switch(m_ParentGraph->pHDigraph()->pHTailor()->hlevelOrientation()) {
	            case TS_RIGHT_TO_LEFT : side=RIGHT_CONNECT;
			                            break;
	            case TS_LEFT_TO_RIGHT : side=LEFT_CONNECT;
			                            break;
	            case TS_BOTTOM_TO_TOP : side=BOTTOM_CONNECT;
				                        break;
	            case TS_TOP_TO_BOTTOM : side=TOP_CONNECT;
			                            break;
			}
            sourceConnection = (*(m_ParentGraph->m_HeaderPortCallback)) (
				                        m_ParentGraph->GetClientID(),
			                            pSource->GetReadableName(), 
		                                pSource->GetItemsList(), 
			                            pSource->GetActiveNodeProperties(),
						                side
					           );
            targetConnection = (*(m_ParentGraph->m_HeaderPortCallback)) (
				                        m_ParentGraph->GetClientID(),
			                            pTarget->GetReadableName(), 
		                                pTarget->GetItemsList(), 
			                            pTarget->GetActiveNodeProperties(),
						                side
					           );
	        pSource->pHNode()->numberOfOutPorts(sourceConnection.x);
	        pTarget->pHNode()->numberOfInPorts(targetConnection.x);
            pHEdge()->toPortNumber(targetConnection.y);
	        pHEdge()->fromPortNumber(sourceConnection.y);
		}
	}
}
void CDisGraphEdge :: Port ( void ) { int side ; CPoint sourceConnection ; CPoint targetConnection ; CDisGraphNode * pSource ; CDisGraphNode * pTarget ; if ( m_ParentGraph -> m_HeaderPortCallback != NULL ) { pSource = ( CDisGraphNode * ) pFromNode ( ) ; pTarget = ( CDisGraphNode * ) pToNode ( ) ; if ( pSource != NULL && pTarget != NULL ) { switch ( m_ParentGraph -> pHDigraph ( ) -> pHTailor ( ) -> hlevelOrientation ( ) ) { case TS_RIGHT_TO_LEFT : side = RIGHT_CONNECT ; break ; case TS_LEFT_TO_RIGHT : side = LEFT_CONNECT ; break ; case TS_BOTTOM_TO_TOP : side = BOTTOM_CONNECT ; break ; case TS_TOP_TO_BOTTOM : side = TOP_CONNECT ; break ; } sourceConnection = ( * ( m_ParentGraph -> m_HeaderPortCallback ) ) ( m_ParentGraph -> GetClientID ( ) , pSource -> GetReadableName ( ) , pSource -> GetItemsList ( ) , pSource -> GetActiveNodeProperties ( ) , side ) ; targetConnection = ( * ( m_ParentGraph -> m_HeaderPortCallback ) ) ( m_ParentGraph -> GetClientID ( ) , pTarget -> GetReadableName ( ) , pTarget -> GetItemsList ( ) , pTarget -> GetActiveNodeProperties ( ) , side ) ; pSource -> pHNode ( ) -> numberOfOutPorts ( sourceConnection . x ) ; pTarget -> pHNode ( ) -> numberOfInPorts ( targetConnection . x ) ; pHEdge ( ) -> toPortNumber ( targetConnection . y ) ; pHEdge ( ) -> fromPortNumber ( sourceConnection . y ) ; } } }
This function will determine the source and destionation nodes for this edge,
will analyse the graph orientation, will create the appropriate amount of the
ports of source and destination node and will connect the edge to the appropriate
ports
This function will determine the source and destionation nodes for this edge will analyse the graph orientation will create the appropriate amount of the ports of source and destination node and will connect the edge to the appropriate ports