1

我正在尝试在OpenMesh. 我遵循了此链接中提供的基本设置:http: //openmesh.org/Documentation/OpenMesh-2.0-Documentation/decimater_docu.html但我收到以下错误,它来自modquadrict.hh(part of the library).

error C2039: 'remove_property' : is not a member of 'OpenMesh::Decimater::DecimaterT<MeshT>'

主文件

#include "MyMesh.h"
#include <conio.h>
#include <iostream>


int main()
{
    MyMesh mesh;

    decimater deci (mesh);

    HModQuadric hModQuad;

    if(!OpenMesh::IO::read_mesh(mesh, "models/monkey.obj"));
    {
        std::cout<<"Cannot read mesh";
    }

    deci.add(hModQuad);

    std::cout << deci.module( hM).name() << std::endl;
    getch();
    return 0;
}

MyMesh.h

#pragma once

// OpenMesh
#pragma warning(push)
#pragma warning(disable: 4267)
#include <OpenMesh/Core/IO/MeshIO.hh>
#include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
#include <OpenMesh/Tools/Decimater/ModQuadricT.hh>
#include <OpenMesh/Tools/Decimater/DecimaterT.hh>
#pragma warning(pop)

//Additional mesh parameters
struct MeshTraits : public OpenMesh::DefaultTraits
{
    VertexAttributes(OpenMesh::Attributes::Normal);
    FaceAttributes(OpenMesh::Attributes::Normal);
};

typedef OpenMesh::TriMesh_ArrayKernelT<MeshTraits>  MyMesh;

// Decimater type
typedef OpenMesh::Decimater::DecimaterT< MyMesh >               decimater;

// Decimation Module Handle type
typedef OpenMesh::Decimater::ModQuadricT< decimater >::Handle HModQuadric;
4

1 回答 1

3

问题出在这条线上。

typedef OpenMesh::Decimater::ModQuadricT< decimater >::Handle HModQuadric;

它应该是这样的:

typedef OpenMesh::Decimater::ModQuadricT< MyMesh >::Handle HModQuadric;

我在使用 3.0 版时参考了 2.0 版的文档

对于最近的版本,模板取决于网格而不是抽取器。

于 2014-04-29T17:20:15.433 回答