Add a MEDFILE attribut for selection in Efficas. Patch submited by P. Rascle on 2004-03-22.

This commit is contained in:
jrt 2004-03-23 09:53:14 +00:00
parent 9fad60b470
commit addaa0b071

View File

@ -3492,6 +3492,7 @@ void SMESHGUI::Export_Mesh(QAD_Desktop * parent, int theCommandID)
SMESH::SMESH_Mesh_var aMesh = smeshGUI->ConvertIOinMesh(IObject, res); SMESH::SMESH_Mesh_var aMesh = smeshGUI->ConvertIOinMesh(IObject, res);
if (res) if (res)
{ {
QString filename;
if (theCommandID == 122) if (theCommandID == 122)
{ // EXPORT MED { // EXPORT MED
QString filename = QAD_FileDlg::getFileName(parent, QString filename = QAD_FileDlg::getFileName(parent,
@ -3533,11 +3534,10 @@ void SMESHGUI::Export_Mesh(QAD_Desktop * parent, int theCommandID)
aMesh->Export(filename.latin1(), "UNV"); aMesh->Export(filename.latin1(), "UNV");
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
} }
}
else else
aMesh->Export(filename.latin1(), "DAT"); aMesh->Export(filename.latin1(), "DAT");
QApplication::restoreOverrideCursor();
if (IObject->hasEntry()) if (IObject->hasEntry())
{ {
MESSAGE("---"); MESSAGE("---");
@ -3545,15 +3545,27 @@ void SMESHGUI::Export_Mesh(QAD_Desktop * parent, int theCommandID)
smeshGUI->myStudy->FindObjectID(IObject->getEntry()); smeshGUI->myStudy->FindObjectID(IObject->getEntry());
SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeComment_var aFileName; SALOMEDS::AttributeComment_var aFileName;
SALOMEDS::StudyBuilder_var aStudyBuilder = SALOMEDS::StudyBuilder_var aStudyBuilder =
smeshGUI->myStudy->NewBuilder(); smeshGUI->myStudy->NewBuilder();
anAttr = anAttr =
aStudyBuilder->FindOrCreateAttribute(SO, aStudyBuilder->FindOrCreateAttribute(SO, "AttributeComment");
"AttributeComment");
aFileName = SALOMEDS::AttributeComment::_narrow(anAttr); aFileName = SALOMEDS::AttributeComment::_narrow(anAttr);
aFileName->SetValue(filename.latin1()); aFileName->SetValue(filename.latin1());
// Add a MEDFILE attribute to make selection in Efficas
if (theCommandID == 122)
{ // EXPORT MED
QString medfilename="FICHIERMED"+filename;
anAttr = aStudyBuilder->FindOrCreateAttribute(SO, "AttributeComment");
SALOMEDS::AttributeComment_var MEDFileName;
MEDFileName = SALOMEDS::AttributeComment::_narrow(anAttr);
MEDFileName->SetValue(medfilename.latin1());
} // EXPORT MED
} }
}
QApplication::restoreOverrideCursor();
} }
} }
} }
@ -4125,7 +4137,7 @@ SMESH_Actor *SMESHGUI::ReadScript(SMESH::SMESH_Mesh_ptr aMesh)
} }
case SMESH::ADD_EDGE: case SMESH::ADD_EDGE:
{ {
// AddEdges( MeshActor, aSeq[ind].number, aSeq[ind].coords, aSeq[ind].indexes ); AddEdges( MeshActor, aSeq[ind].number, aSeq[ind].coords, aSeq[ind].indexes );
break; break;
} }
case SMESH::ADD_TRIANGLE: case SMESH::ADD_TRIANGLE:
@ -4228,7 +4240,7 @@ void SMESHGUI::Dump(SMESH_Actor * Mactor)
void SMESHGUI::AddNodes(SMESH_Actor * Mactor, int number, void SMESHGUI::AddNodes(SMESH_Actor * Mactor, int number,
const SMESH::double_array & coords, const SMESH::long_array & indexes) const SMESH::double_array & coords, const SMESH::long_array & indexes)
{ {
MESSAGE("SMESHGUI::AddNodes(number="<<number<<", indexes.length()="<<indexes.length()<<")"); //MESSAGE("SMESHGUI::AddNodes(number="<<number<<", indexes.length()="<<indexes.length()<<")");
QApplication::setOverrideCursor(Qt::waitCursor); QApplication::setOverrideCursor(Qt::waitCursor);
if (Mactor->GetMapper() == NULL) if (Mactor->GetMapper() == NULL)
{ {
@ -4949,8 +4961,8 @@ void SMESHGUI::AddEdge(SMESH_Actor * Mactor, int idedge, int idnode1,
void SMESHGUI::AddTriangles(SMESH_Actor * Mactor, int number, void SMESHGUI::AddTriangles(SMESH_Actor * Mactor, int number,
const SMESH::double_array & coords, const SMESH::long_array & indexes) const SMESH::double_array & coords, const SMESH::long_array & indexes)
{ {
MESSAGE("SMESHGUI::AddTriangles(number="<<number<<", indexes.length=" // MESSAGE("SMESHGUI::AddTriangles(number="<<number<<", indexes.length="
<<indexes.length()<<")"); // <<indexes.length()<<")");
QApplication::setOverrideCursor(Qt::waitCursor); QApplication::setOverrideCursor(Qt::waitCursor);
//vtkUnstructuredGrid* ugrid = vtkUnstructuredGrid::SafeDownCast( Mactor->DataSource ); //vtkUnstructuredGrid* ugrid = vtkUnstructuredGrid::SafeDownCast( Mactor->DataSource );