Error when I try to load a .obj file load_surface_osg not implemented

Digitize Your World Forums SDK Development Error when I try to load a .obj file load_surface_osg not implemented

This topic contains 1 reply, has 1 voice, and was last updated by  Alessio 3 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13264

    Alessio

    I wrote a Windows Form Application that uses a file chooser dialog to open a .obj file with the SDK viewer. However, when I choose the file to create the surface, it doesn’t load, and the following output appears:

    Error: ..\..\source\lib_reconstructme\src\surface\io.cpp(133): Throw in function void __cdecl LibReconstructMe::load_surface_osg(const class boost::filesystem::path &,class OpenMesh::TriMesh_ArrayKernelT<struct OpenMesh::DefaultTraits> &)
    Dynamic exception type: class boost::exception_detail::clone_impl<class LibFundament::robvis_error>
    std::exception::what: load_surface_osg not implemented
    [struct LibFundament::tag_robvis_message *] = load_surface_osg not implemented

    This is the Click Event of the button:

    private: System::Void viewButton_Click(System::Object^  sender, System::EventArgs^  e) {
    				 std::string filename;
    				 if(openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK){
    					filename = marshal_as< std::string >(openFileDialog1->FileName);
    				 }
    				 ReconstructionView(filename);
    			 }
    	}

    and this is the function where I try to load the file:

    reme_error_t ReconstructionView(string fileName){
    	// Create a new context
    	reme_context_t context;
    	reme_context_create(&context);
    	reme_context_set_log_callback(context, reme_default_log_callback, 0);
    	// Create and set new options
    	reme_options_t option;
    	reme_options_create(context, &option);
    	// Bind the reconstruction options.
    	reme_context_bind_reconstruction_options(context, option);
    	// Increase resolution in all dimensions
    	reme_options_set_int(context, option, "device_id", 2);
    	// Compile for OpenCL device using the upper options
    	reme_context_compile(context);
    	// Create a new surface
    	reme_surface_t surface;
    	reme_surface_create(context, &surface);
    	// Load surface from file
    	if(!REME_SUCCESS(reme_surface_load_from_file(context, surface, fileName.c_str()))){ //error
    		cout << "Failed to load file.\n";
    		reme_surface_destroy(context, &surface);
    		// Make sure to release all memory acquired
    		reme_context_destroy(&context);
    		return REME_ERROR_UNSPECIFIED;
    	}
    	// Visualize resulting surface
    	reme_viewer_t viewer_surface;
    	reme_viewer_create_surface(context, surface, ("ReconstructMe SDK: " + fileName).c_str(), &viewer_surface);
    	reme_viewer_wait(context, viewer_surface);
    	reme_surface_destroy(context, &surface);
    	// Print pending errors
    	reme_context_print_errors(context);
    	// Make sure to release all memory acquired
    	reme_context_destroy(&context);
    	return REME_ERROR_SUCCESS;
    }

    .obj files are always named with the creation date, like “09-08-2014 15-49-38.obj”.

    Can anyone help me? :)

    #13285

    Alessio

    The .obj file format is not supported for loading. The only supported formats are ply, stl, stlb, stla, off. I tested the code with a .ply file and worked. Thanks to Christoph Heindl for the help.

    http://stackoverflow.com/questions/25695020/c-and-reconstructme-sdk-error-with-a-file-choosers-return-value

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.