X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXAOPlugin%2FXAOPlugin_ExportDlg.cxx;h=5ee2069db775f6622ccfafff26c986d458c52f28;hb=b6f0965afb72083a5234f9b4fb0b233adaaf8d9d;hp=01e570f6460b89a0d15ea196c56871aa2357eb62;hpb=6e2763b42437045fd4b18aa3a6197865020de84b;p=modules%2Fgeom.git diff --git a/src/XAOPlugin/XAOPlugin_ExportDlg.cxx b/src/XAOPlugin/XAOPlugin_ExportDlg.cxx index 01e570f64..5ee2069db 100644 --- a/src/XAOPlugin/XAOPlugin_ExportDlg.cxx +++ b/src/XAOPlugin/XAOPlugin_ExportDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2013-2022 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -54,6 +54,7 @@ #include #include #include +#include #include //================================================================================= @@ -101,6 +102,7 @@ XAOPlugin_ExportDlg::XAOPlugin_ExportDlg(GeometryGUI* geometryGUI, QWidget* pare ledShape->setMinimumSize(QSize(100, 0)); int line = 0, col = 0; + // adWidget(widget, fromRow, fromColumn, rowSpan, columnSpan) gridLayoutExport->addWidget(lblShape, line, col++, 1, 1); gridLayoutExport->addWidget(btnShapeSelect, line, col++, 1, 1); gridLayoutExport->addWidget(ledShape, line, col++, 1, 1); @@ -121,10 +123,17 @@ XAOPlugin_ExportDlg::XAOPlugin_ExportDlg(GeometryGUI* geometryGUI, QWidget* pare ledAuthor = new QLineEdit(gbxExport); line++; col = 0; - gridLayoutExport->addWidget(lblAuthor, line, col++, 2, 1); + gridLayoutExport->addWidget(lblAuthor, line, col++, 1, 1); col++; // span gridLayoutExport->addWidget(ledAuthor, line, col++, 1, 1); + // Line 3 + ckxUseSeparateFile = new QCheckBox(tr("XAOPLUGIN_EXPORT_SHAPEFILE"), gbxExport); + + line++; col = 0; + gridLayoutExport->addWidget(ckxUseSeparateFile, line, col++, 1, 2); + + //**************************** // Filter Group box QGroupBox* gbxFilter = new QGroupBox(parent); @@ -162,7 +171,7 @@ XAOPlugin_ExportDlg::XAOPlugin_ExportDlg(GeometryGUI* geometryGUI, QWidget* pare layout->addWidget(gbxFilter); // set help - setHelpFileName("xao_format_page.html"); + setHelpFileName("import_export_geom_obj_page.html#io_xao"); Init(); } @@ -217,7 +226,7 @@ void XAOPlugin_ExportDlg::processObject() else { ledShape->setText(GEOMBase::GetName(m_mainObj)); - GEOM::GEOM_IShapesOperations_var shapeOp = getGeomEngine()->GetIShapesOperations(getStudyId()); + GEOM::GEOM_IShapesOperations_var shapeOp = getGeomEngine()->GetIShapesOperations(); // add groups names GEOM::ListOfGO_var groups = shapeOp->GetExistingSubObjects(m_mainObj, true); @@ -234,7 +243,7 @@ void XAOPlugin_ExportDlg::processObject() lstGroups->sortItems(Qt::AscendingOrder); // add fields - GEOM::GEOM_IFieldOperations_var fieldOp = getGeomEngine()->GetIFieldOperations(getStudyId()); + GEOM::GEOM_IFieldOperations_var fieldOp = getGeomEngine()->GetIFieldOperations(); GEOM::ListOfFields_var fields = fieldOp->GetFields(m_mainObj); for (int i = 0, n = fields->length(); i < n; i++) @@ -380,14 +389,14 @@ void XAOPlugin_ExportDlg::enterEvent(QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr XAOPlugin_ExportDlg::createOperation() { - return getGeomEngine()->GetPluginOperations( getStudyId(), "XAOPluginEngine" ); + return getGeomEngine()->GetPluginOperations( "XAOPluginEngine" ); } //================================================================================= // function : isValid // purpose : //================================================================================= -bool XAOPlugin_ExportDlg::isValid(QString& msg) +bool XAOPlugin_ExportDlg::isValid(QString& /*msg*/) { // check shape if (ledShape->text().isEmpty()) @@ -410,6 +419,12 @@ bool XAOPlugin_ExportDlg::execute() QString author = ledAuthor->text(); QString fileName = ledFileName->text(); + QString shapeFileName = QString("");//ledShapeFile->text(); + if (ckxUseSeparateFile->isChecked()) + { + shapeFileName = fileName; + shapeFileName.append(".brep"); + } // get selected groups QList selGroups; @@ -450,7 +465,8 @@ bool XAOPlugin_ExportDlg::execute() // call engine function GEOM::IXAOOperations_var aXAOOp = GEOM::IXAOOperations::_narrow( getOperation() ); res = aXAOOp->ExportXAO(m_mainObj, groups, fields, - author.toStdString().c_str(), - fileName.toStdString().c_str()); + author.toUtf8().constData(), + fileName.toUtf8().constData(), + shapeFileName.toStdString().c_str()); return res; }