本文整理汇总了C++中XSec::GetXSecCurve方法的典型用法代码示例。如果您正苦于以下问题:C++ XSec::GetXSecCurve方法的具体用法?C++ XSec::GetXSecCurve怎么用?C++ XSec::GetXSecCurve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XSec
的用法示例。
在下文中一共展示了XSec::GetXSecCurve方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CopyXSec
//==== 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: InsertWingSect
//==== 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() );
}
}
示例3: InsertXSec
//==== Insert XSec ====//
void PropGeom::InsertXSec( )
{
if ( m_ActiveXSec >= NumXSec() - 1 )
{
return;
}
XSec* xs = GetXSec( m_ActiveXSec );
if ( xs )
{
InsertXSec( xs->GetXSecCurve()->GetType() );
}
}
示例4: CopyXSecCurve
//==== 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() );
}
}
示例5: SetActiveAirfoilType
//==== 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();
}
示例6: SetActiveXSecType
//==== 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();
}
示例7: LoadDragFactors
//==== 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;
}
示例8: GuiDeviceCallBack
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() );
}
}
//.........这里部分代码省略.........
示例9: GuiDeviceCallBack
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();
}
}
}
}
//.........这里部分代码省略.........
示例10: GuiDeviceCallBack
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 );
}