1 // Copyright (C) 2014-2020 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef CollectionAPI_Field_H_
21 #define CollectionAPI_Field_H_
23 #include "CollectionAPI.h"
25 #include <CollectionPlugin_Field.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelHighAPI_Dumper;
31 class ModelHighAPI_Selection;
32 class ModelHighAPI_Integer;
33 class ModelHighAPI_ComponentValue;
35 /// \class CollectionAPI_Field
36 /// \inField CPPHighAPI
37 /// \brief Interface for Field feature.
38 class CollectionAPI_Field: public ModelHighAPI_Interface
41 /// Constructor without values.
43 explicit CollectionAPI_Field(const std::shared_ptr<ModelAPI_Feature>& theFeature);
47 virtual ~CollectionAPI_Field();
49 INTERFACE_4(CollectionPlugin_Field::ID(),
50 selection, CollectionPlugin_Field::SELECTED_ID(),
51 ModelAPI_AttributeSelectionList, /** Field selection list*/,
52 componentsNames, CollectionPlugin_Field::COMPONENTS_NAMES_ID(),
53 ModelAPI_AttributeStringArray, /** Names of components list of strings */,
54 stamps, CollectionPlugin_Field::STAMPS_ID(),
55 ModelAPI_AttributeIntArray, /** Identifiers of stamps */,
56 values, CollectionPlugin_Field::VALUES_ID(), ModelAPI_AttributeTables /** Table of values */,
59 /// Set selected objects.
61 void setSelection(const std::list<ModelHighAPI_Selection>& theFieldList);
62 /// Set names of components
64 void setComponentsNames(const std::list<std::string>& theNames);
65 /// Set type of values
67 void setValuesType(const std::string& theType);
68 /// Set number of steps
70 void setStepsNum(const ModelHighAPI_Integer& theSteps);
71 /// Set stamps identifiers
73 void setStamps(const std::list<ModelHighAPI_Integer>& theStamps);
74 /// Sets the double values of specific step
76 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
77 const std::list<std::list<double> >& theComponents);
78 /// Sets the integer values of specific step
80 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
81 const std::list<std::list<int> >& theComponents);
82 /// Sets the string values of specific step
84 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
85 const std::list<std::list<std::string> >& theComponents);
86 /// Sets the boolean values of specific step
88 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
89 const std::list<std::list<bool> >& theComponents);
91 /// Dump wrapped feature
93 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
95 /// Returns the internal values tables
97 std::shared_ptr<ModelAPI_AttributeTables> tableValues();
101 /// Pointer on Field object.
102 typedef std::shared_ptr<CollectionAPI_Field> FieldPtr;
104 /// \inField CPPHighAPI
105 /// \brief Create Field feature.
107 FieldPtr addField(const std::shared_ptr<ModelAPI_Document>& thePart,
108 const ModelHighAPI_Integer& theStepsNum,
109 const std::string& theComponentType,
110 const int theComponentsNum,
111 const std::list<std::string>& theComponentNames,
112 const std::list<ModelHighAPI_Selection>& theSelectionList);
114 #endif // CollectionAPI_Field_H_