X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FExchangePlugin%2FExchangePlugin_ExportFeature.h;h=5ec91c660f65b2230fe5b2be15f8be630f291265;hb=b707e7178424958f7dc1ed87a0aabd813f671d88;hp=f5c27d0daa574d4af7a0200d25cd5748fcd614d6;hpb=7807756f46b9dcd90994ac57a8a514f0570e794e;p=modules%2Fshaper.git diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h index f5c27d0da..5ec91c660 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h @@ -18,7 +18,7 @@ * \ingroup Plugins * \brief Feature for export shapes to the external files in CAD formats. * - * The set of supported formats is defined in the configuration file. + * The list of supported formats is defined in the configuration file. */ class ExchangePlugin_ExportFeature : public ModelAPI_Feature { @@ -29,12 +29,24 @@ public: static const std::string MY_EXPORT_ID("Export"); return MY_EXPORT_ID; } + /// attribute name for file format + inline static const std::string& EXPORT_TYPE_ID() + { + static const std::string MY_EXPORT_TYPE_ID("ExportType"); + return MY_EXPORT_TYPE_ID; + } /// attribute name of file path inline static const std::string& FILE_PATH_ID() { static const std::string MY_FILE_PATH_ID("file_path"); return MY_FILE_PATH_ID; } + /// attribute name of xao file path + inline static const std::string& XAO_FILE_PATH_ID() + { + static const std::string MY_XAO_FILE_PATH_ID("xao_file_path"); + return MY_XAO_FILE_PATH_ID; + } /// attribute name of file format inline static const std::string& FILE_FORMAT_ID() { @@ -47,16 +59,34 @@ public: static const std::string MY_SELECTION_LIST_ID("selection_list"); return MY_SELECTION_LIST_ID; } - /// default constructor + /// attribute name of author for XAO format + inline static const std::string& XAO_AUTHOR_ID() + { + static const std::string MY_XAO_AUTHOR_ID("xao_author"); + return MY_XAO_AUTHOR_ID; + } + /// attribute name of geometry name for XAO format + inline static const std::string& XAO_GEOMETRY_NAME_ID() + { + static const std::string MY_XAO_GEOMETRY_NAME_ID("xao_geometry_name"); + return MY_XAO_GEOMETRY_NAME_ID; + } + /// Default constructor EXCHANGEPLUGIN_EXPORT ExchangePlugin_ExportFeature(); - /// default destructor + /// Default destructor EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ExportFeature(); + /// Returns the unique kind of a feature + EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind() + { + return ExchangePlugin_ExportFeature::ID(); + } + /// Request for initialization of data model of the feature: adding all attributes EXCHANGEPLUGIN_EXPORT virtual void initAttributes(); - /// Returns the unique kind of a feature - EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind(); + /// Reimplemented from ModelAPI_Feature::attributeChanged() + EXCHANGEPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID); /// Computes or recomputes the results EXCHANGEPLUGIN_EXPORT virtual void execute(); @@ -68,10 +98,12 @@ public: EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; } protected: - /// Performs the export of the file - EXCHANGEPLUGIN_EXPORT bool exportFile(const std::string& theFileName, - const std::string& theFormat, - std::shared_ptr theShape); + /// Performs export of the file + EXCHANGEPLUGIN_EXPORT void exportFile(const std::string& theFileName, + const std::string& theFormat); + + /// Performs export to XAO file + EXCHANGEPLUGIN_EXPORT void exportXAO(const std::string& theFileName); }; #endif /* EXPORT_EXPORTFEATURE_H_ */