SHAPER  9.12.0
CollectionAPI_Field.h
1 // Copyright (C) 2014-2023 CEA, EDF
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 email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef CollectionAPI_Field_H_
21 #define CollectionAPI_Field_H_
22 
23 #include "CollectionAPI.h"
24 
25 #include <CollectionPlugin_Field.h>
26 
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29 
33 class ModelHighAPI_ComponentValue;
34 
39 {
40 public:
42  COLLECTIONAPI_EXPORT
43  explicit CollectionAPI_Field(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44 
46  COLLECTIONAPI_EXPORT
47  virtual ~CollectionAPI_Field();
48 
49  INTERFACE_4(CollectionPlugin_Field::ID(),
57  )
58 
59 
60  COLLECTIONAPI_EXPORT
61  void setSelection(const std::list<ModelHighAPI_Selection>& theFieldList);
63  COLLECTIONAPI_EXPORT
64  void setComponentsNames(const std::list<std::string>& theNames);
66  COLLECTIONAPI_EXPORT
67  void setValuesType(const std::string& theType);
69  COLLECTIONAPI_EXPORT
70  void setStepsNum(const ModelHighAPI_Integer& theSteps);
72  COLLECTIONAPI_EXPORT
73  void setStamps(const std::list<ModelHighAPI_Integer>& theStamps);
75  COLLECTIONAPI_EXPORT
76  void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
77  const std::list<std::list<double> >& theComponents);
79  COLLECTIONAPI_EXPORT
80  void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
81  const std::list<std::list<int> >& theComponents);
83  COLLECTIONAPI_EXPORT
84  void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
85  const std::list<std::list<std::string> >& theComponents);
87  COLLECTIONAPI_EXPORT
88  void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
89  const std::list<std::list<bool> >& theComponents);
90 
92  COLLECTIONAPI_EXPORT
93  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
94 
96  COLLECTIONAPI_EXPORT
97  std::shared_ptr<ModelAPI_AttributeTables> tableValues();
98 
99 };
100 
102 typedef std::shared_ptr<CollectionAPI_Field> FieldPtr;
103 
106 COLLECTIONAPI_EXPORT
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);
113 
114 #endif // CollectionAPI_Field_H_
\inField CPPHighAPI
Definition: CollectionAPI_Field.h:39
CollectionAPI_Field(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: CollectionAPI_Field.cpp:32
std::shared_ptr< ModelAPI_AttributeTables > tableValues()
Returns the internal values tables.
Definition: CollectionAPI_Field.cpp:148
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > selection() const
Field selection list.
Definition: CollectionAPI_Field.h:57
void setValuesType(const std::string &theType)
Set type of values.
Definition: CollectionAPI_Field.cpp:58
virtual std::shared_ptr< ModelAPI_AttributeIntArray > stamps() const
Identifiers of stamps.
Definition: CollectionAPI_Field.h:57
virtual std::shared_ptr< ModelAPI_AttributeStringArray > componentsNames() const
Names of components list of strings.
Definition: CollectionAPI_Field.h:57
void addStep(const ModelHighAPI_Integer &theStepNum, const ModelHighAPI_Integer &theStamp, const std::list< std::list< double > > &theComponents)
Sets the double values of specific step.
Definition: CollectionAPI_Field.cpp:102
void setStamps(const std::list< ModelHighAPI_Integer > &theStamps)
Set stamps identifiers.
Definition: CollectionAPI_Field.cpp:72
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: CollectionAPI_Field.cpp:108
void setComponentsNames(const std::list< std::string > &theNames)
Set names of components.
Definition: CollectionAPI_Field.cpp:51
void setSelection(const std::list< ModelHighAPI_Selection > &theFieldList)
Set selected objects.
Definition: CollectionAPI_Field.cpp:44
void setStepsNum(const ModelHighAPI_Integer &theSteps)
Set number of steps.
Definition: CollectionAPI_Field.cpp:65
virtual ~CollectionAPI_Field()
Destructor.
Definition: CollectionAPI_Field.cpp:39
static const std::string & COMPONENTS_NAMES_ID()
attribute name of componenets titles array
Definition: CollectionPlugin_Field.h:58
static const std::string & ID()
Feature kind.
Definition: CollectionPlugin_Field.h:46
static const std::string & SELECTED_ID()
attribute name of selected entities list
Definition: CollectionPlugin_Field.h:52
static const std::string & VALUES_ID()
attribute name of list of tables that contain deafult values (row 0) and the custom values
Definition: CollectionPlugin_Field.h:70
static const std::string & STAMPS_ID()
attribute name of stamps integer array
Definition: CollectionPlugin_Field.h:64
API for the attribute that contains several integers in the array inside.
Definition: ModelAPI_AttributeIntArray.h:36
Attribute that contains list of references to the sub-shapes with possibility to manage them.
Definition: ModelAPI_AttributeSelectionList.h:37
API for the attribute that contains several strings in the array inside.
Definition: ModelAPI_AttributeStringArray.h:32
API for the attribute that contains tables of some values type.
Definition: ModelAPI_AttributeTables.h:39
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:52
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Class for filling ModelAPI_AttributeInteger.
Definition: ModelHighAPI_Integer.h:36
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:42
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49