]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelHighAPI/ModelHighAPI_FeatureStore.h
Salome HOME
d6d92d91d624b139944e42e1d5993284ba1dffe6
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_FeatureStore.h
1 // Copyright (C) 2016-20xx CEA/DEN, EDF R&D -->
2
3 // File:        ModelHighAPI_FeatureStore.h
4 // Created:     12 August 2016
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef ModelHighAPI_FeatureStore_H_
8 #define ModelHighAPI_FeatureStore_H_
9
10 #include "ModelHighAPI.h"
11
12 #include <map>
13 #include <list>
14 #include <string>
15
16 class ModelAPI_Feature;
17 class ModelAPI_Data;
18 class GeomAPI_Shape;
19 class ModelAPI_Attribute;
20
21 typedef std::shared_ptr<ModelAPI_Feature>  FeaturePtr;
22 typedef std::shared_ptr<ModelAPI_Attribute>  AttributePtr;
23
24 /**\class ModelHighAPI_FeatureStore
25  * \ingroup CPPHighAPI
26  * \brief Allows to compare the original and the dumped/executed feature
27  */
28 class ModelHighAPI_FeatureStore {
29   /// dumps of attributes of the stored feature (id -> dump)
30   std::map<std::string, std::string> myAttrs;
31    /// dumps of attributes of results (list of results id -> dumps)
32   std::list<std::map<std::string, std::string> > myRes;
33 public:
34   // unused constructor for the map container needs
35   ModelHighAPI_FeatureStore() {}
36   // constructor that initializes this object by feature to store
37   ModelHighAPI_FeatureStore(FeaturePtr theFeature);
38   // compares the stored feature information with the given feature
39   std::string compare(FeaturePtr theFeature);
40
41 private:
42   /// stores the information about all attributes of data in map
43   void storeData(std::shared_ptr<ModelAPI_Data> theData, 
44                  std::map<std::string, std::string>& theAttrs);
45   /// compares the information about all attributes of data with map
46   /// returns not empty string with error if something is different
47   std::string compareData(std::shared_ptr<ModelAPI_Data> theData, 
48                  std::map<std::string, std::string>& theAttrs);
49   /// dumps the attribute content to the string
50   std::string dumpAttr(const AttributePtr& theAttr);
51   /// dumps the shape main charatceristics to string
52   std::string dumpShape(std::shared_ptr<GeomAPI_Shape>& theShape);
53 };
54
55 #endif