1 // Copyright (C) 2014-2020 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include <ExchangePlugin_ExportFeature.h>
30 #include <Config_Common.h>
31 #include <Config_PropManager.h>
33 #include <GeomAlgoAPI_BREPExport.h>
34 #include <GeomAlgoAPI_CompoundBuilder.h>
35 #include <GeomAlgoAPI_IGESExport.h>
36 #include <GeomAlgoAPI_STEPExport.h>
37 #include <GeomAlgoAPI_Tools.h>
38 #include <GeomAlgoAPI_XAOExport.h>
40 #include <GeomAPI_Shape.h>
41 #include <GeomAPI_ShapeExplorer.h>
42 #include <GeomAPI_Trsf.h>
44 #include <ModelAPI_AttributeSelectionList.h>
45 #include <ModelAPI_AttributeString.h>
46 #include <ModelAPI_AttributeStringArray.h>
47 #include <ModelAPI_AttributeIntArray.h>
48 #include <ModelAPI_AttributeTables.h>
49 #include <ModelAPI_Data.h>
50 #include <ModelAPI_Document.h>
51 #include <ModelAPI_Object.h>
52 #include <ModelAPI_ResultBody.h>
53 #include <ModelAPI_ResultPart.h>
54 #include <ModelAPI_ResultGroup.h>
55 #include <ModelAPI_ResultField.h>
56 #include <ModelAPI_Session.h>
57 #include <ModelAPI_Validator.h>
58 #include <ModelAPI_Tools.h>
60 #include <Events_InfoMessage.h>
62 #include <XAO_Group.hxx>
63 #include <XAO_Field.hxx>
64 #include <XAO_Xao.hxx>
65 #include <XAO_Geometry.hxx>
67 #include <ExchangePlugin_Tools.h>
69 ExchangePlugin_ExportFeature::ExchangePlugin_ExportFeature()
73 ExchangePlugin_ExportFeature::~ExchangePlugin_ExportFeature()
75 // TODO Auto-generated destructor stub
79 * Request for initialization of data model of the feature: adding all attributes
81 void ExchangePlugin_ExportFeature::initAttributes()
83 data()->addAttribute(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID(),
84 ModelAPI_AttributeString::typeId());
85 data()->addAttribute(ExchangePlugin_ExportFeature::FILE_PATH_ID(),
86 ModelAPI_AttributeString::typeId());
87 data()->addAttribute(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID(),
88 ModelAPI_AttributeString::typeId());
89 data()->addAttribute(ExchangePlugin_ExportFeature::FILE_FORMAT_ID(),
90 ModelAPI_AttributeString::typeId());
91 data()->addAttribute(ExchangePlugin_ExportFeature::SELECTION_LIST_ID(),
92 ModelAPI_AttributeSelectionList::typeId());
93 data()->addAttribute(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID(),
94 ModelAPI_AttributeString::typeId());
95 data()->addAttribute(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID(),
96 ModelAPI_AttributeString::typeId());
97 data()->addAttribute(ExchangePlugin_ExportFeature::XAO_SELECTION_LIST_ID(),
98 ModelAPI_AttributeSelectionList::typeId());
100 ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(),
101 ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID());
102 ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(),
103 ExchangePlugin_ExportFeature::XAO_AUTHOR_ID());
104 ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(),
105 ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID());
106 ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(),
107 ExchangePlugin_ExportFeature::XAO_SELECTION_LIST_ID());
109 // to support previous version of document, move the selection list
110 // if the type of export operation is XAO
111 AttributeStringPtr aTypeAttr = string(EXPORT_TYPE_ID());
112 if (aTypeAttr->isInitialized() && aTypeAttr->value() == "XAO") {
113 bool aWasBlocked = data()->blockSendAttributeUpdated(true, false);
114 AttributeSelectionListPtr aSelList = selectionList(SELECTION_LIST_ID());
115 AttributeSelectionListPtr aXAOSelList = selectionList(XAO_SELECTION_LIST_ID());
116 if (aSelList->size() > 0 && aXAOSelList->size() == 0)
117 aSelList->copyTo(aXAOSelList);
119 data()->blockSendAttributeUpdated(aWasBlocked, false);
123 void ExchangePlugin_ExportFeature::attributeChanged(const std::string& theID)
125 if (theID == XAO_FILE_PATH_ID()) {
126 string(ExchangePlugin_ExportFeature::FILE_PATH_ID())->setValue(
127 string(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID())->value());
132 * Computes or recomputes the results
134 void ExchangePlugin_ExportFeature::execute()
136 AttributeStringPtr aFormatAttr =
137 this->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID());
138 std::string aFormat = aFormatAttr->value();
140 AttributeStringPtr aFilePathAttr =
141 this->string(ExchangePlugin_ExportFeature::FILE_PATH_ID());
142 std::string aFilePath = aFilePathAttr->value();
143 if (aFilePath.empty())
146 exportFile(aFilePath, aFormat);
149 void ExchangePlugin_ExportFeature::exportFile(const std::string& theFileName,
150 const std::string& theFormat)
152 std::string aFormatName = theFormat;
154 if (aFormatName.empty()) { // get default format for the extension
156 std::string anExtension = GeomAlgoAPI_Tools::File_Tools::extension(theFileName);
157 if (anExtension == "BREP" || anExtension == "BRP") {
158 aFormatName = "BREP";
159 } else if (anExtension == "STEP" || anExtension == "STP") {
160 aFormatName = "STEP";
161 } else if (anExtension == "IGES" || anExtension == "IGS") {
162 aFormatName = "IGES-5.1";
164 aFormatName = anExtension;
168 if (aFormatName == "XAO") {
169 exportXAO(theFileName);
173 // make shape for export from selected shapes
174 AttributeSelectionListPtr aSelectionListAttr =
175 this->selectionList(ExchangePlugin_ExportFeature::SELECTION_LIST_ID());
176 std::list<GeomShapePtr> aShapes;
177 for (int i = 0, aSize = aSelectionListAttr->size(); i < aSize; ++i) {
178 AttributeSelectionPtr anAttrSelection = aSelectionListAttr->value(i);
179 std::shared_ptr<GeomAPI_Shape> aCurShape = anAttrSelection->value();
180 if (aCurShape.get() == NULL)
181 aCurShape = anAttrSelection->context()->shape();
182 if (aCurShape.get() != NULL)
183 aShapes.push_back(aCurShape);
186 // Store compound if we have more than one shape.
187 std::shared_ptr<GeomAPI_Shape> aShape =
188 aShapes.size() == 1 ? aShapes.front() : GeomAlgoAPI_CompoundBuilder::compound(aShapes);
190 // Perform the export
192 bool aResult = false;
193 if (aFormatName == "BREP") {
194 aResult = BREPExport(theFileName, aFormatName, aShape, anError);
195 } else if (aFormatName == "STEP") {
196 aResult = STEPExport(theFileName, aFormatName, aShape, anError);
197 } else if (aFormatName.substr(0, 4) == "IGES") {
198 aResult = IGESExport(theFileName, aFormatName, aShape, anError);
200 anError = "Unsupported format: " + aFormatName;
203 if (!aResult || !anError.empty()) {
204 setError("An error occurred while exporting " + theFileName + ": " + anError);
209 /// Returns XAO string by the value from the table
210 static std::string valToString(const ModelAPI_AttributeTables::Value& theVal,
211 const ModelAPI_AttributeTables::ValueType& theType) {
212 std::ostringstream aStr; // the resulting string value
214 case ModelAPI_AttributeTables::BOOLEAN:
215 aStr<<(theVal.myBool ? "true" : "false");
217 case ModelAPI_AttributeTables::INTEGER:
220 case ModelAPI_AttributeTables::DOUBLE:
221 aStr<<theVal.myDouble;
223 case ModelAPI_AttributeTables::STRING:
230 /// Returns true if something in selection is presented in the results list
231 static bool isInResults(AttributeSelectionListPtr theSelection,
232 const std::list<ResultPtr>& theResults,
233 std::set<ResultPtr>& theCashedResults)
235 // collect all results into a cashed set
236 if (theCashedResults.empty()) {
237 std::list<ResultPtr>::const_iterator aRes = theResults.cbegin();
238 for(; aRes != theResults.cend(); aRes++) {
239 if (theCashedResults.count(*aRes))
242 theCashedResults.insert(*aRes);
243 if ((*aRes)->groupName() == ModelAPI_ResultBody::group()) {
244 ResultBodyPtr aResBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aRes);
245 std::list<ResultPtr> aResults;
246 ModelAPI_Tools::allSubs(aResBody, aResults, false);
247 for(std::list<ResultPtr>::iterator aR = aResults.begin(); aR != aResults.end(); aR++) {
248 theCashedResults.insert(std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aR));
250 } else if ((*aRes)->groupName() == ModelAPI_ResultPart::group()) { // all results of the part
251 ResultPartPtr aResPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aRes);
252 DocumentPtr aPartDoc = aResPart->partDoc();
253 if (!aPartDoc.get() || !aPartDoc->isOpened()) { // document is not accessible
256 int aBodyCount = aPartDoc->size(ModelAPI_ResultBody::group());
257 for (int aBodyIndex = 0; aBodyIndex < aBodyCount; ++aBodyIndex) {
258 ResultBodyPtr aResBody =
259 std::dynamic_pointer_cast<ModelAPI_ResultBody>(
260 aPartDoc->object(ModelAPI_ResultBody::group(), aBodyIndex));
261 if (aResBody.get()) {
262 theCashedResults.insert(aResBody);
263 std::list<ResultPtr> aResults;
264 ModelAPI_Tools::allSubs(aResBody, aResults, false);
265 for(std::list<ResultPtr>::iterator aR = aResults.begin(); aR != aResults.end(); aR++) {
266 theCashedResults.insert(std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aR));
273 // if context is in results, return true
274 for(int a = 0; a < theSelection->size(); a++) {
275 AttributeSelectionPtr anAttr = theSelection->value(a);
276 ResultPtr aContext = anAttr->context();
277 // check is it group selected for groups BOP
278 if (aContext.get() && aContext->groupName() == ModelAPI_ResultGroup::group()) {
279 // it is impossible by used results check which result is used in this group result,
280 // so check the results shapes is it in results of this document or not
281 FeaturePtr aSelFeature =
282 std::dynamic_pointer_cast<ModelAPI_Feature>(theSelection->owner());
283 if (!aSelFeature.get() || aSelFeature->results().empty())
285 GeomShapePtr aGroupResShape = aSelFeature->firstResult()->shape();
287 std::set<ResultPtr>::iterator allResultsIter = theCashedResults.begin();
288 for(; allResultsIter != theCashedResults.end(); allResultsIter++) {
289 GeomShapePtr aResultShape = (*allResultsIter)->shape();
291 GeomAPI_Shape::ShapeType aType =
292 GeomAPI_Shape::shapeTypeByStr(theSelection->selectionType());
293 GeomAPI_ShapeExplorer aGroupResExp(aGroupResShape, aType);
294 for(; aGroupResExp.more(); aGroupResExp.next()) {
295 if (aResultShape->isSubShape(aGroupResExp.current(), false))
296 return true; // at least one shape of the group is in the used results
300 ResultBodyPtr aSelected = std::dynamic_pointer_cast<ModelAPI_ResultBody>(anAttr->context());
301 if (!aSelected.get()) { // try to get selected feature and all its results
302 FeaturePtr aContextFeature = anAttr->contextFeature();
303 if (aContextFeature.get() && !aContextFeature->results().empty()) {
304 const std::list<ResultPtr>& allResluts = aContextFeature->results();
305 std::list<ResultPtr>::const_iterator aResIter = allResluts.cbegin();
306 for(; aResIter != allResluts.cend(); aResIter++) {
307 if (aResIter->get() && theCashedResults.count(*aResIter))
311 } else if (aSelected.get() && theCashedResults.count(aSelected))
317 void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName)
326 std::string anAuthor = string(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID())->value();
327 aXao.setAuthor(anAuthor);
329 // make shape for export from all results
330 std::list<GeomShapePtr> aShapes;
331 std::list<ResultPtr> aResults;
332 std::list<DocumentPtr> aDocuments; /// documents of Parts selected and used in export
333 std::map<DocumentPtr, GeomTrsfPtr> aDocTrsf; /// translation of the part
335 AttributeSelectionListPtr aSelection = selectionList(XAO_SELECTION_LIST_ID());
336 bool aIsSelection = aSelection->isInitialized() && aSelection->size() > 0;
337 if (aIsSelection) { // a mode for export to geom result by result
338 for(int a = 0; a < aSelection->size(); a++) {
339 AttributeSelectionPtr anAttr = aSelection->value(a);
340 ResultPtr aBodyContext =
341 std::dynamic_pointer_cast<ModelAPI_Result>(anAttr->context());
342 if (aBodyContext.get() && !aBodyContext->isDisabled() && aBodyContext->shape().get()) {
343 aResults.push_back(aBodyContext);
344 GeomShapePtr aShape = anAttr->value();
346 aShape = aBodyContext->shape();
347 aShapes.push_back(aShape);
348 if (aBodyContext->groupName() == ModelAPI_ResultPart::group()) {
349 ResultPartPtr aResPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aBodyContext);
350 DocumentPtr aPartDoc = aResPart->partDoc();
351 if (!aPartDoc.get() || !aPartDoc->isOpened()) { // document is not accessible
352 std::string msg = "Can not export XAO for not loaded part";
353 Events_InfoMessage("ExportFeature", msg, this).send();
356 aDocuments.push_back(aPartDoc);
357 aDocTrsf[aPartDoc] = aResPart->summaryTrsf();
363 int aBodyCount = document()->size(ModelAPI_ResultBody::group());
364 for (int aBodyIndex = 0; aBodyIndex < aBodyCount; ++aBodyIndex) {
365 ResultBodyPtr aResultBody =
366 std::dynamic_pointer_cast<ModelAPI_ResultBody>(
367 document()->object(ModelAPI_ResultBody::group(), aBodyIndex));
368 if (!aResultBody.get())
370 aShapes.push_back(aResultBody->shape());
371 aResults.push_back(aResultBody);
374 if (aShapes.empty()) {
375 setError("No shapes to export");
380 GeomShapePtr aShape = (aShapes.size() == 1)
382 : GeomAlgoAPI_CompoundBuilder::compound(aShapes);
384 SetShapeToXAO(aShape, &aXao, anError);
386 if (!anError.empty()) {
387 setError("An error occurred while exporting " + theFileName + ": " + anError);
392 std::string aGeometryName = string(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID())->value();
393 if (aGeometryName.empty() && aResults.size() == 1) {
394 // get the name from the first result
395 ResultPtr aResultBody = *aResults.begin();
396 aGeometryName = aResultBody->data()->name();
399 aXao.getGeometry()->setName(aGeometryName);
401 std::set<ResultPtr> allResultsCashed; // cash to speed up searching in all results selected
403 // iterate all documents used
404 if (aDocuments.empty())
405 aDocuments.push_back(document());
406 std::list<DocumentPtr>::iterator aDoc = aDocuments.begin();
407 for(; aDoc != aDocuments.end(); aDoc++) {
409 int aGroupCount = (*aDoc)->size(ModelAPI_ResultGroup::group());
410 for (int aGroupIndex = 0; aGroupIndex < aGroupCount; ++aGroupIndex) {
411 ResultGroupPtr aResultGroup = std::dynamic_pointer_cast<ModelAPI_ResultGroup>(
412 (*aDoc)->object(ModelAPI_ResultGroup::group(), aGroupIndex));
413 if (!aResultGroup.get() || !aResultGroup->shape().get())
416 FeaturePtr aGroupFeature = (*aDoc)->feature(aResultGroup);
418 AttributeSelectionListPtr aSelectionList =
419 aGroupFeature->selectionList("group_list");
420 if (!isInResults(aSelectionList, aResults, allResultsCashed))// skip group not used in result
423 // conversion of dimension
424 std::string aSelectionType = aSelectionList->selectionType();
425 GeomAPI_Shape::ShapeType aSelType = GeomAPI_Shape::shapeTypeByStr(aSelectionType);
426 std::string aDimensionString =
427 ExchangePlugin_Tools::selectionType2xaoDimension(aSelectionType);
428 XAO::Dimension aGroupDimension = XAO::XaoUtils::stringToDimension(aDimensionString);
430 XAO::Group* aXaoGroup = aXao.addGroup(aGroupDimension,
431 aResultGroup->data()->name());
434 GeomAPI_ShapeExplorer aGroupResExplorer(aResultGroup->shape(), aSelType);
435 for(; aGroupResExplorer.more(); aGroupResExplorer.next()) {
436 GeomShapePtr aGroupShape = aGroupResExplorer.current();
437 if (aDocTrsf.find(*aDoc) != aDocTrsf.end())
438 aGroupShape->move(aDocTrsf[*aDoc]);
439 int aReferenceID = GeomAlgoAPI_CompoundBuilder::id(aShape, aGroupShape);
440 if (aReferenceID == 0) // selected value does not found in the exported shape
442 std::string aReferenceString = XAO::XaoUtils::intToString(aReferenceID);
444 aXao.getGeometry()->getElementIndexByReference(aGroupDimension, aReferenceString);
445 aXaoGroup->add(anElementID);
447 } catch (XAO::XAO_Exception& e) {
449 std::string msg = "An error occurred while exporting group " +
450 aResultGroup->data()->name();
454 msg += "=> skipping this group from XAO export.";
455 Events_InfoMessage("ExportFeature", msg, this).send();
456 aXao.removeGroup(aXaoGroup);
462 int aFieldCount = (*aDoc)->size(ModelAPI_ResultField::group());
463 for (int aFieldIndex = 0; aFieldIndex < aFieldCount; ++aFieldIndex) {
464 ResultFieldPtr aResultField = std::dynamic_pointer_cast<ModelAPI_ResultField>(
465 (*aDoc)->object(ModelAPI_ResultField::group(), aFieldIndex));
467 FeaturePtr aFieldFeature = (*aDoc)->feature(aResultField);
469 AttributeSelectionListPtr aSelectionList =
470 aFieldFeature->selectionList("selected");
471 std::string aSelectionType = aSelectionList->selectionType();
472 bool isWholePart = aSelectionType == "part";
473 // skip field not used in results
474 if (!isWholePart && !isInResults(aSelectionList, aResults, allResultsCashed))
477 // conversion of dimension
478 std::string aDimensionString =
479 ExchangePlugin_Tools::selectionType2xaoDimension(aSelectionType);
480 XAO::Dimension aFieldDimension = XAO::XaoUtils::stringToDimension(aDimensionString);
481 // get tables and their type
482 std::shared_ptr<ModelAPI_AttributeTables> aTables = aFieldFeature->tables("values");
483 std::string aTypeString = ExchangePlugin_Tools::valuesType2xaoType(aTables->type());
484 XAO::Type aFieldType = XAO::XaoUtils::stringToFieldType(aTypeString);
486 XAO::Field* aXaoField = aXao.addField(aFieldType, aFieldDimension, aTables->columns(),
487 aResultField->data()->name());
491 // set components names
492 AttributeStringArrayPtr aComponents = aFieldFeature->stringArray("components_names");
493 for(int aComp = 0; aComp < aComponents->size(); aComp++) {
494 std::string aName = aComponents->value(aComp);
495 aXaoField->setComponentName(aComp, aName);
498 AttributeIntArrayPtr aStamps = aFieldFeature->intArray("stamps");
499 for (int aStepIndex = 0; aStepIndex < aTables->tables(); aStepIndex++) {
500 XAO::Step* aStep = aXaoField->addNewStep(aStepIndex + 1);
501 aStep->setStep(aStepIndex + 1);
502 int aStampIndex = aStamps->value(aStepIndex);
503 aStep->setStamp(aStampIndex);
504 int aNumElements = isWholePart ? aXaoField->countElements() : aTables->rows();
505 int aNumComps = aTables->columns();
506 std::set<int> aFilledIDs; // to fill the rest by defaults
507 // omit default values first row
508 for(int aRow = isWholePart ? 0 : 1; aRow < aNumElements; aRow++) {
509 for(int aCol = 0; aCol < aNumComps; aCol++) {
512 // element index actually is the ID of the selection
513 AttributeSelectionPtr aSel = aSelectionList->value(aRow - 1);
514 int aReferenceID = GeomAlgoAPI_CompoundBuilder::id(aShape, aSel->value());
515 if (aReferenceID == 0) // selected value does not found in the exported shape
518 std::string aReferenceString = XAO::XaoUtils::intToString(aReferenceID);
519 anElementID = aXao.getGeometry()->
520 getElementIndexByReference(aFieldDimension, aReferenceString);
523 ModelAPI_AttributeTables::Value aVal = aTables->value(
524 isWholePart ? 0 : aRow, aCol, aStepIndex);
525 std::string aStrVal = valToString(aVal, aTables->type());
526 aStep->setStringValue(isWholePart ? aRow : anElementID, aCol, aStrVal);
527 aFilledIDs.insert(anElementID);
530 if (!isWholePart) { // fill the rest values by default ones
531 XAO::GeometricElementList::iterator allElem =
532 aXao.getGeometry()->begin(aFieldDimension);
533 for(; allElem != aXao.getGeometry()->end(aFieldDimension); allElem++) {
534 if (aFilledIDs.find(allElem->first) != aFilledIDs.end())
536 for(int aCol = 0; aCol < aNumComps; aCol++) {
538 ModelAPI_AttributeTables::Value aVal = aTables->value(0, aCol, aStepIndex);
539 std::string aStrVal = valToString(aVal, aTables->type());
540 aStep->setStringValue(allElem->first, aCol, aStrVal);
545 } catch (XAO::XAO_Exception& e) {
547 std::string msg = "An error occurred while exporting field " +
548 aResultField->data()->name();
552 msg += "=> skipping this field from XAO export.";
553 Events_InfoMessage("ExportFeature", msg, this).send();
554 aXao.removeField(aXaoField);
561 XAOExport(theFileName, &aXao, anError);
563 if (!anError.empty()) {
564 setError("An error occurred while exporting " + theFileName + ": " + anError);
569 } catch (XAO::XAO_Exception& e) {
570 std::string anError = e.what();
571 setError("An error occurred while exporting " + theFileName + ": " + anError);
577 bool ExchangePlugin_ExportFeature::isMacro() const
579 if (!data().get() || !data()->isValid())
581 ExchangePlugin_ExportFeature* aThis = ((ExchangePlugin_ExportFeature*)(this));
582 AttributeStringPtr aFormatAttr = aThis->string(FILE_FORMAT_ID());
583 std::string aFormat(aFormatAttr.get() ? aFormatAttr->value() : "");
585 if (aFormat.empty()) { // get default format for the extension
586 AttributeStringPtr aFilePathAttr = aThis->string(FILE_PATH_ID());
587 std::string aFilePath = aFilePathAttr->value();
588 if (!aFilePath.empty()) {
589 std::string anExtension = GeomAlgoAPI_Tools::File_Tools::extension(aFilePath);
590 aFormat = anExtension;
594 if (aFormat == "XAO") { // on export to GEOM the selection attribute is filled - this is
595 // an exceptional case where export to XAO feature must be kept
596 AttributeSelectionListPtr aList = aThis->selectionList(XAO_SELECTION_LIST_ID());
597 return !aList->isInitialized() || aList->size() == 0;