本文整理汇总了C++中Skeleton::getRoot方法的典型用法代码示例。如果您正苦于以下问题:C++ Skeleton::getRoot方法的具体用法?C++ Skeleton::getRoot怎么用?C++ Skeleton::getRoot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skeleton
的用法示例。
在下文中一共展示了Skeleton::getRoot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createSkeleton
Skeleton* AssimpAssetLoader::createSkeleton(const aiNode &node)
{
Skeleton *skel = NULL;
mBones.clear();
aggregateBones(node);
if(mBones.size() != 0)
{
aiNode *skeletonRootNode = findSkeletonRoot(node);
skel = new Skeleton(AssimpHelpers::aiNodeToBone(skeletonRootNode));
buildSkeletonFromSubTree(skel->getRoot(), skeletonRootNode);
std::cout << "found " << mBones.size() << " bones" << std::endl;
std::cout << "Skeleton Root Node: " << skeletonRootNode->mName.C_Str() << std::endl;
skel->getRoot()->debugPrintTree();
}
return skel;
}
示例2: importFile
void MainWindow_M::importFile(const char* folder,int* file,double* color,int size,bool bkg)
{
// if CSAEncodeImages object not exist, create it
if(m_pSAEncodeImg == NULL)
{
qDebug()<<"loading the encoded file";
QString fileName = folder;
//fileName += "\\"+fileName.section('\\',-1) + ".sa";
fileName += "\\"+fileName.section('\\',-1) + ".data";
m_pSAEncodeImg = new CSAEncodeVectorImages();
m_pSAEncodeImg->loadFromFile(fileName.toAscii());
qDebug()<<"encoded file loaded";
}
// clear the graphics scene
m_graphicsScene.clear();
// draw the shadow
QImage resultImage,tmp;
resultImage = QImage(480,480,QImage::Format_ARGB32);
resultImage.fill(qRgba(255,255,255,0));
tmp = QImage(120,120,QImage::Format_ARGB32);
int displaynum = min(m_iDisplayNearestNum,size);
if(renderarea->m_pSkeleton)
{
Skeleton* pSkeleton = renderarea->m_pSkeleton;
// Nearest neighbor in graphics view
for(int i = 0; i < displaynum /*&& i < 20*/; i++)
{
tmp.fill(qRgba(255,255,255,0));
int ix = (displaynum - i) * (colormap.size() - 1) / displaynum;
// use the colormap to describe the probability
QColor color2(colormap[ix][0] * 255,colormap[ix][1] * 255,colormap[ix][2] * 255);
//QColor color2(colormap[colormap.size()-1-i*3][0] * 255,colormap[colormap.size()-1-i*3][1] * 255,colormap[colormap.size()-1-i*3][2] * 255);
QPainter painter(&tmp);
painter.setPen(color2);
for(int j = 1; j < m_pSAEncodeImg->m_sJointName.size(); j++)
{
string child_name = m_pSAEncodeImg->m_sJointName[j];
Bone* pBone = NULL;
pBone = pSkeleton->findBoneByName(pSkeleton->getRoot(),child_name.c_str());
string parent_name = pBone->parent_name;
int k = 0;
for(; k < m_pSAEncodeImg->m_sJointName.size(); k++)
{
if(parent_name == m_pSAEncodeImg->m_sJointName[k])
break;
}
painter.drawLine(m_pSAEncodeImg->m_iJointPosition[file[i]][k*2]/4,m_pSAEncodeImg->m_iJointPosition[file[i]][k*2+1]/4,m_pSAEncodeImg->m_iJointPosition[file[i]][j*2]/4,m_pSAEncodeImg->m_iJointPosition[file[i]][j*2+1]/4);
}
painter.end();
QPixmap pixmap;
pixmap.convertFromImage(tmp);
CSACustomGraphicsPixmapItem* graphicspixmapitem = new CSACustomGraphicsPixmapItem(&m_graphicsScene);
graphicspixmapitem->setPixmap(pixmap);
graphicspixmapitem->setPos(4 + i%2*124,4 + i/2*124);
graphicspixmapitem->setImageIndex(file[i]);
}
}
// background images
//for(int i = 0; i < displaynum; i++)
//{
// QColor color(250-i*100.0/(displaynum-1),250-i*100.0/(displaynum-1),250-i*100.0/(displaynum-1));
// for(int j = 0; j < m_pSAEncodeImg->m_sJointName.size(); j += 2)
// {
// int m = m_pSAEncodeImg->m_iJointPosition[file[displaynum-1-i]][j];
// int n = m_pSAEncodeImg->m_iJointPosition[file[displaynum-1-i]][j+1];
// resultImage.setPixel(m,n,color.rgb());
// }
//}
//*/
if(bkg)
renderarea->setCurrentCanvas(resultImage);
}