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);
96 QList<QWidget *> configurationWidgets()
const override;
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;
122 bool pickNodeEdge(
const int x,
const int y,
tlp::node &n,
tlp::edge &e,
bool pickNode =
true,
123 bool pickEdge =
true);
163 inline void zoomXY(
int step,
const int x,
const int y) {
191 void zoomAndPanAnimation(
const tlp::BoundingBox &boundingBox,
const double duration = 1000.);
197 void draw()
override;
207 void refresh()
override;
213 virtual void drawOverview(
bool generatePixmap =
true);
218 void centerView(
bool graphChanged =
false)
override;
223 void setOverviewVisible(
bool);
228 void setQuickAccessBarVisible(
bool);
233 void setViewOrtho(
bool);
238 void applySettings()
override;
240 void undoCallback()
override;
244 bool getNodeOrEdgeAtViewportPos(
int x,
int y,
node &n,
edge &e)
const override {
245 return getNodeOrEdgeAtViewportPos(_glMainWidget, x, y, n, e);
251 QImage getRGBImage()
const;
254 virtual void glMainViewDrawn(
bool graphChanged);
255 virtual void sceneRectChanged(
const QRectF &);
256 void fillContextMenu(QMenu *menu,
const QPointF &)
override;
259 void setupWidget()
override;
260 void assignNewGlMainWidget(
GlMainWidget *glMainWidget,
bool deleteOldGlMainWidget =
true);
261 bool eventFilter(QObject *obj, QEvent *event)
override;
263 tlp::GlOverviewGraphicsItem *overviewItem()
const;
264 void updateShowOverviewButton();
265 void updateShowQuickAccessBarButton();
266 virtual QuickAccessBar *getQuickAccessBarImpl();
268 OverviewPosition _overviewPosition;
270 bool _updateOverview;
An abstract view that displays a GlMainWidget as its central widget.
Coord viewToWorld(const Coord &vpos) const
Return the 3D world position for the given view position.
tlp::GlScene * getScene()
Get the GlScene of this GlMainWidget You have to add yours GlLayer and GlEntity to this GlScene At th...
void rotateCamera(int x, int y, int z)
Rotate the view camera by (x,y,z)
void translateCamera(const int x, const int y, const int z)
Translate camera by (x,y,z)
void rotateCamera(const int x, const int y, const int z)
Rotate camera by (x,y,z)
A container that can store data from any type.
Camera & getGraphCamera()
By default the most important layer is the layer where the graph is visualized This function return t...
void zoom(int step)
Zoom by step.
The edge struct represents an edge in a Graph object.
The node struct represents a node in a Graph object.
Coord viewportTo3DWorld(const Coord &point) const
Return the 3D world coordinate for the given viewport point.
This class represents the 3D bounding box of an object. It is mostly used to determine whether or not...
void zoomXY(int step, const int x, const int y)
Zoom by step to given x,y screen coordinates.
void zoomXY(int step, const int x, const int y)
Zoom by step to the given (x,y) view position.
void zoomFactor(float factor)
Zoom by factor.
void translateCamera(int x, int y, int z)
Translate the view camera by (x,y,z)
Coord worldToView(const Coord &wpos) const
Return the view position for the given 3D position.
Coord worldTo2DViewport(const Coord &obj) const
Return the viewport position for the given 3D coordinate.
void zoom(float factor, const Coord &dest)
Zoom to given world coordinate.
void zoomFactor(float factor)
Zoom by factor.
This widget provide a simple system to visualize data/graph with OpenGL 3D engine.