From: nadir Date: Mon, 8 Dec 2003 14:30:11 +0000 (+0000) Subject: updating or adding when merging with the main trunk version !! X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fnadir_1_2_2;p=modules%2Fsmesh.git updating or adding when merging with the main trunk version !! --- diff --git a/doc/html/INPUT/sources/Application-About.png b/doc/html/INPUT/sources/Application-About.png index 80e0bcb06..7b58330d5 100755 Binary files a/doc/html/INPUT/sources/Application-About.png and b/doc/html/INPUT/sources/Application-About.png differ diff --git a/doc/html/INPUT/sources/Application-About1.jpg b/doc/html/INPUT/sources/Application-About1.jpg index b8f2cfb6d..cf7ab8ba0 100755 Binary files a/doc/html/INPUT/sources/Application-About1.jpg and b/doc/html/INPUT/sources/Application-About1.jpg differ diff --git a/doc/html/INPUT/sources/application.gif b/doc/html/INPUT/sources/application.gif index 10da488d2..0b05d5c18 100644 Binary files a/doc/html/INPUT/sources/application.gif and b/doc/html/INPUT/sources/application.gif differ diff --git a/doc/html/INPUT/sources/application.jpg b/doc/html/INPUT/sources/application.jpg index 6d3b6a0a8..a6979ab99 100755 Binary files a/doc/html/INPUT/sources/application.jpg and b/doc/html/INPUT/sources/application.jpg differ diff --git a/src/MEFISTO2/areteideale.f b/src/MEFISTO2/areteideale.f index cabc8d442..f0c8744ca 100755 --- a/src/MEFISTO2/areteideale.f +++ b/src/MEFISTO2/areteideale.f @@ -1,3 +1,28 @@ +c MEFISTO : library to compute 2D triangulation from segmented boundaries +c +c Copyright (C) 2003 Laboratoire J.-L. Lions UPMC Paris +c +c This library is free software; you can redistribute it and/or +c modify it under the terms of the GNU Lesser General Public +c License as published by the Free Software Foundation; either +c version 2.1 of the License. +c +c This library is distributed in the hope that it will be useful, +c but WITHOUT ANY WARRANTY; without even the implied warranty of +c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +c Lesser General Public License for more details. +c +c You should have received a copy of the GNU Lesser General Public +c License along with this library; if not, write to the Free Software +c Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +c +c See http://www.ann.jussieu.fr/~perronne or email Perronnet@ann.jussieu.fr +c +c +c File : areteideale.f +c Module : SMESH +c Author: Alain PERRONNET + double precision function areteideale( xyz, direction ) double precision xyz(3), direction(3) areteideale = 10 diff --git a/src/MEFISTO2/trte.f b/src/MEFISTO2/trte.f index f66104e34..8e0388b88 100755 --- a/src/MEFISTO2/trte.f +++ b/src/MEFISTO2/trte.f @@ -1,3 +1,28 @@ +c MEFISTO : library to compute 2D triangulation from segmented boundaries +c +c Copyright (C) 2003 Laboratoire J.-L. Lions UPMC Paris +c +c This library is free software; you can redistribute it and/or +c modify it under the terms of the GNU Lesser General Public +c License as published by the Free Software Foundation; either +c version 2.1 of the License. +c +c This library is distributed in the hope that it will be useful, +c but WITHOUT ANY WARRANTY; without even the implied warranty of +c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +c Lesser General Public License for more details. +c +c You should have received a copy of the GNU Lesser General Public +c License along with this library; if not, write to the Free Software +c Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +c +c See http://www.ann.jussieu.fr/~perronne or email Perronnet@ann.jussieu.fr +c +c +c File : trte.f +c Module : SMESH +c Author: Alain PERRONNET + subroutine qutr2d( p1, p2, p3, qualite ) c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ c but : calculer la qualite d'un triangle de r**2 @@ -2957,7 +2982,6 @@ c une arete de sommet ns if( narete .le. 0 ) then c erreur: le point appartient a aucune arete write(imprim,*) 'sommet ',ns,' dans aucune arete' - pause ierr = 11 return endif @@ -4369,7 +4393,6 @@ c ---------------------------------- c else if( nbar .le. 2 ) then write(imprim,*) 'erreur trchtd: cf<3 aretes' - pause namin = 0 namin0 = 0 return @@ -5447,7 +5470,6 @@ c l'arete appartient a 2 triangles differents de nt0 c anomalie. chainage des triangles des aretes defectueux c a corriger write(imprim,*) 'pause dans tridcf' - pause ierr = 5 return endif @@ -5983,7 +6005,6 @@ c recherche du numero de l'arete noaret dans le triangle nt1 10 continue c impossible d'arriver ici sans bogue! write(imprim,*) 'pause dans te2t2t 1' - pause c c l'arete de sommets 2 et 3 15 if( n1 .lt. 3 ) then @@ -6008,7 +6029,6 @@ c recherche du numero de l'arete noaret dans le triangle nt2 20 continue c impossible d'arriver ici sans bogue! write(imprim,*) 'pause dans te2t2t 2' - pause c c l'arete de sommets 1 et 4 25 if( n1 .lt. 3 ) then @@ -7078,7 +7098,6 @@ c c c erreur: le point np n'est pas dans l'un des nbtr triangles write(imprim,10010) np - pause ierr = 3 return c @@ -7165,7 +7184,6 @@ c l'arete noar n'a pas ete retrouvee dans le chainage => erreur % ' st2=',nosoar(2,noar),' ligne=',nosoar(3,noar), % ' tr1=',nosoar(4,noar),' tr2=',nosoar(5,noar) write(imprim,*) 'chainages=',(nosoar(i,noar),i=6,mosoar) - pause c l'arete n'est pas detruite return c @@ -7802,7 +7820,6 @@ c les sens ns1->ns2 et ns2->ns1 ne donne pas de solution! write(imprim,*)'tefoar:arete ',ns1,' - ',ns2,' a imposer' write(imprim,*)'tefoar:anomalie sommet ',ns1, % 'non dans le triangle de sommets ',(nosotr(i),i=1,3) - pause ierr = 11 return endif @@ -7934,7 +7951,6 @@ c ici le sommet nsp est trop proche de l'arete perdue ns1-ns2 c point utilisateur ou frontalier non supprimable ierr = 11 write(imprim,*) 'pause dans tefoar 1', d, d3, d4, d12 - pause return endif c @@ -7958,7 +7974,6 @@ ccc % ncroug, ncblan ) ccc tratri = .false. ierr = 11 write(imprim,*) 'pause dans tefoar 2' - pause return endif c @@ -8030,7 +8045,6 @@ c redemarrage avec le triangle nt0 et l'arete na0 c write(imprim,*) 'tefoar: algorithme defaillant' ierr = 11 - pause return endif 50 continue @@ -8042,7 +8056,6 @@ c rotation autour du sommet par l'arete suivant na1 write(imprim,*) 'les lignes fermees doivent etre disjointes' write(imprim,*) 'verifiez si elles ne se coupent pas' ierr = 13 - pause return c c cas sans probleme : intersection differente de celle initiale diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index fb8dcf04f..a48f011be 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -72,6 +72,8 @@ SMESH_Actor::SMESH_Actor() EdgeShrinkDevice->VisibilityOff(); EdgeShrinkDevice->PickableOff(); + DataSource = NULL; + myIO = NULL; myName = ""; myDisplayMode = 0; diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index daabeb0f8..07385dc90 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -214,7 +214,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4) { - return AddFaceWithID(n1,n2,n3, myElementIDFactory->GetFreeID()); + return AddFaceWithID(n1,n2,n3, n4, myElementIDFactory->GetFreeID()); } /////////////////////////////////////////////////////////////////////////////// @@ -731,11 +731,7 @@ SMDS_MeshFace * SMDS_Mesh::createQuadrangle(SMDS_MeshNode * node1, void SMDS_Mesh::RemoveNode(const SMDS_MeshNode * node) { - SMDS_Iterator * it= - node->GetInverseElementIterator(); - while(it->more()) RemoveElement(it->next(),true); - myNodeIDFactory->ReleaseID(node->GetID()); - myNodes.erase(const_cast(node)); + RemoveElement(node, true); } /////////////////////////////////////////////////////////////////////////////// @@ -744,10 +740,7 @@ void SMDS_Mesh::RemoveNode(const SMDS_MeshNode * node) void SMDS_Mesh::RemoveEdge(const SMDS_MeshEdge * edge) { - /** @todo to be fix */ - myEdges.erase(const_cast(edge)); - //removeElementDependencies(edge); - delete edge; + RemoveElement(edge,true); } /////////////////////////////////////////////////////////////////////////////// @@ -756,10 +749,7 @@ void SMDS_Mesh::RemoveEdge(const SMDS_MeshEdge * edge) void SMDS_Mesh::RemoveFace(const SMDS_MeshFace * face) { - /** @todo to be fix */ - myFaces.erase(const_cast(face)); - //removeElementDependencies(face); - delete face; + RemoveElement(face, true); } /////////////////////////////////////////////////////////////////////////////// @@ -768,64 +758,7 @@ void SMDS_Mesh::RemoveFace(const SMDS_MeshFace * face) void SMDS_Mesh::RemoveVolume(const SMDS_MeshVolume * volume) { - /** @todo to be fix */ - myVolumes.erase(const_cast(volume)); - //removeElementDependencies(volume); - delete volume; -} - -/////////////////////////////////////////////////////////////////////////////// -/// Remove no longer used sub element of an element. Unbind the element ID -/////////////////////////////////////////////////////////////////////////////// - -void SMDS_Mesh::removeElementDependencies(SMDS_MeshElement * element) -{ - /** @todo to be fix */ - myElementIDFactory->ReleaseID(element->GetID()); - SMDS_Iterator * it=element->nodesIterator(); - while(it->more()) - { - SMDS_MeshNode * node=static_cast( - const_cast(it->next())); - node->RemoveInverseElement(element); - if(node->emptyInverseElements()) RemoveNode(node); - } -} - -//======================================================================= -//function : RemoveElement -//purpose : -//======================================================================= - -void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, - const bool removenodes) -{ - /** @todo to be fix */ - switch(elem->GetType()) - { - case SMDSAbs_Node: - RemoveNode((const SMDS_MeshNode*)elem); - return; - case SMDSAbs_Edge: - RemoveEdge((const SMDS_MeshEdge*)elem); - break; - case SMDSAbs_Face: - RemoveFace((const SMDS_MeshFace*)elem); - break; - case SMDSAbs_Volume: - RemoveVolume((const SMDS_MeshVolume*)elem); - break; - default : - MESSAGE("remove function : unknown type"); - return; - } -/* - SMDS_Iterator * it=elem->nodesIterator(); - while(it->more()) - { - const SMDS_MeshNode * node=it->next(); - - }*/ + RemoveElement(volume, true); } //======================================================================= @@ -1440,3 +1373,201 @@ SMDS_Iterator * SMDS_Mesh::volumesIterator() const return new MyIterator(myVolumes); } +/////////////////////////////////////////////////////////////////////////////// +/// Do intersection of sets (more than 2) +/////////////////////////////////////////////////////////////////////////////// +set * intersectionOfSets( + set vs[], int numberOfSets) +{ + set* rsetA=new set(vs[0]); + set* rsetB; + + for(int i=0; i(); + set_intersection( + rsetA->begin(), rsetA->end(), + vs[i+1].begin(), vs[i+1].end(), + inserter(*rsetB, rsetB->begin())); + delete rsetA; + rsetA=rsetB; + } + return rsetA; +} + +/////////////////////////////////////////////////////////////////////////////// +/// Return the list of finit elements owning the given element +/////////////////////////////////////////////////////////////////////////////// +set * getFinitElements(const SMDS_MeshElement * element) +{ + int numberOfSets=element->NbNodes(); + set initSet[numberOfSets]; + + SMDS_Iterator * itNodes=element->nodesIterator(); + + int i=0; + while(itNodes->more()) + { + const SMDS_MeshNode * n=static_cast(itNodes->next()); + SMDS_Iterator * itFe = n->GetInverseElementIterator(); + + //initSet[i]=set(); + while(itFe->more()) initSet[i].insert(itFe->next()); + + i++; + delete itFe; + } + delete itNodes; + + return intersectionOfSets(initSet, numberOfSets); +} + +/////////////////////////////////////////////////////////////////////////////// +/// Return the list of nodes used only by the given elements +/////////////////////////////////////////////////////////////////////////////// +set * getExclusiveNodes( + set& elements) +{ + set * toReturn=new set(); + set::iterator itElements=elements.begin(); + + while(itElements!=elements.end()) + { + SMDS_Iterator * itNodes= + (*itElements)->nodesIterator(); + itElements++; + + while(itNodes->more()) + { + const SMDS_MeshNode * n=static_cast(itNodes->next()); + SMDS_Iterator * itFe = n->GetInverseElementIterator(); + set s; + while(itFe->more()) s.insert(itFe->next()); + delete itFe; + if(s==elements) toReturn->insert(n); + } + delete itNodes; + } + return toReturn; +} + +/////////////////////////////////////////////////////////////////////////////// +///Find the children of an element that are made of given nodes +///@param setOfChildren The set in which matching children will be inserted +///@param element The element were to search matching children +///@param nodes The nodes that the children must have to be selected +/////////////////////////////////////////////////////////////////////////////// +void SMDS_Mesh::addChildrenWithNodes(set& setOfChildren, + const SMDS_MeshElement * element, set& nodes) +{ + + switch(element->GetType()) + { + case SMDSAbs_Node: + MESSAGE("Internal Error: This should not append"); + break; + case SMDSAbs_Edge: + { + SMDS_Iterator * itn=element->nodesIterator(); + while(itn->more()) + { + const SMDS_MeshElement * e=itn->next(); + if(nodes.find(e)!=nodes.end()) setOfChildren.insert(element); + } + delete itn; + } break; + case SMDSAbs_Face: + { + SMDS_Iterator * itn=element->nodesIterator(); + while(itn->more()) + { + const SMDS_MeshElement * e=itn->next(); + if(nodes.find(e)!=nodes.end()) setOfChildren.insert(element); + } + delete itn; + if(hasConstructionEdges()) + { + SMDS_Iterator* ite=element->edgesIterator(); + while(ite->more()) + addChildrenWithNodes(setOfChildren, ite->next(), nodes); + delete ite; + } + } break; + case SMDSAbs_Volume: + { + if(hasConstructionFaces()) + { + SMDS_Iterator * ite=element->facesIterator(); + while(ite->more()) + addChildrenWithNodes(setOfChildren, ite->next(), nodes); + delete ite; + } + else if(hasConstructionEdges()) + { + SMDS_Iterator * ite=element->edgesIterator(); + while(ite->more()) + addChildrenWithNodes(setOfChildren, ite->next(), nodes); + delete ite; + } + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +///@param elem The element to delete +///@param removenodes if true remaining nodes will be removed +/////////////////////////////////////////////////////////////////////////////// +void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, + const bool removenodes) +{ + set * s1=getFinitElements(elem); + + set * s2=getExclusiveNodes(*s1); + set s3; + set::iterator it=s1->begin(); + while(it!=s1->end()) + { + addChildrenWithNodes(s3, *it ,*s2); + s3.insert(*it); + it++; + } + if(elem->GetType()!=SMDSAbs_Node) s3.insert(elem); + it=s3.begin(); + while(it!=s3.end()) + { + switch((*it)->GetType()) + { + case SMDSAbs_Node: + MESSAGE("Internal Error: This should not happen"); + break; + case SMDSAbs_Edge: + myEdges.erase(static_cast( + const_cast(*it))); + break; + case SMDSAbs_Face: + myFaces.erase(static_cast( + const_cast(*it))); + break; + case SMDSAbs_Volume: + myVolumes.erase(static_cast( + const_cast(*it))); + break; + } + delete (*it); + it++; + } + if(removenodes) + { + it=s2->begin(); + while(it!=s2->end()) + { + myNodes.erase(static_cast( + const_cast(*it))); + delete *it; + it++; + } + } + + delete s2; + delete s1; +} diff --git a/src/SMDS/SMDS_Mesh.hxx b/src/SMDS/SMDS_Mesh.hxx index 5af0795fd..f869cd705 100644 --- a/src/SMDS/SMDS_Mesh.hxx +++ b/src/SMDS/SMDS_Mesh.hxx @@ -190,7 +190,6 @@ class SMDS_Mesh:public SMDS_MeshObject SMDS_MeshNode * node2, SMDS_MeshNode * node3); SMDS_MeshFace * createQuadrangle(SMDS_MeshNode * node1, SMDS_MeshNode * node2, SMDS_MeshNode * node3, SMDS_MeshNode * node4); - void removeElementDependencies(SMDS_MeshElement * element); const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2) const; SMDS_MeshEdge* FindEdgeOrCreate(const SMDS_MeshNode * n1, @@ -209,6 +208,8 @@ class SMDS_Mesh:public SMDS_MeshObject const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4); + void addChildrenWithNodes(set& setOfChildren, + const SMDS_MeshElement * element, set& nodes); // Fields PRIVATE typedef set SetOfNodes; diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index e02913ede..861630a2f 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -130,6 +130,7 @@ using namespace std; #include "VTKViewer_ViewFrame.h" #include #include +#include // Open CASCADE Includes @@ -400,6 +401,7 @@ void SMESHGUI::activeStudyChanged( QAD_Desktop* parent ) bool SMESHGUI::DefineDlgPosition(QWidget* aDlg, int& x, int& y) { /* Here the position is on the bottom right corner - 10 */ + aDlg->resize(QSize().expandedTo(aDlg->minimumSizeHint())); QAD_Desktop* PP = QAD_Application::getDesktop() ; x = abs ( PP->x() + PP->size().width() - aDlg->size().width() - 10 ) ; y = abs ( PP->y() + PP->size().height() - aDlg->size().height() - 10 ) ; @@ -1318,8 +1320,10 @@ void SMESHGUI::ChangeRepresentation( SMESH_Actor* ac, int type ) case 0 : { QApplication::setOverrideCursor( Qt::waitCursor ); if (ac->getDisplayMode()==2) { + bool isColored = ac->getMapper()->GetScalarVisibility(); //SAL3899 vtkDataSetMapper* meshMapper = (vtkDataSetMapper*) (ac->getMapper()); meshMapper->SetInput(ac->DataSource); + meshMapper->SetScalarVisibility(isColored); //SAL3899 } ac->setDisplayMode(0); ac->GetProperty()->SetRepresentationToWireframe(); @@ -1330,8 +1334,10 @@ void SMESHGUI::ChangeRepresentation( SMESH_Actor* ac, int type ) case 1 : { QApplication::setOverrideCursor( Qt::waitCursor ); if (ac->getDisplayMode()==2) { + bool isColored = ac->getMapper()->GetScalarVisibility(); //SAL3899 vtkDataSetMapper* meshMapper = (vtkDataSetMapper*) (ac->getMapper()); meshMapper->SetInput(ac->DataSource); + meshMapper->SetScalarVisibility(isColored); //SAL3899 } ac->setDisplayMode(1); ac->GetProperty()->SetRepresentationToSurface(); @@ -1344,13 +1350,14 @@ void SMESHGUI::ChangeRepresentation( SMESH_Actor* ac, int type ) // ChangeRepresentation(ac, 1); QApplication::setOverrideCursor( Qt::waitCursor ); ac->setDisplayMode(2); + bool isColored = ac->getMapper()->GetScalarVisibility(); //SAL3899 vtkDataSetMapper* meshMapper = (vtkDataSetMapper*) (ac->getMapper()); - meshMapper->SetInput(ac->DataSource); vtkShrinkFilter *shrink = vtkShrinkFilter::New(); - shrink->SetInput(meshMapper->GetInput()); + shrink->SetInput(ac->DataSource); shrink->SetShrinkFactor(ac->GetShrinkFactor()); meshMapper->SetInput( shrink->GetOutput() ); + meshMapper->SetScalarVisibility(isColored); //SAL3899 ac->SetMapper( meshMapper ); QApplication::restoreOverrideCursor(); // } @@ -1436,6 +1443,7 @@ void SMESHGUI::ChangeRepresentation( SMESH_Actor* ac, int type ) ac->SetNodeSize(aDlg->GetIntValue(2)) ; if (ac->getDisplayMode()==2) { + bool isColored = ac->getMapper()->GetScalarVisibility(); //SAL3899 vtkDataSetMapper* meshMapper = (vtkDataSetMapper*) (ac->getMapper()); meshMapper->SetInput(ac->DataSource); vtkShrinkFilter *shrink = vtkShrinkFilter::New(); @@ -1443,6 +1451,7 @@ void SMESHGUI::ChangeRepresentation( SMESH_Actor* ac, int type ) shrink->SetShrinkFactor(ac->GetShrinkFactor()); meshMapper->SetInput( shrink->GetOutput() ); + meshMapper->SetScalarVisibility(isColored); //SAL3899 ac->SetMapper( meshMapper ); } } @@ -2505,12 +2514,12 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) } case 5020: { - smeshGUI->CreateAlgorithm("Hexa_3D","Hexahedral (i,j,k)"); + smeshGUI->CreateAlgorithm("Hexa_3D","Hexahedron (i,j,k)"); break; } case 5021: { - smeshGUI->CreateAlgorithm("NETGEN_3D","Tetrahedral (Netgen)"); + smeshGUI->CreateAlgorithm("NETGEN_3D","Tetrahedron (Netgen)"); break; } @@ -4558,9 +4567,7 @@ void SMESHGUI::Control(int theCommandID) QApplication::setOverrideCursor( Qt::waitCursor ); DisplayScalarBar( false ); -// mpv porting vtk 4.2.2 -// vtkScalars *scalars = vtkScalars::New(); - vtkIntArray *scalars = vtkIntArray::New(); + vtkDoubleArray *scalars = vtkDoubleArray::New(); scalars->SetNumberOfComponents(1); vtkDataSetMapper* meshMapper = 0; @@ -4576,140 +4583,60 @@ void SMESHGUI::Control(int theCommandID) return; } - bool ValidateScalars = false; - if ( result ) { + vtkDataSet* aDataSet = MeshActor->DataSource; + typedef double (*TScalarFun)(vtkCell* theCell); + TScalarFun aScalarFun; + if(result){ QString type; - switch (theCommandID) - { - case 6001: //Length Edges - { - type = tr( "SMESH_CONTROL_LENGTH_EDGES"); - meshMapper = (vtkDataSetMapper*)MeshActor->EdgeDevice->GetMapper(); - vtkUnstructuredGrid* grid = (vtkUnstructuredGrid*)meshMapper->GetInput(); - MESSAGE ( " init minimum length " << grid->GetNumberOfCells() ) - for (int i=0; iGetNumberOfCells(); i++ ) { - vtkCell* cell = grid->GetCell(i); - float len = SMESHGUI_ComputeScalarValue::LengthEdges(cell); - if (len == 0) continue; - else { - ValidateScalars = true; -// mpv porting vtk 4.2.2 -// scalars->InsertScalar(i,len); - scalars->InsertTuple1(i,len); - } - } - if (ValidateScalars && (MeshActor->getDisplayMode()!=0)) - ChangeRepresentation( MeshActor, 1 );// limitation; in Wireframe, colored edges are not visible - break; - } - case 6011: // Area Elements - { - type = tr( "SMESH_CONTROL_AREA_ELEMENTS"); - for (int i=0; i< MeshActor->GetMapper()->GetInput()->GetNumberOfCells(); i++ ) { - vtkCell* cell = MeshActor->GetMapper()->GetInput()->GetCell(i); - float area = SMESHGUI_ComputeScalarValue::AreaElements(cell); - if (area == 0) continue; - else { - ValidateScalars = true; -// mpv porting vtk 4.2.2 -// scalars->InsertScalar(i,area); - scalars->InsertTuple1(i,area); - } - } - if (ValidateScalars && (MeshActor->getDisplayMode()!=1)) - ChangeRepresentation( MeshActor, 1 ); - break; - } - case 6012: // Taper - { - type = tr( "SMESH_CONTROL_TAPER_ELEMENTS"); - for (int i=0; i< MeshActor->DataSource->GetNumberOfCells(); i++ ) { - vtkCell* cell = MeshActor->DataSource->GetCell(i); - float taper = SMESHGUI_ComputeScalarValue::Taper(cell); - if (taper == 0) continue; - else { - ValidateScalars = true; -// mpv porting vtk 4.2.2 -// scalars->InsertScalar(i,taper); - scalars->InsertTuple1(i,taper); - } - } - break; - } - case 6013: // Aspect ratio - { - type = tr( "SMESH_CONTROL_ASPECTRATIO_ELEMENTS"); - for (int i=0; iDataSource->GetNumberOfCells(); i++ ) { - vtkCell* cell = MeshActor->DataSource->GetCell(i); - float aspect = SMESHGUI_ComputeScalarValue::AspectRatio(cell); - if (aspect == 0) continue; - else { - ValidateScalars = true; -// mpv porting vtk 4.2.2 -// scalars->InsertScalar(i,aspect); - scalars->InsertTuple1(i,aspect); - } - } - if (ValidateScalars && (MeshActor->getDisplayMode()!=1)) - ChangeRepresentation( MeshActor, 1 ); - break; - } - case 6014: // Minimum angle - { - type = tr( "SMESH_CONTROL_MINIMUMANGLE_ELEMENTS"); - for (int i=0; iDataSource->GetNumberOfCells(); i++ ) { - vtkCell* cell = MeshActor->DataSource->GetCell(i); - float angle = SMESHGUI_ComputeScalarValue::MinimumAngle(cell); - if (angle == 0) continue; - else { - ValidateScalars = true; -// mpv porting vtk 4.2.2 -// scalars->InsertScalar(i,angle); - scalars->InsertTuple1(i,angle); - } - } - if (ValidateScalars && (MeshActor->getDisplayMode()!=1)) - ChangeRepresentation( MeshActor, 1 ); - break; - } - case 6015: // Warp - { - type = tr( "SMESH_CONTROL_WARP_ELEMENTS"); - for (int i=0; iDataSource->GetNumberOfCells(); i++ ) { - vtkCell* cell = MeshActor->DataSource->GetCell(i); - float Warp = SMESHGUI_ComputeScalarValue::Warp(cell); - if (Warp == 0) continue; - else { - ValidateScalars = true; -// mpv porting vtk 4.2.2 -// scalars->InsertScalar(i,Warp); - scalars->InsertTuple1(i,Warp); - } - } - break; - } - case 6016: // Skew - { - type = tr( "SMESH_CONTROL_SKEW_ELEMENTS"); - for (int i=0; iDataSource->GetNumberOfCells(); i++ ) { - vtkCell* cell = MeshActor->DataSource->GetCell(i); - float angle = SMESHGUI_ComputeScalarValue::Skew(cell); - if (angle == 0) continue; - else { - ValidateScalars = true; -// mpv porting vtk 4.2.2 -// scalars->InsertScalar(i,angle); - scalars->InsertTuple1(i,angle); - } - } - break; - } - } - - if ( !ValidateScalars ) { - QApplication::restoreOverrideCursor(); - return; + switch (theCommandID){ + case 6001: { + type = tr( "SMESH_CONTROL_LENGTH_EDGES"); + aDataSet = MeshActor->EdgeDevice->GetMapper()->GetInput(); + aScalarFun = &(SMESHGUI_ComputeScalarValue::LengthEdges); + MESSAGE ( " init minimum length " << aDataSet->GetNumberOfCells() ); + if(MeshActor->getDisplayMode() != 0) + ChangeRepresentation( MeshActor, 1);// limitation; in Wireframe, colored edges are not visible + break; + } + case 6011: { + type = tr( "SMESH_CONTROL_AREA_ELEMENTS"); + aScalarFun = &(SMESHGUI_ComputeScalarValue::AreaElements); + if(MeshActor->getDisplayMode() != 1) + ChangeRepresentation( MeshActor, 1 ); + break; + } + case 6012: { + type = tr( "SMESH_CONTROL_TAPER_ELEMENTS"); + aScalarFun = &(SMESHGUI_ComputeScalarValue::Taper); + break; } + case 6013: { + type = tr( "SMESH_CONTROL_ASPECTRATIO_ELEMENTS"); + aScalarFun = &(SMESHGUI_ComputeScalarValue::AspectRatio); + if(MeshActor->getDisplayMode() != 1) + ChangeRepresentation( MeshActor, 1 ); + break; + } + case 6014: { + type = tr( "SMESH_CONTROL_MINIMUMANGLE_ELEMENTS"); + aScalarFun = &(SMESHGUI_ComputeScalarValue::MinimumAngle); + if(MeshActor->getDisplayMode() != 1) + ChangeRepresentation( MeshActor, 1 ); + break; + } + case 6015: { + type = tr( "SMESH_CONTROL_WARP_ELEMENTS"); + aScalarFun = &(SMESHGUI_ComputeScalarValue::Warp); + break; + } + case 6016: { + type = tr( "SMESH_CONTROL_SKEW_ELEMENTS"); + aScalarFun = &(SMESHGUI_ComputeScalarValue::Skew); + break; + }} + + for(int i = 0, iEnd = aDataSet->GetNumberOfCells(); i < iEnd; i++) + scalars->InsertTuple1(i,aScalarFun(aDataSet->GetCell(i))); float range[2]; scalars->GetRange(range); @@ -4722,7 +4649,7 @@ void SMESHGUI::Control(int theCommandID) if (!meshMapper) meshMapper = (vtkDataSetMapper*) (MeshActor->getMapper()); meshMapper->SetScalarModeToUseCellData(); - meshMapper->GetInput()->GetCellData()->SetScalars(scalars); + MeshActor->DataSource->GetCellData()->SetScalars(scalars); meshMapper->SetScalarRange( range ); meshMapper->ScalarVisibilityOn(); diff --git a/src/SMESH_I/SMESH_MEDFamily_i.cxx b/src/SMESH_I/SMESH_MEDFamily_i.cxx index c9588503b..cd8a66742 100644 --- a/src/SMESH_I/SMESH_MEDFamily_i.cxx +++ b/src/SMESH_I/SMESH_MEDFamily_i.cxx @@ -298,5 +298,3 @@ SALOME_MED::string_array* SMESH_MEDFamily_i::getGroupsNames() THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM); return NULL; } - - diff --git a/src/SMESH_I/SMESH_MEDFamily_i.hxx b/src/SMESH_I/SMESH_MEDFamily_i.hxx index 3506c5c8f..05ed02971 100644 --- a/src/SMESH_I/SMESH_MEDFamily_i.hxx +++ b/src/SMESH_I/SMESH_MEDFamily_i.hxx @@ -62,7 +62,6 @@ public : throw (SALOME::SALOME_Exception); CORBA::Long getNumberOfAttributes() throw (SALOME::SALOME_Exception); -// Engines::long_array* getAttributesIdentifiers() SALOME_MED::long_array* getAttributesIdentifiers() throw (SALOME::SALOME_Exception); CORBA::Long getAttributeIdentifier(CORBA::Long i) @@ -80,6 +79,6 @@ public : char * getGroupName( CORBA::Long i) throw (SALOME::SALOME_Exception); SALOME_MED::string_array* getGroupsNames() - throw (SALOME::SALOME_Exception); + throw (SALOME::SALOME_Exception); }; #endif /* MED_FAMILY_I_HXX_ */ diff --git a/src/SMESH_I/SMESH_MEDMesh_i.cxx b/src/SMESH_I/SMESH_MEDMesh_i.cxx index 4d699ca53..25ce55bfe 100644 --- a/src/SMESH_I/SMESH_MEDMesh_i.cxx +++ b/src/SMESH_I/SMESH_MEDMesh_i.cxx @@ -489,7 +489,7 @@ CORBA::Long SMESH_MEDMesh_i::getNumberOfElements(SALOME_MED:: } catch(...) { - MESSAGE("Exception en accedant au nombre d élements"); + MESSAGE("Exception en accedant au nombre d élements"); THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object", SALOME::INTERNAL_ERROR); } @@ -547,10 +547,11 @@ SMESH_MEDMesh_i::getConnectivityIndex(SALOME_MED::medConnectivity mode, * CORBA: Find an element corresponding to the given connectivity */ //============================================================================= -CORBA::Long SMESH_MEDMesh_i::getElementNumber(SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement type, - const SALOME_MED::long_array & connectivity) +CORBA::Long +SMESH_MEDMesh_i::getElementNumber(SALOME_MED::medConnectivity mode, + SALOME_MED::medEntityMesh entity, + SALOME_MED::medGeometryElement type, + const SALOME_MED::long_array & connectivity) throw(SALOME::SALOME_Exception) { const char *LOC = "getElementNumber "; @@ -1053,7 +1054,7 @@ void SMESH_MEDMesh_i::calculeNbElts() throw(SALOME::SALOME_Exception) SCRUTE(index); // Traitement de la face - // Attention La numérotation des noeuds Med commence a 1 + // Attention La numérotation des noeuds Med commence a 1 int longueur = _seq_elemId[index]->length(); _seq_elemId[index]->length(longueur + nb_of_nodes); diff --git a/src/SMESH_I/SMESH_MEDMesh_i.hxx b/src/SMESH_I/SMESH_MEDMesh_i.hxx index 5e275446d..9e9814e20 100644 --- a/src/SMESH_I/SMESH_MEDMesh_i.hxx +++ b/src/SMESH_I/SMESH_MEDMesh_i.hxx @@ -88,17 +88,18 @@ class SMESH_MEDMesh_i: throw (SALOME::SALOME_Exception); char *getCoordinatesSystem() throw(SALOME::SALOME_Exception); - SALOME_MED::double_array * getCoordinates(SALOME_MED::medModeSwitch typeSwitch) - throw(SALOME::SALOME_Exception); CORBA::Double getCoordinate(CORBA::Long Number, CORBA::Long Axis) throw (SALOME::SALOME_Exception); + SALOME_MED::double_array * getCoordinates(SALOME_MED::medModeSwitch typeSwitch) + throw(SALOME::SALOME_Exception); + SALOME_MED::string_array * getCoordinatesNames() throw(SALOME::SALOME_Exception); SALOME_MED::string_array * getCoordinatesUnits() - throw(SALOME::SALOME_Exception); + throw(SALOME::SALOME_Exception); CORBA::Long getNumberOfNodes() throw(SALOME::SALOME_Exception); @@ -114,7 +115,7 @@ class SMESH_MEDMesh_i: CORBA::Long number) throw (SALOME::SALOME_Exception); - CORBA::Long getNumberOfElements(SALOME_MED::medEntityMesh entity, + CORBA::Long getNumberOfElements(SALOME_MED::medEntityMesh entity, SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception); @@ -141,8 +142,8 @@ class SMESH_MEDMesh_i: throw(SALOME::SALOME_Exception); SALOME_MED::long_array * - getReverseConnectivity(SALOME_MED::medConnectivity mode) throw(SALOME:: - SALOME_Exception); + getReverseConnectivity(SALOME_MED::medConnectivity mode) + throw(SALOME::SALOME_Exception); SALOME_MED::long_array * getReverseConnectivityIndex(SALOME_MED:: @@ -155,13 +156,12 @@ class SMESH_MEDMesh_i: CORBA::Long getNumberOfGroups(SALOME_MED::medEntityMesh entity) throw(SALOME::SALOME_Exception); - SALOME_MED::Family_array * + SALOME_MED::Family_array * getFamilies(SALOME_MED::medEntityMesh entity) throw(SALOME::SALOME_Exception); - SALOME_MED::FAMILY_ptr - getFamily(SALOME_MED::medEntityMesh entity, - CORBA::Long i) throw(SALOME::SALOME_Exception); + SALOME_MED::FAMILY_ptr getFamily(SALOME_MED::medEntityMesh entity, + CORBA::Long i) throw(SALOME::SALOME_Exception); SALOME_MED::Group_array * getGroups(SALOME_MED::medEntityMesh entity) throw(SALOME::SALOME_Exception); diff --git a/src/SMESH_I/SMESH_MEDSupport_i.cxx b/src/SMESH_I/SMESH_MEDSupport_i.cxx index 2d1f0e427..ba72f1973 100644 --- a/src/SMESH_I/SMESH_MEDSupport_i.cxx +++ b/src/SMESH_I/SMESH_MEDSupport_i.cxx @@ -329,6 +329,7 @@ SALOME_MED::long_array * SMESH_MEDSupport_i::getNumber( * CORBA: ?????????????????????????????? */ //============================================================================= + SALOME_MED::long_array * SMESH_MEDSupport_i::getNumberIndex()throw(SALOME::SALOME_Exception) { @@ -341,6 +342,7 @@ SALOME_MED::long_array * * CORBA: Array containing indexes for elements included in the support */ //============================================================================= + CORBA::Long SMESH_MEDSupport_i::getNumberOfGaussPoint(SALOME_MED:: medGeometryElement geomElement) throw(SALOME::SALOME_Exception) { diff --git a/src/SMESH_I/SMESH_MEDSupport_i.hxx b/src/SMESH_I/SMESH_MEDSupport_i.hxx index aa1458fee..5be60dda4 100644 --- a/src/SMESH_I/SMESH_MEDSupport_i.hxx +++ b/src/SMESH_I/SMESH_MEDSupport_i.hxx @@ -56,9 +56,12 @@ class SMESH_MEDSupport_i: SALOME_MED::MESH_ptr getMesh() throw(SALOME::SALOME_Exception); CORBA::Boolean isOnAllElements() throw(SALOME::SALOME_Exception); SALOME_MED::medEntityMesh getEntity() throw(SALOME::SALOME_Exception); - CORBA::Long getNumberOfElements(SALOME_MED::medGeometryElement geomElement) - throw(SALOME::SALOME_Exception); + CORBA::Long + getNumberOfElements(SALOME_MED::medGeometryElement geomElement) + throw(SALOME::SALOME_Exception); + CORBA::Long getNumberOfTypes() throw (SALOME::SALOME_Exception); + SALOME_MED::long_array * getNumber(SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception); @@ -66,19 +69,23 @@ class SMESH_MEDSupport_i: SALOME_MED::long_array * getNumberIndex() throw(SALOME::SALOME_Exception); - CORBA::Long getNumberOfGaussPoint(SALOME_MED:: - medGeometryElement geomElement) throw(SALOME::SALOME_Exception); + CORBA::Long + getNumberOfGaussPoint(SALOME_MED::medGeometryElement geomElement) + throw(SALOME::SALOME_Exception); + SALOME_MED::long_array* getNumbersOfGaussPoint() throw (SALOME::SALOME_Exception); - SALOME_MED::medGeometryElement_array * - getTypes() throw(SALOME::SALOME_Exception); + SALOME_MED::medGeometryElement_array *getTypes() + throw(SALOME::SALOME_Exception); void getBoundaryElements() throw (SALOME::SALOME_Exception); CORBA::Long getCorbaIndex() throw(SALOME::SALOME_Exception); + SALOME_MED::SUPPORT::supportInfos * getSupportGlobal() throw (SALOME::SALOME_Exception); + void createSeq() throw(SALOME::SALOME_Exception); public: //public field