ReconstructMe SDK  1.1.739-75658
Real-time 3D reconstruction engine
 All Classes Files Functions Typedefs Enumerations Enumerator Groups Pages
example_reconstructmesdk_options_type_safe.cpp

Content

This example shows how to modify options of ReMe objects using a type safe approach

Boost is only used to generate examples and is not necessary for working with this SDK.

#include <boost/test/unit_test.hpp>
// Generated class by Google protocol buffer compiler.
#include <reconstructmesdk/private/surface_generation_options.h>
#include <iostream>
BOOST_AUTO_TEST_SUITE(example_reconstructmesdk)
BOOST_AUTO_TEST_CASE(options_type_safe)
{
// Create a new context that has default options applied
// Create empty options binding
// Bind Poisson options
// We've used the protocol buffer specification file (see documentation of reme_surface_bind_poisson_options)
// and the Google protocol buffer C++ compiler to generate a getter/setter class out of it.
poisson_options po;
po.set_depth(9);
// In order to supply it to ReconstructMe SDK we use the built-in serialization mechanism.
std::string msg;
po.SerializeToString(&msg);
reme_options_set_bytes(c, o, msg.c_str(), msg.size());
// We can also read the current settings in a similar fashion
const void *m;
int length;
reme_options_get_bytes(c, o, &m, &length);
po.ParseFromArray(m, length);
std::cout << po.DebugString() << std::endl;
// Make sure to release all memory acquired
}
BOOST_AUTO_TEST_SUITE_END()