1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef CollectionAPI_Field_H_
22 #define CollectionAPI_Field_H_
24 #include "CollectionAPI.h"
26 #include <CollectionPlugin_Field.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Dumper;
32 class ModelHighAPI_Selection;
33 class ModelHighAPI_Integer;
34 class ModelHighAPI_ComponentValue;
36 /// \class CollectionAPI_Field
37 /// \inField CPPHighAPI
38 /// \brief Interface for Field feature.
39 class CollectionAPI_Field: public ModelHighAPI_Interface
42 /// Constructor without values.
44 explicit CollectionAPI_Field(const std::shared_ptr<ModelAPI_Feature>& theFeature);
48 virtual ~CollectionAPI_Field();
50 INTERFACE_4(CollectionPlugin_Field::ID(),
51 selection, CollectionPlugin_Field::SELECTED_ID(),
52 ModelAPI_AttributeSelectionList, /** Field selection list*/,
53 componentsNames, CollectionPlugin_Field::COMPONENTS_NAMES_ID(),
54 ModelAPI_AttributeStringArray, /** Names of components list of strings */,
55 stamps, CollectionPlugin_Field::STAMPS_ID(),
56 ModelAPI_AttributeIntArray, /** Identifiers of stamps */,
57 values, CollectionPlugin_Field::VALUES_ID(), ModelAPI_AttributeTables /** Table of values */,
60 /// Set selected objects.
62 void setSelection(const std::list<ModelHighAPI_Selection>& theFieldList);
63 /// Set names of components
65 void setComponentsNames(const std::list<std::string>& theNames);
66 /// Set type of values
68 void setValuesType(const std::string& theType);
69 /// Set number of steps
71 void setStepsNum(const ModelHighAPI_Integer& theSteps);
72 /// Set stamps identifiers
74 void setStamps(const std::list<ModelHighAPI_Integer>& theStamps);
75 /// Sets the double values of specific step
77 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
78 const std::list<std::list<double> >& theComponents);
79 /// Sets the integer values of specific step
81 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
82 const std::list<std::list<int> >& theComponents);
83 /// Sets the string values of specific step
85 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
86 const std::list<std::list<std::string> >& theComponents);
87 /// Sets the boolean values of specific step
89 void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
90 const std::list<std::list<bool> >& theComponents);
92 /// Dump wrapped feature
94 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
96 /// Returns the internal values tables
98 std::shared_ptr<ModelAPI_AttributeTables> tableValues();
102 /// Pointer on Field object.
103 typedef std::shared_ptr<CollectionAPI_Field> FieldPtr;
105 /// \inField CPPHighAPI
106 /// \brief Create Field feature.
108 FieldPtr addField(const std::shared_ptr<ModelAPI_Document>& thePart,
109 const ModelHighAPI_Integer& theStepsNum,
110 const std::string& theComponentType,
111 const int theComponentsNum,
112 const std::list<std::string>& theComponentNames,
113 const std::list<ModelHighAPI_Selection>& theSelectionList);
115 #endif // CollectionAPI_Field_H_