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;
139 virtual void resetGraphicsScene() {}
144 virtual bool rebuildSceneOnShowEvent() {
170 return interactorsActivated;
180 virtual QList<QWidget *> configurationWidgets()
const;
190 virtual QString configurationWidgetsStyleSheet()
const;
209 QSet<tlp::Observable *> triggers()
const;
215 void treatEvents(
const std::vector<Event> &events)
override;
223 virtual QGraphicsItem *centralItem()
const;
231 virtual QPixmap snapshot(
const QSize &outputSize = QSize())
const = 0;
237 void showContextMenu(
const QPoint &point,
const QPointF &scenePoint);
244 _displayContextMenu = show;
253 virtual void undoCallback();
261 virtual void applySettings();
272 virtual void centerView(
bool graphChanged =
false);
278 virtual void setInteractors(
const QList<tlp::Interactor *> &);
310 virtual void draw() = 0;
326 virtual void setupUi() = 0;
334 void treatEvent(
const Event &)
override;
363 void clearRedrawTriggers();
368 void emitDrawNeededSignal();
405 void interactorsChanged();
412 virtual void interactorsInstalled(
const QList<tlp::Interactor *> &interactors);
428 void toggleInteractors(
const bool activate,
const std::unordered_set<const char *> &exceptions);
442 virtual void graphDeleted(
tlp::Graph *parentGraph) = 0;
450 virtual void fillContextMenu(QMenu *,
const QPointF &);
455 void fillContextMenu(QMenu *menu,
node n);
460 void fillContextMenu(QMenu *menu,
edge e);
467 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.