PAL10974: use SMESH_Algo::IsReversedSubMesh() to know orientation

This commit is contained in:
eap 2005-12-20 14:09:17 +00:00
parent 2086167845
commit b9d1b4a4f9

View File

@ -19,6 +19,9 @@ using namespace std;
#include "SMDS_MeshNode.hxx" #include "SMDS_MeshNode.hxx"
#include <TopExp.hxx> #include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shell.hxx>
#include <BRepTools.hxx> #include <BRepTools.hxx>
#include "utilities.h" #include "utilities.h"
@ -155,13 +158,12 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next()) for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next())
{ {
TopoDS_Shape aShapeFace = exp.Current(); const TopoDS_Shape& aShapeFace = exp.Current();
int faceID = meshDS->ShapeToIndex( aShapeFace ); const SMESHDS_SubMesh * aSubMeshDSFace = meshDS->MeshElements( aShapeFace );
TopoDS_Shape aMeshedFace = meshDS->IndexToShape( faceID );
const SMESHDS_SubMesh * aSubMeshDSFace = meshDS->MeshElements( faceID );
if ( aSubMeshDSFace ) if ( aSubMeshDSFace )
{ {
bool isRev = ( aShapeFace.Orientation() != aMeshedFace.Orientation() ); bool isRev = SMESH_Algo::IsReversedSubMesh( TopoDS::Face(aShapeFace), meshDS );
SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements(); SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
while ( iteratorElem->more() ) // loop on elements on a face while ( iteratorElem->more() ) // loop on elements on a face
{ {