当前位置: 首页>>代码示例>>C++>>正文


C++ BodyPart::meshFocused方法代码示例

本文整理汇总了C++中BodyPart::meshFocused方法的典型用法代码示例。如果您正苦于以下问题:C++ BodyPart::meshFocused方法的具体用法?C++ BodyPart::meshFocused怎么用?C++ BodyPart::meshFocused使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BodyPart的用法示例。


在下文中一共展示了BodyPart::meshFocused方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: scoreGPU

std::vector<float> PosEst::weightGPU(MatrixXf boundBox, float gridSize)
{
    int numSceneP, numModelF;
    numSceneP = scene->numPC();
    if(DEBUG_ALGORITHM) cout<<"# of all faces: "<<model->numFace()<<endl;
    if(DEBUG_ALGORITHM) cout<<"# of all filtered faces: "<<model->numFilteredFace()<<endl;
    numModelF = model->numFilteredFace();

    float3 maxBound, minBound;
    maxBound.x = boundBox(0,0);
    minBound.x = boundBox(0,1);
    maxBound.y = boundBox(1,0);
    minBound.y = boundBox(1,1);
    maxBound.z = boundBox(2,0);
    minBound.z = boundBox(2,1);

    ParticleScoreGPU scoreGPU(numParticles, numSceneP, numModelF, gridSize);
    *scoreGPU.minBound = minBound;
    *scoreGPU.maxBound = maxBound;

    // copy data
    if(DEBUG_ALGORITHM) cout<<"copy scene data: "<<numSceneP<<endl;
    for(int i=0;i<numSceneP;i++){
        scoreGPU.scenePos[i].x = scene->getPCFocus_back()->points.at(i).x;
        scoreGPU.scenePos[i].y = scene->getPCFocus_back()->points.at(i).y;
        scoreGPU.scenePos[i].z = scene->getPCFocus_back()->points.at(i).z;

        //        scoreGPU.sceneNorm[i].x = scene->getPCNorm()->points.at(i).x;
        //        scoreGPU.sceneNorm[i].y = scene->getPCNorm()->points.at(i).y;
        //        scoreGPU.sceneNorm[i].z = scene->getPCNorm()->points.at(i).z;
    }

    int nFace = 0;
    int nVert = 0;
    if(DEBUG_ALGORITHM) cout<<"copy model data"<<endl;
    for(int n=0;n<model->filteredParts.size();n++){
        BodyPart *part = model->bodyPart(model->filteredParts.at(n));
        Mesh* mesh = part->meshFocused();
        for(int i=0;i<mesh->numMesh();i++){
            for(int j=0;j<mesh->numFilteredFaces(i);j++){
                int faceId = mesh->filteredFaceId(i,j);
                //                Vector3f faceNorm = mesh->faceNorm(i,faceId);
                for(int k=0;k<3;k++){
                    scoreGPU.modelVertPos[nVert].x = mesh->vertex(i,mesh->face(i,faceId)->mIndices[k])->m_pos[0];
                    scoreGPU.modelVertPos[nVert].y = mesh->vertex(i,mesh->face(i,faceId)->mIndices[k])->m_pos[1];
                    scoreGPU.modelVertPos[nVert].z = mesh->vertex(i,mesh->face(i,faceId)->mIndices[k])->m_pos[2];
                    if(USENORM){
                        scoreGPU.modelVertNorm[nVert].x = mesh->vertex(i,mesh->face(i,faceId)->mIndices[k])->m_normal[0];
                        scoreGPU.modelVertNorm[nVert].y = mesh->vertex(i,mesh->face(i,faceId)->mIndices[k])->m_normal[1];
                        scoreGPU.modelVertNorm[nVert].z = mesh->vertex(i,mesh->face(i,faceId)->mIndices[k])->m_normal[2];
                    }
                    nVert ++;
                }
                //                scoreGPU.modelFaceNorm[nFace].x = faceNorm[0];
                //                scoreGPU.modelFaceNorm[nFace].y = faceNorm[1];
                //                scoreGPU.modelFaceNorm[nFace].z = faceNorm[2];
                nFace ++;
            }
        }
    }

    for(int i=0;i<numParticles;i++){
        scoreGPU.particlePos[i].x = particles[i].x;
        scoreGPU.particlePos[i].y = particles[i].y;
        scoreGPU.particlePos[i].z = particles[i].z;
        scoreGPU.particleRPY[i].x = particles[i].roll;
        scoreGPU.particleRPY[i].y = particles[i].pitch;
        scoreGPU.particleRPY[i].z = particles[i].yaw;
    }

    float3 *crspdFacesPos = (float3 *)malloc(numSceneP * sizeof(float3));
    if(DEBUG_ALGORITHM) cout<<"particle filtering"<<endl;
    std::vector<float> out = scoreGPU.compute(crspdFacesPos);

    //    out_crspdFacesPos.resize(numSceneP);
    //    for (size_t i=0; i<numSceneP; i++){
    //        out_crspdFacesPos[i] = crspdFacesPos[i];
    //    }

    free(crspdFacesPos);

    //    crspdFacesPos = scoreGPU.compute();
    return (out);
}
开发者ID:AIS-Bonn,项目名称:vismotcoord,代码行数:84,代码来源:posest.cpp


注:本文中的BodyPart::meshFocused方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。