本文整理汇总了C++中PathNode::readObject方法的典型用法代码示例。如果您正苦于以下问题:C++ PathNode::readObject方法的具体用法?C++ PathNode::readObject怎么用?C++ PathNode::readObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathNode
的用法示例。
在下文中一共展示了PathNode::readObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readObject
void PathGraph::readObject(IffStream* iffStream) {
iffStream->openForm('PGRF');
iffStream->openForm('0001');
iffStream->openChunk('META');
type = static_cast<PathGraphType>(iffStream->getInt());
iffStream->closeChunk('META');
iffStream->openChunk('PNOD');
int nodesSize = iffStream->getInt();
for (int i = 0; i < nodesSize; ++i) {
PathNode* pathNode = new PathNode(this);
pathNode->readObject(iffStream);
pathNodes.add(pathNode);
}
iffStream->closeChunk('PNOD');
iffStream->openChunk('PEDG');
Vector<PathEdge> pathEdges;
int pathEdgeSize = iffStream->getInt();
for (int i = 0; i < pathEdgeSize; ++i) {
PathEdge pathEdge;
pathEdge.readObject(iffStream);
pathEdges.add(pathEdge);
}
iffStream->closeChunk('PEDG');
iffStream->openChunk('ECNT');
int ecntSize = iffStream->getInt();
for (int i = 0; i < ecntSize; ++i) {
edgeCounts.add(iffStream->getInt());
}
iffStream->closeChunk('ECNT');
iffStream->openChunk('ESTR');
int estrSize = iffStream->getInt();
for (int i = 0; i < estrSize; ++i) {
edgeStarts.add(iffStream->getInt());
}
iffStream->closeChunk('ESTR');
iffStream->closeForm('0001');
iffStream->closeForm('PGRF');
connectNodes(pathEdges);
}
示例2: readObject
void PathGraph::readObject(IffStream* iffStream) {
iffStream->openForm('PGRF');
iffStream->openForm('0001');
iffStream->openChunk('META');
unkownMetaInt = iffStream->getInt();
iffStream->closeChunk('META');
iffStream->openChunk('PNOD');
int nodesSize = iffStream->getInt();
for (int i = 0; i < nodesSize; ++i) {
PathNode* pathNode = new PathNode(this);
pathNode->readObject(iffStream);
pathNodes.add(pathNode);
}
iffStream->closeChunk('PNOD');
iffStream->openChunk('PEDG');
//Vector<PathEdge> pathEdges;
int pathEdgeSize = iffStream->getInt();
for (int i = 0; i < pathEdgeSize; ++i) {
PathEdge* pathEdge = new PathEdge();
pathEdge->readObject(iffStream);
pathEdges.add(pathEdge);
}
iffStream->closeChunk('PEDG');
iffStream->openChunk('ECNT');
int ecntSize = iffStream->getInt();
for (int i = 0; i < ecntSize; ++i) {
ecnt.add(iffStream->getInt());
}
iffStream->closeChunk('ECNT');
iffStream->openChunk('ESTR');
int estrSize = iffStream->getInt();
for (int i = 0; i < estrSize; ++i) {
estr.add(iffStream->getInt());
}
iffStream->closeChunk('ESTR');
iffStream->closeForm('0001');
iffStream->closeForm('PGRF');
connectNodes();
}