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.

ovvizIVisualizationManager.h 3.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #pragma once
  2. #include "ovvizIVisualizationTree.h"
  3. #include <openvibe/ov_all.h>
  4. typedef struct _GtkWidget GtkWidget;
  5. namespace OpenViBE {
  6. namespace VisualizationToolkit {
  7. /**
  8. * \class IVisualizationManager
  9. * \author Vincent Delannoy (INRIA/IRISA)
  10. * \date 2007-11
  11. * \brief The VisualizationManager handles IVisualizationTree objects
  12. * It maintains a list of IVisualizationTree objects, each of which is associated to a scenario. This
  13. * manager is used both at scenario creation time (to load or create IVisualizationTree objects), and when the
  14. * scenario is being run (to forward IVisualizationWidget pointers to the related IVisualizationTree).
  15. */
  16. class IVisualizationManager
  17. {
  18. public:
  19. virtual ~IVisualizationManager() = default;
  20. /**
  21. * \brief An interface used to iteratively notify its creator of the existence of IVisualizationTree objects
  22. */
  23. class IVisualizationTreeEnum
  24. {
  25. public:
  26. virtual ~IVisualizationTreeEnum() = default;
  27. /**
  28. * \brief Callback method called iteratively as the IVisualizationManager goes through a set of IVisualizationTree objects
  29. * \param visualizationTreeIdentifier identifier of an IVisualizationTree object
  30. * \param visualizationTree corresponding IVisualizationTree object
  31. * \return True if IVisualizationTree object was successfully registered, false otherwise
  32. */
  33. virtual bool callback(const CIdentifier& visualizationTreeIdentifier, const IVisualizationTree& visualizationTree) = 0;
  34. };
  35. /**
  36. * \brief Creates an IVisualizationTree object.
  37. * \param visualizationTreeIdentifier [out] identifier of the IVisualizationTree object created by this method
  38. * \return True if object was successfully created, false otherwise
  39. */
  40. virtual bool createVisualizationTree(CIdentifier& visualizationTreeIdentifier) = 0;
  41. /**
  42. * \brief Releases an IVisualizationTree object.
  43. * \param visualizationTreeIdentifier identifier of the IVisualizationTree object to be released
  44. * \return True if object was successfully released, false otherwise
  45. */
  46. virtual bool releaseVisualizationTree(const CIdentifier& visualizationTreeIdentifier) = 0;
  47. /**
  48. * \brief Looks for an IVisualizationTree object.
  49. * \param visualizationTreeIdentifier identifier of the IVisualizationTree object to be returned
  50. * \return Reference on IVisualizationTree looked for, OV_Undefined otherwise
  51. */
  52. virtual IVisualizationTree& getVisualizationTree(const CIdentifier& visualizationTreeIdentifier) = 0;
  53. /**
  54. * \brief Set the toolbar of a visualization plugin.
  55. * This method is to be called by visualization plugins as they are being initialized. It lets them send
  56. * a pointer to their toolbar (if they have one) to the scenario's IVisualizationTree.
  57. * \param visualizationTreeIdentifier identifier of IVisualizationTree to which the toolbar pointer is to be forwarded
  58. * \param boxID Identifier of IBox whose toolbar pointer is being set
  59. * \param toolbar pointer to the toolbar of the widget
  60. * \return True if pointer was successfully forwarded to IVisualizationTree, false otherwise
  61. */
  62. virtual bool setToolbar(const CIdentifier& visualizationTreeIdentifier, const CIdentifier& boxID, GtkWidget* toolbar) = 0;
  63. /**
  64. * \brief Set the topmost widget of a visualization plugin.
  65. * This method is to be called by visualization plugins as they are being initialized. It lets them send
  66. * a pointer to their topmost widget to the scenario's IVisualizationTree.
  67. * \param visualizationTreeIdentifier identifier of IVisualizationTree to which the toolbar pointer is to be forwarded
  68. * \param boxID Identifier of IBox whose topmost widget pointer is being set
  69. * \param widget pointer to the main window of the widget
  70. * \return True if pointer was successfully forwarded to IVisualizationTree, false otherwise
  71. */
  72. virtual bool setWidget(const CIdentifier& visualizationTreeIdentifier, const CIdentifier& boxID, GtkWidget* widget) = 0;
  73. };
  74. } // namespace VisualizationToolkit
  75. } // namespace OpenViBE