-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File: ExchangePlugin_ImportFeature.h
-// Created: Aug 28, 2014
-// Author: Sergey BELASH
+// 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
+// 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
+//
#ifndef EXCHANGEPLUGIN_IMPORTFEATURE_H_
#define EXCHANGEPLUGIN_IMPORTFEATURE_H_
-#include <ExchangePlugin.h>
-#include <ModelAPI_Feature.h>
+#include "ExchangePlugin.h"
+
+#include <ModelAPI_CompositeFeature.h>
#include <ModelAPI_Result.h>
#include <map>
*
* The list of supported formats is defined in the configuration file.
*/
-class ExchangePlugin_ImportFeature : public ModelAPI_Feature
+class ExchangePlugin_ImportFeature : public ModelAPI_CompositeFeature
{
public:
/// Feature kind
static const std::string MY_FILE_PATH_ID("file_path");
return MY_FILE_PATH_ID;
}
- /// attribute name of group list
- inline static const std::string& GROUP_LIST_ID()
+ /// All features (list of references)
+ inline static const std::string& FEATURES_ID()
{
- static const std::string MY_GROUP_LIST_ID("group_list");
- return MY_GROUP_LIST_ID;
+ static const std::string MY_FEATURES_ID("Features");
+ return MY_FEATURES_ID;
}
/// Default constructor
EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature();
/// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
+ /// Reimplemented from ModelAPI_CompositeFeature::addFeature()
+ virtual std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID);
+
+ /// Reimplemented from ModelAPI_CompositeFeature::numberOfSubs()
+ virtual int numberOfSubs(bool forTree = false) const;
+
+ /// Reimplemented from ModelAPI_CompositeFeature::subFeature()
+ virtual std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex, bool forTree = false);
+
+ /// Reimplemented from ModelAPI_CompositeFeature::subFeatureId()
+ virtual int subFeatureId(const int theIndex) const;
+
+ /// Reimplemented from ModelAPI_CompositeFeature::isSub()
+ virtual bool isSub(ObjectPtr theObject) const;
+
+ /// Reimplemented from ModelAPI_CompositeFeature::removeFeature()
+ virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature);
+
protected:
/// Performs the import of the file
EXCHANGEPLUGIN_EXPORT void importFile(const std::string& theFileName);
private:
/// Loads Naming data structure to the document
- void loadNamingDS(std::shared_ptr<GeomAPI_Shape> theGeomShape,
+ void loadNamingDS(std::shared_ptr<GeomAPI_Shape> theGeomShape,
std::shared_ptr<ModelAPI_ResultBody> theResultBody);
};