-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2024 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <QRadioButton>
#include <QGridLayout>
#include <QPushButton>
+#include <QCheckBox>
#include <QMap>
//=================================================================================
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);
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);
layout->addWidget(gbxFilter);
// set help
- setHelpFileName("xao_format_page.html");
+ setHelpFileName("import_export_geom_obj_page.html#io_xao");
Init();
}
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);
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++)
//=================================================================================
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())
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<QListWidgetItem*> selGroups;
GEOM::IXAOOperations_var aXAOOp = GEOM::IXAOOperations::_narrow( getOperation() );
res = aXAOOp->ExportXAO(m_mainObj, groups, fields,
author.toUtf8().constData(),
- fileName.toUtf8().constData());
+ fileName.toUtf8().constData(),
+ shapeFileName.toStdString().c_str());
return res;
}