1 // Copyright (C) 2010-2016 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 email : webmaster.salome@opencascade.com
20 #ifndef __VTKMEDCOUPLINGMULTIFIELDSCLIENT_HXX__
21 #define __VTKMEDCOUPLINGMULTIFIELDSCLIENT_HXX__
23 #include "ParaMEDMEM2VTK_defines.hxx"
24 #include "ParaMEDCouplingCorbaServant.hh"
32 namespace ParaMEDMEM2VTK
35 * Stores all info on field without consideration of time
40 int _type;//ON_CELLS = 0, ON_NODES = 1, ON_GAUSS_PT = 2, ON_GAUSS_NE = 3
44 class ParaMEDMEM2VTK_EXPORT MEDCouplingMultiFieldsFetcher
47 MEDCouplingMultiFieldsFetcher(int bufferingPolicy, SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_ptr mfieldsPtr);
48 ~MEDCouplingMultiFieldsFetcher();
49 std::vector<double> getTimeStepsForPV();
50 void fetchRegardingPolicy();
51 vtkDataSet *buildDataSetOnTime(double time);
53 void appendFieldValueOnAlreadyFetchedData(vtkDataSet *ds, int fieldId);
54 int getPosGivenTimeLabel(double t);
55 private://CORBA Fetching
56 void retrievesMainTinyInfo();
59 void fetchDataIfNeeded(int fieldId);
60 void unregisterRemoteServantIfAllFetched();
61 void applyBufferingPolicy();
64 SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_var _mfields_ptr;
65 bool _mfields_ptr_released;
67 std::vector<TinyInfoOnField> _info_per_field;
68 std::vector<double> _time_label_per_field;
69 std::vector<int> _time_discr_per_field;
70 std::vector<int> _mesh_id_per_field;
71 std::vector< std::vector<int> > _array_ids_per_field;
72 std::vector< std::vector<double> > _time_def_per_field;
74 int _field_id_previous;
75 int _arr_pos_previous;
76 double _time_field_id_previous;
78 int _mesh_id_previous;
80 std::vector<vtkDataSet *> _meshes;
81 std::vector<bool> _is_meshes_polyhedron;//to correct bug of polyhedrons in VTK on DeepCopy. BUG id :0011860
82 std::vector<vtkDoubleArray *> _arrays;
84 static const double EPS_TIME;