20 #ifndef EXCHANGEPLUGIN_EXPORTFEATURE_H_
21 #define EXCHANGEPLUGIN_EXPORTFEATURE_H_
23 #include <ExchangePlugin.h>
24 #include <ModelAPI_Feature.h>
25 #include <ModelAPI_Result.h>
40 inline static const std::string&
ID()
42 static const std::string MY_EXPORT_ID(
"Export");
48 static const std::string MY_EXPORT_TYPE_ID(
"ExportType");
49 return MY_EXPORT_TYPE_ID;
54 static const std::string MY_FILE_PATH_ID(
"file_path");
55 return MY_FILE_PATH_ID;
60 static const std::string MY_XAO_FILE_PATH_ID(
"xao_file_path");
61 return MY_XAO_FILE_PATH_ID;
66 static const std::string MY_STL_FILE_PATH_ID(
"stl_file_path");
67 return MY_STL_FILE_PATH_ID;
72 static const std::string ATTR_ID(
"stl_object_selected");
78 static const std::string ATTR_ID(
"stl_deflection_type");
84 static const std::string ATTR_ID(
"stl_deflection_type_relative");
90 static const std::string ATTR_ID(
"stl_deflection_type_absolute");
96 static const std::string ATTR_ID(
"stl_relative");
102 static const std::string ATTR_ID(
"stl_absolute");
108 static const std::string ATTR_ID(
"stl_file_type");
114 static const std::string ATTR_ID(
"stl_file_type_acii");
120 static const std::string ATTR_ID(
"stl_file_type_binary");
126 static const std::string MY_FILE_FORMAT_ID(
"file_format");
127 return MY_FILE_FORMAT_ID;
132 static const std::string MY_SELECTION_LIST_ID(
"selection_list");
133 return MY_SELECTION_LIST_ID;
138 static const std::string MY_SELECTION_LIST_ID(
"xao_selection_list");
139 return MY_SELECTION_LIST_ID;
144 static const std::string MY_XAO_AUTHOR_ID(
"xao_author");
145 return MY_XAO_AUTHOR_ID;
150 static const std::string MY_XAO_GEOMETRY_NAME_ID(
"xao_geometry_name");
151 return MY_XAO_GEOMETRY_NAME_ID;
156 static const std::string MY_XAO_SHAPE_FILE_PATH_ID(
"xao_shape_file_path");
157 return MY_XAO_SHAPE_FILE_PATH_ID;
163 static const std::string MY_XAO_SHAPE_FILE_SEPARATE_ID(
"xao_shape_file_separate");
164 return MY_XAO_SHAPE_FILE_SEPARATE_ID;
169 static const std::string MY_MEMORY_BUFFER_ID(
"memory_buffer");
170 return MY_MEMORY_BUFFER_ID;
179 EXCHANGEPLUGIN_EXPORT
virtual const std::string&
getKind()
188 EXCHANGEPLUGIN_EXPORT
virtual void attributeChanged(
const std::string& theID);
191 EXCHANGEPLUGIN_EXPORT
virtual void execute();
196 EXCHANGEPLUGIN_EXPORT
virtual bool isMacro()
const;
207 EXCHANGEPLUGIN_EXPORT
void exportFile(
const std::string& theFileName,
208 const std::string& theFormat,
209 const bool isMemoryExport);
212 EXCHANGEPLUGIN_EXPORT
void exportXAO(
const std::string& theFileName,
213 const bool isMemoryExport);
216 EXCHANGEPLUGIN_EXPORT
void exportSTL(
const std::string& theFileName);
Feature for export shapes to the external files in CAD formats.
Definition: ExchangePlugin_ExportFeature.h:37
static const std::string & SELECTION_LIST_ID()
attribute name of selection list
Definition: ExchangePlugin_ExportFeature.h:130
static const std::string & EXPORT_TYPE_ID()
attribute name for file format
Definition: ExchangePlugin_ExportFeature.h:46
virtual EXCHANGEPLUGIN_EXPORT ~ExchangePlugin_ExportFeature()
Default destructor.
Definition: ExchangePlugin_ExportFeature.cpp:79
static const std::string & XAO_AUTHOR_ID()
attribute name of author for XAO format
Definition: ExchangePlugin_ExportFeature.h:142
static const std::string & STL_FILE_TYPE()
Attribute name for stl file type.
Definition: ExchangePlugin_ExportFeature.h:106
EXCHANGEPLUGIN_EXPORT ExchangePlugin_ExportFeature()
Default constructor.
Definition: ExchangePlugin_ExportFeature.cpp:75
static const std::string & ID()
Feature kind.
Definition: ExchangePlugin_ExportFeature.h:40
static const std::string & MEMORY_BUFFER_ID()
attribute string memory buffer
Definition: ExchangePlugin_ExportFeature.h:167
static const std::string & STL_ABSOLUTE()
Attribute name for absolute.
Definition: ExchangePlugin_ExportFeature.h:100
static const std::string & XAO_GEOMETRY_NAME_ID()
attribute name of geometry name for XAO format
Definition: ExchangePlugin_ExportFeature.h:148
EXCHANGEPLUGIN_EXPORT void exportFile(const std::string &theFileName, const std::string &theFormat, const bool isMemoryExport)
Performs export of the file.
Definition: ExchangePlugin_ExportFeature.cpp:198
static const std::string & STL_FILE_TYPE_ASCII()
Attribute name for stl file type ascii.
Definition: ExchangePlugin_ExportFeature.h:112
virtual EXCHANGEPLUGIN_EXPORT void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: ExchangePlugin_ExportFeature.cpp:87
static const std::string & FILE_FORMAT_ID()
attribute name of file format
Definition: ExchangePlugin_ExportFeature.h:124
EXCHANGEPLUGIN_EXPORT void exportXAO(const std::string &theFileName, const bool isMemoryExport)
Performs export to XAO file.
Definition: ExchangePlugin_ExportFeature.cpp:339
bool isInHistory()
Do not put in history.
Definition: ExchangePlugin_ExportFeature.h:203
static const std::string & XAO_SHAPE_FILE_PATH_ID()
attribute name of xao shape file path
Definition: ExchangePlugin_ExportFeature.h:154
static const std::string & STL_OBJECT_SELECTED()
Attribute name for selected object to export in stl file path.
Definition: ExchangePlugin_ExportFeature.h:70
static const std::string & XAO_SHAPE_FILE_SEPARATE_ID()
attribute flag to export shape in a separate file during xao export, name of shape file will be xao_f...
Definition: ExchangePlugin_ExportFeature.h:161
static const std::string & STL_DEFLECTION_TYPE_ABSOLUTE()
Attribute name for deflection type absolute.
Definition: ExchangePlugin_ExportFeature.h:88
static const std::string & XAO_SELECTION_LIST_ID()
attribute name of xao selection list
Definition: ExchangePlugin_ExportFeature.h:136
virtual EXCHANGEPLUGIN_EXPORT void execute()
Computes or recomputes the results.
Definition: ExchangePlugin_ExportFeature.cpp:178
static const std::string & FILE_PATH_ID()
attribute name of file path
Definition: ExchangePlugin_ExportFeature.h:52
virtual EXCHANGEPLUGIN_EXPORT void attributeChanged(const std::string &theID)
Reimplemented from ModelAPI_Feature::attributeChanged()
Definition: ExchangePlugin_ExportFeature.cpp:163
virtual EXCHANGEPLUGIN_EXPORT bool isPreviewNeeded() const
Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
Definition: ExchangePlugin_ExportFeature.h:199
virtual EXCHANGEPLUGIN_EXPORT const std::string & getKind()
Returns the unique kind of a feature.
Definition: ExchangePlugin_ExportFeature.h:179
static const std::string & STL_DEFLECTION_TYPE()
Attribute name for deflection type.
Definition: ExchangePlugin_ExportFeature.h:76
static const std::string & STL_FILE_PATH_ID()
attribute name of stl file path
Definition: ExchangePlugin_ExportFeature.h:64
static const std::string & STL_FILE_TYPE_BINARY()
Attribute name for stl file type binary.
Definition: ExchangePlugin_ExportFeature.h:118
EXCHANGEPLUGIN_EXPORT void exportSTL(const std::string &theFileName)
Performs export to STL file.
Definition: ExchangePlugin_ExportFeature.cpp:297
static const std::string & STL_DEFLECTION_TYPE_RELATIVE()
Attribute name for deflection type relative.
Definition: ExchangePlugin_ExportFeature.h:82
static const std::string & STL_RELATIVE()
Attribute name for relative.
Definition: ExchangePlugin_ExportFeature.h:94
static const std::string & XAO_FILE_PATH_ID()
attribute name of xao file path
Definition: ExchangePlugin_ExportFeature.h:58
virtual EXCHANGEPLUGIN_EXPORT bool isMacro() const
Reimplemented from ModelAPI_Feature::isMacro(). Returns false.
Definition: ExchangePlugin_ExportFeature.cpp:646
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:41