1 // FILTER FILTER : implemetation of FILTER idl descriptions
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : Filter_Gen_i.hxx
25 // Author : Bernard SECHER, CEA
29 #ifndef _FILTER_GEN_I_HXX_
30 #define _FILTER_GEN_I_HXX_
32 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(FILTER_Gen)
36 #include "utilities.h"
37 #include "MEDMEM_Med.hxx"
38 #include "Utils_SALOME_Exception.hxx"
40 #include "SALOME_Component_i.hxx"
41 #include "SALOME_NamingService.hxx"
44 public POA_SALOME_FILTER::FILTER_Gen,
45 public Engines_Component_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();
56 void loadMED(const char* inMedFile);
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);
77 int getNodeNumber(int);
78 int getNeighbourVertex(int) throw(SALOME_Exception);
80 static Filter_Gen_i* _FILTERGen; // Point to last created instance of the class
83 SALOME_NamingService *_NS;
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;
102 PortableServer::ObjectId * FilterMEDEngine_factory(
104 PortableServer::POA_ptr poa,
105 PortableServer::ObjectId * contId,
106 const char *instanceName,
107 const char *interfaceName);