20 #ifndef Tulip_GLMAINVIEW_H
21 #define Tulip_GLMAINVIEW_H
23 #include <tulip/ViewWidget.h>
24 #include <tulip/GlMainWidget.h>
26 class QGraphicsProxyWidget;
32 class GlOverviewGraphicsItem;
33 class SceneConfigWidget;
34 class SceneLayersConfigWidget;
36 class ViewActionsManager;
73 tlp::GlOverviewGraphicsItem *_overviewItem;
74 tlp::ViewActionsManager *_viewActionsManager;
76 QPushButton *_showOvButton, *_showQabButton;
79 bool needQuickAccessBar, _needTooltipAndUrlManager;
80 QGraphicsProxyWidget *_quickAccessBarItem;
81 tlp::QuickAccessBar *_quickAccessBar;
82 tlp::SceneConfigWidget *_sceneConfigurationWidget;
83 tlp::SceneLayersConfigWidget *_sceneLayersConfigurationWidget;
86 enum OverviewPosition {
93 GlMainView(
bool needTooltipAndUrlManager =
false);
97 bool overviewVisible()
const;
98 bool quickAccessBarVisible()
const;
99 QPixmap
snapshot(
const QSize &outputSize = QSize())
const override;
101 void setOverviewPosition(
const OverviewPosition &position);
102 OverviewPosition overviewPosition()
const;
104 void setUpdateOverview(
bool updateOverview);
105 bool updateOverview()
const;
148 inline void zoomXY(
int step,
const int x,
const int y) {
225 void undoCallback()
override;
229 bool getNodeOrEdgeAtViewportPos(
int x,
int y,
node &n,
edge &e)
const override {
230 return getNodeOrEdgeAtViewportPos(_glMainWidget, x, y, n, e);
239 virtual void glMainViewDrawn(
bool graphChanged);
240 virtual void sceneRectChanged(
const QRectF &);
241 void fillContextMenu(QMenu *menu,
const QPointF &)
override;
245 void assignNewGlMainWidget(
GlMainWidget *glMainWidget,
bool deleteOldGlMainWidget =
true);
246 bool eventFilter(QObject *obj, QEvent *event)
override;
248 tlp::GlOverviewGraphicsItem *overviewItem()
const;
249 void updateShowOverviewButton();
250 void updateShowQuickAccessBarButton();
251 virtual QuickAccessBar *getQuickAccessBarImpl();
253 OverviewPosition _overviewPosition;
255 bool _updateOverview;
Coord viewportTo3DWorld(const Coord &point) const
Return the 3D world coordinate for the given viewport point.
Coord worldTo2DViewport(const Coord &obj) const
Return the viewport position for the given 3D coordinate.
A container that can store data from any type.
An abstract view that displays a GlMainWidget as its central widget.
tlp::DataSet state() const override
Backup the state of the view. This method is used to restore the View's parameters when it's re-opene...
void setupWidget() override
Sets up the central widget. This is similar to View::setupUi in the sense that the purpose of setupWi...
void refresh() override
Calls GlMainWidget::redraw();.
QPixmap snapshot(const QSize &outputSize=QSize()) const override
Takes a snapshot of the view's screen and saves it into the given pixmap. The snapshot is scaled to o...
void setOverviewVisible(bool)
Toggles the overview on or off.
Coord viewToWorld(const Coord &vpos) const
Return the 3D world position for the given view position.
void setQuickAccessBarVisible(bool)
allows to control the quick access bar visibility
void redraw()
Calls GlMainWidget::redraw();.
virtual void drawOverview(bool generatePixmap=true)
Force the overview to be redrawn. Since GlMainView already detects graph's modifications,...
void setViewOrtho(bool)
Toggles the orthogonal projection on or off, then draws.
void zoomFactor(float factor)
Zoom by factor.
void rotateCamera(int x, int y, int z)
Rotate the view camera by (x,y,z)
Coord worldToView(const Coord &wpos) const
Return the view position for the given 3D position.
void zoomXY(int step, const int x, const int y)
Zoom by step to the given (x,y) view position.
std::list< QWidget * > configurationWidgets() const override
void draw() override
Calls GlMainWidget::draw();.
void centerView(bool graphChanged=false) override
Centers the scene's camera.
void zoom(int step)
Zoom by step.
void zoomAndPanAnimation(const tlp::BoundingBox &boundingBox, const double duration=1000.)
Do a zoom and pan animation.
void translateCamera(int x, int y, int z)
Translate the view camera by (x,y,z)
QImage getRGBImage() const
Return the glMainWidget current display in the RGB888 format.
void applySettings() override
Force the settings set in the configuration widgets to be re-applied.
void setState(const tlp::DataSet &) override
Restores the state of the view. DataSet passed down to this method can come from a previous backup or...
This widget provide a simple system to visualize data/graph with OpenGL 3D engine.
tlp::GlScene * getScene()
Get the GlScene of this GlMainWidget You have to add yours GlLayer and GlEntity to this GlScene At th...
void zoomFactor(float factor)
Zoom by factor.
Camera & getGraphCamera()
By default the most important layer is the layer where the graph is visualized This function return t...
void zoomXY(int step, const int x, const int y)
Zoom by step to given x,y screen coordinates.
void rotateCamera(const int x, const int y, const int z)
Rotate camera by (x,y,z)
void zoom(float factor, const Coord &dest)
Zoom to given world coordinate.
void translateCamera(const int x, const int y, const int z)
Translate camera by (x,y,z)
This class represents the 3D bounding box of an object. It is mostly used to determine whether or not...
The edge struct represents an edge in a Graph object.
The node struct represents a node in a Graph object.