1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: CollectionAPI_Field.h
4 // Created: 16 Nov 2016
5 // Author: Mikhail Ponikarov
7 #ifndef CollectionAPI_Field_H_
8 #define CollectionAPI_Field_H_
10 #include "CollectionAPI.h"
12 #include <CollectionPlugin_Field.h>
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
17 class ModelHighAPI_Dumper;
18 class ModelHighAPI_Selection;
19 class ModelHighAPI_Integer;
20 class ModelHighAPI_ComponentValue;
22 /// \class CollectionAPI_Field
23 /// \inField CPPHighAPI
24 /// \brief Interface for Field feature.
25 class CollectionAPI_Field: public ModelHighAPI_Interface
28 /// Constructor without values.
30 explicit CollectionAPI_Field(const std::shared_ptr<ModelAPI_Feature>& theFeature);
34 virtual ~CollectionAPI_Field();
36 INTERFACE_4(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 stamps, CollectionPlugin_Field::STAMPS_ID(),
42 ModelAPI_AttributeIntArray, /** Identifiers of stamps */,
43 values, CollectionPlugin_Field::VALUES_ID(), ModelAPI_AttributeTables /** Table of values */,
46 /// Set selected objects.
48 void setSelection(const std::list<ModelHighAPI_Selection>& theFieldList);
49 /// Set names of components
51 void setComponentsNames(const std::list<std::string>& theNames);
52 /// Set type of values
54 void setValuesType(const std::string& theType);
55 /// Set number of steps
57 void setStepsNum(const ModelHighAPI_Integer& theSteps);
58 /// Set stamps identifiers
60 void setStamps(const std::list<ModelHighAPI_Integer>& theStamps);
61 /// Sets the double values of specific step
63 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
64 const std::list<std::list<double> >& theComponents);
65 /// Sets the integer values of specific step
67 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
68 const std::list<std::list<int> >& theComponents);
69 /// Sets the string values of specific step
71 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
72 const std::list<std::list<std::string> >& theComponents);
73 /// Sets the boolean values of specific step
75 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
76 const std::list<std::list<bool> >& theComponents);
78 /// Dump wrapped feature
80 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
82 /// Returns the internal values tables
84 std::shared_ptr<ModelAPI_AttributeTables> tableValues();
88 /// Pointer on Field object.
89 typedef std::shared_ptr<CollectionAPI_Field> FieldPtr;
91 /// \inField CPPHighAPI
92 /// \brief Create Field feature.
94 FieldPtr addField(const std::shared_ptr<ModelAPI_Document>& thePart,
95 const ModelHighAPI_Integer& theStepsNum,
96 const std::string& theComponentType,
97 const int theComponentsNum,
98 const std::list<std::string>& theComponentNames,
99 const std::list<ModelHighAPI_Selection>& theSelectionList);
101 #endif // CollectionAPI_Field_H_