本文整理汇总了C++中Parm::get_geom_base方法的典型用法代码示例。如果您正苦于以下问题:C++ Parm::get_geom_base方法的具体用法?C++ Parm::get_geom_base怎么用?C++ Parm::get_geom_base使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parm
的用法示例。
在下文中一共展示了Parm::get_geom_base方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LinkAllGroup
bool ParmLinkMgr::LinkAllGroup()
{
Parm* pA = m_WorkingParmLink.GetParmA();
Parm* pB = m_WorkingParmLink.GetParmB();
if ( pA->get_geom_base() == pB->get_geom_base() )
return false;
string gnameA = string( pA->get_group_name().get_char_star() );
string gnameB = string( pB->get_group_name().get_char_star() );
vector< Parm* > parmAVec = GetParmVec( pA->get_geom_base(), gnameA );
vector< Parm* > parmBVec = GetParmVec( pB->get_geom_base(), gnameB );
for ( int k = 0 ; k < (int)parmAVec.size() ; k++ )
{
for ( int n = 0 ; n < (int)parmBVec.size() ; n++ )
{
Parm* parmA = parmAVec[k];
Parm* parmB = parmBVec[n];
if ( parmA->get_name() == parmB->get_name() )
{
AddLink( parmA, parmB );
}
}
}
return true;
}
示例2: SwapGeom
void ParmLinkMgr::SwapGeom( Geom* gOld, Geom* gNew )
{
for ( int i = 0 ; i < (int)m_ParmLinkVec.size() ; i++ )
{
Parm* pA = m_ParmLinkVec[i]->GetParmA();
if ( pA->get_geom_base() == gOld )
{
Stringc group_name = pA->get_group_name();
Stringc parm_name = pA->get_name();
Parm* p = FindParm( gNew, group_name, parm_name );
if ( p )
m_ParmLinkVec[i]->SetParmA( p );
}
Parm* pB = m_ParmLinkVec[i]->GetParmB();
if ( pB->get_geom_base() == gOld )
{
Stringc group_name = pB->get_group_name();
Stringc parm_name = pB->get_name();
Parm* p = FindParm( gNew, group_name, parm_name );
if ( p )
m_ParmLinkVec[i]->SetParmB( p );
}
m_ParmLinkVec[i]->GetParmA()->set_linked_flag( true );
m_ParmLinkVec[i]->GetParmB()->set_linked_flag( true );
}
}
示例3: LoadAllParms
void ParmLinkMgr::LoadAllParms()
{
//==== Clear All Existing Parms ====//
map< GeomBase*, map< string, vector< Parm* > > >::iterator g;
map< string, vector<Parm*> >::iterator itr;
for ( g = m_ParmMap.begin() ; g != m_ParmMap.end() ; g++ )
{
for ( itr = g->second.begin() ; itr != g->second.end() ; itr++ )
{
itr->second.clear();
}
g->second.clear();
}
m_ParmMap.clear();
if ( aircraftPtr == NULL )
return;
//==== Loop Thru All Geoms ====//
vector< Geom* > geomVec = aircraftPtr->getGeomVec();
geomVec.push_back( aircraftPtr->getUserGeom() );
for ( int i = 0 ; i < (int)geomVec.size() ; i++ )
{
vector < Parm* > parmVec;
geomVec[i]->LoadLinkableParms( parmVec );
for ( int j = 0 ; j < (int)parmVec.size() ; j++ )
{
Parm* p = parmVec[j];
p->set_linked_flag( false );
Register( p, p->get_geom_base(), p->get_group_name().get_char_star() );
}
}
}
示例4: WritePHolderListDES
void PHolderListMgr::WritePHolderListDES( char *newfile )
{
FILE *fp;
fp = fopen( newfile, "w" );
fprintf( fp, "%d\n", (int)m_PHolderVec.size() );
for ( int i = 0 ; i < (int)m_PHolderVec.size() ; i++ )
{
Parm *p = m_PHolderVec[i]->getParm();
fprintf( fp, "%d:%s:%s:%s: %g\n", ((Geom*)p->get_geom_base())->getPtrID(), p->get_geom_base()->getName().get_char_star(), p->get_group_name().get_char_star(), p->get_name().get_char_star(), p->get() );
}
fclose( fp );
}
示例5: WritePHolderListXDDM
void PHolderListMgr::WritePHolderListXDDM( char *newfile )
{
xmlDocPtr doc = xmlNewDoc((const xmlChar *)"1.0");
xmlNodePtr model_node = xmlNewNode(NULL,(const xmlChar *)"Model");
xmlDocSetRootElement(doc, model_node);
xmlSetProp( model_node, (const xmlChar *)"ID", (const xmlChar *)aircraftPtr->getFileName().get_char_star() );
xmlSetProp( model_node, (const xmlChar *)"Modeler", (const xmlChar *)"OpenVSP" );
xmlSetProp( model_node, (const xmlChar *)"Wrapper", (const xmlChar *)"wrap_vsp.csh" );
for ( int i = 0 ; i < (int)m_PHolderVec.size() ; i++ )
{
Parm* p = m_PHolderVec[i]->getParm();
xmlNodePtr var_node;
if( m_PHolderVec[i]->getDesType() == XDDM_VAR )
var_node = xmlNewChild( model_node, NULL, (const xmlChar *)"Variable", NULL );
else
var_node = xmlNewChild( model_node, NULL, (const xmlChar *)"Constant", NULL );
char varname[255];
sprintf( varname, "%d:%s:%s:%s", ((Geom*)p->get_geom_base())->getPtrID(), p->get_geom_base()->getName().get_char_star(), p->get_group_name().get_char_star(), p->get_name().get_char_star() );
xmlSetProp( var_node, (const xmlChar *)"ID", (const xmlChar *)varname );
xmlSetDoubleProp( var_node, "Value", p->get() );
xmlSetDoubleProp( var_node, "Min", p->get_lower() );
xmlSetDoubleProp( var_node, "Max", p->get_upper() );
xmlSetProp( var_node, (const xmlChar *)"VSPVarName", (const xmlChar *)varname );
}
//===== Save XML Tree and Free Doc =====//
xmlSaveFormatFile((const char *)newfile, doc, 1);
xmlFreeDoc( doc );
}
示例6: LinkAllComp
bool ParmLinkMgr::LinkAllComp()
{
Parm* pA = m_WorkingParmLink.GetParmA();
Parm* pB = m_WorkingParmLink.GetParmB();
if ( pA->get_geom_base() == pB->get_geom_base() )
return false;
//==== For All Parms in GeomA, Try to Find Match in GeomB and Link ====//
vector< string > groupAVec = GetGroupNameVec( pA->get_geom_base() );
vector< string > groupBVec = GetGroupNameVec( pB->get_geom_base() );
for ( int i = 0 ; i < (int)groupAVec.size() ; i++ )
{
for ( int j = 0 ; j < (int)groupBVec.size() ; j++ )
{
if ( groupAVec[i].compare( groupBVec[j] ) == 0 )
{
vector< Parm* > parmAVec = GetParmVec( pA->get_geom_base(), groupAVec[i] );
vector< Parm* > parmBVec = GetParmVec( pB->get_geom_base(), groupBVec[j] );
for ( int k = 0 ; k < (int)parmAVec.size() ; k++ )
{
for ( int n = 0 ; n < (int)parmBVec.size() ; n++ )
{
Parm* parmA = parmAVec[k];
Parm* parmB = parmBVec[n];
if ( parmA->get_name() == parmB->get_name() )
{
AddLink( parmA, parmB );
}
}
}
}
}
}
return true;
}