Salome HOME
This commit was generated by cvs2git to create tag 'V4_1_0a3'.
[modules/filter.git] / src / FILTER / Filter_Gen_i.hxx
1 //  FILTER FILTER : implemetation of FILTER idl descriptions
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //
24 //  File   : Filter_Gen_i.hxx
25 //  Author : Bernard SECHER, CEA
26 //  Module : FILTER
27 //  $Header$
28
29 #ifndef _FILTER_GEN_I_HXX_
30 #define _FILTER_GEN_I_HXX_
31
32 #include <SALOMEconfig.h>
33 #include <map>
34 #include CORBA_SERVER_HEADER(FILTER_Gen)
35
36 #include "utilities.h"
37 #include "MEDMEM_Med.hxx"
38 #include "Utils_SALOME_Exception.hxx"
39
40 #include "SALOME_Component_i.hxx"
41 #include "SALOME_NamingService.hxx"
42
43 class Filter_Gen_i:
44   public POA_SALOME_FILTER::FILTER_Gen,
45   public Engines_Component_i 
46 {
47 public:
48   Filter_Gen_i();
49   Filter_Gen_i(CORBA::ORB_ptr orb,
50             PortableServer::POA_ptr poa,
51             PortableServer::ObjectId * contId, 
52             const char *instanceName, 
53             const char *interfaceName);
54   virtual ~Filter_Gen_i();
55
56   void loadMED(const char* inMedFile);
57   void unloadMED();
58   SALOME_FILTER::StrSeq* getMeshNames();
59   SALOME_FILTER::StrSeq* getFieldNames();
60   CORBA::Long getMeshDimension(const char* meshName);
61   CORBA::Long getFieldEntity(const char* fieldName,CORBA::Long dt,CORBA::Long it);
62   CORBA::Boolean fieldIsOnAllElements(const char* fieldName,CORBA::Long dt,CORBA::Long it);
63   SALOME_FILTER::DTITSeq* getFieldIteration(const char* fieldName);
64   char* getMeshName(const char* fieldName,CORBA::Long dt,CORBA::Long it);
65   void readReferenceField(const char* meshName, const char* fieldName, CORBA::Long ts);
66   void buildGradient()  throw(SALOME_FILTER::FILTER_Gen::FilterError);
67   void getMinMax(CORBA::Double& imin, CORBA::Double& imax,SALOME_FILTER::ref_func rf);
68   SALOME_FILTER::LongSeq* getHistogram(CORBA::Long size,SALOME_FILTER::ref_func rf);
69   void generateCriteria(CORBA::Long nbthresh,CORBA::Double fthresh,CORBA::Double thresh,CORBA::Boolean areaFlag,SALOME_FILTER::ref_func rf) throw(SALOME_FILTER::FILTER_Gen::FilterError);
70   void createEnsightInputFiles() throw(SALOME_FILTER::FILTER_Gen::FilterError);
71   void filtering() throw(SALOME_FILTER::FILTER_Gen::FilterError);
72   void projectFieldsOnDecimateMesh() throw(SALOME_FILTER::FILTER_Gen::FilterError);
73   void createMedOutputFile(const char* outMedFile);
74
75 private :
76   void readMapping();
77   int getNodeNumber(int);
78   int getNeighbourVertex(int) throw(SALOME_Exception);
79
80   static Filter_Gen_i*  _FILTERGen;    // Point to last created instance of the class
81
82   bool   _duringLoad;
83   SALOME_NamingService *_NS;
84
85   int _nbvmap;
86   int *_map;
87   int _connL;
88   const int *_conn;
89   const int *_connI;
90   string _file;
91
92   ::MEDMEM::MED *_med, *_newMed;
93   MESH* _mesh, *_newMesh;
94   FIELD<double> * _myGradient;
95   FIELD<double> * _myDField;
96   FIELD<int> * _myIField;
97   FIELD<int> *_criteria;
98
99 };
100
101 extern "C"
102     PortableServer::ObjectId * FilterMEDEngine_factory(
103             CORBA::ORB_ptr orb,
104             PortableServer::POA_ptr poa,
105             PortableServer::ObjectId * contId,
106             const char *instanceName,
107             const char *interfaceName);
108 #endif