本文整理汇总了C++中Star::SetJ2000Body方法的典型用法代码示例。如果您正苦于以下问题:C++ Star::SetJ2000Body方法的具体用法?C++ Star::SetJ2000Body怎么用?C++ Star::SetJ2000Body使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Star
的用法示例。
在下文中一共展示了Star::SetJ2000Body方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
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
{
std::string SLPFileName = "/GMAT/dev/datafiles/mac/DBS_mn2000.dat";
std::string DEFileName = "/GMAT/dev/datafiles/DEascii/macp1941.405";
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;
}
ss->SetSource(Gmat::SLP);
ss->SetSourceFile(anSLP);
//ss->SetSource(Gmat::DE_405);
//ss->SetSourceFile(aDE);
// set the j2000Body
j2000BN = "Earth";
j2000B = earth;
sol->SetJ2000BodyName(j2000BN);
sol->SetJ2000Body(j2000B);
earth->SetJ2000BodyName(j2000BN);
earth->SetJ2000Body(j2000B);
luna->SetJ2000BodyName(j2000BN);
luna->SetJ2000Body(j2000B);
mars->SetJ2000BodyName(j2000BN);
mars->SetJ2000Body(j2000B);
jupiter->SetJ2000BodyName(j2000BN);
jupiter->SetJ2000Body(j2000B);
}
catch (GmatBaseException &ex)
{
cout << "Some kind of error ..........." << endl;
}
bool isOK = false;
cout << "\n==> Now creating CoordinateSystems <==" << endl;
CoordinateSystem* mj2000 = new CoordinateSystem("", "CoordSystemMJ2000");
cout << " ------ number of objects instantiated = " << GmatBase::GetInstanceCount() << endl;
mj2000->SetSolarSystem(ss);
mj2000->SetStringParameter("OriginName","Earth");
mj2000->SetStringParameter("J2000BodyName",j2000BN);
isOK = mj2000->SetRefObject(earth,Gmat::SPACE_POINT,"Earth");
isOK = mj2000->SetRefObject(j2000B,Gmat::SPACE_POINT,j2000BN);
isOK = mj2000->SetRefObject(mj, Gmat::AXIS_SYSTEM, mj->GetName());
if (isOK) cout << "It seems to have been set OK!!!!!!!!!!!" << endl;
else cout << "ERROR setting axis system for coordinate system!!!!!" << endl;
mj2000->Initialize();
示例2: main
//.........这里部分代码省略.........
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;
}
//ss->SetSource(Gmat::SLP);
//ss->SetSourceFile(anSLP);
ss->SetSource(Gmat::DE_405);
ss->SetSourceFile(aDE);
// set the j2000Body
j2000BN = "Earth";
j2000B = earth;
sol->SetJ2000BodyName(j2000BN);
sol->SetJ2000Body(j2000B);
earth->SetJ2000BodyName(j2000BN);
earth->SetJ2000Body(j2000B);
luna->SetJ2000BodyName(j2000BN);
luna->SetJ2000Body(j2000B);
mars->SetJ2000BodyName(j2000BN);
mars->SetJ2000Body(j2000B);
jupiter->SetJ2000BodyName(j2000BN);
jupiter->SetJ2000Body(j2000B);
}
catch (GmatBaseException &ex)
{
cout << "Some kind of error ..........." << endl;
}
bool OK = false;
cout << "Now creating Barycenter1" << endl;
Barycenter *bary1 = (Barycenter*) cpf->CreateCalculatedPoint("Barycenter", "Bary1");
cout << "Now setting bddies for Bary1 .........." << endl;
bary1->SetStringParameter("BodyNames","Earth",0);
bary1->SetStringParameter("BodyNames","Sun",1);
bary1->SetStringParameter("BodyNames","Luna",2);
OK = bary1->SetRefObject(earth, Gmat::SPACE_POINT, "Earth");
if (!OK) cout << "ERROR setting barycenter with body Earth" << endl;
OK = bary1->SetRefObject(sol, Gmat::SPACE_POINT, "Sun");
if (!OK) cout << "ERROR setting barycenter with body Sun" << endl;
OK = bary1->SetRefObject(luna, Gmat::SPACE_POINT, "Luna");
if (!OK) cout << "ERROR setting barycenter with body Luna" << endl;
Integer num = 0;