From: jfa Date: Mon, 4 Mar 2024 14:51:02 +0000 (+0000) Subject: Merge branch 'jfa/40620_ExportXAO_separate_BREP' X-Git-Tag: V9_13_0a1~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4c86b629d1bf8daa737f90b64e934c7bd22f6525;hp=661f1f75eb0ca81796e4ef53650d1b6d4feebcc1;p=modules%2Fshaper.git Merge branch 'jfa/40620_ExportXAO_separate_BREP' --- diff --git a/src/ExchangeAPI/ExchangeAPI_Export.cpp b/src/ExchangeAPI/ExchangeAPI_Export.cpp index 6d9193235..cda585a2d 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Export.cpp @@ -41,14 +41,17 @@ ExchangeAPI_Export::ExchangeAPI_Export(const std::shared_ptr& /// Constructor with values for XAO export. ExchangeAPI_Export::ExchangeAPI_Export(const std::shared_ptr& theFeature, - const std::string & theFilePath, - const std::string & theAuthor, - const std::string & theGeometryName) + const std::string & theFilePath, + const std::string & theAuthor, + const std::string & theGeometryName, + const std::string & theShapeFilePath) : ModelHighAPI_Interface(theFeature) { initialize(); fillAttribute("XAO", theFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID())); fillAttribute(theFilePath, theFeature->string(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID())); + fillAttribute(theShapeFilePath, + theFeature->string(ExchangePlugin_ExportFeature::XAO_SHAPE_FILE_PATH_ID())); fillAttribute(theAuthor, theFeature->string(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID())); fillAttribute(theGeometryName, theFeature->string(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID())); @@ -106,20 +109,23 @@ ExchangeAPI_Export::ExchangeAPI_Export(const std::shared_ptr& const std::string & theFilePath, const ModelHighAPI_Selection& theResult, const std::string & theAuthor, - const std::string & theGeometryName) + const std::string & theGeometryName, + const std::string & theShapeFilePath) : ModelHighAPI_Interface(theFeature) { initialize(); fillAttribute("XAO", theFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID())); fillAttribute(theFilePath, theFeature->string(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID())); + fillAttribute(theShapeFilePath, + theFeature->string(ExchangePlugin_ExportFeature::XAO_SHAPE_FILE_PATH_ID())); fillAttribute(theAuthor, theFeature->string(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID())); fillAttribute(theGeometryName, - theFeature->string(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID())); + theFeature->string(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID())); fillAttribute("XAO", theFeature->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID())); std::list aListOfOneSel; aListOfOneSel.push_back(theResult); fillAttribute(aListOfOneSel, - theFeature->selectionList(ExchangePlugin_ExportFeature::XAO_SELECTION_LIST_ID())); + theFeature->selectionList(ExchangePlugin_ExportFeature::XAO_SELECTION_LIST_ID())); execute(); apply(); // finish operation to make sure the export is done on the current state of the history } @@ -301,14 +307,15 @@ ExportPtr exportToFile(const std::shared_ptr & thePart, } ExportPtr exportToXAO(const std::shared_ptr & thePart, - const std::string & theFilePath, - const std::string & theAuthor, - const std::string & theGeometryName) + const std::string & theFilePath, + const std::string & theAuthor, + const std::string & theGeometryName, + const std::string & theShapeFilePath) { apply(); // finish previous operation to make sure all previous operations are done std::shared_ptr aFeature = thePart->addFeature(ExchangePlugin_ExportFeature::ID()); - return ExportPtr(new ExchangeAPI_Export(aFeature, theFilePath, theAuthor, theGeometryName)); + return ExportPtr(new ExchangeAPI_Export(aFeature, theFilePath, theAuthor, theGeometryName, theShapeFilePath)); } ExportPtr exportToSTL(const std::shared_ptr & thePart, @@ -336,13 +343,14 @@ ExportPtr exportToXAO(const std::shared_ptr & thePart, const std::string & theFilePath, const ModelHighAPI_Selection& theSelectedShape, const std::string & /*theAuthor*/, - const std::string & /*theGeometryName*/) + const std::string & /*theGeometryName*/, + const std::string & theShapeFilePath) { apply(); // finish previous operation to make sure all previous operations are done std::shared_ptr aFeature = thePart->addFeature(ExchangePlugin_ExportFeature::ID()); // special internal case when for XAO a selection list is filled - return ExportPtr(new ExchangeAPI_Export(aFeature, theFilePath, theSelectedShape, "XAO")); + return ExportPtr(new ExchangeAPI_Export(aFeature, theFilePath, theSelectedShape, "XAO", "", theShapeFilePath)); } PyObject* exportToXAOMem(const std::shared_ptr & thePart, diff --git a/src/ExchangeAPI/ExchangeAPI_Export.h b/src/ExchangeAPI/ExchangeAPI_Export.h index 4fc9be602..4500c95db 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.h +++ b/src/ExchangeAPI/ExchangeAPI_Export.h @@ -54,7 +54,8 @@ public: explicit ExchangeAPI_Export(const std::shared_ptr& theFeature, const std::string & theFilePath, const std::string & theAuthor = std::string(), - const std::string & theGeometryName = std::string()); + const std::string & theGeometryName = std::string(), + const std::string & theShapeFilePath = std::string()); /// Constructor with values for STL of selected result export. EXCHANGEAPI_EXPORT @@ -72,7 +73,8 @@ public: const std::string & theFilePath, const ModelHighAPI_Selection& theResult, const std::string & theAuthor, - const std::string & theGeometryName = std::string()); + const std::string & theGeometryName = std::string(), + const std::string & theShapeFilePath = std::string()); /// Constructor with values for XAO of selected result export to memory buffer. EXCHANGEAPI_EXPORT @@ -92,7 +94,7 @@ public: EXCHANGEAPI_EXPORT virtual ~ExchangeAPI_Export(); - INTERFACE_16(ExchangePlugin_ExportFeature::ID(), + INTERFACE_17(ExchangePlugin_ExportFeature::ID(), exportType, ExchangePlugin_ExportFeature::EXPORT_TYPE_ID(), ModelAPI_AttributeString, /** ExportType */, filePath, ExchangePlugin_ExportFeature::FILE_PATH_ID(), @@ -126,7 +128,9 @@ public: ExchangePlugin_ExportFeature::STL_DEFLECTION_TYPE_RELATIVE(), ModelAPI_AttributeString, /** Type of the defelection */, memoryBuff, ExchangePlugin_ExportFeature::MEMORY_BUFFER_ID(), - ModelAPI_AttributeString, /** Bytes*/) + ModelAPI_AttributeString, /** Bytes*/, + xaoShapeFilePath, ExchangePlugin_ExportFeature::XAO_SHAPE_FILE_PATH_ID(), + ModelAPI_AttributeString, /** xao shape file path */) /// Dump wrapped feature EXCHANGEAPI_EXPORT @@ -150,9 +154,10 @@ ExportPtr exportToFile(const std::shared_ptr & thePart, */ EXCHANGEAPI_EXPORT ExportPtr exportToXAO(const std::shared_ptr & thePart, - const std::string & theFilePath, - const std::string & theAuthor = std::string(), - const std::string & theGeometryName = std::string()); + const std::string & theFilePath, + const std::string & theAuthor = std::string(), + const std::string & theGeometryName = std::string(), + const std::string & theShapeFilePath = std::string()); /**\ingroup CPPHighAPI * \brief Exports to STL file the result of the current document @@ -174,7 +179,8 @@ ExportPtr exportToXAO(const std::shared_ptr & thePart, const std::string & theFilePath, const ModelHighAPI_Selection& theSelectedShape, const std::string & theAuthor = std::string(), - const std::string & theGeometryName = std::string()); + const std::string & theGeometryName = std::string(), + const std::string & theShapeFilePath = std::string()); /**\ingroup CPPHighAPI * \brief Exports to XAO format buffer the selected result with groups parts related to it only. diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp index 3924fb733..b536f54ef 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp @@ -123,6 +123,11 @@ void ExchangePlugin_ExportFeature::initAttributes() data()->addAttribute(ExchangePlugin_ExportFeature::MEMORY_BUFFER_ID(), ModelAPI_AttributeString::typeId()); + data()->addAttribute(ExchangePlugin_ExportFeature::XAO_SHAPE_FILE_PATH_ID(), + ModelAPI_AttributeString::typeId()); + data()->addAttribute(ExchangePlugin_ExportFeature::XAO_SHAPE_FILE_SEPARATE_ID(), + ModelAPI_AttributeBoolean::typeId()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), @@ -135,6 +140,10 @@ void ExchangePlugin_ExportFeature::initAttributes() ExchangePlugin_ExportFeature::XAO_SELECTION_LIST_ID()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ExchangePlugin_ExportFeature::MEMORY_BUFFER_ID()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), + ExchangePlugin_ExportFeature::XAO_SHAPE_FILE_PATH_ID()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), + ExchangePlugin_ExportFeature::XAO_SHAPE_FILE_SEPARATE_ID()); // to support previous version of document, move the selection list // if the type of export operation is XAO @@ -605,7 +614,19 @@ void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName, string(ExchangePlugin_ExportFeature::MEMORY_BUFFER_ID())->setValue(XAOExportMem(&aXao, anError)); } else { - XAOExport(theFileName, &aXao, anError); + std::string aShapeFile (""); + AttributeBooleanPtr aShapeSeparateAttr = boolean(XAO_SHAPE_FILE_SEPARATE_ID()); + if (aShapeSeparateAttr->isInitialized() && + aShapeSeparateAttr->value() == true) { + aShapeFile = theFileName + ".brep"; + } + else { + AttributeStringPtr aShapeFileAttr = string(XAO_SHAPE_FILE_PATH_ID()); + if (aShapeFileAttr->isInitialized()) + aShapeFile = aShapeFileAttr->value(); + } + + XAOExport(theFileName, &aXao, anError, aShapeFile); } if (!anError.empty()) { diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h index a3f6fb651..295aa7618 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h @@ -150,6 +150,19 @@ public: static const std::string MY_XAO_GEOMETRY_NAME_ID("xao_geometry_name"); return MY_XAO_GEOMETRY_NAME_ID; } + /// attribute name of xao shape file path + inline static const std::string& XAO_SHAPE_FILE_PATH_ID() + { + static const std::string MY_XAO_SHAPE_FILE_PATH_ID("xao_shape_file_path"); + return MY_XAO_SHAPE_FILE_PATH_ID; + } + /// attribute flag to export shape in a separate file during xao export, + /// name of shape file will be xao_file_path + .brep + inline static const std::string& XAO_SHAPE_FILE_SEPARATE_ID() + { + static const std::string MY_XAO_SHAPE_FILE_SEPARATE_ID("xao_shape_file_separate"); + return MY_XAO_SHAPE_FILE_SEPARATE_ID; + } /// attribute string memory buffer inline static const std::string& MEMORY_BUFFER_ID() { diff --git a/src/ExchangePlugin/ExchangePlugin_msg_fr.ts b/src/ExchangePlugin/ExchangePlugin_msg_fr.ts index cd29c1b85..45b2343bf 100644 --- a/src/ExchangePlugin/ExchangePlugin_msg_fr.ts +++ b/src/ExchangePlugin/ExchangePlugin_msg_fr.ts @@ -223,6 +223,13 @@ Veuillez saisir le nom de la géométrie + + Export:xao_shape_file_separate + + Export shape in a separate file + Exporter la forme dans un fichier séparé + + Export:stl_absolute diff --git a/src/ExchangePlugin/Test/TestExportToXAO_SeparateShapeFile.py b/src/ExchangePlugin/Test/TestExportToXAO_SeparateShapeFile.py new file mode 100644 index 000000000..34a3f4271 --- /dev/null +++ b/src/ExchangePlugin/Test/TestExportToXAO_SeparateShapeFile.py @@ -0,0 +1,169 @@ +# Copyright (C) 2018-2024 CEA, EDF +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +from salome.shaper import model + +from GeomAPI import * + +import tempfile +import os +import math + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() + +Cyl_1 = model.addCylinder(Part_1_doc, 7, 13) +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) + +Group_1 = model.addGroup(Part_1_doc, "Faces", [model.selection("FACE", "Box_1_1/Top")]) + +Field_1 = model.addField(Part_1_doc, 1, "STRING", 1, ["Comp 1"], [model.selection("SOLID", "Box_1_1")]) +Field_1.addStep(0, 0, [[""], ["box"]]) + +with tempfile.TemporaryDirectory() as tmpdirname: + # Export entire Part + tmp_file1 = os.path.join(tmpdirname, "Part.xao") + tmp_file2 = os.path.join(tmpdirname, "Part_shape.brep") + + Export_1 = model.exportToXAO(Part_1_doc, tmp_file1, "", "", tmp_file2) + # due to the issue 2530, the export feature is removed after execution, so, + # if export was performed correctly, the feature must become invalid + #assert(Export_1.feature().error() == "") + assert(not Export_1.feature().data().isValid()) + assert(os.path.isfile(tmp_file1)) + assert(os.path.isfile(tmp_file2)) + + # Add two fields and one group to the Box_1 + Field_2 = model.addField(Part_1_doc, 1, "BOOLEAN", 1, ["Comp 1"], [model.selection("FACE", "Box_1_1/Front")]) + Field_2.addStep(0, 0, [[False], [True]]) + + Field_3_objects = [model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]")] + Field_3 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_3_objects) + Field_3.addStep(0, 0, [[0], [1], [0], [0], [0]]) + + Group_2 = model.addGroup(Part_1_doc, "Edges", [model.selection("EDGE", "[Box_1_1/Top][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Top][Box_1_1/Right]")]) + + tmp_file3 = os.path.join(tmpdirname, "Box.xao") + tmp_file4 = os.path.join(tmpdirname, "Box_shape.brep") + + Export_2 = model.exportToXAO(Part_1_doc, tmp_file3, model.selection("SOLID", "Box_1_1"), + "", "", tmp_file4) + assert(Export_2.feature().error() == "") + assert(os.path.isfile(tmp_file3)) + assert(os.path.isfile(tmp_file4)) + + model.end() + + # Try to import the exported data + model.begin() + partSet = model.moduleDocument() + Part_1 = model.addPart(partSet) + Part_1_doc = Part_1.document() + + Import_1 = model.addImport(Part_1_doc, tmp_file1) + model.do() + assert(Import_1.feature().error() == "") + + model.testNbResults(Import_1, 1) + model.testNbSubResults(Import_1, [2]) + model.testNbSubShapes(Import_1, GeomAPI_Shape.SOLID, [2]) + model.testNbSubShapes(Import_1, GeomAPI_Shape.FACE, [9]) + model.testNbSubShapes(Import_1, GeomAPI_Shape.EDGE, [30]) + model.testNbSubShapes(Import_1, GeomAPI_Shape.VERTEX, [60]) + model.testResultsVolumes(Import_1, [3001.1945203]) + model.testResultsAreas(Import_1, [1479.645943]) + + assert(Import_1.name() == "Part") + assert(Import_1.result().name() == "Part_1") + assert(Import_1.subFeature(0).name() == "Group_1") + assert(Import_1.subFeature(1).name() == "Field_1") + assert(Import_1.subFeature(0).result().name() == "Group_1") + assert(Import_1.subFeature(1).result().name() == "Field_1") + + # check group + assert(Part_1_doc.size("Groups") == 1) + res1 = model.objectToResult(Part_1_doc.object("Groups", 0)) + assert(res1 is not None) + res1It = GeomAPI_ShapeExplorer(res1.shape(), GeomAPI_Shape.FACE) + assert(res1It.more()) + shape1 = res1It.current() + res1It.next() + assert(not res1It.more()) + p1 = res1.shape().middlePoint() + aTol = 1.e-7 + assert(math.fabs(p1.x() - 5) <= aTol and math.fabs(p1.y() - 5) <= aTol and math.fabs(p1.z() - 10) <= aTol), "({}, {}, {}) != ({}, {}, {})".format(p1.x(), p1.y(), p1.z(), 5, 5, 10) + + Import_2 = model.addImport(Part_1_doc, tmp_file3) + model.do() + assert(Import_2.feature().error() == "") + + model.testNbResults(Import_2, 1) + model.testNbSubResults(Import_2, [0]) + model.testNbSubShapes(Import_2, GeomAPI_Shape.SOLID, [1]) + model.testNbSubShapes(Import_2, GeomAPI_Shape.FACE, [6]) + model.testNbSubShapes(Import_2, GeomAPI_Shape.EDGE, [24]) + model.testNbSubShapes(Import_2, GeomAPI_Shape.VERTEX, [48]) + model.testResultsVolumes(Import_2, [1000]) + model.testResultsAreas(Import_2, [600]) + + assert(Import_2.name() == "Box_1_1") + assert(Import_2.result().name() == "Box_1_1_1") + assert(Import_2.subFeature(0).name() == "Group_1") + assert(Import_2.subFeature(1).name() == "Group_2") + assert(Import_2.subFeature(2).name() == "Field_1") + assert(Import_2.subFeature(3).name() == "Field_2") + assert(Import_2.subFeature(4).name() == "Field_3") + assert(Import_2.subFeature(0).result().name() == "Group_1") + assert(Import_2.subFeature(1).result().name() == "Group_2") + assert(Import_2.subFeature(2).result().name() == "Field_1") + assert(Import_2.subFeature(3).result().name() == "Field_2") + assert(Import_2.subFeature(4).result().name() == "Field_3") + + # check groups + assert(Part_1_doc.size("Groups") == 3) + + res1 = model.objectToResult(Part_1_doc.object("Groups", 1)) + assert(res1 is not None) + res1It = GeomAPI_ShapeExplorer(res1.shape(), GeomAPI_Shape.FACE) + assert(res1It.more()) + shape1 = res1It.current() + res1It.next() + assert(not res1It.more()) + p1 = res1.shape().middlePoint() + aTol = 1.e-7 + assert(math.fabs(p1.x() - 5) <= aTol and math.fabs(p1.y() - 5) <= aTol and math.fabs(p1.z() - 10) <= aTol), "({}, {}, {}) != ({}, {}, {})".format(p1.x(), p1.y(), p1.z(), 5, 5, 10) + + res2 = model.objectToResult(Part_1_doc.object("Groups", 2)) + assert(res2 is not None) + res2It = GeomAPI_ShapeExplorer(res2.shape(), GeomAPI_Shape.EDGE) + assert(res2It.more()) + edge1 = res2It.current() + res2It.next() + edge2 = res2It.current() + res2It.next() + assert(not res2It.more()) + p2 = res2.shape().middlePoint() + aTol = 1.e-7 + assert(math.fabs(p1.x() - 5) <= aTol and math.fabs(p1.y() - 5) <= aTol and math.fabs(p1.z() - 10) <= aTol), "({}, {}, {}) != ({}, {}, {})".format(p1.x(), p1.y(), p1.z(), 5, 5, 10) + + pass + +model.end() diff --git a/src/ExchangePlugin/Test/tests.set b/src/ExchangePlugin/Test/tests.set index aae491066..236656414 100755 --- a/src/ExchangePlugin/Test/tests.set +++ b/src/ExchangePlugin/Test/tests.set @@ -23,6 +23,7 @@ SET(TEST_NAMES Test2290.py Test2459.py Test18710.py + TestExportToXAO_SeparateShapeFile.py TestExportToXAOWithFields.py TestExportToXAOWithGroupNotUpdated.py TestExport_FiniteValidator.py diff --git a/src/ExchangePlugin/doc/TUI_exportFeature.rst b/src/ExchangePlugin/doc/TUI_exportFeature.rst index 4ef25d686..6a76f3cad 100644 --- a/src/ExchangePlugin/doc/TUI_exportFeature.rst +++ b/src/ExchangePlugin/doc/TUI_exportFeature.rst @@ -10,6 +10,19 @@ Export File :download:`Download this script ` + + .. _tui_export_file_XAO: + +Export XAO File +=============== + +.. literalinclude:: examples/exportXAO.py + :linenos: + :language: python + +:download:`Download this script ` + + .. _tui_export_file_STL: Export STL File @@ -20,5 +33,3 @@ Export STL File :language: python :download:`Download this script ` - - diff --git a/src/ExchangePlugin/doc/examples/export.py b/src/ExchangePlugin/doc/examples/export.py index 2a807f263..1f9b7c2b5 100644 --- a/src/ExchangePlugin/doc/examples/export.py +++ b/src/ExchangePlugin/doc/examples/export.py @@ -9,9 +9,5 @@ Part_1_doc = Part_1.document() Box_1 = model.addBox(Part_1_doc, 10, 10, 10) Export_1 = model.exportToFile(Part_1_doc, file_path, [model.selection("SOLID", "Box_1_1")]) - -file_xao = os.path.join(os.getenv("DATA_DIR"), "test.xao") -Export_2 = model.exportToXAO(Part_1_doc, file_xao, - model.selection("SOLID", "Box_1_1"), "author", "box") model.do() model.end() diff --git a/src/ExchangePlugin/doc/examples/exportXAO.py b/src/ExchangePlugin/doc/examples/exportXAO.py new file mode 100644 index 000000000..757956cf8 --- /dev/null +++ b/src/ExchangePlugin/doc/examples/exportXAO.py @@ -0,0 +1,20 @@ +from salome.shaper import model +import os + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) + +file_xao = os.path.join(os.getenv("DATA_DIR"), "test.xao") +Export_1 = model.exportToXAO(Part_1_doc, file_xao, + model.selection("SOLID", "Box_1_1"), "author", "box") + +file_xao = os.path.join(os.getenv("DATA_DIR"), "test1.xao") +file_brep = os.path.join(os.getenv("DATA_DIR"), "test1_shape.brep") +Export_2 = model.exportToXAO(Part_1_doc, file_xao, + model.selection("SOLID", "Box_1_1"), "author", "box", + file_brep) +model.do() +model.end() diff --git a/src/ExchangePlugin/doc/exportFeature.rst b/src/ExchangePlugin/doc/exportFeature.rst index 072c9495a..e8f88c2d3 100644 --- a/src/ExchangePlugin/doc/exportFeature.rst +++ b/src/ExchangePlugin/doc/exportFeature.rst @@ -95,8 +95,6 @@ In case of first choice the format of exported file will be defined according to Selection list in the property panel contains a list of exported objects which can be selected in a viewer or object browser. -*Note*: For XAO format, selection list is not available, the whole part is exported. - **Apply** button exports the file. **Cancel** button cancels the operation. @@ -109,15 +107,48 @@ Selection list in the property panel contains a list of exported objects which c :param string: The file name :param list: A list of exporting objects +Result +"""""" + +The Result of operation is an exported file. + +**See Also** a sample TUI Script of :ref:`tui_export_file` operation. + + +Export to XAO +""""""""""""" +In this case, the following property panel will be opened: + +.. figure:: images/ExportXAO.png + :align: center + + **Dialog box to export in XAO format** -.. py:function:: model.exportToXAO(Part_doc, FileNameString, Author="", GeometryName="") -.. py:function:: model.exportToXAO(Part_doc, FileNameString, Object, Author="", GeometryName="") +The file name and path can be defined in **Export file** field by direct input or browsing with **'...'** button, which opens **Export file** dialog box + +*Note*: For XAO format, selection list is not available, the whole part is exported. + +**Author** Author name, empty by default + +**Geometry name** Geometry name, empty by default + +**Export shape in a separate file** if checked, shape will be exported in a separate BREP file with path = + ".brep" + +**Apply** button exports the file. + +**Cancel** button cancels the operation. + +**TUI Command**: + +.. py:function:: model.exportToXAO(Part_doc, FileNameString, Author="", GeometryName="", ShapeFile="") +.. py:function:: model.exportToXAO(Part_doc, FileNameString, Object, Author="", GeometryName="", ShapeFile="") :param part: The current part object :param string: The file name :param object: An exporting object, if necessary :param string: The name of the author, empty by default :param string: The name for the shape processed in GEOMETRY module, empty by default + :param string: The shape file name. If not empty, shape data will be stored in a separate BREP file, given by this parameter .. py:function:: aBuffer = model.exportToXAOMem(Part_doc, Object, Author="", GeometryName="") @@ -127,12 +158,14 @@ Selection list in the property panel contains a list of exported objects which c :param string: The name of the author, empty by default :param string: The name for the shape processed in GEOMETRY module, empty by default + Result """""" -The Result of operation is an exported file. +The Result of operation is an exported XAO file. + +**See Also** a sample TUI Script of :ref:`tui_export_file_XAO` operation. -**See Also** a sample TUI Script of :ref:`tui_export_file` operation. Export to STL """"""""""""" diff --git a/src/ExchangePlugin/doc/images/ExportXAO.png b/src/ExchangePlugin/doc/images/ExportXAO.png new file mode 100755 index 000000000..395844242 Binary files /dev/null and b/src/ExchangePlugin/doc/images/ExportXAO.png differ diff --git a/src/ExchangePlugin/export_widget.xml b/src/ExchangePlugin/export_widget.xml index 9eff85040..10f812867 100644 --- a/src/ExchangePlugin/export_widget.xml +++ b/src/ExchangePlugin/export_widget.xml @@ -24,12 +24,13 @@ - + placeholder="Please input the author"/> - + placeholder="Please input the geometry name"/> + & theShape, //============================================================================= bool XAOExport(const std::string& theFileName, XAO::Xao* theXao, - std::string& theError) + std::string& theError, + const std::string& theShapeFileName) { #ifdef _DEBUG std::cout << "Export XAO into file " << theFileName << std::endl; @@ -72,7 +73,7 @@ bool XAOExport(const std::string& theFileName, bool aWasFree = aShape.Free(); // make top level topology free, same as imported if (!aWasFree) aShape.Free(Standard_True); - XAO::XaoExporter::saveToFile(theXao, theFileName, ""); + XAO::XaoExporter::saveToFile(theXao, theFileName, theShapeFileName); if (!aWasFree) aShape.Free(Standard_False); } catch (XAO::XAO_Exception& e) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_XAOExport.h b/src/GeomAlgoAPI/GeomAlgoAPI_XAOExport.h index d4ec4430b..ed135020f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_XAOExport.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_XAOExport.h @@ -40,7 +40,8 @@ bool SetShapeToXAO(const std::shared_ptr& theShape, GEOMALGOAPI_EXPORT bool XAOExport(const std::string& theFileName, XAO::Xao* theXao, - std::string& theError); + std::string& theError, + const std::string& theShapeFileName = std::string()); /// Implementation of the export XAO to memory buffer (std::string) GEOMALGOAPI_EXPORT diff --git a/src/ModelHighAPI/ModelHighAPI_Macro.h b/src/ModelHighAPI/ModelHighAPI_Macro.h index 14f187163..3d6f716bb 100644 --- a/src/ModelHighAPI/ModelHighAPI_Macro.h +++ b/src/ModelHighAPI/ModelHighAPI_Macro.h @@ -535,182 +535,9 @@ SET_ATTRIBUTE(N_13, T_13, AN_13) \ END_INIT() \ public: -//-------------------------------------------------------------------------------------- -#define INTERFACE_15(KIND, \ - N_0, AN_0, T_0, C_0, \ - N_1, AN_1, T_1, C_1, \ - N_2, AN_2, T_2, C_2, \ - N_3, AN_3, T_3, C_3, \ - N_4, AN_4, T_4, C_4, \ - N_5, AN_5, T_5, C_5, \ - N_6, AN_6, T_6, C_6, \ - N_7, AN_7, T_7, C_7, \ - N_8, AN_8, T_8, C_8, \ - N_9, AN_9, T_9, C_9, \ - N_10, AN_10, T_10, C_10, \ - N_11, AN_11, T_11, C_11, \ - N_12, AN_12, T_12, C_12, \ - N_13, AN_13, T_13, C_13, \ - N_14, AN_14, T_14, C_14) \ - public: \ - INTERFACE_COMMON(KIND) \ - DEFINE_ATTRIBUTE(N_0, T_0, C_0) \ - DEFINE_ATTRIBUTE(N_1, T_1, C_1) \ - DEFINE_ATTRIBUTE(N_2, T_2, C_2) \ - DEFINE_ATTRIBUTE(N_3, T_3, C_3) \ - DEFINE_ATTRIBUTE(N_4, T_4, C_4) \ - DEFINE_ATTRIBUTE(N_5, T_5, C_5) \ - DEFINE_ATTRIBUTE(N_6, T_6, C_6) \ - DEFINE_ATTRIBUTE(N_7, T_7, C_7) \ - DEFINE_ATTRIBUTE(N_8, T_8, C_8) \ - DEFINE_ATTRIBUTE(N_9, T_9, C_9) \ - DEFINE_ATTRIBUTE(N_10, T_10, C_10) \ - DEFINE_ATTRIBUTE(N_11, T_11, C_11) \ - DEFINE_ATTRIBUTE(N_12, T_12, C_12) \ - DEFINE_ATTRIBUTE(N_13, T_13, C_13) \ - DEFINE_ATTRIBUTE(N_14, T_14, C_14) \ - protected: \ - START_INIT() \ - SET_ATTRIBUTE(N_0, T_0, AN_0) \ - SET_ATTRIBUTE(N_1, T_1, AN_1) \ - SET_ATTRIBUTE(N_2, T_2, AN_2) \ - SET_ATTRIBUTE(N_3, T_3, AN_3) \ - SET_ATTRIBUTE(N_4, T_4, AN_4) \ - SET_ATTRIBUTE(N_5, T_5, AN_5) \ - SET_ATTRIBUTE(N_6, T_6, AN_6) \ - SET_ATTRIBUTE(N_7, T_7, AN_7) \ - SET_ATTRIBUTE(N_8, T_8, AN_8) \ - SET_ATTRIBUTE(N_9, T_9, AN_9) \ - SET_ATTRIBUTE(N_10, T_10, AN_10) \ - SET_ATTRIBUTE(N_11, T_11, AN_11) \ - SET_ATTRIBUTE(N_12, T_12, AN_12) \ - SET_ATTRIBUTE(N_13, T_13, AN_13) \ - SET_ATTRIBUTE(N_14, T_14, AN_14) \ - END_INIT() \ - public: //-------------------------------------------------------------------------------------- -#define INTERFACE_16(KIND, \ - N_0, AN_0, T_0, C_0, \ - N_1, AN_1, T_1, C_1, \ - N_2, AN_2, T_2, C_2, \ - N_3, AN_3, T_3, C_3, \ - N_4, AN_4, T_4, C_4, \ - N_5, AN_5, T_5, C_5, \ - N_6, AN_6, T_6, C_6, \ - N_7, AN_7, T_7, C_7, \ - N_8, AN_8, T_8, C_8, \ - N_9, AN_9, T_9, C_9, \ - N_10, AN_10, T_10, C_10, \ - N_11, AN_11, T_11, C_11, \ - N_12, AN_12, T_12, C_12, \ - N_13, AN_13, T_13, C_13, \ - N_14, AN_14, T_14, C_14, \ - N_15, AN_15, T_15, C_15) \ - public: \ - INTERFACE_COMMON(KIND) \ - DEFINE_ATTRIBUTE(N_0, T_0, C_0) \ - DEFINE_ATTRIBUTE(N_1, T_1, C_1) \ - DEFINE_ATTRIBUTE(N_2, T_2, C_2) \ - DEFINE_ATTRIBUTE(N_3, T_3, C_3) \ - DEFINE_ATTRIBUTE(N_4, T_4, C_4) \ - DEFINE_ATTRIBUTE(N_5, T_5, C_5) \ - DEFINE_ATTRIBUTE(N_6, T_6, C_6) \ - DEFINE_ATTRIBUTE(N_7, T_7, C_7) \ - DEFINE_ATTRIBUTE(N_8, T_8, C_8) \ - DEFINE_ATTRIBUTE(N_9, T_9, C_9) \ - DEFINE_ATTRIBUTE(N_10, T_10, C_10) \ - DEFINE_ATTRIBUTE(N_11, T_11, C_11) \ - DEFINE_ATTRIBUTE(N_12, T_12, C_12) \ - DEFINE_ATTRIBUTE(N_13, T_13, C_13) \ - DEFINE_ATTRIBUTE(N_14, T_14, C_14) \ - DEFINE_ATTRIBUTE(N_15, T_15, C_15) \ - protected: \ - START_INIT() \ - SET_ATTRIBUTE(N_0, T_0, AN_0) \ - SET_ATTRIBUTE(N_1, T_1, AN_1) \ - SET_ATTRIBUTE(N_2, T_2, AN_2) \ - SET_ATTRIBUTE(N_3, T_3, AN_3) \ - SET_ATTRIBUTE(N_4, T_4, AN_4) \ - SET_ATTRIBUTE(N_5, T_5, AN_5) \ - SET_ATTRIBUTE(N_6, T_6, AN_6) \ - SET_ATTRIBUTE(N_7, T_7, AN_7) \ - SET_ATTRIBUTE(N_8, T_8, AN_8) \ - SET_ATTRIBUTE(N_9, T_9, AN_9) \ - SET_ATTRIBUTE(N_10, T_10, AN_10) \ - SET_ATTRIBUTE(N_11, T_11, AN_11) \ - SET_ATTRIBUTE(N_12, T_12, AN_12) \ - SET_ATTRIBUTE(N_13, T_13, AN_13) \ - SET_ATTRIBUTE(N_14, T_14, AN_14) \ - SET_ATTRIBUTE(N_15, T_15, AN_15) \ - END_INIT() \ - public: - -//-------------------------------------------------------------------------------------- -#define INTERFACE_18(KIND, \ - N_0, AN_0, T_0, C_0, \ - N_1, AN_1, T_1, C_1, \ - N_2, AN_2, T_2, C_2, \ - N_3, AN_3, T_3, C_3, \ - N_4, AN_4, T_4, C_4, \ - N_5, AN_5, T_5, C_5, \ - N_6, AN_6, T_6, C_6, \ - N_7, AN_7, T_7, C_7, \ - N_8, AN_8, T_8, C_8, \ - N_9, AN_9, T_9, C_9, \ - N_10, AN_10, T_10, C_10, \ - N_11, AN_11, T_11, C_11, \ - N_12, AN_12, T_12, C_12, \ - N_13, AN_13, T_13, C_13, \ - N_14, AN_14, T_14, C_14, \ - N_15, AN_15, T_15, C_15, \ - N_16, AN_16, T_16, C_16, \ - N_17, AN_17, T_17, C_17) \ - public: \ - INTERFACE_COMMON(KIND) \ - DEFINE_ATTRIBUTE(N_0, T_0, C_0) \ - DEFINE_ATTRIBUTE(N_1, T_1, C_1) \ - DEFINE_ATTRIBUTE(N_2, T_2, C_2) \ - DEFINE_ATTRIBUTE(N_3, T_3, C_3) \ - DEFINE_ATTRIBUTE(N_4, T_4, C_4) \ - DEFINE_ATTRIBUTE(N_5, T_5, C_5) \ - DEFINE_ATTRIBUTE(N_6, T_6, C_6) \ - DEFINE_ATTRIBUTE(N_7, T_7, C_7) \ - DEFINE_ATTRIBUTE(N_8, T_8, C_8) \ - DEFINE_ATTRIBUTE(N_9, T_9, C_9) \ - DEFINE_ATTRIBUTE(N_10, T_10, C_10) \ - DEFINE_ATTRIBUTE(N_11, T_11, C_11) \ - DEFINE_ATTRIBUTE(N_12, T_12, C_12) \ - DEFINE_ATTRIBUTE(N_13, T_13, C_13) \ - DEFINE_ATTRIBUTE(N_14, T_14, C_14) \ - DEFINE_ATTRIBUTE(N_15, T_15, C_15) \ - DEFINE_ATTRIBUTE(N_16, T_16, C_16) \ - DEFINE_ATTRIBUTE(N_17, T_17, C_17) \ - protected: \ - START_INIT() \ - SET_ATTRIBUTE(N_0, T_0, AN_0) \ - SET_ATTRIBUTE(N_1, T_1, AN_1) \ - SET_ATTRIBUTE(N_2, T_2, AN_2) \ - SET_ATTRIBUTE(N_3, T_3, AN_3) \ - SET_ATTRIBUTE(N_4, T_4, AN_4) \ - SET_ATTRIBUTE(N_5, T_5, AN_5) \ - SET_ATTRIBUTE(N_6, T_6, AN_6) \ - SET_ATTRIBUTE(N_7, T_7, AN_7) \ - SET_ATTRIBUTE(N_8, T_8, AN_8) \ - SET_ATTRIBUTE(N_9, T_9, AN_9) \ - SET_ATTRIBUTE(N_10, T_10, AN_10) \ - SET_ATTRIBUTE(N_11, T_11, AN_11) \ - SET_ATTRIBUTE(N_12, T_12, AN_12) \ - SET_ATTRIBUTE(N_13, T_13, AN_13) \ - SET_ATTRIBUTE(N_14, T_14, AN_14) \ - SET_ATTRIBUTE(N_15, T_15, AN_15) \ - SET_ATTRIBUTE(N_16, T_16, AN_16) \ - SET_ATTRIBUTE(N_17, T_17, AN_17) \ - END_INIT() \ - public: - -//-------------------------------------------------------------------------------------- -#define INTERFACE_20(KIND, \ +#define INTERFACE_17(KIND, \ N_0, AN_0, T_0, C_0, \ N_1, AN_1, T_1, C_1, \ N_2, AN_2, T_2, C_2, \ @@ -727,10 +554,7 @@ N_13, AN_13, T_13, C_13, \ N_14, AN_14, T_14, C_14, \ N_15, AN_15, T_15, C_15, \ - N_16, AN_16, T_16, C_16, \ - N_17, AN_17, T_17, C_17, \ - N_18, AN_18, T_18, C_18, \ - N_19, AN_19, T_19, C_19) \ + N_16, AN_16, T_16, C_16) \ public: \ INTERFACE_COMMON(KIND) \ DEFINE_ATTRIBUTE(N_0, T_0, C_0) \ @@ -750,9 +574,6 @@ DEFINE_ATTRIBUTE(N_14, T_14, C_14) \ DEFINE_ATTRIBUTE(N_15, T_15, C_15) \ DEFINE_ATTRIBUTE(N_16, T_16, C_16) \ - DEFINE_ATTRIBUTE(N_17, T_17, C_17) \ - DEFINE_ATTRIBUTE(N_18, T_18, C_18) \ - DEFINE_ATTRIBUTE(N_19, T_19, C_19) \ protected: \ START_INIT() \ SET_ATTRIBUTE(N_0, T_0, AN_0) \ @@ -772,9 +593,6 @@ SET_ATTRIBUTE(N_14, T_14, AN_14) \ SET_ATTRIBUTE(N_15, T_15, AN_15) \ SET_ATTRIBUTE(N_16, T_16, AN_16) \ - SET_ATTRIBUTE(N_17, T_17, AN_17) \ - SET_ATTRIBUTE(N_18, T_18, AN_18) \ - SET_ATTRIBUTE(N_19, T_19, AN_19) \ END_INIT() \ public: @@ -850,87 +668,6 @@ END_INIT() \ public: -//-------------------------------------------------------------------------------------- -#define INTERFACE_24(KIND, \ - N_0, AN_0, T_0, C_0, \ - N_1, AN_1, T_1, C_1, \ - N_2, AN_2, T_2, C_2, \ - N_3, AN_3, T_3, C_3, \ - N_4, AN_4, T_4, C_4, \ - N_5, AN_5, T_5, C_5, \ - N_6, AN_6, T_6, C_6, \ - N_7, AN_7, T_7, C_7, \ - N_8, AN_8, T_8, C_8, \ - N_9, AN_9, T_9, C_9, \ - N_10, AN_10, T_10, C_10, \ - N_11, AN_11, T_11, C_11, \ - N_12, AN_12, T_12, C_12, \ - N_13, AN_13, T_13, C_13, \ - N_14, AN_14, T_14, C_14, \ - N_15, AN_15, T_15, C_15, \ - N_16, AN_16, T_16, C_16, \ - N_17, AN_17, T_17, C_17, \ - N_18, AN_18, T_18, C_18, \ - N_19, AN_19, T_19, C_19, \ - N_20, AN_20, T_20, C_20, \ - N_21, AN_21, T_21, C_21, \ - N_22, AN_22, T_22, C_22, \ - N_23, AN_23, T_23, C_23) \ - public: \ - INTERFACE_COMMON(KIND) \ - DEFINE_ATTRIBUTE(N_0, T_0, C_0) \ - DEFINE_ATTRIBUTE(N_1, T_1, C_1) \ - DEFINE_ATTRIBUTE(N_2, T_2, C_2) \ - DEFINE_ATTRIBUTE(N_3, T_3, C_3) \ - DEFINE_ATTRIBUTE(N_4, T_4, C_4) \ - DEFINE_ATTRIBUTE(N_5, T_5, C_5) \ - DEFINE_ATTRIBUTE(N_6, T_6, C_6) \ - DEFINE_ATTRIBUTE(N_7, T_7, C_7) \ - DEFINE_ATTRIBUTE(N_8, T_8, C_8) \ - DEFINE_ATTRIBUTE(N_9, T_9, C_9) \ - DEFINE_ATTRIBUTE(N_10, T_10, C_10) \ - DEFINE_ATTRIBUTE(N_11, T_11, C_11) \ - DEFINE_ATTRIBUTE(N_12, T_12, C_12) \ - DEFINE_ATTRIBUTE(N_13, T_13, C_13) \ - DEFINE_ATTRIBUTE(N_14, T_14, C_14) \ - DEFINE_ATTRIBUTE(N_15, T_15, C_15) \ - DEFINE_ATTRIBUTE(N_16, T_16, C_16) \ - DEFINE_ATTRIBUTE(N_17, T_17, C_17) \ - DEFINE_ATTRIBUTE(N_18, T_18, C_18) \ - DEFINE_ATTRIBUTE(N_19, T_19, C_19) \ - DEFINE_ATTRIBUTE(N_20, T_20, C_20) \ - DEFINE_ATTRIBUTE(N_21, T_21, C_21) \ - DEFINE_ATTRIBUTE(N_22, T_22, C_22) \ - DEFINE_ATTRIBUTE(N_23, T_23, C_23) \ - protected: \ - START_INIT() \ - SET_ATTRIBUTE(N_0, T_0, AN_0) \ - SET_ATTRIBUTE(N_1, T_1, AN_1) \ - SET_ATTRIBUTE(N_2, T_2, AN_2) \ - SET_ATTRIBUTE(N_3, T_3, AN_3) \ - SET_ATTRIBUTE(N_4, T_4, AN_4) \ - SET_ATTRIBUTE(N_5, T_5, AN_5) \ - SET_ATTRIBUTE(N_6, T_6, AN_6) \ - SET_ATTRIBUTE(N_7, T_7, AN_7) \ - SET_ATTRIBUTE(N_8, T_8, AN_8) \ - SET_ATTRIBUTE(N_9, T_9, AN_9) \ - SET_ATTRIBUTE(N_10, T_10, AN_10) \ - SET_ATTRIBUTE(N_11, T_11, AN_11) \ - SET_ATTRIBUTE(N_12, T_12, AN_12) \ - SET_ATTRIBUTE(N_13, T_13, AN_13) \ - SET_ATTRIBUTE(N_14, T_14, AN_14) \ - SET_ATTRIBUTE(N_15, T_15, AN_15) \ - SET_ATTRIBUTE(N_16, T_16, AN_16) \ - SET_ATTRIBUTE(N_17, T_17, AN_17) \ - SET_ATTRIBUTE(N_18, T_18, AN_18) \ - SET_ATTRIBUTE(N_19, T_19, AN_19) \ - SET_ATTRIBUTE(N_20, T_20, AN_20) \ - SET_ATTRIBUTE(N_21, T_21, AN_21) \ - SET_ATTRIBUTE(N_22, T_22, AN_22) \ - SET_ATTRIBUTE(N_23, T_23, AN_23) \ - END_INIT() \ - public: - //-------------------------------------------------------------------------------------- #define INTERFACE_25(KIND, \ N_0, AN_0, T_0, C_0, \ @@ -1015,96 +752,5 @@ END_INIT() \ public: - -//-------------------------------------------------------------------------------------- -#define INTERFACE_27(KIND, \ - N_0, AN_0, T_0, C_0, \ - N_1, AN_1, T_1, C_1, \ - N_2, AN_2, T_2, C_2, \ - N_3, AN_3, T_3, C_3, \ - N_4, AN_4, T_4, C_4, \ - N_5, AN_5, T_5, C_5, \ - N_6, AN_6, T_6, C_6, \ - N_7, AN_7, T_7, C_7, \ - N_8, AN_8, T_8, C_8, \ - N_9, AN_9, T_9, C_9, \ - N_10, AN_10, T_10, C_10, \ - N_11, AN_11, T_11, C_11, \ - N_12, AN_12, T_12, C_12, \ - N_13, AN_13, T_13, C_13, \ - N_14, AN_14, T_14, C_14, \ - N_15, AN_15, T_15, C_15, \ - N_16, AN_16, T_16, C_16, \ - N_17, AN_17, T_17, C_17, \ - N_18, AN_18, T_18, C_18, \ - N_19, AN_19, T_19, C_19, \ - N_20, AN_20, T_20, C_20, \ - N_21, AN_21, T_21, C_21, \ - N_22, AN_22, T_22, C_22, \ - N_23, AN_23, T_23, C_23, \ - N_24, AN_24, T_24, C_24, \ - N_25, AN_25, T_25, C_25, \ - N_26, AN_26, T_26, C_26) \ - public: \ - INTERFACE_COMMON(KIND) \ - DEFINE_ATTRIBUTE(N_0, T_0, C_0) \ - DEFINE_ATTRIBUTE(N_1, T_1, C_1) \ - DEFINE_ATTRIBUTE(N_2, T_2, C_2) \ - DEFINE_ATTRIBUTE(N_3, T_3, C_3) \ - DEFINE_ATTRIBUTE(N_4, T_4, C_4) \ - DEFINE_ATTRIBUTE(N_5, T_5, C_5) \ - DEFINE_ATTRIBUTE(N_6, T_6, C_6) \ - DEFINE_ATTRIBUTE(N_7, T_7, C_7) \ - DEFINE_ATTRIBUTE(N_8, T_8, C_8) \ - DEFINE_ATTRIBUTE(N_9, T_9, C_9) \ - DEFINE_ATTRIBUTE(N_10, T_10, C_10) \ - DEFINE_ATTRIBUTE(N_11, T_11, C_11) \ - DEFINE_ATTRIBUTE(N_12, T_12, C_12) \ - DEFINE_ATTRIBUTE(N_13, T_13, C_13) \ - DEFINE_ATTRIBUTE(N_14, T_14, C_14) \ - DEFINE_ATTRIBUTE(N_15, T_15, C_15) \ - DEFINE_ATTRIBUTE(N_16, T_16, C_16) \ - DEFINE_ATTRIBUTE(N_17, T_17, C_17) \ - DEFINE_ATTRIBUTE(N_18, T_18, C_18) \ - DEFINE_ATTRIBUTE(N_19, T_19, C_19) \ - DEFINE_ATTRIBUTE(N_20, T_20, C_20) \ - DEFINE_ATTRIBUTE(N_21, T_21, C_21) \ - DEFINE_ATTRIBUTE(N_22, T_22, C_22) \ - DEFINE_ATTRIBUTE(N_23, T_23, C_23) \ - DEFINE_ATTRIBUTE(N_24, T_24, C_24) \ - DEFINE_ATTRIBUTE(N_25, T_25, C_25) \ - DEFINE_ATTRIBUTE(N_26, T_26, C_26) \ - protected: \ - START_INIT() \ - SET_ATTRIBUTE(N_0, T_0, AN_0) \ - SET_ATTRIBUTE(N_1, T_1, AN_1) \ - SET_ATTRIBUTE(N_2, T_2, AN_2) \ - SET_ATTRIBUTE(N_3, T_3, AN_3) \ - SET_ATTRIBUTE(N_4, T_4, AN_4) \ - SET_ATTRIBUTE(N_5, T_5, AN_5) \ - SET_ATTRIBUTE(N_6, T_6, AN_6) \ - SET_ATTRIBUTE(N_7, T_7, AN_7) \ - SET_ATTRIBUTE(N_8, T_8, AN_8) \ - SET_ATTRIBUTE(N_9, T_9, AN_9) \ - SET_ATTRIBUTE(N_10, T_10, AN_10) \ - SET_ATTRIBUTE(N_11, T_11, AN_11) \ - SET_ATTRIBUTE(N_12, T_12, AN_12) \ - SET_ATTRIBUTE(N_13, T_13, AN_13) \ - SET_ATTRIBUTE(N_14, T_14, AN_14) \ - SET_ATTRIBUTE(N_15, T_15, AN_15) \ - SET_ATTRIBUTE(N_16, T_16, AN_16) \ - SET_ATTRIBUTE(N_17, T_17, AN_17) \ - SET_ATTRIBUTE(N_18, T_18, AN_18) \ - SET_ATTRIBUTE(N_19, T_19, AN_19) \ - SET_ATTRIBUTE(N_20, T_20, AN_20) \ - SET_ATTRIBUTE(N_21, T_21, AN_21) \ - SET_ATTRIBUTE(N_22, T_22, AN_22) \ - SET_ATTRIBUTE(N_23, T_23, AN_23) \ - SET_ATTRIBUTE(N_24, T_24, AN_24) \ - SET_ATTRIBUTE(N_25, T_25, AN_25) \ - SET_ATTRIBUTE(N_26, T_26, AN_26) \ - END_INIT() \ - public: - //-------------------------------------------------------------------------------------- #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_MACRO_H_ */