当前位置: 首页>>代码示例>>C++>>正文


C++ Parm::GetID方法代码示例

本文整理汇总了C++中Parm::GetID方法的典型用法代码示例。如果您正苦于以下问题:C++ Parm::GetID方法的具体用法?C++ Parm::GetID怎么用?C++ Parm::GetID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Parm的用法示例。


在下文中一共展示了Parm::GetID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FindParm

//==== Find Parm ID Given GroupName and Parm Name ====//
string ParmContainer::FindParm( const string& parm_name, const string& group_name  )
{
    string id;
    map< string, vector< string > >::iterator iter;
    iter = m_GroupParmMap.find( group_name );

    if ( iter != m_GroupParmMap.end() )
    {
        //==== Look For Parm Name ====//
        vector< string > pid_vec = iter->second;
        for ( int i = 0 ; i < (int)pid_vec.size() ; i++ )
        {
            Parm* p = ParmMgr.FindParm( pid_vec[i] );
            if ( p->GetName() == parm_name )
                return pid_vec[i];
        }
    }

    //==== Look Thru All Parms And Return First Name Match ====//
    for ( int i = 0 ; i < ( int )m_ParmVec.size() ; i++ )
    {
        Parm* p = ParmMgr.FindParm( m_ParmVec[i] );
        if ( p )
        {
            if ( p->GetName() == parm_name && p->GetGroupName() == group_name )
            {
                return p->GetID();
            }
        }
    }
    return id;
}
开发者ID:aeromedia,项目名称:OpenVSP,代码行数:33,代码来源:ParmContainer.cpp

示例2: AddParm

//==== Add User Defined Parm ====//
string UserParmContainer::AddParm(int type, const string & name, const string & group )
{
    Parm* p = ParmMgr.CreateParm( type );
    if ( p )
    {
        p->Init( name, group, this, 0.0, -1.0e6, 1.0e6, true );
        p->SetDescript( "User Parm Descript" );
        m_UserParmVec.push_back( p );
        return p->GetID();
    }
    return string();
}
开发者ID:aeromedia,项目名称:OpenVSP,代码行数:13,代码来源:ParmContainer.cpp

示例3: LinkAllGroup

//==== Link All Parms In A Group ====//
bool LinkMgrSingleton::LinkAllGroup()
{
    Parm* pA =  ParmMgr.FindParm( m_WorkingLink->GetParmA() );
    Parm* pB =  ParmMgr.FindParm( m_WorkingLink->GetParmB() );

    if ( !pA || !pB )
    {
        return false;
    }

    string gnameA = pA->GetDisplayGroupName();
    string gnameB = pB->GetDisplayGroupName();

    if ( ( pA->GetLinkContainer() == pB->GetLinkContainer() ) && ( gnameA == gnameB ) )
    {
        return false;
    }

    vector< string > parmAVec, parmBVec;
    pA->GetLinkContainer()->GetParmIDs( pA->GetID(), parmAVec );
    pB->GetLinkContainer()->GetParmIDs( pB->GetID(), parmBVec );

    for ( int k = 0 ; k < ( int )parmAVec.size() ; k++ )
    {
        for ( int n = 0 ; n < ( int )parmBVec.size() ; n++ )
        {
            Parm* parmA = ParmMgr.FindParm( parmAVec[k] );
            Parm* parmB = ParmMgr.FindParm( parmBVec[n] );

            if ( parmA && parmB && ( parmA->GetName() == parmB->GetName() ) )
            {
                AddLink( parmAVec[k], parmBVec[n] );
            }
        }
    }

    return true;

}
开发者ID:sanbales,项目名称:OpenVSP,代码行数:40,代码来源:LinkMgr.cpp

示例4: AddLinkableParms

//==== Look Though All Parms and Load Linkable Ones ===//
void ParmContainer::AddLinkableParms( vector< string > & linkable_parm_vec, const string & link_container_id )
{
    for ( int i = 0 ; i < ( int )m_ParmVec.size() ; i++ )
    {
        Parm* p = ParmMgr.FindParm( m_ParmVec[i] );

        if ( p && p->IsLinkable() )
        {
            if ( link_container_id.size() )
            {
                p->SetLinkContainerID( link_container_id );
            }
            linkable_parm_vec.push_back( p->GetID() );
        }
    }
}
开发者ID:aeromedia,项目名称:OpenVSP,代码行数:17,代码来源:ParmContainer.cpp

示例5: Update

