+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
+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
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
c
else if( nbar .le. 2 ) then
write(imprim,*) 'erreur trchtd: cf<3 aretes'
- pause
namin = 0
namin0 = 0
return
c anomalie. chainage des triangles des aretes defectueux
c a corriger
write(imprim,*) 'pause dans tridcf'
- pause
ierr = 5
return
endif
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
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
c
c erreur: le point np n'est pas dans l'un des nbtr triangles
write(imprim,10010) np
- pause
ierr = 3
return
c
% ' 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
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
c point utilisateur ou frontalier non supprimable
ierr = 11
write(imprim,*) 'pause dans tefoar 1', d, d3, d4, d12
- pause
return
endif
c
ccc tratri = .false.
ierr = 11
write(imprim,*) 'pause dans tefoar 2'
- pause
return
endif
c
c
write(imprim,*) 'tefoar: algorithme defaillant'
ierr = 11
- pause
return
endif
50 continue
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
EdgeShrinkDevice->VisibilityOff();
EdgeShrinkDevice->PickableOff();
+ DataSource = NULL;
+
myIO = NULL;
myName = "";
myDisplayMode = 0;
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4)
{
- return AddFaceWithID(n1,n2,n3, myElementIDFactory->GetFreeID());
+ return AddFaceWithID(n1,n2,n3, n4, myElementIDFactory->GetFreeID());
}
///////////////////////////////////////////////////////////////////////////////
void SMDS_Mesh::RemoveNode(const SMDS_MeshNode * node)
{
- SMDS_Iterator<const SMDS_MeshElement *> * it=
- node->GetInverseElementIterator();
- while(it->more()) RemoveElement(it->next(),true);
- myNodeIDFactory->ReleaseID(node->GetID());
- myNodes.erase(const_cast<SMDS_MeshNode*>(node));
+ RemoveElement(node, true);
}
///////////////////////////////////////////////////////////////////////////////
void SMDS_Mesh::RemoveEdge(const SMDS_MeshEdge * edge)
{
- /** @todo to be fix */
- myEdges.erase(const_cast<SMDS_MeshEdge*>(edge));
- //removeElementDependencies(edge);
- delete edge;
+ RemoveElement(edge,true);
}
///////////////////////////////////////////////////////////////////////////////
void SMDS_Mesh::RemoveFace(const SMDS_MeshFace * face)
{
- /** @todo to be fix */
- myFaces.erase(const_cast<SMDS_MeshFace*>(face));
- //removeElementDependencies(face);
- delete face;
+ RemoveElement(face, true);
}
///////////////////////////////////////////////////////////////////////////////
void SMDS_Mesh::RemoveVolume(const SMDS_MeshVolume * volume)
{
- /** @todo to be fix */
- myVolumes.erase(const_cast<SMDS_MeshVolume*>(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<const SMDS_MeshElement*> * it=element->nodesIterator();
- while(it->more())
- {
- SMDS_MeshNode * node=static_cast<SMDS_MeshNode*>(
- const_cast<SMDS_MeshElement*>(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<const SMDS_MeshNode*> * it=elem->nodesIterator();
- while(it->more())
- {
- const SMDS_MeshNode * node=it->next();
-
- }*/
+ RemoveElement(volume, true);
}
//=======================================================================
return new MyIterator(myVolumes);
}
+///////////////////////////////////////////////////////////////////////////////
+/// Do intersection of sets (more than 2)
+///////////////////////////////////////////////////////////////////////////////
+set<const SMDS_MeshElement*> * intersectionOfSets(
+ set<const SMDS_MeshElement*> vs[], int numberOfSets)
+{
+ set<const SMDS_MeshElement*>* rsetA=new set<const SMDS_MeshElement*>(vs[0]);
+ set<const SMDS_MeshElement*>* rsetB;
+
+ for(int i=0; i<numberOfSets-1; i++)
+ {
+ rsetB=new set<const SMDS_MeshElement*>();
+ 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<const SMDS_MeshElement*> * getFinitElements(const SMDS_MeshElement * element)
+{
+ int numberOfSets=element->NbNodes();
+ set<const SMDS_MeshElement*> initSet[numberOfSets];
+
+ SMDS_Iterator<const SMDS_MeshElement*> * itNodes=element->nodesIterator();
+
+ int i=0;
+ while(itNodes->more())
+ {
+ const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(itNodes->next());
+ SMDS_Iterator<const SMDS_MeshElement*> * itFe = n->GetInverseElementIterator();
+
+ //initSet[i]=set<const SMDS_MeshElement*>();
+ 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<const SMDS_MeshElement*> * getExclusiveNodes(
+ set<const SMDS_MeshElement*>& elements)
+{
+ set<const SMDS_MeshElement*> * toReturn=new set<const SMDS_MeshElement*>();
+ set<const SMDS_MeshElement*>::iterator itElements=elements.begin();
+
+ while(itElements!=elements.end())
+ {
+ SMDS_Iterator<const SMDS_MeshElement*> * itNodes=
+ (*itElements)->nodesIterator();
+ itElements++;
+
+ while(itNodes->more())
+ {
+ const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(itNodes->next());
+ SMDS_Iterator<const SMDS_MeshElement*> * itFe = n->GetInverseElementIterator();
+ set<const SMDS_MeshElement*> 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<const SMDS_MeshElement*>& setOfChildren,
+ const SMDS_MeshElement * element, set<const SMDS_MeshElement*>& nodes)
+{
+
+ switch(element->GetType())
+ {
+ case SMDSAbs_Node:
+ MESSAGE("Internal Error: This should not append");
+ break;
+ case SMDSAbs_Edge:
+ {
+ SMDS_Iterator<const SMDS_MeshElement*> * 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<const SMDS_MeshElement*> * 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<const SMDS_MeshElement*>* ite=element->edgesIterator();
+ while(ite->more())
+ addChildrenWithNodes(setOfChildren, ite->next(), nodes);
+ delete ite;
+ }
+ } break;
+ case SMDSAbs_Volume:
+ {
+ if(hasConstructionFaces())
+ {
+ SMDS_Iterator<const SMDS_MeshElement*> * ite=element->facesIterator();
+ while(ite->more())
+ addChildrenWithNodes(setOfChildren, ite->next(), nodes);
+ delete ite;
+ }
+ else if(hasConstructionEdges())
+ {
+ SMDS_Iterator<const SMDS_MeshElement*> * 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<const SMDS_MeshElement*> * s1=getFinitElements(elem);
+
+ set<const SMDS_MeshElement*> * s2=getExclusiveNodes(*s1);
+ set<const SMDS_MeshElement*> s3;
+ set<const SMDS_MeshElement*>::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<SMDS_MeshEdge*>(
+ const_cast<SMDS_MeshElement*>(*it)));
+ break;
+ case SMDSAbs_Face:
+ myFaces.erase(static_cast<SMDS_MeshFace*>(
+ const_cast<SMDS_MeshElement*>(*it)));
+ break;
+ case SMDSAbs_Volume:
+ myVolumes.erase(static_cast<SMDS_MeshVolume*>(
+ const_cast<SMDS_MeshElement*>(*it)));
+ break;
+ }
+ delete (*it);
+ it++;
+ }
+ if(removenodes)
+ {
+ it=s2->begin();
+ while(it!=s2->end())
+ {
+ myNodes.erase(static_cast<SMDS_MeshNode*>(
+ const_cast<SMDS_MeshElement*>(*it)));
+ delete *it;
+ it++;
+ }
+ }
+
+ delete s2;
+ delete s1;
+}
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,
const SMDS_MeshNode *n2,
const SMDS_MeshNode *n3,
const SMDS_MeshNode *n4);
+ void addChildrenWithNodes(set<const SMDS_MeshElement*>& setOfChildren,
+ const SMDS_MeshElement * element, set<const SMDS_MeshElement*>& nodes);
// Fields PRIVATE
typedef set<SMDS_MeshNode *> SetOfNodes;
#include "VTKViewer_ViewFrame.h"
#include <vtkLegendBoxActor.h>
#include <vtkFeatureEdges.h>
+#include <vtkDoubleArray.h>
// Open CASCADE Includes
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 ) ;
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();
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();
// 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();
// }
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();
shrink->SetShrinkFactor(ac->GetShrinkFactor());
meshMapper->SetInput( shrink->GetOutput() );
+ meshMapper->SetScalarVisibility(isColored); //SAL3899
ac->SetMapper( meshMapper );
}
}
}
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;
}
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;
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; i<grid->GetNumberOfCells(); 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; i<MeshActor->DataSource->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; i<MeshActor->DataSource->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; i<MeshActor->DataSource->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; i<MeshActor->DataSource->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);
if (!meshMapper) meshMapper = (vtkDataSetMapper*) (MeshActor->getMapper());
meshMapper->SetScalarModeToUseCellData();
- meshMapper->GetInput()->GetCellData()->SetScalars(scalars);
+ MeshActor->DataSource->GetCellData()->SetScalars(scalars);
meshMapper->SetScalarRange( range );
meshMapper->ScalarVisibilityOn();
THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM);
return NULL;
}
-
-
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)
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_ */
}
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);
}
* 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 ";
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);
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);
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);
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::
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);
* CORBA: ??????????????????????????????
*/
//=============================================================================
+
SALOME_MED::long_array *
SMESH_MEDSupport_i::getNumberIndex()throw(SALOME::SALOME_Exception)
{
* CORBA: Array containing indexes for elements included in the support
*/
//=============================================================================
+
CORBA::Long SMESH_MEDSupport_i::getNumberOfGaussPoint(SALOME_MED::
medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
{
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);
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