void NCAssimpModel::initBones() {
    aiNode* root = scene->mRootNode;
    saveChild(root);
    for (int i=0;i<bones.size();++i) {
        jointlabels[i] = bones[i].node->mName.data;
    }
}
/**
 *	This method collects up all the children of this section into the
 *	zip file system.
 */
BinaryPtr ZipSection::recollect()
{
	pFileSystem_->clear(pFileSystem_->tag());

	// update / add all the kids
	for ( uint i=0; i<children_.size(); i++ )
	{
		if (children_[i])
			saveChild( children_[i], true );
	}
	return NULL;
}
Exemplo n.º 3
0
/**
 * @brief RsCollectionDialog::save: Update collection to save it in caller.
 */
void RsCollectionDialog::save()
{
	std::cerr << "Saving!" << std::endl;
	_newColFileInfos.clear();
	QTreeWidgetItem* root = getRootItem();
	if (root) {
		saveChild(root);

		emit saveColl(_newColFileInfos, _fileName);
	}
	close();
}
void NCAssimpModel::saveChild(aiNode* node) {
    NCBone bone;
    bone.ownstarttransform = node->mTransformation;
    bone.name = node->mName;
    bone.node = node;
    bones.push_back(bone);

    if (node->mNumChildren > 0) {
		for (int i=0 ;i < (int)node->mNumChildren;i++) {
			aiNode* childNode = node->mChildren[i];
            saveChild(childNode);
        }
    }
}
Exemplo n.º 5
0
/**
 * @brief RsCollectionDialog::saveChild: Save each child in _newColFileInfos
 * @param parent
 */
void RsCollectionDialog::saveChild(QTreeWidgetItem *parentItem, ColFileInfo *parentInfo)
{
	ColFileInfo parent;
	if (!parentInfo) parentInfo = &parent;

	parentInfo->checked = (parentItem->checkState(COLUMN_FILE)==Qt::Checked);
	parentInfo->hash = parentItem->text(COLUMN_HASH);
	parentInfo->name = parentItem->data(COLUMN_HASH,ROLE_NAME).toString();
	parentInfo->path = parentItem->data(COLUMN_HASH,ROLE_PATH).toString();
	parentInfo->type = parentItem->data(COLUMN_HASH,ROLE_TYPE).toUInt();
	parentInfo->size = parentItem->data(COLUMN_SIZE,ROLE_SELSIZE).toULongLong();

	for (int i=0; i<parentItem->childCount(); ++i) {
		ColFileInfo child;
		saveChild(parentItem->child(i), &child);
		if (parentInfo->name != "") {
			parentInfo->children.push_back(child);
		} else {
			_newColFileInfos.push_back(child);
		}
	}
}