osg fbx 模型树结构
Posted herd
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了osg fbx 模型树结构相关的知识,希望对你有一定的参考价值。
void Test::printOsgGroup(osg::ref_ptr<osg::Group> &groupParam) qDebug() <<groupParam->getNumChildren(); //std::cout << groupParam->getNumChildren() << std::endl; for (int k = 0; k<groupParam->getNumChildren(); k++) osg::ref_ptr<osg::Group> group_index = groupParam->getChild(k)->asGroup(); if (group_index->getNumChildren()>1) printOsgGroup(group_index); //转换编 //std::string name = w2m1(m2w1(groupParam->getChild(k)->getName(), CP_UTF8)); //std::cout << k << "=" << name << std::endl; qDebug() <<QString::fromStdString(groupParam->getChild(k)->getName()); QString item1 = QString::fromStdString(groupParam->getChild(k)->getName()); QStandardItem* itemProject = new QStandardItem(item1); qStandardItemModel->appendRow(itemProject); //qStandardItemModel->setItem(qStandardItemModel->indexFromItem(itemProject).row(), 1, new QStandardItem(QStringLiteral("项目信息说明"))); //sg->getChild(k)->setNodeMask(1); //std::cout << k << " " << sg->getChild(k)->getName() << " " << sg->getNodeMask() << std::endl;
QStandardItemModel* Test::showTreeView() qStandardItemModel = new QStandardItemModel(this->tesla_manage_ui.treeView); qStandardItemModel->setHorizontalHeaderLabels(QStringList() << QStringLiteral("名称") << QStringLiteral("信息")); return qStandardItemModel;
以上是关于osg fbx 模型树结构的主要内容,如果未能解决你的问题,请参考以下文章
osg fbx模型删除模型中的某几个节点,实现编辑模型的功能