本文整理汇总了C++中Part::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ Part::Load方法的具体用法?C++ Part::Load怎么用?C++ Part::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part::Load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseCMSD
void CCMSDIntegrator::ParseCMSD(std::string filename)
{
CMSD::CCMSD doc = CMSD::CCMSD::LoadFromFile(filename);
doc.SaveToFile((::ExeDirectory() + "Test1.xml").c_str(), true);
//CMSD::CCMSD::DataSection d = doc.DataSection().first();
CMSD::CwhiteSpaceType root = doc.whiteSpace.first();
CMSD::CCMSDDocument cmsddocument = doc.CMSDDocument[0];
CMSD::CDataSectionType2 data = cmsddocument.DataSection[0];
for(int i=0; i< data.PartType.count() ; i++)
{
Part * apart ( (Part*) Part().CreateSave<Part>());
apart->Load(data.PartType[i].GetNode());
//std::vector<IObjectPtr> &someparts ( apart->objects());
//Part * part2=(Part *) someparts[0].get();
}
for(int i=0; i< data.ProcessPlan.count() ; i++)
{
ProcessPlan * aplan ( (ProcessPlan *) IObject::CreateSave<ProcessPlan>());
aplan->Load(data.ProcessPlan[i].GetNode());
}
for(int i=0; i< data.Resource.count() ; i++)
{
if(Cell::IsResourceCell(data.Resource[i].GetNode()))
{
Cell * acell( (Cell *) IObject::CreateSave<Cell>());
acell->Load(data.Resource[i].GetNode());
}
else
{
Resource * aresource ((Resource *) IObject::CreateSave<Resource>());
aresource->Load(data.Resource[i].GetNode());
}
}
for(int i=0; i< data.Job.count() ; i++)
{
Job * ajob ( IObject::CreateSave<Job>() );
ajob->Load(data.Job[i].GetNode());
}
for(int i=0; i< data.DistributionDefinition.count() ; i++)
{
Distribution * astat ( (Distribution *) IObject::CreateSave<Distribution>() );
astat->LoadDefinition(data.DistributionDefinition[i].GetNode());
}
for(int i=0; i< data.Calendar.count() ; i++)
{
Calendar * calendar ( (Calendar *) IObject::CreateSave<Calendar>());
calendar->Load(data.Calendar[i].GetNode());
}
for(int i=0; i< data.Layout.count() ; i++)
{
Layout * layout ((Layout *) IObject::CreateSave<Layout>());
layout->Load(data.Layout[i].GetNode());
}
//CMSD::CInventoryItem inv = data.InventoryItem[0];
//inv.Location
int j=0;
}
示例2: LoadParts
void Puppet::LoadParts(TiXmlElement *element, Entity *intoEntity)
{
TiXmlElement *xmlPart = element->FirstChildElement("Part");
while (xmlPart)
{
XMLFileNode xmlFileNode(xmlPart);
Part *part = new Part();
part->SetPuppet(this);
part->Load(&xmlFileNode);
LoadParts(xmlPart, part);
parts.push_back(part);
/// TODO...?
intoEntity->Add(part);
xmlPart = xmlPart->NextSiblingElement("Part");
}
}
示例3: LoadParts
void Puppet::LoadParts(TiXmlElement *element, Part *intoPart)
{
TiXmlElement *xmlPart = element->FirstChildElement("Part");
while (xmlPart)
{
XMLFileNode xmlFileNode(xmlPart);
Part *part = new Part();
part->SetPuppet(this);
part->Load(&xmlFileNode);
LoadParts(xmlPart, part);
printf("loaded part [%s]\n", part->GetName().c_str());
if (intoPart)
{
intoPart->parts.push_back(part);
part->SetParent(intoPart);
printf(" into part [%s]\n", intoPart->GetName().c_str());
}
else
{
part->SetParent(entity);
}
parts.push_back(part);
Game::GetScene()->Add(part);
//intoEntity->Add(part);
xmlPart = xmlPart->NextSiblingElement("Part");
}
}