1 // Copyright (C) 2014-2019 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 AttributeSelectionListPtr aSelList = selectionList(SELECTION_LIST_ID());
114 int aSelListSize = aSelList->size();
115 AttributeSelectionListPtr aXAOSelList = selectionList(XAO_SELECTION_LIST_ID());
116 if (aSelListSize > 0 && aXAOSelList->size() == 0) {
117 for (int i = 0; i < aSelListSize; ++i) {
118 AttributeSelectionPtr aSelection = aSelList->value(i);
119 aXAOSelList->append(aSelection->context(), aSelection->value());
121 aXAOSelList->setSelectionType(aSelList->selectionType());
127 void ExchangePlugin_ExportFeature::attributeChanged(const std::string& theID)
129 if (theID == XAO_FILE_PATH_ID()) {
130 string(ExchangePlugin_ExportFeature::FILE_PATH_ID())->setValue(
131 string(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID())->value());
136 * Computes or recomputes the results
138 void ExchangePlugin_ExportFeature::execute()
140 AttributeStringPtr aFormatAttr =
141 this->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID());
142 std::string aFormat = aFormatAttr->value();
144 AttributeStringPtr aFilePathAttr =
145 this->string(ExchangePlugin_ExportFeature::FILE_PATH_ID());
146 std::string aFilePath = aFilePathAttr->value();
147 if (aFilePath.empty())
150 exportFile(aFilePath, aFormat);
153 void ExchangePlugin_ExportFeature::exportFile(const std::string& theFileName,
154 const std::string& theFormat)
156 std::string aFormatName = theFormat;
158 if (aFormatName.empty()) { // get default format for the extension
160 std::string anExtension = GeomAlgoAPI_Tools::File_Tools::extension(theFileName);
161 if (anExtension == "BREP" || anExtension == "BRP") {
162 aFormatName = "BREP";
163 } else if (anExtension == "STEP" || anExtension == "STP") {
164 aFormatName = "STEP";
165 } else if (anExtension == "IGES" || anExtension == "IGS") {
166 aFormatName = "IGES-5.1";
168 aFormatName = anExtension;
172 if (aFormatName == "XAO") {
173 exportXAO(theFileName);
177 // make shape for export from selected shapes
178 AttributeSelectionListPtr aSelectionListAttr =
179 this->selectionList(ExchangePlugin_ExportFeature::SELECTION_LIST_ID());
180 std::list<GeomShapePtr> aShapes;
181 for (int i = 0, aSize = aSelectionListAttr->size(); i < aSize; ++i) {
182 AttributeSelectionPtr anAttrSelection = aSelectionListAttr->value(i);
183 std::shared_ptr<GeomAPI_Shape> aCurShape = anAttrSelection->value();
184 if (aCurShape.get() == NULL)
185 aCurShape = anAttrSelection->context()->shape();
186 if (aCurShape.get() != NULL)
187 aShapes.push_back(aCurShape);
190 // Store compound if we have more than one shape.
191 std::shared_ptr<GeomAPI_Shape> aShape =
192 aShapes.size() == 1 ? aShapes.front() : GeomAlgoAPI_CompoundBuilder::compound(aShapes);
194 // Perform the export
196 bool aResult = false;
197 if (aFormatName == "BREP") {
198 aResult = BREPExport(theFileName, aFormatName, aShape, anError);
199 } else if (aFormatName == "STEP") {
200 aResult = STEPExport(theFileName, aFormatName, aShape, anError);
201 } else if (aFormatName.substr(0, 4) == "IGES") {
202 aResult = IGESExport(theFileName, aFormatName, aShape, anError);
204 anError = "Unsupported format: " + aFormatName;
207 if (!anError.empty()) {
208 setError("An error occurred while exporting " + theFileName + ": " + anError);
213 /// Returns XAO string by the value from the table
214 static std::string valToString(const ModelAPI_AttributeTables::Value& theVal,
215 const ModelAPI_AttributeTables::ValueType& theType) {
216 std::ostringstream aStr; // the resulting string value
218 case ModelAPI_AttributeTables::BOOLEAN:
219 aStr<<(theVal.myBool ? "true" : "false");
221 case ModelAPI_AttributeTables::INTEGER:
224 case ModelAPI_AttributeTables::DOUBLE:
225 aStr<<theVal.myDouble;
227 case ModelAPI_AttributeTables::STRING:
234 /// Returns true if something in selection is presented in the results list
235 static bool isInResults(AttributeSelectionListPtr theSelection,
236 const std::list<ResultPtr>& theResults,
237 std::set<ResultPtr>& theCashedResults)
239 // collect all results into a cashed set
240 if (theCashedResults.empty()) {
241 std::list<ResultPtr> aResults;
242 std::list<ResultPtr>::const_iterator aRes = theResults.cbegin();
243 for(; aRes != theResults.cend(); aRes++) {
244 if (theCashedResults.count(*aRes))
247 theCashedResults.insert(*aRes);
248 if ((*aRes)->groupName() == ModelAPI_ResultBody::group()) {
249 ResultBodyPtr aResBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aRes);
250 std::list<ResultPtr> aResults;
251 ModelAPI_Tools::allSubs(aResBody, aResults, false);
252 for(std::list<ResultPtr>::iterator aR = aResults.begin(); aR != aResults.end(); aR++) {
253 theCashedResults.insert(std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aR));
255 } else if ((*aRes)->groupName() == ModelAPI_ResultPart::group()) { // all results of the part
256 ResultPartPtr aResPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aRes);
257 DocumentPtr aPartDoc = aResPart->partDoc();
258 if (!aPartDoc.get() || !aPartDoc->isOpened()) { // document is not accessible
261 int aBodyCount = aPartDoc->size(ModelAPI_ResultBody::group());
262 for (int aBodyIndex = 0; aBodyIndex < aBodyCount; ++aBodyIndex) {
263 ResultBodyPtr aResBody =
264 std::dynamic_pointer_cast<ModelAPI_ResultBody>(
265 aPartDoc->object(ModelAPI_ResultBody::group(), aBodyIndex));
266 if (aResBody.get()) {
267 theCashedResults.insert(aResBody);
268 std::list<ResultPtr> aResults;
269 ModelAPI_Tools::allSubs(aResBody, aResults, false);
270 for(std::list<ResultPtr>::iterator aR = aResults.begin(); aR != aResults.end(); aR++) {
271 theCashedResults.insert(std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aR));
278 // if context is in results, return true
279 for(int a = 0; a < theSelection->size(); a++) {
280 AttributeSelectionPtr anAttr = theSelection->value(a);
281 ResultPtr aContext = anAttr->context();
282 // check is it group selected for groups BOP
283 if (aContext.get() && aContext->groupName() == ModelAPI_ResultGroup::group()) {
284 // it is impossible by used results check which result is used in this group result,
285 // so check the results shapes is it in results of this document or not
286 FeaturePtr aSelFeature =
287 std::dynamic_pointer_cast<ModelAPI_Feature>(theSelection->owner());
288 if (!aSelFeature.get() || aSelFeature->results().empty())
290 GeomShapePtr aGroupResShape = aSelFeature->firstResult()->shape();
292 std::set<ResultPtr>::iterator allResultsIter = theCashedResults.begin();
293 for(; allResultsIter != theCashedResults.end(); allResultsIter++) {
294 GeomShapePtr aResultShape = (*allResultsIter)->shape();
296 GeomAPI_Shape::ShapeType aType =
297 GeomAPI_Shape::shapeTypeByStr(theSelection->selectionType());
298 GeomAPI_ShapeExplorer aGroupResExp(aGroupResShape, aType);
299 for(; aGroupResExp.more(); aGroupResExp.next()) {
300 if (aResultShape->isSubShape(aGroupResExp.current(), false))
301 return true; // at least one shape of the group is in the used results
305 ResultBodyPtr aSelected = std::dynamic_pointer_cast<ModelAPI_ResultBody>(anAttr->context());
306 if (!aSelected.get()) { // try to get selected feature and all its results
307 FeaturePtr aContextFeature = anAttr->contextFeature();
308 if (aContextFeature.get() && !aContextFeature->results().empty()) {
309 const std::list<ResultPtr>& allResluts = aContextFeature->results();
310 std::list<ResultPtr>::const_iterator aResIter = allResluts.cbegin();
311 for(; aResIter != allResluts.cend(); aResIter++) {
312 if (aResIter->get() && theCashedResults.count(*aResIter))
316 } else if (aSelected.get() && theCashedResults.count(aSelected))
322 void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName)
331 std::string anAuthor = string(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID())->value();
332 aXao.setAuthor(anAuthor);
334 // make shape for export from all results
335 std::list<GeomShapePtr> aShapes;
336 std::list<ResultPtr> aResults;
337 std::list<DocumentPtr> aDocuments; /// documents of Parts selected and used in export
338 std::map<DocumentPtr, GeomTrsfPtr> aDocTrsf; /// translation of the part
340 AttributeSelectionListPtr aSelection = selectionList(XAO_SELECTION_LIST_ID());
341 bool aIsSelection = aSelection->isInitialized() && aSelection->size() > 0;
342 if (aIsSelection) { // a mode for export to geom result by result
343 for(int a = 0; a < aSelection->size(); a++) {
344 AttributeSelectionPtr anAttr = aSelection->value(a);
345 ResultPtr aBodyContext =
346 std::dynamic_pointer_cast<ModelAPI_Result>(anAttr->context());
347 if (aBodyContext.get() && !aBodyContext->isDisabled() && aBodyContext->shape().get()) {
348 aResults.push_back(aBodyContext);
349 GeomShapePtr aShape = anAttr->value();
351 aShape = aBodyContext->shape();
352 aShapes.push_back(aShape);
353 if (aBodyContext->groupName() == ModelAPI_ResultPart::group()) {
354 ResultPartPtr aResPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aBodyContext);
355 DocumentPtr aPartDoc = aResPart->partDoc();
356 if (!aPartDoc.get() || !aPartDoc->isOpened()) { // document is not accessible
357 std::string msg = "Can not export XAO for not loaded part";
358 Events_InfoMessage("ExportFeature", msg, this).send();
361 aDocuments.push_back(aPartDoc);
362 aDocTrsf[aPartDoc] = aResPart->summaryTrsf();
368 int aBodyCount = document()->size(ModelAPI_ResultBody::group());
369 for (int aBodyIndex = 0; aBodyIndex < aBodyCount; ++aBodyIndex) {
370 ResultBodyPtr aResultBody =
371 std::dynamic_pointer_cast<ModelAPI_ResultBody>(
372 document()->object(ModelAPI_ResultBody::group(), aBodyIndex));
373 if (!aResultBody.get())
375 aShapes.push_back(aResultBody->shape());
376 aResults.push_back(aResultBody);
379 if (aShapes.empty()) {
380 setError("No shapes to export");
385 GeomShapePtr aShape = (aShapes.size() == 1)
387 : GeomAlgoAPI_CompoundBuilder::compound(aShapes);
389 SetShapeToXAO(aShape, &aXao, anError);
391 if (!anError.empty()) {
392 setError("An error occurred while exporting " + theFileName + ": " + anError);
397 std::string aGeometryName = string(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID())->value();
398 if (aGeometryName.empty() && aResults.size() == 1) {
399 // get the name from the first result
400 ResultPtr aResultBody = *aResults.begin();
401 aGeometryName = aResultBody->data()->name();
404 aXao.getGeometry()->setName(aGeometryName);
406 std::set<ResultPtr> allResultsCashed; // cash to speed up searching in all results selected
408 // iterate all documents used
409 if (aDocuments.empty())
410 aDocuments.push_back(document());
411 std::list<DocumentPtr>::iterator aDoc = aDocuments.begin();
412 for(; aDoc != aDocuments.end(); aDoc++) {
414 int aGroupCount = (*aDoc)->size(ModelAPI_ResultGroup::group());
415 for (int aGroupIndex = 0; aGroupIndex < aGroupCount; ++aGroupIndex) {
416 ResultGroupPtr aResultGroup = std::dynamic_pointer_cast<ModelAPI_ResultGroup>(
417 (*aDoc)->object(ModelAPI_ResultGroup::group(), aGroupIndex));
418 if (!aResultGroup.get() || !aResultGroup->shape().get())
421 FeaturePtr aGroupFeature = (*aDoc)->feature(aResultGroup);
423 AttributeSelectionListPtr aSelectionList =
424 aGroupFeature->selectionList("group_list");
425 if (!isInResults(aSelectionList, aResults, allResultsCashed))// skip group not used in result
428 // conversion of dimension
429 std::string aSelectionType = aSelectionList->selectionType();
430 GeomAPI_Shape::ShapeType aSelType = GeomAPI_Shape::shapeTypeByStr(aSelectionType);
431 std::string aDimensionString =
432 ExchangePlugin_Tools::selectionType2xaoDimension(aSelectionType);
433 XAO::Dimension aGroupDimension = XAO::XaoUtils::stringToDimension(aDimensionString);
435 XAO::Group* aXaoGroup = aXao.addGroup(aGroupDimension,
436 aResultGroup->data()->name());
439 GeomAPI_ShapeExplorer aGroupResExplorer(aResultGroup->shape(), aSelType);
440 for(; aGroupResExplorer.more(); aGroupResExplorer.next()) {
441 GeomShapePtr aGroupShape = aGroupResExplorer.current();
442 if (aDocTrsf.find(*aDoc) != aDocTrsf.end())
443 aGroupShape->move(aDocTrsf[*aDoc]);
444 int aReferenceID = GeomAlgoAPI_CompoundBuilder::id(aShape, aGroupShape);
445 if (aReferenceID == 0) // selected value does not found in the exported shape
447 std::string aReferenceString = XAO::XaoUtils::intToString(aReferenceID);
449 aXao.getGeometry()->getElementIndexByReference(aGroupDimension, aReferenceString);
450 aXaoGroup->add(anElementID);
452 } catch (XAO::XAO_Exception& e) {
454 std::string msg = "An error occurred while exporting group " +
455 aResultGroup->data()->name();
459 msg += "=> skipping this group from XAO export.";
460 Events_InfoMessage("ExportFeature", msg, this).send();
461 aXao.removeGroup(aXaoGroup);
467 int aFieldCount = (*aDoc)->size(ModelAPI_ResultField::group());
468 for (int aFieldIndex = 0; aFieldIndex < aFieldCount; ++aFieldIndex) {
469 ResultFieldPtr aResultField = std::dynamic_pointer_cast<ModelAPI_ResultField>(
470 (*aDoc)->object(ModelAPI_ResultField::group(), aFieldIndex));
472 FeaturePtr aFieldFeature = (*aDoc)->feature(aResultField);
474 AttributeSelectionListPtr aSelectionList =
475 aFieldFeature->selectionList("selected");
476 std::string aSelectionType = aSelectionList->selectionType();
477 bool isWholePart = aSelectionType == "part";
478 // skip field not used in results
479 if (!isWholePart && !isInResults(aSelectionList, aResults, allResultsCashed))
482 // conversion of dimension
483 std::string aDimensionString =
484 ExchangePlugin_Tools::selectionType2xaoDimension(aSelectionType);
485 XAO::Dimension aFieldDimension = XAO::XaoUtils::stringToDimension(aDimensionString);
486 // get tables and their type
487 std::shared_ptr<ModelAPI_AttributeTables> aTables = aFieldFeature->tables("values");
488 std::string aTypeString = ExchangePlugin_Tools::valuesType2xaoType(aTables->type());
489 XAO::Type aFieldType = XAO::XaoUtils::stringToFieldType(aTypeString);
491 XAO::Field* aXaoField = aXao.addField(aFieldType, aFieldDimension, aTables->columns(),
492 aResultField->data()->name());
496 // set components names
497 AttributeStringArrayPtr aComponents = aFieldFeature->stringArray("components_names");
498 for(int aComp = 0; aComp < aComponents->size(); aComp++) {
499 std::string aName = aComponents->value(aComp);
500 aXaoField->setComponentName(aComp, aName);
503 AttributeIntArrayPtr aStamps = aFieldFeature->intArray("stamps");
504 for (int aStepIndex = 0; aStepIndex < aTables->tables(); aStepIndex++) {
505 XAO::Step* aStep = aXaoField->addNewStep(aStepIndex + 1);
506 aStep->setStep(aStepIndex + 1);
507 int aStampIndex = aStamps->value(aStepIndex);
508 aStep->setStamp(aStampIndex);
509 int aNumElements = isWholePart ? aXaoField->countElements() : aTables->rows();
510 int aNumComps = aTables->columns();
511 std::set<int> aFilledIDs; // to fill the rest by defaults
512 // omit default values first row
513 for(int aRow = isWholePart ? 0 : 1; aRow < aNumElements; aRow++) {
514 for(int aCol = 0; aCol < aNumComps; aCol++) {
517 // element index actually is the ID of the selection
518 AttributeSelectionPtr aSelection = aSelectionList->value(aRow - 1);
519 int aReferenceID = GeomAlgoAPI_CompoundBuilder::id(aShape, aSelection->value());
520 if (aReferenceID == 0) // selected value does not found in the exported shape
523 std::string aReferenceString = XAO::XaoUtils::intToString(aReferenceID);
524 anElementID = aXao.getGeometry()->
525 getElementIndexByReference(aFieldDimension, aReferenceString);
528 ModelAPI_AttributeTables::Value aVal = aTables->value(
529 isWholePart ? 0 : aRow, aCol, aStepIndex);
530 std::string aStrVal = valToString(aVal, aTables->type());
531 aStep->setStringValue(isWholePart ? aRow : anElementID, aCol, aStrVal);
532 aFilledIDs.insert(anElementID);
535 if (!isWholePart) { // fill the rest values by default ones
536 XAO::GeometricElementList::iterator allElem =
537 aXao.getGeometry()->begin(aFieldDimension);
538 for(; allElem != aXao.getGeometry()->end(aFieldDimension); allElem++) {
539 if (aFilledIDs.find(allElem->first) != aFilledIDs.end())
541 for(int aCol = 0; aCol < aNumComps; aCol++) {
543 ModelAPI_AttributeTables::Value aVal = aTables->value(0, aCol, aStepIndex);
544 std::string aStrVal = valToString(aVal, aTables->type());
545 aStep->setStringValue(allElem->first, aCol, aStrVal);
550 } catch (XAO::XAO_Exception& e) {
552 std::string msg = "An error occurred while exporting field " +
553 aResultField->data()->name();
557 msg += "=> skipping this field from XAO export.";
558 Events_InfoMessage("ExportFeature", msg, this).send();
559 aXao.removeField(aXaoField);
566 XAOExport(theFileName, &aXao, anError);
568 if (!anError.empty()) {
569 setError("An error occurred while exporting " + theFileName + ": " + anError);
574 } catch (XAO::XAO_Exception& e) {
575 std::string anError = e.what();
576 setError("An error occurred while exporting " + theFileName + ": " + anError);
582 bool ExchangePlugin_ExportFeature::isMacro() const
584 if (!data().get() || !data()->isValid())
586 ExchangePlugin_ExportFeature* aThis = ((ExchangePlugin_ExportFeature*)(this));
587 AttributeStringPtr aFormatAttr = aThis->string(FILE_FORMAT_ID());
588 std::string aFormat(aFormatAttr.get() ? aFormatAttr->value() : "");
590 if (aFormat.empty()) { // get default format for the extension
591 AttributeStringPtr aFilePathAttr = aThis->string(FILE_PATH_ID());
592 std::string aFilePath = aFilePathAttr->value();
593 if (!aFilePath.empty()) {
594 std::string anExtension = GeomAlgoAPI_Tools::File_Tools::extension(aFilePath);
595 aFormat = anExtension;
599 if (aFormat == "XAO") { // on export to GEOm the selection attribute is filled - this is
600 // an exceptional case where export to XAO feature must be kept
601 AttributeSelectionListPtr aList = aThis->selectionList(XAO_SELECTION_LIST_ID());
602 return !aList->isInitialized() || aList->size() == 0;