mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-30 04:20:33 +05:00
Use SetSubShape() in IsQuadraticSubMesh(). Fix SIGSEGV in AddFace() on sphere and cone.
This commit is contained in:
parent
44a4764fcf
commit
ae30e9e9e0
@ -7,7 +7,7 @@
|
|||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
|
|
||||||
#include "SMDS_FacePosition.hxx"
|
#include "SMDS_FacePosition.hxx"
|
||||||
#include "SMDS_EdgePosition.hxx".cxx
|
#include "SMDS_EdgePosition.hxx"
|
||||||
#include "SMESH_MeshEditor.hxx"
|
#include "SMESH_MeshEditor.hxx"
|
||||||
|
|
||||||
#include <BRepAdaptor_Surface.hxx>
|
#include <BRepAdaptor_Surface.hxx>
|
||||||
@ -77,13 +77,32 @@ bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh)
|
|||||||
myNLinkNodeMap.clear();
|
myNLinkNodeMap.clear();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
SetSubShape( aSh );
|
||||||
|
}
|
||||||
|
return myCreateQuadratic;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Set geomerty to make elements on
|
||||||
|
* \param aSh - geomertic shape
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh)
|
||||||
|
{
|
||||||
|
myShape = aSh;
|
||||||
|
|
||||||
// treatment of periodic faces
|
// treatment of periodic faces
|
||||||
if ( aSh.ShapeType() == TopAbs_FACE ) {
|
if ( aSh.ShapeType() == TopAbs_FACE )
|
||||||
|
{
|
||||||
const TopoDS_Face& face = TopoDS::Face( aSh );
|
const TopoDS_Face& face = TopoDS::Face( aSh );
|
||||||
BRepAdaptor_Surface surface( face );
|
BRepAdaptor_Surface surface( face );
|
||||||
if ( surface.IsUPeriodic() || surface.IsVPeriodic() ) {
|
if ( surface.IsUPeriodic() || surface.IsVPeriodic() )
|
||||||
|
{
|
||||||
|
SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS();
|
||||||
// look for a seam edge
|
// look for a seam edge
|
||||||
for ( exp.Init( face, TopAbs_EDGE ); exp.More(); exp.Next()) {
|
for ( TopExp_Explorer exp( face, TopAbs_EDGE ); exp.More(); exp.Next()) {
|
||||||
const TopoDS_Edge& edge = TopoDS::Edge( exp.Current() );
|
const TopoDS_Edge& edge = TopoDS::Edge( exp.Current() );
|
||||||
if ( BRep_Tool::IsClosed( edge, face )) {
|
if ( BRep_Tool::IsClosed( edge, face )) {
|
||||||
// initialize myPar1, myPar2 and myParIndex
|
// initialize myPar1, myPar2 and myParIndex
|
||||||
@ -111,8 +130,6 @@ bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return myCreateQuadratic;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -257,8 +274,8 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
|
|||||||
const SMDS_MeshNode* n2,
|
const SMDS_MeshNode* n2,
|
||||||
bool force3d)
|
bool force3d)
|
||||||
{
|
{
|
||||||
//cout<<"n1: "<<n1;
|
TopAbs_ShapeEnum shapeType = myShape.IsNull() ? TopAbs_SHAPE : myShape.ShapeType();
|
||||||
//cout<<"n2: "<<n2;
|
|
||||||
NLink link(( n1 < n2 ? n1 : n2 ), ( n1 < n2 ? n2 : n1 ));
|
NLink link(( n1 < n2 ? n1 : n2 ), ( n1 < n2 ? n2 : n1 ));
|
||||||
ItNLinkNode itLN = myNLinkNodeMap.find( link );
|
ItNLinkNode itLN = myNLinkNodeMap.find( link );
|
||||||
if ( itLN != myNLinkNodeMap.end() ) {
|
if ( itLN != myNLinkNodeMap.end() ) {
|
||||||
@ -292,7 +309,7 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
|
|||||||
if(!force3d) {
|
if(!force3d) {
|
||||||
// we try to create medium node using UV parameters of
|
// we try to create medium node using UV parameters of
|
||||||
// nodes, else - medium between corresponding 3d points
|
// nodes, else - medium between corresponding 3d points
|
||||||
if(faceID>-1 || myShape.ShapeType() == TopAbs_FACE) {
|
if(faceID>-1 || shapeType == TopAbs_FACE) {
|
||||||
// obtaining a face and 2d points for nodes
|
// obtaining a face and 2d points for nodes
|
||||||
TopoDS_Face F;
|
TopoDS_Face F;
|
||||||
if( myShape.IsNull() )
|
if( myShape.IsNull() )
|
||||||
@ -335,7 +352,7 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
|
|||||||
myNLinkNodeMap.insert(NLinkNodeMap::value_type(link,n12));
|
myNLinkNodeMap.insert(NLinkNodeMap::value_type(link,n12));
|
||||||
return n12;
|
return n12;
|
||||||
}
|
}
|
||||||
if (edgeID>-1 || myShape.ShapeType() == TopAbs_EDGE) {
|
if (edgeID>-1 || shapeType == TopAbs_EDGE) {
|
||||||
|
|
||||||
TopoDS_Edge E;
|
TopoDS_Edge E;
|
||||||
if( myShape.IsNull() )
|
if( myShape.IsNull() )
|
||||||
|
@ -182,8 +182,7 @@ class SMESH_MesherHelper
|
|||||||
void SetKeyIsQuadratic(const bool theKey)
|
void SetKeyIsQuadratic(const bool theKey)
|
||||||
{myCreateQuadratic = theKey;};
|
{myCreateQuadratic = theKey;};
|
||||||
|
|
||||||
void SetSubShape(const TopoDS_Shape& subShape)
|
void SetSubShape(const TopoDS_Shape& subShape);
|
||||||
{myShape = subShape;};
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user