20 #ifndef Tulip_GLMAINWIDGET_H 21 #define Tulip_GLMAINWIDGET_H 23 #include <QOpenGLWidget> 25 #include <tulip/tulipconf.h> 26 #include <tulip/GlScene.h> 27 #include <tulip/Graph.h> 29 class QOpenGLFramebufferObject;
34 class GlCompositeHierarchyManager;
113 void pickNodesEdges(
const int x,
const int y,
const int width,
const int height,
114 std::vector<SelectedEntity> &selectedNodes,
115 std::vector<SelectedEntity> &selectedEdges,
tlp::GlLayer *layer =
nullptr,
116 bool pickNodes =
true,
bool pickEdges =
true);
126 bool pickNodesEdges(
const int x,
const int y,
SelectedEntity &selectedEntity,
127 tlp::GlLayer *layer =
nullptr,
bool pickNodes =
true,
bool pickEdges =
true);
135 return l * devicePixelRatio();
144 return l * devicePixelRatio();
153 qreal dpr = devicePixelRatio();
154 return Coord(point.x() * dpr, point.y() * dpr);
163 return l / devicePixelRatio();
172 qreal dpr = devicePixelRatio();
173 return Coord(point.x() / dpr, point.y() / dpr);
181 static void getTextureRealSize(
int width,
int height,
int &textureRealWidth,
182 int &textureRealHeight);
190 void createPicture(
const std::string &pictureName,
int width,
int height,
bool center =
true);
199 QImage createPicture(
int width,
int height,
bool center =
true,
200 QImage::Format format = QImage::Format_RGB32);
212 bool pickGlEntities(
const int x,
const int y,
const int width,
const int height,
213 std::vector<SelectedEntity> &pickedEntities,
tlp::GlLayer *layer =
nullptr);
222 bool pickGlEntities(
const int x,
const int y, std::vector<SelectedEntity> &pickedEntities,
235 void resizeGL(
int w,
int h)
override;
240 void computeInteractors();
245 void drawInteractors();
257 void render(RenderingOptions options = RenderingOptions(RenderScene | SwapBuffers),
258 bool checkVisibility =
true);
264 void setKeepScenePointOfViewOnSubgraphChanging(
bool);
269 bool keepScenePointOfViewOnSubgraphChanging()
const;
272 void createFramebuffers(
int width,
int height);
273 void deleteFramebuffers();
276 QRegion _visibleArea;
280 bool frameBufferStored;
281 QOpenGLFramebufferObject *glFrameBuf, *glFrameBuf2;
282 static bool inRendering;
283 bool keepPointOfViewOnSubgraphChanging;
284 std::string sceneTextureId;
290 void draw(
bool graphChanged =
true);
300 void closeEvent(QCloseEvent *e)
override;
312 void centerScene(
bool graphChanged =
false,
float zoomFactor = 1.0);
314 void emitGraphChanged();
317 void paintEvent(QPaintEvent *)
override;
332 void viewDrawn(
GlMainWidget *glWidget,
bool graphChanged);
334 void glResized(
int w,
int h);
tlp::GlScene * getScene()
Get the GlScene of this GlMainWidget You have to add yours GlLayer and GlEntity to this GlScene At th...
double viewportToScreen(double l) const
convert a viewport measure into a screen measure
Coord viewportToScreen(const Coord &point) const
convert a viewport point into a screen point
Coord screenToViewport(const Coord &point) const
convert a screen point into a viewport point
int screenToViewport(int l) const
convert a screen measure into a viewport measure
double screenToViewport(double l) const
convert a screen measure into a viewport measure
View plugins provide a way to dynamically add to a Tulip plateform various ways to visualize a graph...
Structure to store selected entities.
RenderingOption
Configure the rendering process ( see render function)
A GlLayer is like an 2D drawing software layer system.
This widget provide a simple system to visualize data/graph with OpenGL 3D engine.