ReconstructMe SDK  1.0.726-75385
Real-time 3D reconstruction engine
 All Classes Files Functions Typedefs Enumerations Enumerator Groups
example_reconstructmesdk_options_lazy.cpp

Content

This example shows how to modify options of ReMe objects using the reflection like API.

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

#include <boost/test/unit_test.hpp>
#include <stdio.h>
BOOST_AUTO_TEST_SUITE(example_reconstructmesdk)
BOOST_AUTO_TEST_CASE(options_lazy)
{
// Create a new context that has default options applied
// Create empty options binding
// Bind Poisson options
// Modify the 'depth' field through a reflection like syntax.
reme_options_set(c, o, "depth", "9");
// Make sure to release all memory acquired
}
BOOST_AUTO_TEST_CASE(options_lazy_repeated)
{
// Create a new context that has default options applied
// Create empty options binding
reme_options_t o, o_sub;
reme_options_create(c, &o_sub);
// Bind to OpenCL infos
// See method documentation for protocol buffer specification
// See how many devices are available
int num_devices = 0;
reme_options_get_repeated_count(c, o, "devices", &num_devices);
printf("Found %i OpenCL compatible devices\n", num_devices);
// Each device is a nested message. Iterate over all of them
const char *value;
int length;
for (int i = 0; i < num_devices; i += 1) {
printf("----\n");
reme_options_bind_repeated_message(c, o, "devices", i, o_sub);
reme_options_get(c, o_sub, "name", &value, &length);
printf("Device '%s' \n", value);
reme_options_get(c, o_sub, "vendor", &value, &length);
printf(" - by '%s' \n", value);
reme_options_get(c, o_sub, "type", &value, &length);
printf(" - type %s \n", value);
// Note in the above code we must interleave get and printf
// because of memory management rules.
}
// Make sure to release all memory acquired
}
BOOST_AUTO_TEST_SUITE_END()