1 // Copyright (C) 2014-2023 CEA, EDF
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 #ifndef SRC_EXCHANGEAPI_EXCHANGEAPI_IMPORT_H_
21 #define SRC_EXCHANGEAPI_EXCHANGEAPI_IMPORT_H_
23 //--------------------------------------------------------------------------------------
24 #include "ExchangeAPI.h"
28 #include <ExchangePlugin_ImportFeature.h>
30 #include <ModelHighAPI_Interface.h>
31 #include <ModelHighAPI_Macro.h>
32 #include <ModelHighAPI_Reference.h>
33 #include <ModelHighAPI_Selection.h>
34 //--------------------------------------------------------------------------------------
35 /**\class ExchangeAPI_Import
37 * \brief Interface for Import feature
39 class ExchangeAPI_Import : public ModelHighAPI_Interface
42 /// Constructor without values
44 explicit ExchangeAPI_Import(const std::shared_ptr<ModelAPI_Feature> & theFeature);
45 /// Constructor with values
47 ExchangeAPI_Import(const std::shared_ptr<ModelAPI_Feature> & theFeature,
48 const std::string & theFilePath);
50 /// Constructor with values for Step file
52 ExchangeAPI_Import(const std::shared_ptr<ModelAPI_Feature> & theFeature,
53 const std::string & theFilePath,
54 const bool theScalInterUnits,
55 const bool theMaterials,
59 virtual ~ExchangeAPI_Import();
61 INTERFACE_6(ExchangePlugin_ImportFeature::ID(),
62 filePath, ExchangePlugin_ImportFeature::FILE_PATH_ID(),
63 ModelAPI_AttributeString, /** File path */,
64 importType, ExchangePlugin_ImportFeature::IMPORT_TYPE_ID(),
65 ModelAPI_AttributeString, /**import type */,
66 stepFilePath, ExchangePlugin_ImportFeature::STEP_FILE_PATH_ID(),
67 ModelAPI_AttributeString, /**step File path */,
68 scalInterUnits, ExchangePlugin_ImportFeature::STEP_SCALE_INTER_UNITS_ID(),
69 ModelAPI_AttributeBoolean, /** Scale internationals units */,
70 materials, ExchangePlugin_ImportFeature::STEP_MATERIALS_ID(),
71 ModelAPI_AttributeBoolean, /** Materials */,
72 colors, ExchangePlugin_ImportFeature::STEP_COLORS_ID(),
73 ModelAPI_AttributeBoolean, /** Colors */
78 void setFilePath(const std::string & theFilePath);
81 void setParameters(const std::string & theFilePath,
82 const bool theScalInterUnits,
83 const bool theMaterials,
86 /// Dump wrapped feature
88 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
91 //! Pointer on Import object
92 typedef std::shared_ptr<ExchangeAPI_Import> ImportPtr;
94 /**\ingroup CPPHighAPI
95 * \brief Create Import feature
98 ImportPtr addImport(const std::shared_ptr<ModelAPI_Document> & thePart,
99 const std::string & theFilePath);
101 /**\ingroup CPPHighAPI
102 * \brief Create Import Step feature
105 ImportPtr addImportSTEP(const std::shared_ptr<ModelAPI_Document> & thePart,
106 const std::string & theFilePath,
107 const bool theScalInterUnits,
108 const bool theMaterials,
109 const bool theColor);
112 /** \ingroup CPPHighAPI
113 * \brief Import features from the file to the document after the current feature (or to the end).
115 EXCHANGEAPI_EXPORT void importPart(
116 const std::shared_ptr<ModelAPI_Document> & thePart,
117 const std::string & theFilePath,
118 const ModelHighAPI_Reference & theAfterThis = ModelHighAPI_Reference());
120 //--------------------------------------------------------------------------------------
121 //--------------------------------------------------------------------------------------
122 /**\class ExchangeAPI_Import_Image
123 * \ingroup CPPHighAPI
124 * \brief Interface for Import feature
126 class ExchangeAPI_Import_Image : public ModelHighAPI_Interface
129 /// Constructor without values
131 explicit ExchangeAPI_Import_Image(const std::shared_ptr<ModelAPI_Feature> & theFeature);
132 /// Constructor with values
134 ExchangeAPI_Import_Image(const std::shared_ptr<ModelAPI_Feature> & theFeature,
135 const std::string & theFilePath);
139 virtual ~ExchangeAPI_Import_Image() = default;
141 INTERFACE_1(ExchangePlugin_Import_ImageFeature::ID(),
142 filePath, ExchangePlugin_Import_ImageFeature::FILE_PATH_ID(),
143 ModelAPI_AttributeString, /** File path */
148 void setFilePath(const std::string & theFilePath);
150 /// Dump wrapped feature
152 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
156 //! Pointer on Import object
157 typedef std::shared_ptr<ExchangeAPI_Import_Image> ImportImagePtr;
161 ImportImagePtr addImportImage(const std::shared_ptr<ModelAPI_Document> & thePart,
162 const std::string & theFilePath);
164 //--------------------------------------------------------------------------------------
165 #endif /* SRC_EXCHANGEAPI_EXCHANGEAPI_IMPORT_H_ */