22 #include <unordered_set> 29 #include <tulip/tulipconf.h> 30 #include <tulip/Edge.h> 31 #include <tulip/Observable.h> 32 #include <tulip/Plugin.h> 43 static const std::string VIEW_CATEGORY =
"Panel";
47 class ViewToolTipAndUrlManager;
98 QList<tlp::Interactor *> _interactors;
101 tlp::ViewToolTipAndUrlManager *_tturlManager;
102 bool interactorsActivated;
104 QSet<tlp::Observable *> _triggers;
105 bool _displayContextMenu;
124 return VIEW_CATEGORY;
126 std::string
icon()
const override {
127 return ":/tulip/gui/icons/32/plugin_view.png";
134 virtual QGraphicsView *graphicsView()
const = 0;
138 virtual void resetGraphicsScene() {}
162 return interactorsActivated;
172 virtual QList<QWidget *> configurationWidgets()
const;
182 virtual QString configurationWidgetsStyleSheet()
const;
201 QSet<tlp::Observable *> triggers()
const;
207 void treatEvents(
const std::vector<Event> &events)
override;
215 virtual QGraphicsItem *centralItem()
const;
223 virtual QPixmap snapshot(
const QSize &outputSize = QSize())
const = 0;
229 void showContextMenu(
const QPoint &point,
const QPointF &scenePoint);
236 _displayContextMenu = show;
245 virtual void undoCallback();
253 virtual void applySettings();
264 virtual void centerView(
bool graphChanged =
false);
270 virtual void setInteractors(
const QList<tlp::Interactor *> &);
302 virtual void draw() = 0;
318 virtual void setupUi() = 0;
326 void treatEvent(
const Event &)
override;
355 void clearRedrawTriggers();
360 void emitDrawNeededSignal();
397 void interactorsChanged();
404 virtual void interactorsInstalled(
const QList<tlp::Interactor *> &interactors);
420 void toggleInteractors(
const bool activate,
const std::unordered_set<const char *> &exceptions);
434 virtual void graphDeleted(
tlp::Graph *parentGraph) = 0;
442 virtual void fillContextMenu(QMenu *,
const QPointF &);
447 void fillContextMenu(QMenu *menu,
node n);
452 void fillContextMenu(QMenu *menu,
edge e);
459 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.