Question

I'm trying to use the decimater algorithm in OpenMesh. I followed the basic setup presented in this link: http://openmesh.org/Documentation/OpenMesh-2.0-Documentation/decimater_docu.html but I get the following error which is comes from the modquadrict.hh(part of the library).

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

main.cpp

#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;
Was it helpful?

Solution

The problem was with this line.

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

it should be like this:

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

I was referring the documentation from version 2.0 while working on version 3.0

With recent versions, the templating depend on the mesh and not the decimater.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top