27 #include <tulip/tulipconf.h> 28 #include <tulip/Observable.h> 29 #include <tulip/Plugin.h> 40 static const std::string VIEW_CATEGORY =
"Panel";
44 class ViewToolTipAndUrlManager;
95 QList<tlp::Interactor *> _interactors;
98 tlp::ViewToolTipAndUrlManager *_tturlManager;
99 bool interactorsActivated;
101 QSet<tlp::Observable *> _triggers;
102 bool _displayContextMenu;
121 return VIEW_CATEGORY;
123 std::string
icon()
const override {
124 return ":/tulip/gui/icons/32/plugin_view.png";
131 virtual QGraphicsView *graphicsView()
const = 0;
135 virtual void resetGraphicsScene() {}
159 return interactorsActivated;
169 virtual QList<QWidget *> configurationWidgets()
const;
179 virtual QString configurationWidgetsStyleSheet()
const;
198 QSet<tlp::Observable *> triggers()
const;
204 void treatEvents(
const std::vector<Event> &events)
override;
212 virtual QGraphicsItem *centralItem()
const;
220 virtual QPixmap snapshot(
const QSize &outputSize = QSize())
const = 0;
226 void showContextMenu(
const QPoint &point,
const QPointF &scenePoint);
233 _displayContextMenu = show;
242 virtual void undoCallback();
250 virtual void applySettings();
261 virtual void centerView(
bool graphChanged =
false);
267 virtual void setInteractors(
const QList<tlp::Interactor *> &);
299 virtual void draw() = 0;
315 virtual void setupUi() = 0;
323 void treatEvent(
const Event &)
override;
352 void clearRedrawTriggers();
357 void emitDrawNeededSignal();
394 void interactorsChanged();
401 virtual void interactorsInstalled(
const QList<tlp::Interactor *> &interactors);
417 void toggleInteractors(
const bool activate,
const std::unordered_set<const char *> &exceptions);
431 virtual void graphDeleted(
tlp::Graph *parentGraph) = 0;
439 virtual void fillContextMenu(QMenu *,
const QPointF &);
444 void fillContextMenu(QMenu *menu,
node n);
449 void fillContextMenu(QMenu *menu,
edge e);
456 void activateTooltipAndUrlManager(QWidget *);
void setShowContextMenu(bool show)
This method allows to control the display of the context menu.
Interactor provides a way to handle user inputs over a view. Basically, The interactor class is an ov...
A container that can store data from any type.
virtual void refresh()
Refresh the View's panel. Calling refresh() means that no internal data has been modified. This can happen when the view's panel gets resized, restored etc.
virtual bool interactorsEnabled() const
interactorsEnabled indicates if interactors are enabled or not
The edge struct represents an edge in a Graph object.
The node struct represents a node in a Graph object.
virtual bool checkOnClose()
allow to add some check when a user want to close a view.
virtual bool getNodeOrEdgeAtViewportPos(int, int, node &, edge &) const
indicate which node or edge is under the (x, y) position in graphicsView()->viewport() ...
Event is the base class for all events used in the Observation mechanism.
std::string category() const override
A string identifier for a plugin used for categorization purposes.
Top-level interface for plug-ins.
std::string icon() const override
The icon (preferably a thumbnail) of the plugin.
const QList< Interactor * > & interactors() const
View plugins provide a way to dynamically add to a Tulip plateform various ways to visualize a graph...
The Observable class is the base of Tulip's observation system.