]> SALOME platform Git repositories - modules/shaper.git/blob - src/CollectionAPI/CollectionAPI_Field.h
Salome HOME
Fix for tests of Fields: the attribute number of components is removed since it is...
[modules/shaper.git] / src / CollectionAPI / CollectionAPI_Field.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        CollectionAPI_Field.h
4 // Created:     16 Nov 2016
5 // Author:      Mikhail Ponikarov
6
7 #ifndef CollectionAPI_Field_H_
8 #define CollectionAPI_Field_H_
9
10 #include "CollectionAPI.h"
11
12 #include <CollectionPlugin_Field.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Dumper;
18 class ModelHighAPI_Selection;
19 class ModelHighAPI_Integer;
20 class ModelHighAPI_ComponentValue;
21
22 /// \class CollectionAPI_Field
23 /// \inField CPPHighAPI
24 /// \brief Interface for Field feature.
25 class CollectionAPI_Field: public ModelHighAPI_Interface
26 {
27 public:
28   /// Constructor without values.
29   COLLECTIONAPI_EXPORT
30   explicit CollectionAPI_Field(const std::shared_ptr<ModelAPI_Feature>& theFeature);
31
32   /// Destructor.
33   COLLECTIONAPI_EXPORT
34   virtual ~CollectionAPI_Field();
35
36   INTERFACE_6(CollectionPlugin_Field::ID(),
37     selection, CollectionPlugin_Field::SELECTED_ID(),
38     ModelAPI_AttributeSelectionList, /** Field selection list*/,
39     componentsNames, CollectionPlugin_Field::COMPONENTS_NAMES_ID(),
40     ModelAPI_AttributeStringArray, /** Names of components list of strings */,
41     valuesType, CollectionPlugin_Field::VALUES_TYPE_ID(),
42     ModelAPI_AttributeInteger, /** Type of the values enumeration */,
43     stepsNum, CollectionPlugin_Field::STEPS_NB_ID(),
44     ModelAPI_AttributeInteger, /** Number of steps integer */,
45     stamps, CollectionPlugin_Field::STAMPS_ID(),
46     ModelAPI_AttributeIntArray, /** Identifiers of stamps */,
47     values, CollectionPlugin_Field::VALUES_ID(), ModelAPI_AttributeTables /** Table of values */,
48     )
49
50   /// Set selected objects.
51   COLLECTIONAPI_EXPORT
52   void setSelection(const std::list<ModelHighAPI_Selection>& theFieldList);
53   /// Set names of components
54   COLLECTIONAPI_EXPORT
55   void setComponentsNames(const std::list<std::string>& theNames);
56   /// Set type of values
57   COLLECTIONAPI_EXPORT
58   void setValuesType(const std::string& theType);
59   /// Set number of steps
60   COLLECTIONAPI_EXPORT
61   void setStepsNum(const ModelHighAPI_Integer& theSteps);
62   /// Set stamps identifiers
63   COLLECTIONAPI_EXPORT
64   void setStamps(const std::list<ModelHighAPI_Integer>& theStamps);
65   /// Sets the double values of specific step
66   COLLECTIONAPI_EXPORT
67   void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
68     const std::list<std::list<double> >& theComponents);
69   /// Sets the integer values of specific step
70   COLLECTIONAPI_EXPORT
71   void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
72     const std::list<std::list<int> >& theComponents);
73   /// Sets the string values of specific step
74   COLLECTIONAPI_EXPORT
75   void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
76     const std::list<std::list<std::string> >& theComponents);
77   /// Sets the boolean values of specific step
78   COLLECTIONAPI_EXPORT
79   void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
80     const std::list<std::list<bool> >& theComponents);
81
82   /// Dump wrapped feature
83   COLLECTIONAPI_EXPORT
84   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
85 };
86
87 /// Pointer on Field object.
88 typedef std::shared_ptr<CollectionAPI_Field> FieldPtr;
89
90 /// \inField CPPHighAPI
91 /// \brief Create Field feature.
92 COLLECTIONAPI_EXPORT
93 FieldPtr addField(const std::shared_ptr<ModelAPI_Document>& thePart,
94                   const ModelHighAPI_Integer& theStepsNum,
95                   const std::string& theComponentType,
96                   const int theComponentsNum,
97                   const std::list<std::string>& theComponentNames,
98                   const std::list<ModelHighAPI_Selection>& theSelectionList);
99
100 #endif // CollectionAPI_Field_H_