The code are following:
{
//initialize some parametres
}
glWidget::~glWidget ()
{
}
void makeImage ()
{
//draw the graphics according to given data, using OpenGL API
}
void initializeGL()
{
}
void resizeGL(int width, int height)
{
}
void paintGL()
{
this->makeImage();
}
{
//get the start point of the line
}
{
//get the end point of the line
updateGL(); //this will always call the func paintGL() and call makeImage(). Move event will make the paintGL() be called high frequency.
}
{
//draw line to link the start point and the end point, using OpenGL API
}
glWidget::glWidget (QWidget* parent):QGLWidget (parent)
{
//initialize some parametres
}
glWidget::~glWidget ()
{
}
void makeImage ()
{
//draw the graphics according to given data, using OpenGL API
}
void initializeGL()
{
}
void resizeGL(int width, int height)
{
}
void paintGL()
{
this->makeImage();
}
void mousePressEvent (QMouseEvent *e)
{
//get the start point of the line
}
void mouseMoveEvent (QMouseEvent *e)
{
//get the end point of the line
updateGL(); //this will always call the func paintGL() and call makeImage(). Move event will make the paintGL() be called high frequency.
}
void drawLineTo (QPoint start, QPoint end )
{
//draw line to link the start point and the end point, using OpenGL API
}
To copy to clipboard, switch view to plain text mode
I only want to draw lines on the image which I make by large size of data. Mouse move event will make the paintGL() be called high frequency.
Would you please give some advices (or code best) to solve my problem? Thanks for your reply!!!
Bookmarks