OGS 6.3.0-179-g962fdcd4e.dirty.20200403132553
Properties.h
Go to the documentation of this file.
1 
13 #pragma once
14 
15 #include <cstdlib>
16 #include <string>
17 #include <map>
18 
19 #include <logog/include/logog.hpp>
20 
21 #include "Location.h"
22 
23 #include "PropertyVector.h"
24 
25 namespace MeshLib
26 {
27 
37 {
38 public:
52  template <typename T>
54  MeshItemType mesh_item_type,
55  std::size_t n_components = 1);
56 
73  template <typename T>
75  std::string const& name,
76  std::size_t n_prop_groups,
77  std::vector<std::size_t> const& item2group_mapping,
78  MeshItemType mesh_item_type,
79  std::size_t n_components = 1);
80 
84  template <typename T>
85  bool existsPropertyVector(std::string const& name) const;
86 
89  template <typename T>
90  bool existsPropertyVector(std::string const& property_name,
91  MeshItemType const mesh_item_type,
92  int const number_of_components) const;
93 
96  template <typename T>
97  PropertyVector<T> const* getPropertyVector(std::string const& name) const;
98 
101  template <typename T>
102  PropertyVector<T>* getPropertyVector(std::string const& name);
103 
107  template <typename T>
108  PropertyVector<T> const* getPropertyVector(std::string const& name,
109  MeshItemType const item_type,
110  int const n_components) const;
111 
115  template <typename T>
116  PropertyVector<T>* getPropertyVector(std::string const& name,
117  MeshItemType const item_type,
118  int const n_components);
120  void removePropertyVector(std::string const& name);
121 
125  bool hasPropertyVector(std::string const& name) const;
126 
127  std::vector<std::string> getPropertyVectorNames() const;
128  std::vector<std::string> getPropertyVectorNames(
129  MeshLib::MeshItemType t) const;
130 
136  std::vector<std::size_t> const& exclude_elem_ids,
137  std::vector<std::size_t> const& exclude_node_ids) const;
138 
143  std::vector<MeshItemType> const& exclude_mesh_item_types) const;
144 
145  Properties() = default;
146 
147  Properties(Properties const& properties);
148  Properties(Properties&& properties) = default;
149  Properties& operator=(Properties const& properties);
150  Properties& operator=(Properties&& properties) = default;
151 
152  ~Properties();
153 
154 private:
157  std::map<std::string, PropertyVectorBase*> _properties;
158 }; // end class
159 
161 
162 } // end namespace MeshLib
PropertyVector< T > * createNewPropertyVector(std::string const &name, MeshItemType mesh_item_type, std::size_t n_components=1)
Definition: Properties.h:15
std::vector< std::string > getPropertyVectorNames() const
Definition: Properties.cpp:36
Properties & operator=(Properties const &properties)
Definition: Properties.cpp:118
Property manager on mesh items. Class Properties manages scalar, vector or matrix properties...
Definition: Properties.h:36
Properties excludeCopyProperties(std::vector< std::size_t > const &exclude_elem_ids, std::vector< std::size_t > const &exclude_node_ids) const
Definition: Properties.cpp:60
MeshItemType
Definition: Location.h:21
void removePropertyVector(std::string const &name)
Definition: Properties.cpp:18
Interface for heuristic search length strategy.
Definition: ProjectData.h:30
PropertyVector< T > const * getPropertyVector(std::string const &name) const
Definition: Properties.h:119
bool existsPropertyVector(std::string const &name) const
Definition: Properties.h:79
bool hasPropertyVector(std::string const &name) const
Definition: Properties.cpp:31
std::map< std::string, PropertyVectorBase * > _properties
Definition: Properties.h:157
Implemenatiom of the template part of the class Properties.