GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
FieldCollectorBase.hpp
Go to the documentation of this file.
1 // This file is part of GranOO, a workbench for DEM simulation.
2 //
3 // Author(s) : - Damien Andre IRCER/UNILIM, Limoges France
4 // <damien.andre@unilim.fr>
5 // - Jean-luc Charles Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
6 // <jean-luc.charles@ensam.eu>
7 // - Jeremie Girardot Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
8 // <jeremie.girardot@ensam.eu>
9 // - Cedric Hubert LAMIH/UPHF, Valenciennes France
10 // <cedric.hubert@uphf.fr>
11 // - Ivan Iordanoff Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
12 // <ivan.iordanoff@ensam.eu>
13 //
14 // Copyright (C) 2008-2019 D. Andre, JL. Charles, J. Girardot, C. Hubert, I. Iordanoff
15 //
16 // This program is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 // This program is distributed in the hope that it will be useful,
22 // but WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 // GNU General Public License for more details.
25 //
26 // You should have received a copy of the GNU General Public License
27 // along with this program. If not, see <http://www.gnu.org/licenses/>.
28 
29 
30 #ifndef _libCore_FieldCollectorBase_hpp_
31 #define _libCore_FieldCollectorBase_hpp_
32 
33 #include <string>
34 #include <map>
35 #include <vtkUnstructuredGrid.h>
36 
37 
38 #include "GranOO3/Core/Macro.hpp"
40 #include "GranOO3/Core/SetOf.hpp"
41 
42 namespace GranOO3
43 {
45 
46  namespace Core
47  {
49  {
50  public:
51  static void parse_xml();
52  static void collect_all_vtkData(vtkUnstructuredGrid* uGrid);
53  static void collect_all_vtkData(vtkUnstructuredGrid* uGrid, VtkDataType dataType);
54  static void enable_all();
55  static void disable_all();
56 
57  public:
58  FieldCollectorBase(const std::string& classID);
59  virtual ~FieldCollectorBase();
60 
61  GRANOO_ACCESS_GET(ClassID, std::string, _classID);
62  GRANOO_ACCESS(VtkData, VtkDataType, _vtkDataType);
63 
64  FieldBase& get_FieldBase(const std::string&);
65  const FieldBase& get_FieldBase(const std::string&) const;
66 
67  void enable_allField();
68  void disable_allField();
69 
70  virtual void collect_vtkData(vtkUnstructuredGrid* uGrid) = 0;
71 
72  protected:
73  void store(FieldBase*);
74 
75  private:
76  FieldCollectorBase() = delete;
79 
80  void parse_my_xml_attr();
81 
82  private:
83  const std::string _classID;
84 
85  protected:
86  std::map<const std::string, FieldBase*> _field;
88 
89  private:
91  };
92 
93  }
94 }
95 
96 
97 
98 #endif
Definition: FieldBase.hpp:45
Definition: FieldCollectorBase.hpp:49
const std::string _classID
Definition: FieldCollectorBase.hpp:83
virtual void collect_vtkData(vtkUnstructuredGrid *uGrid)=0
static SetOfBase< FieldCollectorBase > & get_all_set()
Definition: FieldCollectorBase.cpp:39
std::map< const std::string, FieldBase * > _field
Definition: FieldCollectorBase.hpp:86
void parse_my_xml_attr()
Definition: FieldCollectorBase.cpp:126
VtkDataType _vtkDataType
Definition: FieldCollectorBase.hpp:87
void disable_allField()
Definition: FieldCollectorBase.cpp:153
virtual ~FieldCollectorBase()
Definition: FieldCollectorBase.cpp:99
FieldCollectorBase(const FieldCollectorBase &)=delete
static void enable_all()
Definition: FieldCollectorBase.cpp:45
FieldCollectorBase & operator=(const FieldCollectorBase &)=delete
void enable_allField()
Definition: FieldCollectorBase.cpp:147
static void disable_all()
Definition: FieldCollectorBase.cpp:51
static void collect_all_vtkData(vtkUnstructuredGrid *uGrid)
Definition: FieldCollectorBase.cpp:87
void store(FieldBase *)
Definition: FieldCollectorBase.cpp:107
static void parse_xml()
Definition: FieldCollectorBase.cpp:57
FieldBase & get_FieldBase(const std::string &)
Definition: FieldCollectorBase.cpp:114
Definition: SetOf.hpp:153
Definition: Common.hpp:198
VtkDataType
Definition: FieldCollectorBase.hpp:44
@ VTK_POINT
Definition: FieldCollectorBase.hpp:44
@ VTK_CELL
Definition: FieldCollectorBase.hpp:44