3#include <SimoxUtility/algorithm/string.h>
17 "The RGB image(s) entity ID. Provider segment name can be set via 'img.ProviderName'.");
19 simox::alg::join(simox::alg::multi_to_string(
rgbIndices)),
20 "Indices of RGB images in provided images");
24 "The depth image(s) entity ID. Provider segment name can be "
25 "set via 'img.ProviderName'.");
27 simox::alg::join(simox::alg::multi_to_string(
depthIndices)),
28 "Indices of Depth images in provided images.");
33 const std::string& defaultProviderSegmentName)
45 const std::string& propertyName,
46 const std::string& defaultProviderSegmentName)
49 if (!
id.hasProviderSegmentName())
51 id.providerSegmentName = defaultProviderSegmentName;
59 std::string prop = properties.
getProperty<std::string>(propertyName);
60 std::vector<size_t> indices;
66 std::vector<std::string> indicesStr = simox::alg::split(prop,
",",
true,
true);
67 std::transform(indicesStr.begin(),
69 std::back_inserter(indices),
70 [](
const std::string& s)
72 long l = std::stol(s);
73 ARMARX_CHECK_NONNEGATIVE(l) <<
"Image indices must be non-negative.";
74 return static_cast<size_t>(l);
PropertyDefinitionContainer.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
Abstract PropertyUser class.
Property< PropertyType > getProperty(const std::string &name)
Property creation and retrieval.
armarx::armem::MemoryID depthEntityID
std::vector< size_t > rgbIndices
static armarx::armem::MemoryID getEntityID(armarx::PropertyUser &properties, const std::string &propertyName, const std::string &defaultProviderSegmentName)
static std::vector< size_t > getIndices(armarx::PropertyUser &properties, const std::string &propertyName)
void define(armarx::PropertyDefinitionContainer &defs)
void read(armarx::PropertyUser &properties, const std::string &defaultProviderSegmentName)
std::vector< size_t > depthIndices
armarx::armem::MemoryID rgbEntityID