X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FExchangeAPI%2FExchangeAPI_Export.h;h=6cfddfd8f65d13500e2b984bb59d85dc39a4dff5;hb=d7144bf137b2ea4f8c7bfbc6b678e1a762e98653;hp=f10bf831c137ebd011efffdc12c14d1435cfea1f;hpb=4e4fc73a06a282000d9736f676d35559d295be41;p=modules%2Fshaper.git diff --git a/src/ExchangeAPI/ExchangeAPI_Export.h b/src/ExchangeAPI/ExchangeAPI_Export.h index f10bf831c..6cfddfd8f 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.h +++ b/src/ExchangeAPI/ExchangeAPI_Export.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // 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 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SRC_EXCHANGEAPI_EXCHANGEAPI_EXPORT_H_ @@ -34,24 +33,96 @@ //-------------------------------------------------------------------------------------- class ModelHighAPI_Selection; //-------------------------------------------------------------------------------------- + + +/// \class ExchangeAPI_Export +/// \ingroup CPPHighAPI +/// \brief Interface for Export feature. +class ExchangeAPI_Export: public ModelHighAPI_Interface +{ +public: + /// Constructor without values. + EXCHANGEAPI_EXPORT + explicit ExchangeAPI_Export(const std::shared_ptr& theFeature); + + /// Constructor with values for XAO export. + EXCHANGEAPI_EXPORT + explicit ExchangeAPI_Export(const std::shared_ptr& theFeature, + const std::string & theFilePath, + const std::string & theAuthor = std::string(), + const std::string & theGeometryName = std::string()); + + /// Constructor with values for XAO of selected result export. + EXCHANGEAPI_EXPORT + explicit ExchangeAPI_Export(const std::shared_ptr& theFeature, + const std::string & theFilePath, + const ModelHighAPI_Selection& theResult, + const std::string & theAuthor, + const std::string & theGeometryName = std::string()); + + /// Constructor with values for export in other formats than XAO. + EXCHANGEAPI_EXPORT + explicit ExchangeAPI_Export(const std::shared_ptr& theFeature, + const std::string & theFilePath, + const std::list & theSelectionList, + const std::string & theFileFormat = std::string()); + + /// Destructor. + EXCHANGEAPI_EXPORT + virtual ~ExchangeAPI_Export(); + + INTERFACE_7(ExchangePlugin_ExportFeature::ID(), + exportType, ExchangePlugin_ExportFeature::EXPORT_TYPE_ID(), + ModelAPI_AttributeString, /** ExportType */, + filePath, ExchangePlugin_ExportFeature::FILE_PATH_ID(), + ModelAPI_AttributeString, /** file path */, + xaoFilePath, ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID(), + ModelAPI_AttributeString, /** xao_file_path */, + fileFormat, ExchangePlugin_ExportFeature::FILE_FORMAT_ID(), + ModelAPI_AttributeString, /** file format */, + selectionList, ExchangePlugin_ExportFeature::SELECTION_LIST_ID(), + ModelAPI_AttributeString, /** selection list */, + xaoAuthor, ExchangePlugin_ExportFeature::XAO_AUTHOR_ID(), + ModelAPI_AttributeString, /** xao author */, + xaoGeometryName, ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID(), + ModelAPI_AttributeString, /** xao geometry name */) + + /// Dump wrapped feature + EXCHANGEAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; +}; + +/// Pointer on Export object +typedef std::shared_ptr ExportPtr; + /**\ingroup CPPHighAPI * \brief Export to file */ EXCHANGEAPI_EXPORT -void exportToFile(const std::shared_ptr & thePart, +ExportPtr exportToFile(const std::shared_ptr & thePart, const std::string & theFilePath, const std::list & theSelectionList, const std::string & theFileFormat = std::string()); /**\ingroup CPPHighAPI - * \brief Export XAO + * \brief Exports to XAO file all results of the current document */ EXCHANGEAPI_EXPORT -void exportToXAO(const std::shared_ptr & thePart, +ExportPtr exportToXAO(const std::shared_ptr & thePart, const std::string & theFilePath, const std::string & theAuthor = std::string(), const std::string & theGeometryName = std::string()); +/**\ingroup CPPHighAPI +* \brief Exports to XAO file the selected result with groups parts related to it only. +*/ +EXCHANGEAPI_EXPORT +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()); + //-------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------- #endif /* SRC_EXCHANGEAPI_EXCHANGEAPI_EXPORT_H_ */