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


C++ Geom::GetName方法代码示例

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


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

示例1: LoadActiveGeomOutput

//==== Load Active Geom Output ====//
void ManageGeomScreen::LoadActiveGeomOutput()
{
    vector< string > activeVec = m_VehiclePtr->GetActiveGeomVec();
    if ( activeVec.size() == 0 )
    {
        m_GeomUI->activeGeomInput->value( m_VehiclePtr->GetName().c_str() );
    }
    else if ( activeVec.size() == 1 )
    {
        Geom* gptr = m_VehiclePtr->FindGeom( activeVec[0] );
        if ( gptr )
        {
            m_GeomUI->activeGeomInput->value( gptr->GetName().c_str() );
        }
    }
    else
    {
        m_GeomUI->activeGeomInput->value( "<multiple>" );
    }
}
开发者ID:Heathckliff,项目名称:OpenVSP,代码行数:21,代码来源:ManageGeomScreen.cpp

示例2: Update

bool CfdMeshScreen::Update()
{
    int i;

    LoadSetChoice();

    CfdMeshMgr.UpdateSourcesAndWakes();
    CfdMeshMgr.UpdateDomain();

    //==== Base Len ====//

    m_BodyEdgeSizeSlider.Update( CfdMeshMgr.GetGridDensityPtr()->m_BaseLen.GetID() );
    m_MinEdgeSizeSlider.Update( CfdMeshMgr.GetGridDensityPtr()->m_MinLen.GetID() );
    m_MaxGapSizeSlider.Update( CfdMeshMgr.GetGridDensityPtr()->m_MaxGap.GetID() );
    m_NumCircSegmentSlider.Update( CfdMeshMgr.GetGridDensityPtr()->m_NCircSeg.GetID() );
    m_GrowRatioSlider.Update( CfdMeshMgr.GetGridDensityPtr()->m_GrowRatio.GetID() );
    m_IntersectSubSurfsButton.Update( CfdMeshMgr.GetCfdSettingsPtr()->m_IntersectSubSurfs.GetID() );

    m_FarXScaleSlider.Update( CfdMeshMgr.GetCfdSettingsPtr()->m_FarXScale.GetID() );
    m_FarYScaleSlider.Update( CfdMeshMgr.GetCfdSettingsPtr()->m_FarYScale.GetID() );
    m_FarZScaleSlider.Update( CfdMeshMgr.GetCfdSettingsPtr()->m_FarZScale.GetID() );


//  char xstr[255];
//  char ystr[255];
//  char zstr[255];
//  sprintf( xstr, "%0.4f", CfdMeshMgr.GetFarLength() );
//  sprintf( ystr, "%0.4f", CfdMeshMgr.GetFarWidth() );
//  sprintf( zstr, "%0.4f", CfdMeshMgr.GetFarHeight() );
//  m_CfdMeshUI->farXScaleAbsInput->value(xstr);
//  m_CfdMeshUI->farYScaleAbsInput->value(ystr);
//  m_CfdMeshUI->farZScaleAbsInput->value(zstr);


    m_FarXLocationSlider.Update( CfdMeshMgr.GetCfdSettingsPtr()->m_FarXLocation.GetID() );
    m_FarYLocationSlider.Update( CfdMeshMgr.GetCfdSettingsPtr()->m_FarYLocation.GetID() );
    m_FarZLocationSlider.Update( CfdMeshMgr.GetCfdSettingsPtr()->m_FarZLocation.GetID() );

    m_FarEdgeLengthSlider.Update( CfdMeshMgr.GetGridDensityPtr()->m_FarMaxLen.GetID() );
    m_FarGapSizeSlider.Update( CfdMeshMgr.GetGridDensityPtr()->m_FarMaxGap.GetID() );
    m_FarCircSegmentSlider.Update( CfdMeshMgr.GetGridDensityPtr()->m_FarNCircSeg.GetID() );

    m_WakeScaleSlider.Update( CfdMeshMgr.GetCfdSettingsPtr()->m_WakeScale.GetID() );
    m_WakeAngleSlider.Update( CfdMeshMgr.GetCfdSettingsPtr()->m_WakeAngle.GetID() );

    //==== Load Geom Choice ====//
    m_GeomVec = m_Vehicle->GetGeomVec();

    m_CfdMeshUI->compChoice->clear();
    m_CfdMeshUI->surfChoice->clear();
    m_CfdMeshUI->wakeCompChoice->clear();
    m_CfdMeshUI->farCompChoice->clear();
    map< string, int > compIDMap;
    map< string, int > wingCompIDMap;
    m_WingGeomVec.clear();

    int iwing = 0;
    for ( i = 0 ; i < ( int )m_GeomVec.size() ; i++ )
    {
        char str[256];
        Geom* g = m_Vehicle->FindGeom( m_GeomVec[i] );
        if ( g )
        {
            sprintf( str, "%d_%s", i, g->GetName().c_str() );
            m_CfdMeshUI->compChoice->add( str );
            if( g->HasWingTypeSurfs() )
            {
                m_CfdMeshUI->wakeCompChoice->add( str );
                wingCompIDMap[ m_GeomVec[i] ] = iwing;
                m_WingGeomVec.push_back( m_GeomVec[i] );
                iwing ++;
            }
            m_CfdMeshUI->farCompChoice->add( str );
            compIDMap[ m_GeomVec[i] ] = i;
        }
    }

    string currSourceGeomID = CfdMeshMgr.GetCurrSourceGeomID();
    if( currSourceGeomID.length() == 0 && m_GeomVec.size() > 0 )
    {
        // Handle case default case.
        currSourceGeomID = m_GeomVec[0];
        CfdMeshMgr.SetCurrSourceGeomID( currSourceGeomID );
    }
    Geom* currGeom = m_Vehicle->FindGeom( currSourceGeomID );
    m_CfdMeshUI->compChoice->value( compIDMap[ currSourceGeomID ] );

    string wakeGeomID = CfdMeshMgr.GetWakeGeomID();
    if( wakeGeomID.length() == 0 && m_WingGeomVec.size() > 0 )
    {
        // Handle case default case.
        wakeGeomID = m_WingGeomVec[0];
        CfdMeshMgr.SetWakeGeomID( wakeGeomID );
    }
    Geom* wakeGeom = m_Vehicle->FindGeom( wakeGeomID );
    m_CfdMeshUI->wakeCompChoice->value( wingCompIDMap[ wakeGeomID ] );

    string farGeomID = CfdMeshMgr.GetCfdSettingsPtr()->GetFarGeomID();
    if( farGeomID.length() == 0 && m_GeomVec.size() > 0 )
    {
//.........这里部分代码省略.........
开发者ID:Mr-Kumar-Abhishek,项目名称:OpenVSP,代码行数:101,代码来源:CfdMeshScreen.cpp

示例3: Update

bool FitModelScreen::Update()
{
    int i;
    int index;
    char str[256];

    // Update the number of selected points.
    sprintf( str, "%d", FitModelMgr.GetNumSelected() );
    m_NSelOutput.Update( str );

    m_TargetGeomPicker.Update();

    m_UToggleGroup.Update( FitModelMgr.m_UType.GetID() );
    m_USlider.Update( FitModelMgr.m_UTargetPt.GetID() );

    m_WToggleGroup.Update( FitModelMgr.m_WType.GetID() );
    m_WSlider.Update( FitModelMgr.m_WTargetPt.GetID() );

    m_SelOneButton.Update( FitModelMgr.m_SelectOneFlag.GetID() );
    m_SelBoxButton.Update( FitModelMgr.m_SelectBoxFlag.GetID() );

    // Update Fixed target point browser
    m_TargetPtBrowser->clear();

    static int ptwidths[] = { 75, 35, 35, 35, 35, 37, 35, 38 }; // widths for each column
    m_TargetPtBrowser->column_widths( ptwidths );    // assign array to widget
    m_TargetPtBrowser->column_char( ':' );         // use : as the column character

    sprintf( str, "@[email protected]:@[email protected]@.X:@[email protected]@.Y:@[email protected]@.Z:@[email protected]@.U:@[email protected]@.Type:@[email protected]@.W:@[email protected]@.Type" );
    m_TargetPtBrowser->add( str );

    int num_fix = FitModelMgr.GetNumTargetPt();
    for ( i = 0 ; i < num_fix ; i++ )
    {
        TargetPt* tpt = FitModelMgr.GetTargetPt( i );
        if( tpt )
        {
            Geom* g = VehicleMgr.GetVehicle()->FindGeom( tpt->GetMatchGeom() );
            if( g )
            {
                char *fix = "fix";
                char *free = "free";

                char *ut;
                char *wt;

                if( tpt->GetUType() == TargetPt::FIXED )
                {
                    ut = fix;
                }
                else
                {
                    ut = free;
                }

                if( tpt->GetWType() == TargetPt::FIXED )
                {
                    wt = fix;
                }
                else
                {
                    wt = free;
                }


                sprintf( str, "%s:%4.2f:%4.2f:%4.2f:%4.2f:%s:%4.2f:%s", g->GetName().c_str(), tpt->GetPt().x(), tpt->GetPt().y(), tpt->GetPt().z(), tpt->GetUW().x(), ut, tpt->GetUW().y(), wt );
                m_TargetPtBrowser->add( str );
            }
        }
    }

    index = FitModelMgr.GetCurrTargetPtIndex();
    if ( index >= 0 && index < num_fix )
    {
        m_TargetPtBrowser->select( index + 2 );
    }

    sprintf( str, "%d", num_fix );
    m_NTgtOutput.Update( str );

    // Check that all Parms exist.  Needed in case a Geom with DesVars is
    // deleted.
    FitModelMgr.CheckVars();

    // Re-sort DesVars.  Needed in case a Geom's name is changed.
    if ( !FitModelMgr.SortVars() )
    {
        RebuildAdjustTab();
    }

    //==== Update Parm Picker ====//
    m_ParmPicker.Update();

    //==== Update Parm Tree Picker ====//
    m_ParmTreePicker.Update( FitModelMgr.GetVarVec() );

    //==== Update Parm Browser ====//
    varBrowser->clear();

    static int widths[] = { 75, 75, 90 }; // widths for each column
//.........这里部分代码省略.........
开发者ID:hensomc,项目名称:OpenVSP-1,代码行数:101,代码来源:FitModelScreen.cpp

示例4: LoadBrowser

//==== Load Geom Browser ====//
void ManageGeomScreen::LoadBrowser()
{

    //==== Save List of Selected Geoms ====//
    vector< string > activeVec = m_VehiclePtr->GetActiveGeomVec();

    m_LastTopLine = m_GeomUI->geomBrowser->topline();

    //==== Display Vehicle Name ====//
    m_GeomUI->geomBrowser->clear();
    m_GeomUI->geomBrowser->add( m_VehiclePtr->GetName().c_str() );

    //==== Get Geoms To Display ====//
    m_DisplayedGeomVec = m_VehiclePtr->GetGeomVec( true );

    //==== Step Thru Comps ====//
    for ( int i = 0 ; i < ( int )m_DisplayedGeomVec.size() ; i++ )
    {
        Geom* gPtr = m_VehiclePtr->FindGeom( m_DisplayedGeomVec[i] );
        if ( gPtr )
        {
            string str;
            //==== Check if Parent is Selected ====//
            if ( IsParentSelected( m_DisplayedGeomVec[i], activeVec ) )
            {
                str.append( "@[email protected]" );
            }

            int numindents = gPtr->CountParents( 0 );
            for ( int j = 0 ; j < numindents ; j++ )
            {
                str.append( "--" );
            }

            if ( gPtr->m_TransAttachFlag() == GeomXForm::ATTACH_TRANS_NONE &&
                    gPtr->m_RotAttachFlag() == GeomXForm::ATTACH_ROT_NONE )
            {
                str.append( "> " );
            }
            else
            {
                str.append( "^ " );
            }

            if ( !gPtr->m_GuiDraw.GetDisplayChildrenFlag() )
            {
                str.append( "(+) " );
            }

            str.append( gPtr->GetName() );

            if ( gPtr->m_GuiDraw.GetNoShowFlag() )
            {
                str.append( "(no show)" );
            }

            m_GeomUI->geomBrowser->add( str.c_str() );
        }
    }

    //==== Restore List of Selected Geoms ====//
    for ( int i = 0 ; i < ( int )activeVec.size() ; i++ )
    {
        SelectGeomBrowser( activeVec[i] );
    }
}
开发者ID:Heathckliff,项目名称:OpenVSP,代码行数:67,代码来源:ManageGeomScreen.cpp

示例5: Update

bool VSPAEROScreen::Update()
{
    Vehicle *veh = VehicleMgr.GetVehicle();

    VSPAEROMgr.Update();

    if( veh )
    {
        //check if the degenfile name has changed
        string t_ModelNameBase = VSPAEROMgr.m_ModelNameBase;  //m_ModelNameBase is built from calling veh->getExportFileName();
        if( !t_ModelNameBase.empty() && strcmp( m_ModelNameBasePrevious.c_str(), t_ModelNameBase.c_str() ) != 0 )
        {
            ReadSetup();
        }
        m_ModelNameBasePrevious = t_ModelNameBase;

        // Reference Wing Choice
        //    find & list all Wing type geometries
        vector <string> geomVec = veh->GetGeomVec();

        m_RefWingChoice.ClearItems();
        m_WingGeomVec.clear();
        map <string, int> WingCompIDMap;
        int iwing = 0;
        for ( int i = 0 ; i < ( int )geomVec.size() ; i++ )
        {
            char str[256];
            Geom* g = veh->FindGeom( geomVec[i] );
            if ( g )
            {
                sprintf( str, "%d_%s", i, g->GetName().c_str() );

                if( g->GetType().m_Type == MS_WING_GEOM_TYPE )
                {
                    m_RefWingChoice.AddItem( str );
                    WingCompIDMap[ geomVec[i] ] = iwing;
                    m_WingGeomVec.push_back( geomVec[i] );
                    iwing ++;
                }
            }
        }
        m_RefWingChoice.UpdateItems();
        //    Update selected value
        string refGeomID = VSPAEROMgr.m_RefGeomID;
        if( refGeomID.length() == 0 && m_WingGeomVec.size() > 0 )
        {
            // Handle case default case.
            refGeomID = m_WingGeomVec[0];
            VSPAEROMgr.m_RefGeomID = refGeomID;
            // Re-trigger reference quantity update with default component.
            VSPAEROMgr.Update();
        }
        m_RefWingChoice.SetVal( WingCompIDMap[ refGeomID ] );


        // Update available set choices
        m_GeomSetChoice.ClearItems();
        m_CGSetChoice.ClearItems();

        vector <string> setVec = veh->GetSetNameVec();
        for ( int iSet = 0; iSet < setVec.size(); iSet++ )
        {
            m_GeomSetChoice.AddItem( setVec[iSet] );
            m_CGSetChoice.AddItem( setVec[iSet] );
        }
        m_GeomSetChoice.UpdateItems();
        m_CGSetChoice.UpdateItems();

        m_GeomSetChoice.SetVal( VSPAEROMgr.m_GeomSet() );
        m_CGSetChoice.SetVal( VSPAEROMgr.m_CGGeomSet() );


        // Case Setup
        m_AeroMethodToggleGroup.Update( VSPAEROMgr.m_AnalysisMethod.GetID() );
        switch ( VSPAEROMgr.m_AnalysisMethod.Get() )
        {
        case vsp::VSPAERO_ANALYSIS_METHOD::VORTEX_LATTICE:

            m_DegenFileName.Activate();
            m_DegenFileButton.Activate();

            m_CompGeomFileName.Deactivate();
            m_CompGeomFileButton.Deactivate();

            break;

        case vsp::VSPAERO_ANALYSIS_METHOD::PANEL:

            m_DegenFileName.Deactivate();
            m_DegenFileButton.Deactivate();

            m_CompGeomFileName.Activate();
            m_CompGeomFileButton.Activate();

            break;

        default:
            //do nothing; this should not be reachable
            break;
        }
//.........这里部分代码省略.........
开发者ID:cptdime,项目名称:OpenVSP,代码行数:101,代码来源:VSPAEROScreen.cpp


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