#include "QHalconWindow.h" #include "ROIController.h" #include #include #ifdef _WIN32 #include #endif #include #include "HWndMessage.h" #include #include #include #include "HImage.h" #include"Util.h" #include "ROI.h" #include"ROICircle.h" #include"ROIRect1.h" #include"ROICircularArc.h" #include"ROIRect2.h" #include"ROILine.h" #include #include #include using namespace std; using namespace HalconCpp; bool inMeasureLine = false; //构造函数 QHalconWindow::QHalconWindow(QWidget* parent) : QWidget(parent) { resize(400, 300); setGeometry(QRect(30, 30, 400, 300)); setMouseTracking(true); resultShow = ResultShow::AllObject; //show(); OpenWindow(); SetSystem("int_zooming", "true"); SetSystem("border_shape_models", "false"); SetSystem("tsp_width", 6000); SetSystem("tsp_height", 6000); backguoundColor = "#696969"; windowWidth = size().width(); windowHeight = size().height(); showMode = ShowMode::IncludeROI; imageHeight = 400; imageWidth = 300; zoomWndFactor = (double)imageWidth / this->width(); InitUserUI(); roiManager = nullptr; firstEnter = true; } /** * @brief QHalconWindow::~QHalconWindow 析构函数 */ QHalconWindow::~QHalconWindow(void) { using namespace HalconCpp; CloseWindow(winID); // delete roiManager; qDebug() << " CloseWindow(winID);"; } void QHalconWindow::refresh() { try { using namespace HalconCpp; SetSystem("flush_graphic", "false"); SetDraw(winID, "margin"); ClearWindow(winID); mGC.stateOfSettings.clear(); //Util::notify(GBK("对象个数%1").arg(count)); //m_Mutex.lock(); int count = HObjList.count(); for (int i = 0; i < count; i++) { if (i > 0 && resultShow == ResultShow::Image) { break; } HObject objShow = HObjList[i].getHobj(); HWndMessage messageShow = HObjList[i].getMessage(); if (objShow.IsInitialized()) { this->mGC.applyContext(winID, HObjList[i].getGC()); DispObj(objShow, winID); } else if (messageShow.IsInitialized()) { messageShow.dispMessage(winID, "image", ((double)imageWidth / this->width()) / zoomWndFactor); } } //m_Mutex.unlock(); if (roiManager != nullptr && (showMode == ShowMode::IncludeROI)) { int dat = imageWidth / 300; if (dat < 5) { dat = 5; } roiManager->paintData(getWindowID(), dat, zoomWndFactor); } SetSystem("flush_graphic", "true"); //获取当前显示信息 HTuple hv_Red, hv_Green, hv_Blue; HTuple hv_lineWidth; GetRgb(winID, &hv_Red, &hv_Green, &hv_Blue); GetLineWidth(winID, &hv_lineWidth); HTuple hv_Draw; GetDraw(winID, &hv_Draw); if (showCross == false) { SetColor(winID, backguoundColor.toStdString().c_str()); DispLine(winID, -100.0, -100.0, -101.0, -101.0); } else { SetDraw(winID, "margin"); SetLineWidth(winID, 1);//设置线宽 SetLineStyle(winID, HTuple()); SetColor(winID, "green");//十字架显示颜色 double CrossCol = (double)imageWidth / 2, CrossRow = (double)imageHeight / 2; //竖线 HTuple row, col; row[0] = 0; row[1] = CrossRow - 50; col[0] = CrossCol; col[1] = CrossCol; DispPolygon(winID, row, col); row[0] = CrossRow + 50; row[1] = imageHeight; col[0] = CrossCol; col[1] = CrossCol; DispPolygon(winID, row, col); //中心点 row[0] = CrossRow - 2; row[1] = CrossRow + 2; col[0] = CrossCol; col[1] = CrossCol; DispPolygon(winID, row, col); row[0] = CrossRow; row[1] = CrossRow; col[0] = CrossCol - 2; col[1] = CrossCol + 2; DispPolygon(winID, row, col); //横线 row[0] = CrossRow; row[1] = CrossRow; col[0] = 0; col[1] = CrossCol - 50; DispPolygon(winID, row, col); row[0] = CrossRow; row[1] = CrossRow; col[0] = CrossCol + 50; col[1] = imageWidth; DispPolygon(winID, row, col); } //恢复窗口显示信息 SetRgb(winID, hv_Red, hv_Green, hv_Blue); SetLineWidth(winID, hv_lineWidth); SetDraw(winID, hv_Draw); // SetColor(WindowID(),"black"); // DispLine(WindowID(),-100.0, -100.0, -101.0, -101.0); } catch (HalconCpp::HException& exception) { char m_szMsg[2048] = ""; snprintf(m_szMsg, sizeof(m_szMsg), "Error #%u in %s: %s\n", exception.ErrorCode(), exception.ProcName().TextA(), exception.ErrorMessage().TextA()); qWarning() << m_szMsg; } } void QHalconWindow::addIconicVar(HImage img) { using namespace HalconCpp; if (img.IsInitialized() == false) { return; } double r = 0, c = 0; Hlong h = 0, w = 0; Hlong area; //当前使用重载来判断是否图像,如果是hobject的图像,无法进入此处重载 try { area = img.GetDomain().AreaCenter(&r, &c); img.GetImageSize(&w, &h); //面积=长*宽 表示确实是图片 if (area == (w * h)) { //添加图像就显示所有obj resultShow = ResultShow::AllObject; //HObjList.clear(); if ((h != imageHeight) || (w != imageWidth)) { imageHeight = h; imageWidth = w; resetWindow(); } }//if originalImage = img; if (img.IsInitialized()) { HObject ho_object(img); addIconicVar(ho_object); } // HObject ho_object = static_cast(img); // addIconicVar(ho_object); } catch (HalconCpp::HException& exception) { char m_szMsg[2048] = ""; snprintf(m_szMsg, sizeof(m_szMsg), "Error #%u in %s: %s\n", exception.ErrorCode(), exception.ProcName().TextA(), exception.ErrorMessage().TextA()); qWarning() << m_szMsg; } } void QHalconWindow::addIconicVar(HObject obj) { using namespace HalconCpp; if (obj.IsInitialized() == false) { return; } //m_Mutex.lock(); //属性复制 HObjectEntry entry(obj, mGC.graphicalSettings); HObjList.append(entry); if (HObjList.count() > MAX_NUM_OBJ_LIST) { HObjList.removeAt(1); } //m_Mutex.unlock(); } void QHalconWindow::addMessage(HWndMessage message) { HObjectEntry entry(message); //m_Mutex.lock(); HObjList.append(entry); if (HObjList.count() > MAX_NUM_OBJ_LIST) { HObjList.removeAt(1); } //m_Mutex.unlock(); } void QHalconWindow::useROIController(ROIController* rC) { roiManager = rC; rC->setViewController(this); rC->setROISign(ROIOperation::Positive); } void QHalconWindow::resetWindow() { // setImagePart(0, 0, ImgRow2, ImgCol2); QRect rect = this->geometry(); //判断行缩放还是列缩放 double scaleC = (double)imageWidth / rect.width(); double scaleR = (double)imageHeight / rect.height(); double w, h; if (scaleC < scaleR) { h = rect.height() * scaleR; w = rect.width() * scaleR; ImgRow1 = 0; ImgCol1 = (imageWidth - w) / 2.0; } else { h = rect.height() * scaleC; w = rect.width() * scaleC; ImgRow1 = (imageHeight - h) / 2.0; ImgCol1 = 0; } ImgRow2 = ImgRow1 + h - 1; ImgCol2 = ImgCol1 + w - 1; zoomWndFactor = w / rect.width(); SetPart(winID, ImgRow1, ImgCol1, ImgRow2, ImgCol2); // SetPart(WindowID(), 0,0,imageHeight-1,imageWidth-1); } void QHalconWindow::clearWindow() { HObjList.clear(); refresh(); } void QHalconWindow::changeGraphicSettings(const QString& mode, const HTuple& val) { this->mGC.setAttribute(mode, val); } void QHalconWindow::setResultShow(const ResultShow& resultShow) { this->resultShow = resultShow; refresh(); } void QHalconWindow::setShowMode(const ShowMode& showMode) { this->showMode = showMode; refresh(); } void QHalconWindow::on_actDispFit() { resetWindow(); refresh(); } void QHalconWindow::on_actSaveImage() { if (HObjList.count() < 1) { //QMessageBox::information(this, GBK("提示"), GBK("无图像数据,无法保存")); return; } QString runPath = QCoreApplication::applicationDirPath(); //获取exe路径 QString strFileName = "Image_" + QDateTime::currentDateTime().toString("[MM-dd_hh_mm_ss_zzz]"); QString strPath = runPath + "//..//PrjImage//" ; QDir dir(strPath); if (!dir.exists()) { dir.mkdir(strPath); } QString fileName = QFileDialog::getSaveFileName(this, GBK("另存为"), strPath + strFileName, GBK("图像文件 (*.bmp)")); if (!fileName.isNull()) { try { HTuple path = HTuple(fileName.toLocal8Bit().toStdString().c_str()); if (originalImage.IsInitialized()) { WriteImage(originalImage, "bmp", 0, path); //QMessageBox::information(this, GBK("提示"), GBK("图像保存完成")); } else { QMessageBox::information(this, GBK("提示"), GBK("图像未初始化")); } } catch (HException&) { QMessageBox::information(this, GBK("提示"), GBK("操作异常,请检查图像数据及文件路径")); return; } //fileName是文件名 } } void QHalconWindow::on_actDumpWindow() { QString fileName = QFileDialog::getSaveFileName(this, GBK("截图另存为"), "", GBK("图像 (*.bmp)")); if (!fileName.isNull()) { try { HTuple path = HTuple(fileName.toLocal8Bit().toStdString().c_str()); DumpWindow(winID, "bmp", path); QMessageBox::information(this, GBK("提示"), GBK("截图保存完成")); } catch (HException&) { QMessageBox::information(this, GBK("提示"), GBK("文件路径异常,保存失败")); return; } //fileName是文 } } void QHalconWindow::on_actShowCross() { showCross = !showCross; refresh(); } void QHalconWindow::on_actDelActiveRoi() { if (roiManager == Q_NULLPTR) return; roiManager->removeActive(); } void QHalconWindow::on_actDelAllRoi() { if (roiManager == Q_NULLPTR) return; roiManager->reset(); } void QHalconWindow::on_actSetRoiAdd() { if (roiManager == Q_NULLPTR) return; roiManager->setROISign(ROIOperation::Positive); } void QHalconWindow::on_actSetRoiSub() { if (roiManager == Q_NULLPTR) return; roiManager->setROISign(ROIOperation::Negative); } void QHalconWindow::on_actGetDistance() { HWndMessage message = HWndMessage(HTuple(QString("鼠标点击两个位置,单击鼠标右键完成。").toStdString().c_str()), 20, 20, 20, "green"); message.dispMessage(winID, "window", 1); inMeasureLine = true; // viewPort.ContextMenuStrip = null; HTuple r1, c1, r2, c2; HTuple dd; //获取当前显示信息 HTuple hv_Red, hv_Green, hv_Blue; GetRgb(winID, &hv_Red, &hv_Green, &hv_Blue); HTuple hv_lineWidth; GetLineWidth(winID, &hv_lineWidth); HTuple hv_Draw; GetDraw(winID, &hv_Draw); SetLineWidth(winID, 1);//设置线宽 SetLineStyle(winID, HTuple()); SetColor(winID, "green");//画点的颜色 DrawLine(winID, &r1, &c1, &r2, &c2); DispLine(winID, r1, c1, r2, c2); //恢复窗口显示信息 SetRgb(winID, hv_Red, hv_Green, hv_Blue); SetLineWidth(winID, hv_lineWidth); SetDraw(winID, hv_Draw); DistancePp(r1, c1, r2, c2, &dd); double dr = abs(r2.D() - r1.D()); double dc = abs(c2.D() - c1.D()); QMessageBox::information(this, GBK("提示"), QString(GBK("直线长度:%1 px\nx轴距离:%2 px\ny轴距离:%3 px")).arg(dd.D(), 0, 'f', 2) .arg(dc, 0, 'f', 2) .arg(dr, 0, 'f', 2)); // MessageBox.Show(string.Format("直线距离%1 px\rx轴距离%2 px\ry轴距离%3 px", dd.D, dc, dr), "结果", MessageBoxButtons.OK, MessageBoxIcon.Information); //hv_MenuStrip.Visible = true; //viewPort.ContextMenuStrip = hv_MenuStrip; inMeasureLine = false; refresh(); } void QHalconWindow::on_actShowImageOnly() { if (resultShow == ResultShow::AllObject) { resultShow = ResultShow::Image; } else { resultShow = ResultShow::AllObject; } refresh(); } void QHalconWindow::on_actCreateCircle() { if (roiManager == NULL) { return; } ROICircle* roi = new ROICircle(); roiManager->setROISign(ROIOperation::Negative); roiManager->setROIShape(roi); } void QHalconWindow::on_actCreateCircleArc() { if (roiManager == NULL) { return; } ROICircularArc* roi = new ROICircularArc(); roiManager->setROISign(ROIOperation::Negative); roiManager->setROIShape(roi); } void QHalconWindow::on_actCreateLine() { if (roiManager == NULL) { return; } ROILine* roi = new ROILine(); roiManager->setROISign(ROIOperation::Negative); roiManager->setROIShape(roi); } void QHalconWindow::on_actCreateRect1() { if (roiManager == NULL) { return; } ROIRect1* roi = new ROIRect1(); roiManager->setROISign(ROIOperation::Negative); roiManager->setROIShape(roi); } void QHalconWindow::on_actCreateRect2() { if (roiManager == NULL) { return; } ROIRect2* roi = new ROIRect2(); roiManager->setROISign(ROIOperation::Negative); roiManager->setROIShape(roi); } // Open a HALCON window inside the QHalconWindow widget void QHalconWindow::OpenWindow(void) { using namespace HalconCpp; #ifdef Q_WS_X11 // In Qt versions older version 3.3, it is necessary to temporarily // change the SubstructureRedirectMask attribute of a Qt widget // in order to be able to open a HALCON window inside the widget XWindowAttributes attr; #if QT_VERSION >= 0x040000 XGetWindowAttributes(x11Info().display(), winId(), &attr); if (attr.your_event_mask & SubstructureRedirectMask) XSelectInput(x11Info().display(), winId(), attr.your_event_mask & ~SubstructureRedirectMask); XFlush(x11Info().display()); XSync(x11Info().display(), False); #else XGetWindowAttributes(x11Display(), winId(), &attr); if (attr.your_event_mask & SubstructureRedirectMask) XSelectInput(x11Display(), winId(), attr.your_event_mask & ~SubstructureRedirectMask); XFlush(x11Display()); XSync(x11Display(), False); #endif #endif SetWindowAttr("border_width", 0); SetCheck("~father"); // Open a HALCON window with dummy width and height // it will be resized soon HalconCpp::OpenWindow(0, 0, 100, 100, (Hlong)winId(), "visible", "", &winID); // HalconCpp::OpenWindow(0,0,100,100, (Hlong)this,"invisible","",&winID); SetCheck("father"); #ifdef Q_WS_X11 // Reset widget attributes to previous settings (see above comment) #if QT_VERSION >= 0x040000 if (attr.your_event_mask & SubstructureRedirectMask) XSelectInput(x11Info().display(), winId(), attr.your_event_mask); #else if (attr.your_event_mask & SubstructureRedirectMask) XSelectInput(x11Display(), winId(), attr.your_event_mask); #endif #endif } void QHalconWindow::DispImageZoom(HTuple mode, HTuple Mouse_row, HTuple Mouse_col) { GetPart(winID, ¤t_beginRow, ¤t_beginCol, ¤t_endRow, ¤t_endCol); if (mode > 0) // 放大图像 { zoom_beginRow = (int)(current_beginRow.D() + (Mouse_row.D() - current_beginRow.D()) * 0.3); zoom_beginCol = (int)(current_beginCol.D() + (Mouse_col.D() - current_beginCol.D()) * 0.3); zoom_endRow = (int)(current_endRow.D() - (current_endRow.D() - Mouse_row.D()) * 0.3); zoom_endCol = (int)(current_endCol.D() - (current_endCol.D() - Mouse_col.D()) * 0.3); } else // 缩小图像 { zoom_beginRow = (int)(Mouse_row.D() - (Mouse_row.D() - current_beginRow.D()) / 0.7); zoom_beginCol = (int)(Mouse_col.D() - (Mouse_col.D() - current_beginCol.D()) / 0.7); zoom_endRow = (int)(Mouse_row.D() + (current_endRow.D() - Mouse_row.D()) / 0.7); zoom_endCol = (int)(Mouse_col.D() + (current_endCol.D() - Mouse_col.D()) / 0.7); } QRect rect = this->geometry(); int hw_width = rect.width(); int hw_height = rect.height(); bool _isOutOfArea = true; bool _isOutOfSize = true; bool _isOutOfPixel = true; //避免像素过大 if (zoom_endRow == zoom_beginRow || zoom_endCol == zoom_beginCol) { return; } _isOutOfArea = zoom_beginRow >= imageHeight || zoom_endRow <= 0 || zoom_beginCol >= imageWidth || zoom_endCol < 0; _isOutOfSize = (zoom_endRow - zoom_beginRow) > imageHeight * 20 || (zoom_endCol - zoom_beginCol) > imageWidth * 20; _isOutOfPixel = hw_height / (zoom_endRow - zoom_beginRow) > 500 || hw_width / (zoom_endCol - zoom_beginCol) > 500; if (_isOutOfArea || _isOutOfSize || _isOutOfPixel) { return; } SetPaint(winID, "default"); SetPart(winID, zoom_beginRow, zoom_beginCol, zoom_endRow, zoom_beginCol + (zoom_endRow - zoom_beginRow) * hw_width / hw_height); int w = (zoom_endRow - zoom_beginRow) * hw_width / hw_height; int w0 = current_endCol.D() - current_beginCol.D(); double scale = (double)w / w0; zoomWndFactor *= scale; refresh(); } void QHalconWindow::InitUserUI() { actDispImageOnly = new QAction(this); actDispFit = new QAction(this); actShowCross = new QAction(this); actSaveImage = new QAction(this); actDumpWindow = new QAction(this); actDispImageOnly->setText((GBK("显示原图/所有"))); actDispFit->setText(GBK("适应图像显示")); actShowCross->setText(GBK("显示/隐藏十字架")); actSaveImage->setText(GBK("保存图像")); actDumpWindow->setText(GBK("截图另存")); connect(actDispFit, SIGNAL(triggered(bool)), this, SLOT(on_actDispFit())); connect(actSaveImage, SIGNAL(triggered(bool)), this, SLOT(on_actSaveImage())); connect(actDumpWindow, SIGNAL(triggered(bool)), this, SLOT(on_actDumpWindow())); connect(actShowCross, SIGNAL(triggered(bool)), this, SLOT(on_actShowCross())); } void QHalconWindow::moveImage(double motionX, double motionY) { GetPart(winID, ¤t_beginRow, ¤t_beginCol, ¤t_endRow, ¤t_endCol); ImgRow1 = current_beginRow - motionY; ImgRow2 = current_endRow - motionY; ImgCol1 = current_beginCol - motionX; ImgCol2 = current_endCol - motionX; SetPart(winID, ImgRow1, ImgCol1, ImgRow2, ImgCol2); refresh(); } // Resize the HALCON window whenever the QHalconWindow widget is resized void QHalconWindow::resizeEvent(QResizeEvent*) { using namespace HalconCpp; #ifdef Q_WS_X11 // See comment in ::OpenWindow() XWindowAttributes attr; #if QT_VERSION >= 0x040000 XGetWindowAttributes(x11Info().display(), winId(), &attr); if (attr.your_event_mask & SubstructureRedirectMask) XSelectInput(x11Info().display(), winId(), attr.your_event_mask & ~SubstructureRedirectMask); XFlush(x11Info().display()); XSync(x11Info().display(), False); #else XGetWindowAttributes(x11Display(), winId(), &attr); if (attr.your_event_mask & SubstructureRedirectMask) XSelectInput(x11Display(), winId(), attr.your_event_mask & ~SubstructureRedirectMask); XFlush(x11Display()); XSync(x11Display(), False); #endif #endif // Set the HALCON window to its new size. SetWindowExtents(winID, 0, 0, rect().width(), rect().height() ); #ifdef Q_WS_X11 // See comment in ::OpenWindow() #if QT_VERSION >= 0x040000 if (attr.your_event_mask & SubstructureRedirectMask) XSelectInput(x11Info().display(), winId(), attr.your_event_mask); #else if (attr.your_event_mask & SubstructureRedirectMask) XSelectInput(x11Display(), winId(), attr.your_event_mask); #endif #endif } void QHalconWindow::mousePressEvent(QMouseEvent*) { if (inMeasureLine)return; mousePressed = true; HTuple state; HTuple x, y; try { GetMpositionSubPix(winID, &y, &x, &state); } catch (HException&) { return; } int activeROIidx = -1; if (roiManager != Q_NULLPTR && (showMode == ShowMode::IncludeROI)) { activeROIidx = roiManager->mouseDownAction(x.D(), y.D()); } if (activeROIidx == -1) { startX = x; startY = y; } } void QHalconWindow::wheelEvent(QWheelEvent* event) { if (inMeasureLine)return; using namespace HalconCpp; HTuple Row, Column, Button; try { GetMpositionSubPix(winID, &Row, &Column, &Button); } catch (HException&) { return; } HTuple mode = 1; if (event->delta() > 0) { mode = 1; } else { mode = -1; } DispImageZoom(mode, Row, Column); } void QHalconWindow::mouseReleaseEvent(QMouseEvent*) { if (inMeasureLine)return; mousePressed = false; if (roiManager != NULL && (roiManager->getActiveROIidx() != -1) && (showMode == ShowMode::IncludeROI)) { roiManager->tiggerROINotifySignals(ViewMessage::UpdateROI); } } void QHalconWindow::mouseMoveEvent(QMouseEvent*) { if (inMeasureLine)return; // qDebug()<<"mouse move"; double motionX, motionY; if (HObjList.count() < 1) { return; } HTuple currX, currY, state; try { GetMpositionSubPix(winID, &currY, &currX, &state); if (originalImage.IsInitialized()) { QString str_value = ""; QString str_position = ""; bool _isXOut = true, _isYOut = true; int channel_count; QString str_imgSize = QString("%1*%2").arg(imageWidth).arg(imageHeight); channel_count = originalImage.CountChannels(); str_position = QString("|%1*%2").arg((int)currX.D()).arg((int)currY.D());; _isXOut = (currX.D() < 0 || currX.D() >= imageWidth); _isYOut = (currY.D() < 0 || currY.D() >= imageHeight); if (!_isXOut && !_isYOut) { if ((int)channel_count == 1) { double grayVal; grayVal = originalImage.GetGrayval((int)currY.D(), (int)currX.D()); str_value = QString("|%1").arg((int)grayVal); } else if ((int)channel_count == 3) { double grayValRed, grayValGreen, grayValBlue; HImage _RedChannel, _GreenChannel, _BlueChannel; _RedChannel = originalImage.AccessChannel(1); _GreenChannel = originalImage.AccessChannel(2); _BlueChannel = originalImage.AccessChannel(3); grayValRed = _RedChannel.GetGrayval((int)currY.D(), (int)currX.D()); grayValGreen = _GreenChannel.GetGrayval((int)currY.D(), (int)currX.D()); grayValBlue = _BlueChannel.GetGrayval((int)currY.D(), (int)currX.D()); str_value = QString("|%1,%2,%3").arg((int)grayValRed).arg((int)grayValGreen).arg((int)grayValBlue); } else { str_value = ""; } } QString MousePosMessage = str_imgSize + str_position + str_value; emit mouseMoveStatus(MousePosMessage); } if (!mousePressed) { return; } if (roiManager != Q_NULLPTR && (roiManager->getActiveROIidx() != -1) && (showMode == ShowMode::IncludeROI)) { roiManager->mouseMoveAction(currX.D(), currY.D()); } else { //qDebug()<<"xx.D():"<clear(); popMenu->addAction(actDispFit); popMenu->addSeparator(); popMenu->addAction(actDispImageOnly); popMenu->addAction(actShowCross); popMenu->addSeparator(); popMenu->addAction(actSaveImage); popMenu->addAction(actDumpWindow); //菜单出现的位置为当前鼠标的位置 popMenu->exec(event->globalPos()); delete popMenu; popMenu = NULL; } void QHalconWindow::enterEvent(QEvent*) { // if(firstEnter) // { // firstEnter=false; // refresh(); // } } void QHalconWindow::showEvent(QShowEvent*) { refresh(); } void QHalconWindow::setBackgroundColor(QString color) { backguoundColor = color; SetWindowParam(winID, "background_color", color.toStdString().c_str()); } void QHalconWindow::on_actDispImageOnly() { if (resultShow == ResultShow::Image) { setResultShow(ResultShow::AllObject); } else { setResultShow(ResultShow::Image); } }