SHAPER  9.12.0
ModelHighAPI_FeatureStore.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef ModelHighAPI_FeatureStore_H_
21 #define ModelHighAPI_FeatureStore_H_
22 
23 #include "ModelHighAPI.h"
24 
25 #include <map>
26 #include <list>
27 #include <string>
28 #include <memory>
29 
30 class ModelAPI_Object;
31 class ModelAPI_Data;
32 class GeomAPI_Shape;
33 class ModelAPI_Attribute;
34 
35 typedef std::shared_ptr<ModelAPI_Object> ObjectPtr;
36 typedef std::shared_ptr<ModelAPI_Attribute> AttributePtr;
37 
44  std::map<std::string, std::string> myAttrs;
46  std::list<std::map<std::string, std::string> > myRes;
47 public:
48  // unused constructor for the map container needs
50  // constructor that initializes this object by feature to store
51  ModelHighAPI_FeatureStore(ObjectPtr theObject);
52  // compares the stored feature information with the given feature
53  std::string compare(ObjectPtr theObject);
54 
55 private:
57  void storeData(std::shared_ptr<ModelAPI_Data> theData,
58  std::map<std::string, std::string>& theAttrs);
61  std::string compareData(std::shared_ptr<ModelAPI_Data> theData,
62  std::map<std::string, std::string>& theAttrs);
64  std::string dumpAttr(const AttributePtr& theAttr);
66  std::string dumpShape(std::shared_ptr<GeomAPI_Shape>& theShape);
67 };
68 
69 #endif
Interface to the topological shape object.
Definition: GeomAPI_Shape.h:43
Generic attribute of the Object.
Definition: ModelAPI_Attribute.h:34
General object of the application that allows to get/set attributes from the document and compute res...
Definition: ModelAPI_Data.h:72
Represents any object in the data model and in the object browser.
Definition: ModelAPI_Object.h:45
Allows to compare the original and the dumped/executed feature.
Definition: ModelHighAPI_FeatureStore.h:42