Salome HOME
Issue #2365 problem with active panel in feature and Hide faces windows
[modules/shaper.git] / src / CollectionAPI / CollectionAPI_Field.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef CollectionAPI_Field_H_
22 #define CollectionAPI_Field_H_
23
24 #include "CollectionAPI.h"
25
26 #include <CollectionPlugin_Field.h>
27
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30
31 class ModelHighAPI_Dumper;
32 class ModelHighAPI_Selection;
33 class ModelHighAPI_Integer;
34 class ModelHighAPI_ComponentValue;
35
36 /// \class CollectionAPI_Field
37 /// \inField CPPHighAPI
38 /// \brief Interface for Field feature.
39 class CollectionAPI_Field: public ModelHighAPI_Interface
40 {
41 public:
42   /// Constructor without values.
43   COLLECTIONAPI_EXPORT
44   explicit CollectionAPI_Field(const std::shared_ptr<ModelAPI_Feature>& theFeature);
45
46   /// Destructor.
47   COLLECTIONAPI_EXPORT
48   virtual ~CollectionAPI_Field();
49
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 */,
58     )
59
60   /// Set selected objects.
61   COLLECTIONAPI_EXPORT
62   void setSelection(const std::list<ModelHighAPI_Selection>& theFieldList);
63   /// Set names of components
64   COLLECTIONAPI_EXPORT
65   void setComponentsNames(const std::list<std::string>& theNames);
66   /// Set type of values
67   COLLECTIONAPI_EXPORT
68   void setValuesType(const std::string& theType);
69   /// Set number of steps
70   COLLECTIONAPI_EXPORT
71   void setStepsNum(const ModelHighAPI_Integer& theSteps);
72   /// Set stamps identifiers
73   COLLECTIONAPI_EXPORT
74   void setStamps(const std::list<ModelHighAPI_Integer>& theStamps);
75   /// Sets the double values of specific step
76   COLLECTIONAPI_EXPORT
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
80   COLLECTIONAPI_EXPORT
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
84   COLLECTIONAPI_EXPORT
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
88   COLLECTIONAPI_EXPORT
89   void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
90     const std::list<std::list<bool> >& theComponents);
91
92   /// Dump wrapped feature
93   COLLECTIONAPI_EXPORT
94   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
95
96   /// Returns the internal values tables
97   COLLECTIONAPI_EXPORT
98   std::shared_ptr<ModelAPI_AttributeTables> tableValues();
99
100 };
101
102 /// Pointer on Field object.
103 typedef std::shared_ptr<CollectionAPI_Field> FieldPtr;
104
105 /// \inField CPPHighAPI
106 /// \brief Create Field feature.
107 COLLECTIONAPI_EXPORT
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);
114
115 #endif // CollectionAPI_Field_H_