Tulip  6.0.0
Large graphs analysis and drawing
InteractorViewExplorer.h
1 /**
2  *
3  * This file is part of Tulip (https://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 
20 #ifndef INTERACTOREXPLORER_H
21 #define INTERACTOREXPLORER_H
22 
23 #include <vector>
24 
25 #include <tulip/Interactor.h>
26 #include <tulip/MouseInteractors.h>
27 #include <tulip/MouseShowElementInfo.h>
28 #include <tulip/NodeLinkDiagramComponentInteractor.h>
29 #include <tulip/NodeLinkDiagramComponent.h>
30 #include <tulip/StandardInteractorPriority.h>
31 #include <tulip/StringsListSelectionWidget.h>
32 
33 namespace tlp {
34 
35 /** @class Tulip interactor to navigate
36  * and edit graph elements information
37  *
38  */
39 class TLP_QT_SCOPE InteractorViewExplorer : public NodeLinkDiagramComponentInteractor {
40 
41  class ConfigWidget : public QWidget {
42  InteractorViewExplorer *_interactor;
43 
44  public:
45  ConfigWidget(InteractorViewExplorer *interactor) : _interactor(interactor) {}
46 
47  void hideEvent(QHideEvent *) override {
48  _interactor->setVisibleProperties();
49  }
50  };
51 
52  ConfigWidget *_configWidget;
53  StringsListSelectionWidget *_propsList;
54  QString _configText;
55  InteractorComponent *_firstInteractor;
56  MouseShowElementInfo *_elementInfo;
57 
58 public:
59  PLUGININFORMATION("InteractorViewExplorer", "Tulip Team", "01/12/2024", "Explore current view",
60  "1.0", "Information")
61  /**
62  * Default constructor
63  */
64  InteractorViewExplorer(QString configText = QString(), InteractorComponent *interactor = nullptr,
65  MouseShowElementInfo *elementInfo = new MouseShowElementInfo)
66  : NodeLinkDiagramComponentInteractor(":/tulip/gui/icons/i_explore.png",
67  "Explore current view",
68  StandardInteractorPriority::Navigation),
69  _configText(configText), _firstInteractor(interactor), _elementInfo(elementInfo) {}
70 
71  /**
72  * Construct chain of responsibility
73  */
74  void construct() override;
75 
76  QWidget *configurationOptionsWidget() const override {
77  return _configWidget;
78  }
79 
80  void setVisibleProperties();
81 };
82 } // namespace tlp
83 #endif // INTERACTOREXPLORER_H
#define PLUGININFORMATION(NAME, AUTHOR, DATE, INFO, RELEASE, GROUP)
Declare meta-information for a plugin This is an helper macro that defines every function related to ...
Definition: Plugin.h:234