OpenSubdiv icon indicating copy to clipboard operation
OpenSubdiv copied to clipboard

What is the cause of the "no specialization" error TopologyRefinerFactory<>::resizeComponentTopology() ?

Open nyue opened this issue 9 years ago • 3 comments
trafficstars

static void createOsdMesh(ShapeDesc const & shapeDesc, int level) {

Shape * shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme);

CODE

// create Far mesh (topology)
OpenSubdiv::Sdc::SchemeType sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);

printf("Hello 001\n");
OpenSubdiv::Far::TopologyRefiner *topologyRefiner =
    OpenSubdiv::Far::TopologyRefinerFactory<Shape>::Create(*shape,
        OpenSubdiv::Far::TopologyRefinerFactory<Shape>::Options(sdctype, sdcoptions));
printf("Hello 002\n");

OUTPUT

[100%] Built target standaloneCPUEvalLimit Number of shapes = 1 Hello 001 Error: Failure in TopologyRefinerFactory<>::resizeComponentTopology() -- no specialization provided. Hello 002 Segmentation fault: 11

nyue avatar Jan 03 '16 23:01 nyue

Hi,

Since you are specializing Far::TopologyRefinerFactory for your own MESH class <Shape> you must provide specializations for a few protected methods so that TopologyRefinerFactory can correctly access Shape data. See the section of far/topologyRefinerFactory.h labeled "Methods to be provided to complete assembly of the TopologyRefiner" or the example code in tutorial_1/far_tutorial_1.cpp (lines 226-379).

Ideally, this requirement would be expressed as a compile-time static assertion, but the current implementation instead raises a runtime error when the fallback implementation of one of these methods is executed.

Thanks! -David

davidgyu avatar Jan 04 '16 17:01 davidgyu

I'm going to switch labels on this from "wontfix" to "documentation".

davidgyu avatar Sep 30 '16 18:09 davidgyu

Filed as internal issue #151666.

jtran56 avatar Sep 30 '17 01:09 jtran56