예제 #1
0
bool ParmLinkMgr::AddCurrLink()
{
	//==== Check if Modifying Already Add Link ====//
	if (  m_CurrParmLinkIndex >= 0 && m_CurrParmLinkIndex < (int)m_ParmLinkVec.size() )
		return false;

	if ( m_WorkingParmLink.GetParmA() == m_WorkingParmLink.GetParmB() )
		return false;

	if ( CheckForDuplicateLink( m_WorkingParmLink.GetParmA(), m_WorkingParmLink.GetParmB() ) )
		return false;

	ParmLink* pl = new ParmLink();
	*pl = m_WorkingParmLink;

	pl->GetParmA()->set_linked_flag( true );
	pl->GetParmB()->set_linked_flag( true );

	m_ParmLinkVec.push_back( pl );
	m_CurrParmLinkIndex = (int)m_ParmLinkVec.size() - 1;

	m_ParmLinkMap[pl->GetParmA()].push_back( pl );
	ParmChanged( pl->GetParmA(), true );				// Trigger Update

	return true;
}
예제 #2
0
//==== Add Curr Link ====//
bool LinkMgrSingleton::AddCurrLink()
{
    //==== Check if Modifying Already Add Link ====//
    if (  m_CurrLinkIndex >= 0 && m_CurrLinkIndex < ( int )m_LinkVec.size() )
    {
        return false;
    }

    if ( m_WorkingLink->GetParmA() == m_WorkingLink->GetParmB() )
    {
        return false;
    }

    if ( CheckForDuplicateLink( m_WorkingLink->GetParmA(), m_WorkingLink->GetParmB() ) )
    {
        return false;
    }

    AddLink( m_WorkingLink->GetParmA(), m_WorkingLink->GetParmB() );

    return true;
}