//==== Update Wing Screen ====//
bool WingScreen::Update()
{
    assert( m_ScreenMgr );
    char str[256];

    Geom* geom_ptr = m_ScreenMgr->GetCurrGeom();
    if ( !geom_ptr || geom_ptr->GetType().m_Type != MS_WING_GEOM_TYPE )
    {
        Hide();
        return false;
    }

    GeomScreen::Update();
    m_NumUSlider.Deactivate();

    WingGeom* wing_ptr = dynamic_cast< WingGeom* >( geom_ptr );
    assert( wing_ptr );

    //==== Plan Parms ===//
    m_PlanSpanSlider.Update( wing_ptr->m_TotalSpan.GetID() );
    m_PlanProjSpanSlider.Update( wing_ptr->m_TotalProjSpan.GetID() );
    m_PlanChordSlider.Update( wing_ptr->m_TotalChord.GetID() );
    m_PlanAreaSlider.Update( wing_ptr->m_TotalArea.GetID() );

    m_LEClusterSlider.Update( wing_ptr->m_LECluster.GetID() );
    m_TEClusterSlider.Update( wing_ptr->m_TECluster.GetID() );

    sprintf( str, "%6.4f", wing_ptr->m_TotalProjSpan() * wing_ptr->m_TotalProjSpan() / wing_ptr->m_TotalArea() );
    m_PlanAROutput.Update( str );

    m_RootCapTypeChoice.Update( wing_ptr->m_CapUMinOption.GetID() );
    m_TipCapTypeChoice.Update( wing_ptr->m_CapUMaxOption.GetID() );
    if ( wing_ptr->m_CapUMinOption() == VspSurf::NO_END_CAP &&
         wing_ptr->m_CapUMaxOption() == VspSurf::NO_END_CAP )
    {
        m_CapTessSlider.Deactivate();
    }
    else
    {
        m_CapTessSlider.Update( wing_ptr->m_CapUMinTess.GetID() );
    }

    WingSect* root_sect = dynamic_cast<WingSect*>(wing_ptr->GetXSec( 0 ));

    if ( root_sect )
    {
        m_IncidenceSlider.Update( root_sect->m_Twist.GetID() );
        m_IncidenceLocSlider.Update( root_sect->m_TwistLoc.GetID() );
    }

    sprintf( str, "       %d", wing_ptr->NumXSec()-1 );
    m_NumSectOutput.Update(  str );

    ////==== Wing Section Index Display ====//
    int ws_index = wing_ptr->GetActiveXSecIndex();
    m_SectIndexSelector.SetIndex( ws_index );

    WingSect* wing_sect = dynamic_cast<WingSect*>(wing_ptr->GetXSec( ws_index ));

    if ( wing_sect )
    {
        m_SectUTessSlider.Update( wing_sect->m_SectTessU.GetID() );

        m_RootClusterSlider.Update( wing_sect->m_RootCluster.GetID() );
        m_TipClusterSlider.Update( wing_sect->m_TipCluster.GetID() );

        m_WingDriverGroupBank.SetDriverGroup( &wing_sect->m_DriverGroup );
        vector< string > parm_ids = wing_sect->GetDriverParms();
        wing_sect->m_DriverGroup.UpdateGroup( parm_ids );
        m_WingDriverGroupBank.Update( parm_ids );

        m_SweepSlider.Update( wing_sect->m_Sweep.GetID() );
        m_SweepLocSlider.Update( wing_sect->m_SweepLoc.GetID() );
        m_SecSweepLocSlider.Update( wing_sect->m_SecSweepLoc.GetID() );
        m_TwistSlider.Update( wing_sect->m_Twist.GetID() );
        m_TwistLocSlider.Update( wing_sect->m_TwistLoc.GetID() );

        m_DihedralSlider.Update( wing_sect->m_Dihedral.GetID() );
        m_DihedralAbsRelToggle.Update( wing_ptr->m_RelativeDihedralFlag.GetID() );
        m_TwistAbsRelToggle.Update( wing_ptr->m_RelativeTwistFlag.GetID() );

        m_RotateFoilMatchDihedral.Update( wing_ptr->m_RotateAirfoilMatchDiedralFlag.GetID() );

        sprintf( str, " %6.4f", wing_sect->GetProjectedSpan() );
        m_SectProjSpanOutput.Update(  str );

    }

    //==== XSec Index Display ===//
    int xsid = wing_ptr->GetActiveAirfoilIndex();
    m_AfIndexSelector.SetIndex( xsid );
    m_AfModIndexSelector.SetIndex( xsid );

    WingSect* ws = ( WingSect* ) wing_ptr->GetXSec( xsid );
    if ( ws )
    {
        XSecCurve* xsc = ws->GetXSecCurve();
        if ( xsc )
        {
//.........这里部分代码省略.........
开发者ID:tperry01,项目名称:OpenVSP,代码行数:101,代码来源:WingScreen.cpp


注:本文中的Parm::GetID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。