|
@@ -18,7 +18,7 @@ WorkArea::WorkArea (int screenSizeX, int screenSizeY, QWidget * parent):
|
|
img = NULL;
|
|
img = NULL;
|
|
resizeFactor = 1;
|
|
resizeFactor = 1;
|
|
indexPointClicked = -1;
|
|
indexPointClicked = -1;
|
|
-
|
|
|
|
|
|
+ maxLines = 0;
|
|
}
|
|
}
|
|
|
|
|
|
WorkArea::WorkArea (int screenSizeX, int screenSizeY, const std::string & filename, QWidget * parent):QWidget(parent)
|
|
WorkArea::WorkArea (int screenSizeX, int screenSizeY, const std::string & filename, QWidget * parent):QWidget(parent)
|
|
@@ -29,6 +29,7 @@ WorkArea::WorkArea (int screenSizeX, int screenSizeY, const std::string & filena
|
|
img = NULL;
|
|
img = NULL;
|
|
resizeFactor = 1;
|
|
resizeFactor = 1;
|
|
indexPointClicked = -1;
|
|
indexPointClicked = -1;
|
|
|
|
+ maxLines = 0;
|
|
loadImage(filename);
|
|
loadImage(filename);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -39,6 +40,7 @@ WorkArea::WorkArea (int screenSizeX, int screenSizeY, const std::string & imageF
|
|
img = NULL;
|
|
img = NULL;
|
|
resizeFactor = 1;
|
|
resizeFactor = 1;
|
|
indexPointClicked = -1;
|
|
indexPointClicked = -1;
|
|
|
|
+ maxLines = 0;
|
|
loadImage(imageFilename);
|
|
loadImage(imageFilename);
|
|
this->readOnly = readOnly;
|
|
this->readOnly = readOnly;
|
|
loadSL(SLFilename);
|
|
loadSL(SLFilename);
|
|
@@ -60,6 +62,7 @@ WorkArea::loadImage (const std::string & filename)
|
|
liste_points.clear ();
|
|
liste_points.clear ();
|
|
|
|
|
|
setFixedSize (img->width (), img->height ());
|
|
setFixedSize (img->width (), img->height ());
|
|
|
|
+ maxLines = 3;
|
|
}
|
|
}
|
|
|
|
|
|
void
|
|
void
|
|
@@ -164,8 +167,10 @@ WorkArea::mousePressEvent (QMouseEvent * event)
|
|
{
|
|
{
|
|
if (indexPointClicked == -1)
|
|
if (indexPointClicked == -1)
|
|
{
|
|
{
|
|
- indexPointClicked = liste_points.size ();
|
|
|
|
- liste_points << new QPoint (event->x (), event->y ());
|
|
|
|
|
|
+ if((maxLines == 0) || (liste_points.size()<(maxLines*2))){
|
|
|
|
+ indexPointClicked = liste_points.size ();
|
|
|
|
+ liste_points << new QPoint (event->x (), event->y ());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// Clic droit
|
|
// Clic droit
|