45 BOOST_FOREACH(boost::property_tree::ptree::value_type &v, pPt.get_child(
"mapping"))
48 if(!std::strcmp(v.first.c_str(),
"map"))
51 unsigned int value = v.second.get<
unsigned int>(
"<xmlattr>.id");
52 std::string key = v.second.get<std::string>(
"<xmlattr>.name");
56 throw std::invalid_argument(
"Unable to procees loading. Scene object model: no mapping to type 0 allowed, it is reserved for unknown objects");
60 throw std::invalid_argument(
"Unable to procees loading. Scene object model: No name for object mapping specified.");
74 boost::property_tree::ptree subtreeMapping;
79 boost::property_tree::ptree subtreeMap;
81 subtreeMap.add(
"<xmlattr>.id", it->second);
82 subtreeMap.add(
"<xmlattr>.name", it->first);
84 subtreeMapping.add_child(
"map", subtreeMap);
88 pPt.add_child(
"mapping", subtreeMapping);
107 result =
mTable->getProbability(pRow, 0);
134 mTable->add(pRow, 0, pCount);
144 unsigned int index = 0;
157 return mTable->getNumberOfColumns();
162 return mTable->getNumberOfRows();
void initializeTable(unsigned int pRows)
boost::shared_ptr< ProbabilityTable > mTable
std::map< std::string, unsigned int > mMappingTypeToIndice
unsigned int getNumberOfColumns()
void add(std::string pType)
~MappedProbabilityTable()
void setDefaultClassCounter(unsigned int pRow, double pCount)
unsigned int getIndex(std::string pType)
double getProbability(unsigned int pRow, std::string pType)
void load(boost::property_tree::ptree &pPt)
void save(boost::property_tree::ptree &pPt)
unsigned int getNumberOfRows()