Back to index

salome-paravis  6.5.0
VTKMEDCouplingMultiFieldsClient.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2010-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef __VTKMEDCOUPLINGMULTIFIELDSCLIENT_HXX__
00021 #define __VTKMEDCOUPLINGMULTIFIELDSCLIENT_HXX__
00022 
00023 #include "ParaMEDMEM2VTK_defines.hxx"
00024 #include "ParaMEDCouplingCorbaServant.hh"
00025 
00026 #include <vector>
00027 #include <string>
00028 
00029 class vtkDataSet;
00030 class vtkDoubleArray;
00031 
00032 namespace ParaMEDMEM2VTK
00033 {
00037   class TinyInfoOnField
00038   {
00039   public:
00040     int _type;//ON_CELLS = 0, ON_NODES = 1, ON_GAUSS_PT = 2, ON_GAUSS_NE = 3
00041     std::string _name;
00042   };
00043 
00044   class ParaMEDMEM2VTK_EXPORT MEDCouplingMultiFieldsFetcher
00045   {
00046   public:
00047     MEDCouplingMultiFieldsFetcher(int bufferingPolicy, SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_ptr mfieldsPtr);
00048     ~MEDCouplingMultiFieldsFetcher();
00049     std::vector<double> getTimeStepsForPV();
00050     void fetchRegardingPolicy();
00051     vtkDataSet *buildDataSetOnTime(double time);
00052   private:
00053     void appendFieldValueOnAlreadyFetchedData(vtkDataSet *ds, int fieldId);
00054     int getPosGivenTimeLabel(double t);
00055   private://CORBA Fetching
00056     void retrievesMainTinyInfo();
00057     void fetchAll();
00058     void fetchMeshes();
00059     void fetchDataIfNeeded(int fieldId);
00060     void unregisterRemoteServantIfAllFetched();
00061     void applyBufferingPolicy();
00062   private:
00063     int _effective_pol;
00064     SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_var _mfields_ptr;
00065     bool _mfields_ptr_released;
00066   private:
00067     std::vector<TinyInfoOnField> _info_per_field;
00068     std::vector<double> _time_label_per_field;
00069     std::vector<int> _time_discr_per_field;
00070     std::vector<int> _mesh_id_per_field;
00071     std::vector< std::vector<int> > _array_ids_per_field;
00072     std::vector< std::vector<double> > _time_def_per_field;
00073   private:
00074     int _field_id_previous;
00075     int _arr_pos_previous;
00076     double _time_field_id_previous;
00077     int _arr_id_previous;
00078     int _mesh_id_previous;
00079   private:
00080     std::vector<vtkDataSet *> _meshes;
00081     std::vector<bool> _is_meshes_polyhedron;//to correct bug of polyhedrons in VTK on DeepCopy. BUG id :0011860
00082     std::vector<vtkDoubleArray *> _arrays;
00083   private:
00084     static const double EPS_TIME;
00085   };
00086 }
00087 
00088 #endif