本文整理汇总了C++中Vehicle::GetGeomVec方法的典型用法代码示例。如果您正苦于以下问题:C++ Vehicle::GetGeomVec方法的具体用法?C++ Vehicle::GetGeomVec怎么用?C++ Vehicle::GetGeomVec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vehicle
的用法示例。
在下文中一共展示了Vehicle::GetGeomVec方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//==== Get the sub surfaces from all geoms ====//
vector< SubSurface* > SubSurfaceMgrSingleton::GetSubSurfs()
{
vector< SubSurface* > ret_vec;
Vehicle* veh = VehicleMgr.GetVehicle();
if( !veh )
{
return ret_vec;
}
vector<Geom*> geoms = veh->FindGeomVec( veh->GetGeomVec() );
for ( int i = 0 ; i < ( int )geoms.size() ; i++ )
{
const vector< SubSurface* > SubSurfVec = geoms[i]->GetSubSurfVec();
for ( int j = 0 ; j < ( int )SubSurfVec.size() ; j++ )
{
ret_vec.push_back( SubSurfVec[j] );
}
}
return ret_vec;
}
示例2:
//==== Get All FeaStructures ====//
vector < FeaStructure* > StructureMgrSingleton::GetAllFeaStructs()
{
vector < FeaStructure* > feastructvec;
Vehicle* veh = VehicleMgr.GetVehicle();
if ( veh )
{
vector< Geom* > geom_vec = veh->FindGeomVec( veh->GetGeomVec( false ) );
for ( unsigned int i = 0; i < geom_vec.size(); i++ )
{
vector < FeaStructure* > geomstructvec = geom_vec[i]->GetFeaStructVec();
for ( unsigned int j = 0; j < geomstructvec.size(); j++ )
{
feastructvec.push_back( geomstructvec[j] );
}
}
}
return feastructvec;
}
示例3: GetScale
void SVGOptionsScreen::GetScale( int write_set )
{
bool foundgeom = false;
Vehicle *veh = VehicleMgr.GetVehicle();
vector< Geom* > geom_vec = veh->FindGeomVec( veh->GetGeomVec( false ) );
BndBox svgbox;
for ( int i = 0 ; i < ( int )geom_vec.size() ; i++ )
{
if ( geom_vec[i]->GetSetFlag( write_set ) )
{
svgbox.Update( geom_vec[i]->GetBndBox() );
foundgeom = true;
}
}
if ( !foundgeom )
{
veh->m_Scale.Set( 0 ); // Set to 0 if no geoms are in the set
return;
}
double length = svgbox.DiagDist();
double convert_scale;
if ( length >= 1.0 )
{
convert_scale = floor2scale( length, pow( 10.0, mag( length ) ) );
}
else
{
convert_scale = floor2scale( length, pow( 10.0, mag( length ) - 1 ) );
}
veh->m_Scale.Set( convert_scale );
}
示例4: Update
bool ManageTextureScreen::Update()
{
assert( m_ScreenMgr );
Vehicle* veh = m_ScreenMgr->GetVehiclePtr();
vector< Geom* > select_vec = veh->GetActiveGeomPtrVec();
if ( select_vec.size() != 1 )
{
Hide();
return false;
}
// Redo list on each update.
m_TextureMgrUI->compChoice->clear();
m_CompDropDownList.clear();
std::vector<Geom *> geomVec = veh->FindGeomVec( veh->GetGeomVec() );
for( int i = 0; i < ( int )geomVec.size(); i++ )
{
CompDropDownItem item;
item.GeomName = geomVec[i]->GetName();
item.GeomID = geomVec[i]->GetID();
// Hack to add duplicate names
char str[256];
sprintf( str, "%d", i );
item.GUIIndex = m_TextureMgrUI->compChoice->add( str );
m_CompDropDownList.push_back( item );
}
// Fill Hacked char array with correct names.
for( int i = 0; i < ( int )m_CompDropDownList.size(); i++ )
{
m_TextureMgrUI->compChoice->replace( m_CompDropDownList[i].GUIIndex, m_CompDropDownList[i].GeomName.c_str() );
}
// Set compChoice to current selected and update texture dropdown list.
for( int i = 0; i < ( int )m_CompDropDownList.size(); i++ )
{
if( m_CompDropDownList[i].GeomID == select_vec[0]->GetID() )
{
m_TextureMgrUI->compChoice->value( m_CompDropDownList[i].GUIIndex );
// Update Texture Dropdown List. //
// Redo texture list on each update.
m_TextureMgrUI->textureChoice->clear();
m_TexDropDownList.clear();
// Clear preview window.
VSPGraphic::Viewport * viewport = m_GlWin->getGraphicEngine()->getDisplay()->getViewport();
assert( viewport );
viewport->getBackground()->removeImage();
// Load Textures...
TextureMgr * texMgr = select_vec[0]->m_GuiDraw.getTextureMgr();
std::vector<Texture*> texInfos = texMgr->FindTextureVec( texMgr->GetTextureVec() );
for( int j = 0; j < ( int )texInfos.size(); j++ )
{
TexDropDownItem item;
item.TexInfo = texInfos[j];
// Hack to add duplicate names
char str[256];
sprintf( str, "%d", j );
item.GUIIndex = m_TextureMgrUI->textureChoice->add( str );
m_TexDropDownList.push_back( item );
}
// Fill Hacked char array with correct names.
for( int j = 0; j < ( int )m_TexDropDownList.size(); j++ )
{
m_TextureMgrUI->textureChoice->replace( m_TexDropDownList[j].GUIIndex, m_TexDropDownList[j].TexInfo->GetName().c_str() );
}
if( !m_TexDropDownList.empty() )
{
if( m_SelectedTexItem )
{
m_TextureMgrUI->textureChoice->value( m_SelectedTexItem->GUIIndex );
}
else
{
// On refresh list, if nothing is selected, pick last item on list.
m_TextureMgrUI->textureChoice->value( m_TexDropDownList[m_TexDropDownList.size() - 1].GUIIndex );
}
UpdateCurrentSelected();
assert( m_SelectedTexItem );
viewport->getBackground()->attachImage( VSPGraphic::GlobalTextureRepo()->
get2DTexture( m_SelectedTexItem->TexInfo->m_FileName.c_str() ) );
}
else
{
ResetCurrentSelected();
// Force redraw empty list.
m_TextureMgrUI->textureChoice->redraw();
}
//.........这里部分代码省略.........
示例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;
}
//.........这里部分代码省略.........