首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >OpenMesh: remove_property :不是Decimater::DecimaterT<MeshT>的成员

OpenMesh: remove_property :不是Decimater::DecimaterT<MeshT>的成员
EN

Stack Overflow用户
提问于 2014-04-27 04:06:05
回答 1查看 252关注 0票数 1

我试图在OpenMesh中使用小数算法。我遵循了这个链接中提供的基本设置:docu.html,但是我得到了来自modquadrict.hh(part of the library)的以下错误。

代码语言:javascript
运行
复制
error C2039: 'remove_property' : is not a member of 'OpenMesh::Decimater::DecimaterT<MeshT>'

main.cpp

代码语言:javascript
运行
复制
#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

代码语言:javascript
运行
复制
#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;
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-04-29 17:20:15

问题就在这条线上。

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

应该是这样的:

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

在编写3.0版本时,我参考了2.0版的文档

在最近的版本中,模板依赖于网格而不是抽取器。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23319276

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档