ForegroundSceneContent.cpp
Go to the documentation of this file.
1 
19 
21 
23  : SceneContent()
24  {
26  }
27 
29  {
30  }
31 
32  void ForegroundSceneContent::load(boost::property_tree::ptree& pPt)
33  {
34  // load the inference algorithm.
36 
37  // Load all scenen objects which are part of this scene.
38  BOOST_FOREACH(boost::property_tree::ptree::value_type &v, pPt)
39  {
40  // Only access the 'object' child nodes.
41  if(!std::strcmp(v.first.c_str(), "object"))
42  {
43  // Create a new foreground scene instance.
45 
46  // Let it load its parameters ...
47  sceneObject->load(v.second);
48 
49  // ... and list it.
50  mSceneObjects->push_back(sceneObject);
51  }
52  }
53  }
54 
56  {
57  // Select the inference algorithm described by the parameter.
58  if(pAlgorithm.compare("powerset") == 0) {
60  } else if(pAlgorithm.compare("summarized") == 0) {
62  } else if(pAlgorithm.compare("multiplied") == 0) {
64  } else if(pAlgorithm.compare("maximum") == 0) {
66  } else {
67  throw std::invalid_argument("Unable to procees loading. The inference algorithm of type '" + pAlgorithm + "' is unknown to the scene of type 'foreground'.");
68  }
69  }
70 
72  {
73  // Iterate over all primary scene objects and initialize their visualizers.
74  for(unsigned int i = 0; i < mSceneObjects->size(); i++)
75  mSceneObjects->at(i)->initializeVisualizer(mSuperior);
76  }
77 
78  void ForegroundSceneContent::update(std::vector<ISM::Object> pEvidenceList, std::ofstream& pRuntimeLogger)
79  {
80  // Commandy the inference algorithm to execute the inference.
81  doInference(pEvidenceList, pRuntimeLogger);
82  }
83 
84 }
void doInference(std::vector< ISM::Object > pEvidenceList, std::ofstream &pRuntimeLogger)
void setInferenceAlgorithm(boost::shared_ptr< InferenceAlgorithm > pAlgorithm)
void initializeVisualizer(boost::shared_ptr< Visualization::ProbabilisticSceneVisualization > mSuperior)
void update(std::vector< ISM::Object > pEvidenceList, std::ofstream &pRuntimeLogger)
void loadInferenceAlgorithm(boost::property_tree::ptree &pPt)
boost::shared_ptr< std::vector< boost::shared_ptr< SceneObjectDescription > > > mSceneObjects


asr_psm
Author(s): Braun Kai, Gehrung Joachim, Heizmann Heinrich, Meißner Pascal
autogenerated on Fri Nov 15 2019 03:57:54