本文整理汇总了C++中XSec类的典型用法代码示例。如果您正苦于以下问题:C++ XSec类的具体用法?C++ XSec怎么用?C++ XSec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XSec类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: FindXSec
//==== 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();
}
}
开发者ID:cptdime,项目名称:OpenVSP,代码行数:33,代码来源:XSecSurf.cpp
示例2: PasteAirfoil
//==== 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();
}
}
开发者ID:Mr-Kumar-Abhishek,项目名称:OpenVSP,代码行数:12,代码来源:WingGeom.cpp
示例3: CreateXSec
//==== 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;
}
开发者ID:cptdime,项目名称:OpenVSP,代码行数:13,代码来源:XSecSurf.cpp
示例4: SetActiveXSecIndex
//==== 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() );
}
}
开发者ID:Mr-Kumar-Abhishek,项目名称:OpenVSP,代码行数:13,代码来源:WingGeom.cpp
示例5: GetXSec
//==== Insert XSec ====//
void PropGeom::InsertXSec( )
{
if ( m_ActiveXSec >= NumXSec() - 1 )
{
return;
}
XSec* xs = GetXSec( m_ActiveXSec );
if ( xs )
{
InsertXSec( xs->GetXSecCurve()->GetType() );
}
}
开发者ID:SteveDoyle2,项目名称:OpenVSP,代码行数:14,代码来源:PropGeom.cpp
示例6: m_Scale
//==== 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();
}
开发者ID:SteveDoyle2,项目名称:OpenVSP,代码行数:15,代码来源:StackGeom.cpp
示例7: m_Scale
//==== 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();
}
开发者ID:SteveDoyle2,项目名称:OpenVSP,代码行数:16,代码来源:PropGeom.cpp
示例8: m_Scale
//==== 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();
}
开发者ID:hensomc,项目名称:OpenVSP-1,代码行数:16,代码来源:FuselageGeom.cpp
示例9: xmlNewChild
//==== 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;
}
开发者ID:cptdime,项目名称:OpenVSP,代码行数:19,代码来源:XSecSurf.cpp
示例10: GetXSec
//==== 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();
}
开发者ID:Mr-Kumar-Abhishek,项目名称:OpenVSP,代码行数:19,代码来源:WingGeom.cpp
示例11: 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;
}
开发者ID:SteveDoyle2,项目名称:OpenVSP,代码行数:19,代码来源:StackGeom.cpp
示例12: assert
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();
}
}
}
}
//.........这里部分代码省略.........
开发者ID:tperry01,项目名称:OpenVSP,代码行数:101,代码来源:WingScreen.cpp
示例13: assert
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() );
}
}
//.........这里部分代码省略.........
开发者ID:tperry01,项目名称:OpenVSP,代码行数:101,代码来源:FuselageScreen.cpp
示例14: assert
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 );
}
开发者ID:aeromedia,项目名称:OpenVSP,代码行数:90,代码来源:StackScreen.cpp
注:本文中的XSec类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论