You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ovvizCVisualizationContext.cpp 1.6KB

123456789101112131415161718192021222324252627282930313233
  1. #include "ovvizCVisualizationContext.hpp"
  2. namespace OpenViBE {
  3. namespace VisualizationToolkit {
  4. bool CVisualizationContext::setWidget(Toolkit::TBoxAlgorithm<Plugins::IBoxAlgorithm>& box, GtkWidget* widget)
  5. {
  6. const CIdentifier boxID = box.getStaticBoxContext().getIdentifier();
  7. CIdentifier treeIdentifier = CIdentifier::undefined();
  8. // When a scenario is created in the designer, the designer creates a visualization tree for it. The box will then need to add
  9. // visualization widgets into this tree. The designer can not pass this information directly to a box in a way that can be read
  10. // here (for example an Attribute could be written in the designer but then it is not possible to read it here).
  11. //
  12. // What we do is that we write the visualization tree identifier into the local scenario configuration manager. This manager
  13. // can be accessed as long as we have the boxAlgorithm.
  14. if (!treeIdentifier.fromString(box.getConfigurationManager().lookUpConfigurationTokenValue("VisualizationContext_VisualizationTreeId"))) { return false; }
  15. return m_VisualizationManager->setWidget(treeIdentifier, boxID, widget);
  16. }
  17. bool CVisualizationContext::setToolbar(Toolkit::TBoxAlgorithm<Plugins::IBoxAlgorithm>& box, GtkWidget* toolbarWidget)
  18. {
  19. const CIdentifier boxID = box.getStaticBoxContext().getIdentifier();
  20. CIdentifier treeIdentifier = CIdentifier::undefined();
  21. if (!treeIdentifier.fromString(box.getConfigurationManager().lookUpConfigurationTokenValue("VisualizationContext_VisualizationTreeId"))) { return false; }
  22. return m_VisualizationManager->setToolbar(treeIdentifier, boxID, toolbarWidget);
  23. }
  24. } // namespace VisualizationToolkit
  25. } // namespace OpenViBE