PortableServer::ObjectId * contId,
const char *instanceName,
const char *interfaceName) :
- Engines_Component_i(orb, poa, contId, instanceName, interfaceName),_med(NULL),_newMed(NULL),_mesh(NULL),_newMesh(NULL),_myGradient(NULL),_myDField(NULL),_myIField(NULL),_criteria(NULL)
+ Engines_Component_i(orb, poa, contId, instanceName, interfaceName),_med(NULL),_newMed(NULL),_mesh(NULL),_newMesh(NULL),_myGradient(NULL),_myDField(NULL),_myIField(NULL),_criteria(NULL),_map(NULL)
{
MESSAGE("activate object");
_thisObj = this ;
delete _criteria;
}
+ if(_map)
+ delete [] _map;
if(_med)
delete _med;
+ if(_newMed)
+ delete _newMed;
}
void Filter_Gen_i::loadMED(const char* inMedFile)
return seq;
}
-void Filter_Gen_i::generateCriteria(CORBA::Long nbthresh,CORBA::Double fthresh,CORBA::Double sthresh,CORBA::Long areaFlag) throw(SALOME_FILTER::FILTER_Gen::FilterError)
+void Filter_Gen_i::generateCriteria(CORBA::Long nbthresh,CORBA::Double fthresh,CORBA::Double sthresh,CORBA::Boolean areaFlag) throw(SALOME_FILTER::FILTER_Gen::FilterError)
{
double val, min, max;
double sigmaV;
// call ensight driver MED to generate input ensight mesh ,
// input ensight boundary mesh and input criteria ensight field for filtoo
MESSAGE("Create ensight mesh");
- ENSIGHT_MESH_DRIVER myMeshDriver("/tmp/input.geom",_mesh);
+ ENSIGHT_MESH_WRONLY_DRIVER myMeshDriver("/tmp/input.case",_mesh);
myMeshDriver.addSupport(supB);
- id=_mesh->addDriver(myMeshDriver);
- _mesh->write(id);
+// myMeshDriver.open();
+ myMeshDriver.write();
+// myMeshDriver.close();
MESSAGE("Create ensight field");
- ENSIGHT_FIELD_DRIVER<int> myFieldDriver("/tmp/input.data",_criteria);
- id=_criteria->addDriver(myFieldDriver);
- _criteria->write(id);
+ ENSIGHT_FIELD_WRONLY_DRIVER<int> myFieldDriver("/tmp/input.case",_criteria);
+// myFieldDriver.open();
+ myFieldDriver.write();
+// myFieldDriver.close();
}
void Filter_Gen_i::filtering()
string command;
// have to call ensight driver MED to generate output MED file from filtoo output
- MED _newMed(ENSIGHT_DRIVER,"/tmp/output.case");
- _newMed.read();
+ _newMed = new ::MED(ENSIGHT_DRIVER,"/tmp/output.case");
+ _newMed->read();
// destroy filtoo output files
// command = "cd /tmp;rm -f output.*";
// system(command.c_str());
// get new mesh name
- deque<string> meshesNames = _newMed.getMeshNames();
+ deque<string> meshesNames = _newMed->getMeshNames();
int numberOfMeshes = meshesNames.size();
if( numberOfMeshes != 1)
throw SALOME_FILTER::FILTER_Gen::FilterError("Unvalid number of meshes in filtoo output");
// new mesh generated by filtoo
- _newMesh = _newMed.getMesh(meshesNames[0]);
+ _newMesh = _newMed->getMesh(meshesNames[0]);
// create support on nodes on all new mesh
SUPPORT *newSup = new SUPPORT(_newMesh,"Support",MED_NODE);
}
if(newDField)
- _newMed.addField(newDField);
+ _newMed->addField(newDField);
else
- _newMed.addField(newIField);
+ _newMed->addField(newIField);
// Destroy input field if not referecne field
if(!isReferenceField)
{
int id;
- MESSAGE("Create ensight mesh");
- id = _newMed->addDriver(MED_DRIVER,outMedFile);
+ MESSAGE("Create MED mesh: "<<outMedFile);
+ id = _newMed->addDriver(MED_DRIVER,outMedFile,MED_EN::MED_ECRI);
_newMed->write(id);
}