本文整理汇总了C++中Star::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ Star::GetName方法的具体用法?C++ Star::GetName怎么用?C++ Star::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Star
的用法示例。
在下文中一共展示了Star::GetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//------------------------------------------------------------------------------
// int main(int argc, char *argv[])
//------------------------------------------------------------------------------
int main(int argc, char *argv[])
{
cout << "=-=-=-=-=-=-= TEST coordinate system ....." << endl;
cout << " ------ number of objects instantiated = " << GmatBase::GetInstanceCount() << endl;
cout.setf(ios::fixed);
cout.precision(16);
std::string eopFileName = "/GMAT/dev/datafiles/EOPFiles/eopc04.62-now";
std::string nutFileName = "/GMAT/dev/datafiles/ITRF/NUTATION.DAT";
std::string planFileName = "/GMAT/dev/datafiles/ITRF/NUT85.DAT";
std::string SLPFileName = "/GMAT/dev/datafiles/mac/DBS_mn2000.dat";
std::string DEFileName = "/GMAT/dev/datafiles/DEascii/macp1941.405";
std::string LeapFileName = "/GMAT/dev/datafiles/tai-utcFiles/tai-utc.dat";
cout << "\n==> First, test the AxisSystemFactory <==" << endl;
AxisSystemFactory *asf = new AxisSystemFactory();
cout << "AxisSystemFactory created .........." << endl;
cout << " ------ number of objects instantiated = " << GmatBase::GetInstanceCount() << endl;
std::string
AXES_TYPE[13] =
{
"MJ2000Eq",
"MJ2000Ec",
"TOEEq",
"TOEEc",
"MOEEq",
"MOEEc",
"TODEq",
"TODEc",
"MODEq",
"MODEc",
"ObjectReferenced",
"Equator",
"BodyFixed",
};
AxisSystem *as;
MJ2000EqAxes* mj;
MJ2000EqAxes* mj2;
//MJ2000EcAxes* mj2;
std::string tmpStr = "";
//for (int i = 0; i < 13 ; i++)
for (int i = 0; i < 2 ; i++) // only do the first one, for now
{
tmpStr = AXES_TYPE[i] + "1";
as = asf->CreateAxisSystem(AXES_TYPE[i], tmpStr);
if (as)
{
cout << "AxisSystem of type " << AXES_TYPE[i] <<
" was created with name " << tmpStr << endl;
if (i > 1) delete as;
else if (i == 0) mj = (MJ2000EqAxes*) as;
//else mj2 = (MJ2000EcAxes*) as;
}
else cout << "NO " << AXES_TYPE[i] << " AxisSystem created." << endl;
}
cout << " ------ number of objects instantiated = " << GmatBase::GetInstanceCount() << endl;
if (mj)
{
cout << "MJ2000EqAxes object exists with name " << mj->GetName() <<
" and type " << mj->GetTypeName() << endl;
}
mj2 = (MJ2000EqAxes*)(asf->CreateAxisSystem("MJ2000Eq","MJ2000Eq2"));
if (mj2)
{
cout << "MJ20002 object exists with name " << mj2->GetName() <<
" and type " << mj2->GetTypeName() << endl;
}
try
{
LeapSecsFileReader* ls = new LeapSecsFileReader(LeapFileName);
ls->Initialize();
EopFile *eop = new EopFile(eopFileName);
eop->Initialize();
ItrfCoefficientsFile* itrf = new ItrfCoefficientsFile(nutFileName, planFileName);
itrf->Initialize();
//bf->SetEopFile(eop);
//bf->SetCoefficientsFile(itrf);
TimeConverterUtil::SetLeapSecsFileReader(ls);
TimeConverterUtil::SetEopFile(eop);
}
catch (BaseException &bbee)
{
cout << "ERROR !!!!! " << bbee.GetMessage() << endl;
}
SolarSystem* ss;
Star* sol;
Planet* earth;
Planet* mars;
Planet* jupiter;
Moon* luna;
std::string j2000BN = "";
SpacePoint* j2000B = NULL;
//.........这里部分代码省略.........
示例2: main
//------------------------------------------------------------------------------
// int main(int argc, char *argv[])
//------------------------------------------------------------------------------
int main(int argc, char *argv[])
{
std::string eopFileName = "/GMAT/dev/datafiles/EOPFiles/eopc04.62-now";
std::string nutFileName = "/GMAT/dev/datafiles/ITRF/NUTATION.DAT";
std::string planFileName = "/GMAT/dev/datafiles/ITRF/NUT85.DAT";
std::string SLPFileName = "/GMAT/dev/datafiles/mac/DBS_mn2000.dat";
std::string DEFileName = "/GMAT/dev/datafiles/DEascii/macp1941.405";
std::string LeapFileName = "/GMAT/dev/datafiles/tai-utcFiles/tai-utc.dat";
//std::string eopFileName = "/Users/wendyshoan/WORKONLY/dev/build3/bin/files/eop/eopc04.62-now";
//std::string nutFileName = "/Users/wendyshoan/WORKONLY/dev/build3/bin/files/itrf/NUTATION.DAT";
//std::string planFileName = "/Users/wendyshoan/WORKONLY/dev/build3/bin/files/itrf//NUT85.DAT";
//std::string SLPFileName = "/Users/wendyshoan/WORKONLY/dev/build3/bin/files/planetary_ephem/slp/DBS_mn2000.dat";
//std::string DEFileName = "/Users/wendyshoan/WORKONLY/dev/build3/bin/files/planetary_ephem/de/macp1941.405";
//std::string LeapFileName = "/Users/wendyshoan/WORKONLY/dev/build3/bin/files/time/tai-utc.dat";
cout << "=-=-=-=-=-=-= TEST CalculatedPoint/Barycenter ....." << endl;
cout << " ------ number of objects instantiated = " << GmatBase::GetInstanceCount() << endl;
cout.setf(ios::fixed);
cout.precision(30);
cout << "\n==> First, test the CalculatedPointFactory <==" << endl;
CalculatedPointFactory *cpf = new CalculatedPointFactory();
cout << "CalculatedPointFactory created .........." << endl;
cout << " ------ number of objects instantiated = " << GmatBase::GetInstanceCount() << endl;
LeapSecsFileReader* ls;
EopFile *eop;
ItrfCoefficientsFile* itrf;
try
{
ls = new LeapSecsFileReader(LeapFileName);
ls->Initialize();
eop = new EopFile(eopFileName);
eop->Initialize();
itrf = new ItrfCoefficientsFile(nutFileName, planFileName);
itrf->Initialize();
TimeConverterUtil::SetLeapSecsFileReader(ls);
TimeConverterUtil::SetEopFile(eop);
}
catch (BaseException &bbee)
{
cout << "ERROR !!!!! " << bbee.GetMessage() << endl;
}
SolarSystem* ss;
Star* sol;
Planet* earth;
Planet* mars;
Planet* jupiter;
Moon* luna;
std::string j2000BN = "";
SpacePoint* j2000B = NULL;
try
{
cout << "\n==> Create the solar system <==" << endl;
ss = new SolarSystem("TheSS");
cout << "solar system name = " << ss->GetName() << endl;
cout << " ------ number of objects instantiated = " << GmatBase::GetInstanceCount() << endl;
earth = (Planet*) ss->GetBody(SolarSystem::EARTH_NAME);
cout << "earth name = " << earth->GetName() << endl;
cout << "earth's type name is " << earth->GetTypeName() << endl;
sol = (Star*) ss->GetBody(SolarSystem::SUN_NAME);
cout << "sol name = " << sol->GetName() << endl;
cout << "sol's type name is " << sol->GetTypeName() << endl;
cout << " ------ number of objects instantiated = " << GmatBase::GetInstanceCount() << endl;
luna = (Moon*) ss->GetBody(SolarSystem::MOON_NAME);
cout << "luna name = " << luna->GetName() << endl;
cout << "luna's type name is " << luna->GetTypeName() << endl;
mars = (Planet*) ss->GetBody(SolarSystem::MARS_NAME);
cout << "mars name = " << mars->GetName() << endl;
cout << "mars's type name is " << mars->GetTypeName() << endl;
jupiter = (Planet*) ss->GetBody(SolarSystem::JUPITER_NAME);
cout << "jupiter name = " << jupiter->GetName() << endl;
cout << "jupiter's type name is " << jupiter->GetTypeName() << endl;
SlpFile* anSLP;
DeFile* aDE;
try
{
anSLP = new SlpFile(SLPFileName);
aDE = new DeFile(Gmat::DE405,DEFileName);
cout << "the SLP file is : " << anSLP->GetName() << endl;
cout << "the DE file is : " << aDE->GetName() << endl;
}
catch (BaseException &be1)
{
cout << "ERROR with ephem file -> " << be1.GetMessage() << endl;
}
//.........这里部分代码省略.........