Пример #1
0
//==== Copy XSec ====//
void XSecSurf::CopyXSec( int index )
{
    XSec* xs = FindXSec( index );
    if ( !xs )
    {
        return;
    }

    XSec* saved_xs = FindXSec( m_SavedXSec );

    //==== Create Saved XSec ====//
    if ( saved_xs && ( saved_xs->GetType() != xs->GetType()
            || saved_xs->GetXSecCurve()->GetType() != xs->GetXSecCurve()->GetType() ) )
    {
        vector_remove_val( m_XSecPtrVec, saved_xs );
        delete saved_xs;
        saved_xs = NULL;
    }

    //==== Saved XSec ====//
    if ( !saved_xs )
    {
        saved_xs = CreateXSec( xs->GetXSecCurve()->GetType() );
    }

    //==== Copy Data ====//
    if ( saved_xs )
    {
        saved_xs->CopyFrom( xs );
        m_SavedXSec = saved_xs->GetID();
    }
}
Пример #2
0
//==== Paste XSec ====//
void XSecSurf::PasteXSec( int index )
{
    XSec* xs = FindXSec( index );
    if ( !xs )
    {
        return;
    }

    XSec* saved_xs = FindXSec( m_SavedXSec );
    if ( !saved_xs )
    {
        return;
    }

    string new_xs_id = InsertXSec( saved_xs->GetXSecCurve()->GetType(), index );
    XSec* new_xs = FindXSec( new_xs_id );
    if ( !new_xs )
    {
        return;
    }

    //==== Copy Data ====//
    new_xs->CopyFrom( saved_xs );

    //==== Copy Position from xsec being replaced ====//
    new_xs->CopyBasePos( xs );

    deque_remove_val( m_XSecIDDeque, xs->GetID() );
    vector_remove_val( m_XSecPtrVec, xs );

    delete xs;
}
Пример #3
0
//==== Change XSec Type ====//
void XSecSurf::ChangeXSecShape( int index, int type )
{
    //==== Old XSec ====//
    XSec* xs = FindXSec( index );

    if ( !xs )
    {
        return;
    }

    //==== Create New XSec ====//
    XSec* nxs = CreateXSec( type );

    if ( nxs )
    {
        //==== Copy Data ====//
        nxs->CopyFrom( xs );

        m_XSecIDDeque.insert( m_XSecIDDeque.begin() + index, nxs->GetID() );

        //==== Remove Old XSec ====//
        m_XSecIDDeque.erase( m_XSecIDDeque.begin() + index + 1 );
        vector_remove_val( m_XSecPtrVec, xs );
        delete xs;
    }
}
Пример #4
0
//==== Paste Wing Sect ====//
void WingGeom::PasteAirfoil( int index  )
{
    if ( index >= 0 && index < m_XSecSurf.NumXSec() )
    {
        m_XSecSurf.PasteXSecCurve(index);
        XSec* xs = m_XSecSurf.FindXSec( index );
        if ( xs )
            xs->SetLateUpdateFlag( true );
        Update();
    }
}
Пример #5
0
//==== Insert XSec After Index ====//
string XSecSurf::AddXSec( int type )
{
    string id;

    XSec* xs = CreateXSec( type );
    if ( xs )
    {
        id = xs->GetID();
        m_XSecIDDeque.push_back( id );
    }
    return id;
}
Пример #6
0
//==== Insert Wing Sect ====//
void WingGeom::InsertWingSect( int index  )
{
    if ( index > 0 && index < m_XSecSurf.NumXSec() )
    {
        XSec* xs = m_XSecSurf.FindXSec( index );
        int type = xs->GetXSecCurve()->GetType();

        string ins_id = m_XSecSurf.InsertXSec(type, index);
        SetActiveXSecIndex( index + 1 );
        PasteWingSect( GetActiveXSecIndex() );
    }
}
Пример #7
0
//==== Insert XSec ====//
void PropGeom::InsertXSec( )
{
    if ( m_ActiveXSec >= NumXSec() - 1 )
    {
        return;
    }

    XSec* xs = GetXSec( m_ActiveXSec );
    if ( xs )
    {
        InsertXSec( xs->GetXSecCurve()->GetType() );
    }
}
Пример #8
0
//==== Look Though All Parms and Load Linkable Ones ===//
void XSecSurf::AddLinkableParms( vector< string > & parm_vec, const string & link_container_id )
{
    ParmContainer::AddLinkableParms( parm_vec, link_container_id );

    for ( int i = 0 ; i < NumXSec() ; i++ )
    {
        XSec* xsec = FindXSec( i );
        if ( xsec  )
        {
            xsec->AddLinkableParms( parm_vec, link_container_id );
        }
    }
}
Пример #9
0
//==== Scale ====//
void StackGeom::Scale()
{
    double currentScale = m_Scale() / m_LastScale();
    for ( int i = 0 ; i < m_XSecSurf.NumXSec() ; i++ )
    {
        XSec* xs = m_XSecSurf.FindXSec( i );
        if ( xs )
        {
            xs->SetScale( currentScale );
        }
    }

    m_LastScale = m_Scale();
}
Пример #10
0
//==== Scale ====//
void PropGeom::Scale()
{
    double currentScale = m_Scale() / m_LastScale();
    m_Diameter *= currentScale;
    for ( int i = 0 ; i < m_XSecSurf.NumXSec() ; i++ )
    {
        XSec* xs = m_XSecSurf.FindXSec( i );
        if ( xs )
        {
            xs->SetScale( currentScale );
        }
    }

    m_LastScale = m_Scale();
}
Пример #11
0
//==== Scale ====//
void FuselageGeom::Scale()
{
    double currentScale = m_Scale() / m_LastScale();
    m_Length *= currentScale;
    for ( int i = 0 ; i < m_XSecSurf.NumXSec() ; i++ )
    {
        XSec* xs = m_XSecSurf.FindXSec( i );
        if ( xs )
        {
            xs->SetScale( currentScale );
        }
    }

    m_LastScale = m_Scale();
}
Пример #12
0
//==== Encode XML ====//
xmlNodePtr XSecSurf::EncodeXml( xmlNodePtr & node )
{
    ParmContainer::EncodeXml( node );

    xmlNodePtr xsecsurf_node = xmlNewChild( node, NULL, BAD_CAST "XSecSurf", NULL );
    if ( xsecsurf_node )
    {
        for ( int i = 0 ; i < NumXSec() ; i++ )
        {
            XSec* xsec = FindXSec( i );
            if ( xsec  )
            {
                xsec->EncodeXSec( xsecsurf_node );
            }
        }
    }
    return xsecsurf_node;
}
Пример #13
0
//==== Set Active XSec Type ====//
void WingGeom::SetActiveAirfoilType( int type )
{
    XSec* xs = GetXSec( m_ActiveAirfoil );

    if ( !xs )
    {
        return;
    }

    if ( type == xs->GetXSecCurve()->GetType() )
    {
        return;
    }

    m_XSecSurf.ChangeXSecShape( m_ActiveAirfoil, type );

    Update();
}
Пример #14
0
//==== Drag Parameters ====//
void StackGeom::LoadDragFactors( DragFactors& drag_factors )
{
    double max_xsec_area = 0.000000000001;
    for ( int i = 0 ; i < ( int )m_XSecSurf.NumXSec() ; i++ )
    {
        XSec* xs = m_XSecSurf.FindXSec( i );
        XSecCurve* xsc = xs->GetXSecCurve();
        double a = xsc->ComputeArea( );
        if ( a > max_xsec_area )
        {
            max_xsec_area = a;
        }
    }

//    drag_factors.m_Length = m_Length();
    drag_factors.m_MaxXSecArea = max_xsec_area;
//    drag_factors.m_LengthToDia = m_Length() / dia;
}
Пример #15
0
//==== Set Active XSec Type ====//
void PropGeom::SetActiveXSecType( int type )
{
    XSec* xs = GetXSec( m_ActiveXSec );

    if ( !xs )
    {
        return;
    }

    if ( type == xs->GetXSecCurve()->GetType() )
    {
        return;
    }

    m_XSecSurf.ChangeXSecShape( m_ActiveXSec, type );

    Update();
}
Пример #16
0
//==== Paste XSec Curve====//
void XSecSurf::PasteXSecCurve( int index )
{
    XSec* xs = FindXSec( index );
    if ( !xs )
        return;

    if ( !m_SavedXSecCurve )
        return;

    XSecCurve* duplicate_saved_crv = CreateXSecCurve( m_SavedXSecCurve->GetType() );
    if ( duplicate_saved_crv )
    {
        duplicate_saved_crv->CopyFrom( m_SavedXSecCurve );
    }

    xs->SetXSecCurve( duplicate_saved_crv );


}
Пример #17
0
//==== Insert XSec After Index ====//
string XSecSurf::InsertXSec( int type, int index )
{
    string id;

    XSec* xs = CreateXSec( type );

    if ( xs )               // Valid XSec?
    {
        id = xs->GetID();
        if ( index < ( int )m_XSecIDDeque.size() )
        {
            m_XSecIDDeque.insert( m_XSecIDDeque.begin() + index + 1, xs->GetID() );
        }
        else
        {
            m_XSecIDDeque.push_back( xs->GetID() );
        }
    }
    return id;
}
Пример #18
0
//==== Copy XSec Curve====//
void XSecSurf::CopyXSecCurve( int index )
{
    XSec* xs = FindXSec( index );
    if ( !xs )
    {
        return;
    }

    if ( m_SavedXSecCurve && m_SavedXSecCurve->GetType() != xs->GetXSecCurve()->GetType() )
    {
        delete m_SavedXSecCurve;
        m_SavedXSecCurve = NULL;
    }

    if ( !m_SavedXSecCurve )
    {
        m_SavedXSecCurve = CreateXSecCurve( xs->GetXSecCurve()->GetType() );
    }

    if ( m_SavedXSecCurve )
    {
        m_SavedXSecCurve->CopyFrom( xs->GetXSecCurve() );
    }
}
Пример #19
0
//==== Cut XSec ====//
void XSecSurf::CutXSec( int index )
{
    if ( (int)m_XSecIDDeque.size() <= m_CutMinNumXSecs )
    {
        return;
    }

    XSec* xs = FindXSec( index );
    if ( !xs )
    {
        return;
    }

    //==== Delete Saved XSec ====//
    XSec* saved_xs = FindXSec( m_SavedXSec );
    if ( saved_xs )
    {
        vector_remove_val( m_XSecPtrVec, saved_xs );
        delete saved_xs;
    }

    m_SavedXSec = xs->GetID();
    m_XSecIDDeque.erase( m_XSecIDDeque.begin() + index );
}
Пример #20
0
void WingScreen::GuiDeviceCallBack( GuiDevice* gui_device )
{
    //==== Find Fuselage Ptr ====//
    Geom* geom_ptr = m_ScreenMgr->GetCurrGeom();
    if ( !geom_ptr || geom_ptr->GetType().m_Type != MS_WING_GEOM_TYPE )
    {
        return;
    }
    WingGeom* wing_ptr = dynamic_cast< WingGeom* >( geom_ptr );
    assert( wing_ptr );

    if ( gui_device == &m_AfIndexSelector )
    {
        wing_ptr->SetActiveAirfoilIndex( m_AfIndexSelector.GetIndex() );
        wing_ptr->Update();
    }
    else if ( gui_device == &m_AfModIndexSelector )
    {
        wing_ptr->SetActiveAirfoilIndex( m_AfModIndexSelector.GetIndex() );
        wing_ptr->Update();
    }
    else if ( gui_device == &m_SectIndexSelector )
    {
        wing_ptr->SetActiveXSecIndex( m_SectIndexSelector.GetIndex() );
        wing_ptr->Update();
    }
    else if ( gui_device == &m_SplitSectButton )
    {
        int wsid = wing_ptr->GetActiveXSecIndex();
        wing_ptr->SplitWingSect( wsid );
        wing_ptr->Update();
    }
    else if ( gui_device == &m_CutSectButton )
    {
        int wsid = wing_ptr->GetActiveXSecIndex();
        wing_ptr->CutWingSect( wsid );
        wing_ptr->Update();
    }
    else if ( gui_device == &m_CopySectButton )
    {
        int wsid = wing_ptr->GetActiveXSecIndex();
        wing_ptr->CopyWingSect( wsid );
        wing_ptr->Update();
    }
    else if ( gui_device == &m_PasteSectButton )
    {
        int wsid = wing_ptr->GetActiveXSecIndex();
        wing_ptr->PasteWingSect( wsid );
        wing_ptr->Update();
    }
    else if ( gui_device == &m_InsertSectButton )
    {
        int wsid = wing_ptr->GetActiveXSecIndex();
        wing_ptr->InsertWingSect( wsid );
        wing_ptr->Update();
    }
    else if ( gui_device == &m_AfTypeChoice )
    {
        int t = m_AfTypeChoice.GetVal();
        wing_ptr->SetActiveAirfoilType( t );
        wing_ptr->Update();
    }
    else if ( gui_device == &m_ShowXSecButton )
    {
        m_ScreenMgr->ShowScreen( ScreenMgr::VSP_XSEC_SCREEN );
    }
    else if ( gui_device == &m_CopyAfButton   )
    {
        int afid = wing_ptr->GetActiveAirfoilIndex();
        wing_ptr->CopyAirfoil( afid );
    }
    else if ( gui_device == &m_PasteAfButton  )
    {
        int afid = wing_ptr->GetActiveAirfoilIndex();
        wing_ptr->PasteAirfoil(afid);
        wing_ptr->Update();
    }
    else if ( gui_device == &m_ReadFuseFileButton  )
    {
        int xsid = wing_ptr->GetActiveAirfoilIndex();
        XSec* xs = wing_ptr->GetXSec( xsid );
        if ( xs )
        {
            XSecCurve* xsc = xs->GetXSecCurve();
            if ( xsc )
            {
                if ( xsc->GetType() == XS_FILE_FUSE  )
                {
                    FileXSec* file_xs = dynamic_cast< FileXSec* >( xsc );
                    assert( file_xs );
                    string newfile = m_ScreenMgr->GetSelectFileScreen()->FileChooser( "Fuselage Cross Section", "*.fxs" );

                    file_xs->ReadXsecFile( newfile );
                    file_xs->Update();
                    xs->Update();
                    wing_ptr->Update();
                }
            }
        }
    }
    else if ( gui_device == &m_AfReadFileButton   )
    {
        int xsid = wing_ptr->GetActiveAirfoilIndex();
        XSec* xs = wing_ptr->GetXSec( xsid );
        if ( xs )
        {
            XSecCurve* xsc = xs->GetXSecCurve();
            if ( xsc )
            {
                if ( xsc->GetType() == XS_FILE_AIRFOIL  )
                {
                    FileAirfoil* affile_xs = dynamic_cast< FileAirfoil* >( xsc );
                    assert( affile_xs );
                    string newfile = m_ScreenMgr->GetSelectFileScreen()->FileChooser( "Airfoil File", "*.{af,dat}", false  );

                    affile_xs->ReadFile( newfile );
                    affile_xs->Update();
                    xs->Update();
                    wing_ptr->Update();
                }
            }
        }
    }
    else if ( gui_device == &m_UpPromoteButton )
    {
        int xsid = wing_ptr->GetActiveAirfoilIndex();
        XSec* xs = wing_ptr->GetXSec( xsid );
        if ( xs )
        {
            XSecCurve* xsc = xs->GetXSecCurve();
            if ( xsc )
            {
                if ( xsc->GetType() == XS_CST_AIRFOIL  )
                {
                    CSTAirfoil* cst_xs = dynamic_cast< CSTAirfoil* >( xsc );
                    assert( cst_xs );

                    cst_xs->PromoteUpper();
                    cst_xs->Update();
                    xs->Update();
                    wing_ptr->Update();
                }
            }
        }
    }
    else if ( gui_device == &m_LowPromoteButton )
    {
        int xsid = wing_ptr->GetActiveAirfoilIndex();
        XSec* xs = wing_ptr->GetXSec( xsid );
        if ( xs )
        {
            XSecCurve* xsc = xs->GetXSecCurve();
            if ( xsc )
            {
                if ( xsc->GetType() == XS_CST_AIRFOIL  )
                {
                    CSTAirfoil* cst_xs = dynamic_cast< CSTAirfoil* >( xsc );
                    assert( cst_xs );

                    cst_xs->PromoteLower();
                    cst_xs->Update();
                    xs->Update();
                    wing_ptr->Update();
                }
            }
        }

    }
    else if ( gui_device == &m_UpDemoteButton )
    {
        int xsid = wing_ptr->GetActiveAirfoilIndex();
        XSec* xs = wing_ptr->GetXSec( xsid );
        if ( xs )
        {
            XSecCurve* xsc = xs->GetXSecCurve();
            if ( xsc )
            {
                if ( xsc->GetType() == XS_CST_AIRFOIL  )
                {
                    CSTAirfoil* cst_xs = dynamic_cast< CSTAirfoil* >( xsc );
                    assert( cst_xs );

                    cst_xs->DemoteUpper();
                    cst_xs->Update();
                    xs->Update();
                    wing_ptr->Update();
                }
            }
        }

    }
    else if ( gui_device == &m_LowDemoteButton )
    {
        int xsid = wing_ptr->GetActiveAirfoilIndex();
        XSec* xs = wing_ptr->GetXSec( xsid );
        if ( xs )
        {
            XSecCurve* xsc = xs->GetXSecCurve();
            if ( xsc )
            {
                if ( xsc->GetType() == XS_CST_AIRFOIL  )
                {
                    CSTAirfoil* cst_xs = dynamic_cast< CSTAirfoil* >( xsc );
                    assert( cst_xs );

                    cst_xs->DemoteLower();
                    cst_xs->Update();
                    xs->Update();
                    wing_ptr->Update();
                }
            }
        }

    }
    else if ( ( gui_device == &m_FourFitCSTButton ) ||
              ( gui_device == &m_SixFitCSTButton ) ||
              ( gui_device == &m_AfFileFitCSTButton ) )
    {
        int xsid = wing_ptr->GetActiveAirfoilIndex();
        XSec* xs = wing_ptr->GetXSec( xsid );
        if ( xs )
        {
            XSecCurve* xsc = xs->GetXSecCurve();
            if ( xsc )
            {
                Airfoil* af_xs = dynamic_cast< Airfoil* >( xsc );

                if ( af_xs )
                {
                    VspCurve c = af_xs->GetOrigCurve();
                    int deg = af_xs->m_FitDegree();

                    wing_ptr->SetActiveAirfoilType( XS_CST_AIRFOIL );

                    XSec* newxs = wing_ptr->GetXSec( xsid );
                    if ( newxs )
                    {
                        XSecCurve* newxsc = newxs->GetXSecCurve();
                        if ( newxsc )
                        {
                            if ( newxsc->GetType() == XS_CST_AIRFOIL  )
                            {
                                CSTAirfoil* cst_xs = dynamic_cast< CSTAirfoil* >( newxsc );
                                assert( cst_xs );

                                cst_xs->FitCurve( c, deg );

                                cst_xs->Update();
                                newxs->Update();
                                wing_ptr->Update();
                            }
                        }
                    }
                }
            }
        }
    }
    else if ( gui_device == &m_TestDriverGroupButton )
    {
        int wsid = wing_ptr->GetActiveXSecIndex();

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

        if ( wing_sect )
        {
            vector< string > parm_ids = wing_sect->GetDriverParms();
            wing_sect->m_DriverGroup.Test( parm_ids, 1e-4 );
        }
    }

    GeomScreen::GuiDeviceCallBack( gui_device );
}
Пример #21
0
void FuselageScreen::GuiDeviceCallBack( GuiDevice* gui_device )
{
    //==== Find Fuselage Ptr ====//
    Geom* geom_ptr = m_ScreenMgr->GetCurrGeom();
    if ( !geom_ptr || geom_ptr->GetType().m_Type != FUSELAGE_GEOM_TYPE )
    {
        return;
    }
    FuselageGeom* fuselage_ptr = dynamic_cast< FuselageGeom* >( geom_ptr );
    assert( fuselage_ptr );

    if ( gui_device == &m_XSecIndexSelector )
    {
        fuselage_ptr->SetActiveXSecIndex( m_XSecIndexSelector.GetIndex() );
        fuselage_ptr->Update();
    }
    else if ( gui_device == &m_XSecTypeChoice )
    {
        int t = m_XSecTypeChoice.GetVal();
        fuselage_ptr->SetActiveXSecType( t );
    }
    else if ( gui_device == &m_ShowXSecButton )
    {
        m_ScreenMgr->ShowScreen( ScreenMgr::VSP_XSEC_SCREEN );
    }
    else if ( gui_device == &m_CutXSec )
    {
        fuselage_ptr->CutActiveXSec();
    }
    else if ( gui_device == &m_CopyXSec   )
    {
        fuselage_ptr->CopyActiveXSec();
    }
    else if ( gui_device == &m_PasteXSec  )
    {
        fuselage_ptr->PasteActiveXSec();
    }
    else if ( gui_device == &m_InsertXSec  )
    {
        fuselage_ptr->InsertXSec( );
    }
    else if ( gui_device == &m_ReadFuseFileButton  )
    {
        int xsid = fuselage_ptr->GetActiveXSecIndex();
        XSec* xs = fuselage_ptr->GetXSec( xsid );
        if ( xs )
        {
            XSecCurve* xsc = xs->GetXSecCurve();
            if ( xsc )
            {
                if ( xsc->GetType() == XS_FILE_FUSE  )
                {
                    FileXSec* file_xs = dynamic_cast< FileXSec* >( xsc );
                    assert( file_xs );
                    string newfile = m_ScreenMgr->GetSelectFileScreen()->FileChooser( "Fuselage Cross Section", "*.fxs" );

                    file_xs->ReadXsecFile( newfile );
                    file_xs->Update();
                    xs->Update();
                    fuselage_ptr->Update();
                }
            }
        }
    }
    else if ( gui_device == &m_AfReadFileButton   )
    {
        int xsid = fuselage_ptr->GetActiveXSecIndex();
        XSec* xs = fuselage_ptr->GetXSec( xsid );
        if ( xs )
        {
            XSecCurve* xsc = xs->GetXSecCurve();
            if ( xsc )
            {
                if ( xsc->GetType() == XS_FILE_AIRFOIL  )
                {
                    FileAirfoil* affile_xs = dynamic_cast< FileAirfoil* >( xsc );
                    assert( affile_xs );
                    string newfile = m_ScreenMgr->GetSelectFileScreen()->FileChooser( "Airfoil File", "*.{af,dat}", false );

                    affile_xs->ReadFile( newfile );
                    affile_xs->Update();
                    xs->Update();
                    fuselage_ptr->Update();
                }
            }
        }
    }
    else if ( gui_device == &m_DesignPolicyChoice )
    {
        // This is a hack to get the XSecXSlider to update its ranges.  This
        // requires setting the ID to another valid FractionParm's ID.  In this
        // case, m_YLocPercent of the same XSec.  It will get set back to
        // m_XLocPercent in Update() before anyone notices the change.
        int xsid = fuselage_ptr->GetActiveXSecIndex();
        FuseXSec* xs = (FuseXSec*) fuselage_ptr->GetXSec( xsid );
        if ( xs )
        {
            m_XSecXSlider.Update( xs->m_YLocPercent.GetID() );
        }
    }

    SkinScreen::GuiDeviceCallBack( gui_device );
}
Пример #22
0
void StackScreen::GuiDeviceCallBack( GuiDevice* gui_device )
{
    //==== Find Fuselage Ptr ====//
    Geom* geom_ptr = m_ScreenMgr->GetCurrGeom();
    if ( !geom_ptr || geom_ptr->GetType().m_Type != STACK_GEOM_TYPE )
    {
        return;
    }
    StackGeom* stackgeom_ptr = dynamic_cast< StackGeom* >( geom_ptr );
    assert( stackgeom_ptr );

    if ( gui_device == &m_XSecIndexSelector )
    {
        stackgeom_ptr->SetActiveXSecIndex( m_XSecIndexSelector.GetIndex() );
        stackgeom_ptr->Update();
    }
    else if ( gui_device == &m_XSecTypeChoice )
    {
        int t = m_XSecTypeChoice.GetVal();
        stackgeom_ptr->SetActiveXSecType( t );
    }
    else if ( gui_device == &m_ShowXSecButton )
    {
        m_ScreenMgr->ShowScreen( ScreenMgr::VSP_XSEC_SCREEN );
    }
    else if ( gui_device == &m_CutXSec )
    {
        stackgeom_ptr->CutActiveXSec();
    }
    else if ( gui_device == &m_CopyXSec   )
    {
        stackgeom_ptr->CopyActiveXSec();
    }
    else if ( gui_device == &m_PasteXSec  )
    {
        stackgeom_ptr->PasteActiveXSec();
    }
    else if ( gui_device == &m_InsertXSec  )
    {
        stackgeom_ptr->InsertXSec( );
    }
    else if ( gui_device == &m_ReadFuseFileButton  )
    {
        int xsid = stackgeom_ptr->GetActiveXSecIndex();
        XSec* xs = stackgeom_ptr->GetXSec( xsid );
        if ( xs )
        {
            XSecCurve* xsc = xs->GetXSecCurve();
            if ( xsc )
            {
                if ( xsc->GetType() == XS_FILE_FUSE  )
                {
                    FileXSec* file_xs = dynamic_cast< FileXSec* >( xsc );
                    assert( file_xs );
                    string newfile = m_ScreenMgr->GetSelectFileScreen()->FileChooser( "Fuselage Cross Section", "*.fxs" );

                    file_xs->ReadXsecFile( newfile );
                    file_xs->Update();
                    xs->Update();
                    stackgeom_ptr->Update();
                }
            }
        }
    }
    else if ( gui_device == &m_AfReadFileButton   )
    {
        int xsid = stackgeom_ptr->GetActiveXSecIndex();
        XSec* xs = stackgeom_ptr->GetXSec( xsid );
        if ( xs )
        {
            XSecCurve* xsc = xs->GetXSecCurve();
            if ( xsc )
            {
                if ( xsc->GetType() == XS_FILE_AIRFOIL  )
                {
                    FileAirfoil* affile_xs = dynamic_cast< FileAirfoil* >( xsc );
                    assert( affile_xs );
                    string newfile = m_ScreenMgr->GetSelectFileScreen()->FileChooser( "Airfoil File", "*.{af,dat}" );

                    affile_xs->ReadFile( newfile );
                    affile_xs->Update();
                    xs->Update();
                    stackgeom_ptr->Update();
                }
            }
        }
    }

    SkinScreen::GuiDeviceCallBack( gui_device );
}