mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-04-25 02:12:03 +05:00
PAL13504 (Mesh from an imported mesh)
add SetElementsOnShape(), redesign
This commit is contained in:
parent
9e4f893366
commit
f3d960a86a
@ -44,6 +44,16 @@
|
|||||||
|
|
||||||
#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; }
|
#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; }
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Constructor
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
SMESH_MesherHelper::SMESH_MesherHelper(SMESH_Mesh& theMesh)
|
||||||
|
: myMesh(&theMesh), myShapeID(-1), myCreateQuadratic(false), mySetElemOnShape(false)
|
||||||
|
{}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : CheckShape
|
//function : CheckShape
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -115,7 +125,7 @@ void SMESH_MesherHelper::SetSubShape(const int aShID)
|
|||||||
if ( aShID == myShapeID )
|
if ( aShID == myShapeID )
|
||||||
return;
|
return;
|
||||||
if ( aShID > 1 )
|
if ( aShID > 1 )
|
||||||
SetSubShape( GetMesh()->GetMeshDS()->IndexToShape( aShID ));
|
SetSubShape( GetMeshDS()->IndexToShape( aShID ));
|
||||||
else
|
else
|
||||||
SetSubShape( TopoDS_Shape() );
|
SetSubShape( TopoDS_Shape() );
|
||||||
}
|
}
|
||||||
@ -282,7 +292,7 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F,
|
|||||||
// edge and recieve value from this pcurve
|
// edge and recieve value from this pcurve
|
||||||
const SMDS_EdgePosition* epos =
|
const SMDS_EdgePosition* epos =
|
||||||
static_cast<const SMDS_EdgePosition*>(n->GetPosition().get());
|
static_cast<const SMDS_EdgePosition*>(n->GetPosition().get());
|
||||||
SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS();
|
SMESHDS_Mesh* meshDS = GetMeshDS();
|
||||||
int edgeID = Pos->GetShapeId();
|
int edgeID = Pos->GetShapeId();
|
||||||
TopoDS_Edge E = TopoDS::Edge(meshDS->IndexToShape(edgeID));
|
TopoDS_Edge E = TopoDS::Edge(meshDS->IndexToShape(edgeID));
|
||||||
double f, l;
|
double f, l;
|
||||||
@ -326,7 +336,7 @@ double SMESH_MesherHelper::GetNodeU(const TopoDS_Edge& E,
|
|||||||
param = epos->GetUParameter();
|
param = epos->GetUParameter();
|
||||||
}
|
}
|
||||||
else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX) {
|
else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX) {
|
||||||
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
|
SMESHDS_Mesh * meshDS = GetMeshDS();
|
||||||
int vertexID = n->GetPosition()->GetShapeId();
|
int vertexID = n->GetPosition()->GetShapeId();
|
||||||
const TopoDS_Vertex& V = TopoDS::Vertex(meshDS->IndexToShape(vertexID));
|
const TopoDS_Vertex& V = TopoDS::Vertex(meshDS->IndexToShape(vertexID));
|
||||||
param = BRep_Tool::Parameter( V, E );
|
param = BRep_Tool::Parameter( V, E );
|
||||||
@ -478,68 +488,108 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AddQuadraticEdge
|
/*!
|
||||||
//purpose :
|
* Creates a node
|
||||||
//=======================================================================
|
|
||||||
/**
|
|
||||||
* Special function for creation quadratic edge
|
|
||||||
*/
|
*/
|
||||||
SMDS_QuadraticEdge* SMESH_MesherHelper::AddQuadraticEdge(const SMDS_MeshNode* n1,
|
//=======================================================================
|
||||||
const SMDS_MeshNode* n2,
|
|
||||||
const int id,
|
SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, int ID)
|
||||||
const bool force3d)
|
|
||||||
{
|
{
|
||||||
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
|
SMESHDS_Mesh * meshDS = GetMeshDS();
|
||||||
|
SMDS_MeshNode* node = 0;
|
||||||
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
if ( ID )
|
||||||
|
node = meshDS->AddNodeWithID( x, y, z, ID );
|
||||||
myCreateQuadratic = true;
|
|
||||||
|
|
||||||
if(id)
|
|
||||||
return (SMDS_QuadraticEdge*)(meshDS->AddEdgeWithID(n1, n2, n12, id));
|
|
||||||
else
|
else
|
||||||
return (SMDS_QuadraticEdge*)(meshDS->AddEdge(n1, n2, n12));
|
node = meshDS->AddNode( x, y, z );
|
||||||
|
if ( mySetElemOnShape && myShapeID > 0 ) {
|
||||||
|
switch ( myShape.ShapeType() ) {
|
||||||
|
case TopAbs_SOLID: meshDS->SetNodeInVolume( node, myShapeID); break;
|
||||||
|
case TopAbs_SHELL: meshDS->SetNodeInVolume( node, myShapeID); break;
|
||||||
|
case TopAbs_FACE: meshDS->SetNodeOnFace( node, myShapeID); break;
|
||||||
|
case TopAbs_EDGE: meshDS->SetNodeOnEdge( node, myShapeID); break;
|
||||||
|
case TopAbs_VERTEX: meshDS->SetNodeOnVertex( node, myShapeID); break;
|
||||||
|
default: ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AddFace
|
/*!
|
||||||
//purpose :
|
* Creates quadratic or linear edge
|
||||||
|
*/
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
SMDS_MeshEdge* SMESH_MesherHelper::AddEdge(const SMDS_MeshNode* n1,
|
||||||
|
const SMDS_MeshNode* n2,
|
||||||
|
const int id,
|
||||||
|
const bool force3d)
|
||||||
|
{
|
||||||
|
SMESHDS_Mesh * meshDS = GetMeshDS();
|
||||||
|
|
||||||
|
SMDS_MeshEdge* edge = 0;
|
||||||
|
if (myCreateQuadratic) {
|
||||||
|
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
||||||
|
if(id)
|
||||||
|
edge = meshDS->AddEdgeWithID(n1, n2, n12, id);
|
||||||
|
else
|
||||||
|
edge = meshDS->AddEdge(n1, n2, n12);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(id)
|
||||||
|
edge = meshDS->AddEdgeWithID(n1, n2, id);
|
||||||
|
else
|
||||||
|
edge = meshDS->AddEdge(n1, n2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( mySetElemOnShape && myShapeID > 0 )
|
||||||
|
meshDS->SetMeshElementOnShape( edge, myShapeID );
|
||||||
|
|
||||||
|
return edge;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
/*!
|
/*!
|
||||||
* Special function for creation quadratic triangle
|
* Creates quadratic or linear triangle
|
||||||
*/
|
*/
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
|
SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
|
||||||
const SMDS_MeshNode* n2,
|
const SMDS_MeshNode* n2,
|
||||||
const SMDS_MeshNode* n3,
|
const SMDS_MeshNode* n3,
|
||||||
const int id,
|
const int id,
|
||||||
const bool force3d)
|
const bool force3d)
|
||||||
{
|
{
|
||||||
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
|
SMESHDS_Mesh * meshDS = GetMeshDS();
|
||||||
|
SMDS_MeshFace* elem = 0;
|
||||||
if(!myCreateQuadratic) {
|
if(!myCreateQuadratic) {
|
||||||
if(id)
|
if(id)
|
||||||
return meshDS->AddFaceWithID(n1, n2, n3, id);
|
elem = meshDS->AddFaceWithID(n1, n2, n3, id);
|
||||||
else
|
else
|
||||||
return meshDS->AddFace(n1, n2, n3);
|
elem = meshDS->AddFace(n1, n2, n3);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
||||||
|
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
||||||
|
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
if(id)
|
||||||
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
elem = meshDS->AddFaceWithID(n1, n2, n3, n12, n23, n31, id);
|
||||||
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
|
else
|
||||||
|
elem = meshDS->AddFace(n1, n2, n3, n12, n23, n31);
|
||||||
|
}
|
||||||
|
if ( mySetElemOnShape && myShapeID > 0 )
|
||||||
|
meshDS->SetMeshElementOnShape( elem, myShapeID );
|
||||||
|
|
||||||
if(id)
|
return elem;
|
||||||
return meshDS->AddFaceWithID(n1, n2, n3, n12, n23, n31, id);
|
|
||||||
else
|
|
||||||
return meshDS->AddFace(n1, n2, n3, n12, n23, n31);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : AddFace
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
/*!
|
/*!
|
||||||
* Special function for creation quadratic quadrangle
|
* Creates quadratic or linear quadrangle
|
||||||
*/
|
*/
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
|
SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
|
||||||
const SMDS_MeshNode* n2,
|
const SMDS_MeshNode* n2,
|
||||||
const SMDS_MeshNode* n3,
|
const SMDS_MeshNode* n3,
|
||||||
@ -547,33 +597,37 @@ SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
|
|||||||
const int id,
|
const int id,
|
||||||
const bool force3d)
|
const bool force3d)
|
||||||
{
|
{
|
||||||
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
|
SMESHDS_Mesh * meshDS = GetMeshDS();
|
||||||
|
SMDS_MeshFace* elem = 0;
|
||||||
if(!myCreateQuadratic) {
|
if(!myCreateQuadratic) {
|
||||||
if(id)
|
if(id)
|
||||||
return meshDS->AddFaceWithID(n1, n2, n3, n4, id);
|
elem = meshDS->AddFaceWithID(n1, n2, n3, n4, id);
|
||||||
else
|
else
|
||||||
return meshDS->AddFace(n1, n2, n3, n4);
|
elem = meshDS->AddFace(n1, n2, n3, n4);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
||||||
|
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
||||||
|
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
|
||||||
|
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
if(id)
|
||||||
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
elem = meshDS->AddFaceWithID(n1, n2, n3, n4, n12, n23, n34, n41, id);
|
||||||
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
|
else
|
||||||
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d);
|
elem = meshDS->AddFace(n1, n2, n3, n4, n12, n23, n34, n41);
|
||||||
|
}
|
||||||
|
if ( mySetElemOnShape && myShapeID > 0 )
|
||||||
|
meshDS->SetMeshElementOnShape( elem, myShapeID );
|
||||||
|
|
||||||
if(id)
|
return elem;
|
||||||
return meshDS->AddFaceWithID(n1, n2, n3, n4, n12, n23, n34, n41, id);
|
|
||||||
else
|
|
||||||
return meshDS->AddFace(n1, n2, n3, n4, n12, n23, n34, n41);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : AddVolume
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
/*!
|
/*!
|
||||||
* Special function for creation quadratic volume
|
* Creates quadratic or linear volume
|
||||||
*/
|
*/
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
|
SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
|
||||||
const SMDS_MeshNode* n2,
|
const SMDS_MeshNode* n2,
|
||||||
const SMDS_MeshNode* n3,
|
const SMDS_MeshNode* n3,
|
||||||
@ -583,37 +637,43 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
|
|||||||
const int id,
|
const int id,
|
||||||
const bool force3d)
|
const bool force3d)
|
||||||
{
|
{
|
||||||
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
|
SMESHDS_Mesh * meshDS = GetMeshDS();
|
||||||
|
SMDS_MeshVolume* elem = 0;
|
||||||
if(!myCreateQuadratic) {
|
if(!myCreateQuadratic) {
|
||||||
if(id)
|
if(id)
|
||||||
return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, id);
|
elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, id);
|
||||||
else
|
else
|
||||||
return meshDS->AddVolume(n1, n2, n3, n4, n5, n6);
|
elem = meshDS->AddVolume(n1, n2, n3, n4, n5, n6);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
||||||
|
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
||||||
|
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
const SMDS_MeshNode* n45 = GetMediumNode(n4,n5,force3d);
|
||||||
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
const SMDS_MeshNode* n56 = GetMediumNode(n5,n6,force3d);
|
||||||
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
|
const SMDS_MeshNode* n64 = GetMediumNode(n6,n4,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n45 = GetMediumNode(n4,n5,force3d);
|
const SMDS_MeshNode* n14 = GetMediumNode(n1,n4,force3d);
|
||||||
const SMDS_MeshNode* n56 = GetMediumNode(n5,n6,force3d);
|
const SMDS_MeshNode* n25 = GetMediumNode(n2,n5,force3d);
|
||||||
const SMDS_MeshNode* n64 = GetMediumNode(n6,n4,force3d);
|
const SMDS_MeshNode* n36 = GetMediumNode(n3,n6,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n14 = GetMediumNode(n1,n4,force3d);
|
if(id)
|
||||||
const SMDS_MeshNode* n25 = GetMediumNode(n2,n5,force3d);
|
elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6,
|
||||||
const SMDS_MeshNode* n36 = GetMediumNode(n3,n6,force3d);
|
n12, n23, n31, n45, n56, n64, n14, n25, n36, id);
|
||||||
|
else
|
||||||
|
elem = meshDS->AddVolume(n1, n2, n3, n4, n5, n6,
|
||||||
|
n12, n23, n31, n45, n56, n64, n14, n25, n36);
|
||||||
|
}
|
||||||
|
if ( mySetElemOnShape && myShapeID > 0 )
|
||||||
|
meshDS->SetMeshElementOnShape( elem, myShapeID );
|
||||||
|
|
||||||
if(id)
|
return elem;
|
||||||
return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6,
|
|
||||||
n12, n23, n31, n45, n56, n64, n14, n25, n36, id);
|
|
||||||
else
|
|
||||||
return meshDS->AddVolume(n1, n2, n3, n4, n5, n6,
|
|
||||||
n12, n23, n31, n45, n56, n64, n14, n25, n36);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
/*!
|
/*!
|
||||||
* Special function for creation quadratic volume
|
* Creates quadratic or linear volume
|
||||||
*/
|
*/
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
@ -624,31 +684,37 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
|
|||||||
const int id,
|
const int id,
|
||||||
const bool force3d)
|
const bool force3d)
|
||||||
{
|
{
|
||||||
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
|
SMESHDS_Mesh * meshDS = GetMeshDS();
|
||||||
|
SMDS_MeshVolume* elem = 0;
|
||||||
if(!myCreateQuadratic) {
|
if(!myCreateQuadratic) {
|
||||||
if(id)
|
if(id)
|
||||||
return meshDS->AddVolumeWithID(n1, n2, n3, n4, id);
|
elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, id);
|
||||||
else
|
else
|
||||||
return meshDS->AddVolume(n1, n2, n3, n4);
|
elem = meshDS->AddVolume(n1, n2, n3, n4);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
||||||
|
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
||||||
|
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
const SMDS_MeshNode* n14 = GetMediumNode(n1,n4,force3d);
|
||||||
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
const SMDS_MeshNode* n24 = GetMediumNode(n2,n4,force3d);
|
||||||
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
|
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n14 = GetMediumNode(n1,n4,force3d);
|
if(id)
|
||||||
const SMDS_MeshNode* n24 = GetMediumNode(n2,n4,force3d);
|
elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n12, n23, n31, n14, n24, n34, id);
|
||||||
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
|
else
|
||||||
|
elem = meshDS->AddVolume(n1, n2, n3, n4, n12, n23, n31, n14, n24, n34);
|
||||||
|
}
|
||||||
|
if ( mySetElemOnShape && myShapeID > 0 )
|
||||||
|
meshDS->SetMeshElementOnShape( elem, myShapeID );
|
||||||
|
|
||||||
if(id)
|
return elem;
|
||||||
return meshDS->AddVolumeWithID(n1, n2, n3, n4, n12, n23, n31, n14, n24, n34, id);
|
|
||||||
else
|
|
||||||
return meshDS->AddVolume(n1, n2, n3, n4, n12, n23, n31, n14, n24, n34);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
/*!
|
/*!
|
||||||
* Special function for creation quadratic pyramid
|
* Creates quadratic or linear pyramid
|
||||||
*/
|
*/
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
@ -660,37 +726,43 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
|
|||||||
const int id,
|
const int id,
|
||||||
const bool force3d)
|
const bool force3d)
|
||||||
{
|
{
|
||||||
|
SMDS_MeshVolume* elem = 0;
|
||||||
if(!myCreateQuadratic) {
|
if(!myCreateQuadratic) {
|
||||||
if(id)
|
if(id)
|
||||||
return GetMeshDS()->AddVolumeWithID(n1, n2, n3, n4, n5, id);
|
elem = GetMeshDS()->AddVolumeWithID(n1, n2, n3, n4, n5, id);
|
||||||
else
|
else
|
||||||
return GetMeshDS()->AddVolume(n1, n2, n3, n4, n5);
|
elem = GetMeshDS()->AddVolume(n1, n2, n3, n4, n5);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
||||||
|
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
||||||
|
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
|
||||||
|
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
const SMDS_MeshNode* n15 = GetMediumNode(n1,n5,force3d);
|
||||||
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
const SMDS_MeshNode* n25 = GetMediumNode(n2,n5,force3d);
|
||||||
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
|
const SMDS_MeshNode* n35 = GetMediumNode(n3,n5,force3d);
|
||||||
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d);
|
const SMDS_MeshNode* n45 = GetMediumNode(n4,n5,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n15 = GetMediumNode(n1,n5,force3d);
|
if(id)
|
||||||
const SMDS_MeshNode* n25 = GetMediumNode(n2,n5,force3d);
|
elem = GetMeshDS()->AddVolumeWithID ( n1, n2, n3, n4, n5,
|
||||||
const SMDS_MeshNode* n35 = GetMediumNode(n3,n5,force3d);
|
n12, n23, n34, n41,
|
||||||
const SMDS_MeshNode* n45 = GetMediumNode(n4,n5,force3d);
|
n15, n25, n35, n45,
|
||||||
|
id);
|
||||||
|
else
|
||||||
|
elem = GetMeshDS()->AddVolume( n1, n2, n3, n4, n5,
|
||||||
|
n12, n23, n34, n41,
|
||||||
|
n15, n25, n35, n45);
|
||||||
|
}
|
||||||
|
if ( mySetElemOnShape && myShapeID > 0 )
|
||||||
|
GetMeshDS()->SetMeshElementOnShape( elem, myShapeID );
|
||||||
|
|
||||||
if(id)
|
return elem;
|
||||||
return GetMeshDS()->AddVolumeWithID ( n1, n2, n3, n4, n5,
|
|
||||||
n12, n23, n34, n41,
|
|
||||||
n15, n25, n35, n45,
|
|
||||||
id);
|
|
||||||
else
|
|
||||||
return GetMeshDS()->AddVolume( n1, n2, n3, n4, n5,
|
|
||||||
n12, n23, n34, n41,
|
|
||||||
n15, n25, n35, n45);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
/*!
|
/*!
|
||||||
* Special function for creation of quadratic hexahedron
|
* Creates quadratic or linear hexahedron
|
||||||
*/
|
*/
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
@ -705,37 +777,43 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
|
|||||||
const int id,
|
const int id,
|
||||||
const bool force3d)
|
const bool force3d)
|
||||||
{
|
{
|
||||||
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
|
SMESHDS_Mesh * meshDS = GetMeshDS();
|
||||||
|
SMDS_MeshVolume* elem = 0;
|
||||||
if(!myCreateQuadratic) {
|
if(!myCreateQuadratic) {
|
||||||
if(id)
|
if(id)
|
||||||
return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, id);
|
elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, id);
|
||||||
else
|
else
|
||||||
return meshDS->AddVolume(n1, n2, n3, n4, n5, n6, n7, n8);
|
elem = meshDS->AddVolume(n1, n2, n3, n4, n5, n6, n7, n8);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
||||||
|
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
||||||
|
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
|
||||||
|
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
|
const SMDS_MeshNode* n56 = GetMediumNode(n5,n6,force3d);
|
||||||
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
|
const SMDS_MeshNode* n67 = GetMediumNode(n6,n7,force3d);
|
||||||
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
|
const SMDS_MeshNode* n78 = GetMediumNode(n7,n8,force3d);
|
||||||
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d);
|
const SMDS_MeshNode* n85 = GetMediumNode(n8,n5,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n56 = GetMediumNode(n5,n6,force3d);
|
const SMDS_MeshNode* n15 = GetMediumNode(n1,n5,force3d);
|
||||||
const SMDS_MeshNode* n67 = GetMediumNode(n6,n7,force3d);
|
const SMDS_MeshNode* n26 = GetMediumNode(n2,n6,force3d);
|
||||||
const SMDS_MeshNode* n78 = GetMediumNode(n7,n8,force3d);
|
const SMDS_MeshNode* n37 = GetMediumNode(n3,n7,force3d);
|
||||||
const SMDS_MeshNode* n85 = GetMediumNode(n8,n5,force3d);
|
const SMDS_MeshNode* n48 = GetMediumNode(n4,n8,force3d);
|
||||||
|
|
||||||
const SMDS_MeshNode* n15 = GetMediumNode(n1,n5,force3d);
|
if(id)
|
||||||
const SMDS_MeshNode* n26 = GetMediumNode(n2,n6,force3d);
|
elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8,
|
||||||
const SMDS_MeshNode* n37 = GetMediumNode(n3,n7,force3d);
|
n12, n23, n34, n41, n56, n67,
|
||||||
const SMDS_MeshNode* n48 = GetMediumNode(n4,n8,force3d);
|
n78, n85, n15, n26, n37, n48, id);
|
||||||
|
else
|
||||||
|
elem = meshDS->AddVolume(n1, n2, n3, n4, n5, n6, n7, n8,
|
||||||
|
n12, n23, n34, n41, n56, n67,
|
||||||
|
n78, n85, n15, n26, n37, n48);
|
||||||
|
}
|
||||||
|
if ( mySetElemOnShape && myShapeID > 0 )
|
||||||
|
meshDS->SetMeshElementOnShape( elem, myShapeID );
|
||||||
|
|
||||||
if(id)
|
return elem;
|
||||||
return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8,
|
|
||||||
n12, n23, n34, n41, n56, n67,
|
|
||||||
n78, n85, n15, n26, n37, n48, id);
|
|
||||||
else
|
|
||||||
return meshDS->AddVolume(n1, n2, n3, n4, n5, n6, n7, n8,
|
|
||||||
n12, n23, n34, n41, n56, n67,
|
|
||||||
n78, n85, n15, n26, n37, n48);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -55,6 +55,15 @@ class SMESH_MesherHelper
|
|||||||
public:
|
public:
|
||||||
// ---------- PUBLIC UTILITIES ----------
|
// ---------- PUBLIC UTILITIES ----------
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Returns true if given node is medium
|
||||||
|
* \param n - node to check
|
||||||
|
* \param typeToCheck - type of elements containing the node to ask about node status
|
||||||
|
* \retval bool - check result
|
||||||
|
*/
|
||||||
|
static bool IsMedium(const SMDS_MeshNode* node,
|
||||||
|
const SMDSAbs_ElementType typeToCheck = SMDSAbs_All);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Load nodes bound to face into a map of node columns
|
* \brief Load nodes bound to face into a map of node columns
|
||||||
* \param theParam2ColumnMap - map of node columns to fill
|
* \param theParam2ColumnMap - map of node columns to fill
|
||||||
@ -95,119 +104,72 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// ---------- PUBLIC METHODS ----------
|
// ---------- PUBLIC INSTANCE METHODS ----------
|
||||||
|
|
||||||
/// Empty constructor
|
// constructor
|
||||||
SMESH_MesherHelper(SMESH_Mesh& theMesh)
|
SMESH_MesherHelper(SMESH_Mesh& theMesh);
|
||||||
{ myMesh=(void *)&theMesh; myCreateQuadratic = false; myShapeID=-1;}
|
|
||||||
|
|
||||||
SMESH_Mesh* GetMesh() const { return (SMESH_Mesh*)myMesh; }
|
SMESH_Mesh* GetMesh() const { return myMesh; }
|
||||||
|
|
||||||
SMESHDS_Mesh* GetMeshDS() const { return GetMesh()->GetMeshDS(); }
|
SMESHDS_Mesh* GetMeshDS() const { return GetMesh()->GetMeshDS(); }
|
||||||
|
|
||||||
/// Copy constructor
|
/*!
|
||||||
//Standard_EXPORT SMESH_MesherHelper (const SMESH_MesherHelper& theOther);
|
* Check submesh for given shape: if all elements on this shape are quadratic,
|
||||||
|
* quadratic elements will be created. Also fill myNLinkNodeMap
|
||||||
/// Destructor
|
|
||||||
//Standard_EXPORT virtual ~SMESH_MesherHelper ();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check submesh for given shape
|
|
||||||
* Check if all elements on this shape
|
|
||||||
* are quadratic, if yes => set true to myCreateQuadratic
|
|
||||||
* (default value is false). Also fill myNLinkNodeMap
|
|
||||||
* Returns myCreateQuadratic
|
|
||||||
*/
|
*/
|
||||||
bool IsQuadraticSubMesh(const TopoDS_Shape& theShape);
|
bool IsQuadraticSubMesh(const TopoDS_Shape& theShape);
|
||||||
|
/*!
|
||||||
|
* \brief Set order of elements to create without calling IsQuadraticSubMesh()
|
||||||
|
*/
|
||||||
|
void SetIsQuadratic(const bool theBuildQuadratic)
|
||||||
|
{ myCreateQuadratic = theBuildQuadratic; }
|
||||||
|
/*!
|
||||||
|
* \brief Return myCreateQuadratic flag
|
||||||
|
*/
|
||||||
|
bool GetIsQuadratic() const { return myCreateQuadratic; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns true if given node is medium
|
* \brief To set created elements on the shape set by IsQuadraticSubMesh()
|
||||||
* \param n - node to check
|
* or the next methods. By defaul elements are not set on the shape
|
||||||
* \param typeToCheck - type of elements containing the node to ask about node status
|
|
||||||
* \retval bool - check result
|
|
||||||
*/
|
*/
|
||||||
static bool IsMedium(const SMDS_MeshNode* node,
|
void SetElementsOnShape(bool toSet) { mySetElemOnShape = toSet; }
|
||||||
const SMDSAbs_ElementType typeToCheck = SMDSAbs_All);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auxilary function for filling myNLinkNodeMap
|
|
||||||
*/
|
|
||||||
void AddNLinkNode(const SMDS_MeshNode* n1,
|
|
||||||
const SMDS_MeshNode* n2,
|
|
||||||
const SMDS_MeshNode* n12);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auxilary function for filling myNLinkNodeMap
|
|
||||||
*/
|
|
||||||
void AddNLinkNodeMap(const NLinkNodeMap& aMap)
|
|
||||||
{ myNLinkNodeMap.insert(aMap.begin(), aMap.end()); }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns myNLinkNodeMap
|
|
||||||
*/
|
|
||||||
const NLinkNodeMap& GetNLinkNodeMap() { return myNLinkNodeMap; }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Return node UV on face
|
* \brief Set shape to make elements on without calling IsQuadraticSubMesh()
|
||||||
* \param F - the face
|
|
||||||
* \param n - the node
|
|
||||||
* \param inFaceNode - a node of element being created located inside a face
|
|
||||||
* \retval gp_XY - resulting UV
|
|
||||||
*
|
|
||||||
* Auxilary function called form GetMediumNode()
|
|
||||||
*/
|
*/
|
||||||
gp_XY GetNodeUV(const TopoDS_Face& F,
|
void SetSubShape(const int subShapeID);//!==SMESHDS_Mesh::ShapeToIndex(shape)
|
||||||
const SMDS_MeshNode* n,
|
void SetSubShape(const TopoDS_Shape& subShape);
|
||||||
const SMDS_MeshNode* inFaceNode=0) const;
|
/*!
|
||||||
|
* \brief Return ID of the shape set by IsQuadraticSubMesh() or SetSubShape()
|
||||||
|
* \retval int - shape index in SMESHDS
|
||||||
|
*/
|
||||||
|
int GetSubShapeID() const { return myShapeID; }
|
||||||
|
/*!
|
||||||
|
* \brief Return the shape set by IsQuadraticSubMesh() or SetSubShape()
|
||||||
|
*/
|
||||||
|
TopoDS_Shape GetSubShape() const { return myShape; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Check if inFaceNode argument is necessary for call GetNodeUV(F,..)
|
* Creates a node
|
||||||
* \param F - the face
|
|
||||||
* \retval bool - return true if the face is periodic
|
|
||||||
*
|
|
||||||
* if F is Null, answer about subshape set through IsQuadraticSubMesh() or
|
|
||||||
* SetSubShape()
|
|
||||||
*/
|
*/
|
||||||
bool GetNodeUVneedInFaceNode(const TopoDS_Face& F = TopoDS_Face()) const;
|
SMDS_MeshNode* AddNode(double x, double y, double z, int ID = 0);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Return U on edge
|
* Creates quadratic or linear edge
|
||||||
* \param F - the edge
|
|
||||||
* \param n - the node
|
|
||||||
* \retval double - resulting U
|
|
||||||
*
|
|
||||||
* Auxilary function called from GetMediumNode()
|
|
||||||
*/
|
*/
|
||||||
double GetNodeU(const TopoDS_Edge& E,
|
SMDS_MeshEdge* AddEdge(const SMDS_MeshNode* n1,
|
||||||
const SMDS_MeshNode* n);
|
const SMDS_MeshNode* n2,
|
||||||
|
const int id = 0,
|
||||||
|
const bool force3d = true);
|
||||||
/**
|
/*!
|
||||||
* Special function for search or creation medium node
|
* Creates quadratic or linear triangle
|
||||||
*/
|
|
||||||
const SMDS_MeshNode* GetMediumNode(const SMDS_MeshNode* n1,
|
|
||||||
const SMDS_MeshNode* n2,
|
|
||||||
const bool force3d);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Special function for creation quadratic edge
|
|
||||||
*/
|
|
||||||
SMDS_QuadraticEdge* AddQuadraticEdge(const SMDS_MeshNode* n1,
|
|
||||||
const SMDS_MeshNode* n2,
|
|
||||||
const int id = 0,
|
|
||||||
const bool force3d = true);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Special function for creation quadratic triangle
|
|
||||||
*/
|
*/
|
||||||
SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1,
|
SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1,
|
||||||
const SMDS_MeshNode* n2,
|
const SMDS_MeshNode* n2,
|
||||||
const SMDS_MeshNode* n3,
|
const SMDS_MeshNode* n3,
|
||||||
const int id=0,
|
const int id=0,
|
||||||
const bool force3d = false);
|
const bool force3d = false);
|
||||||
|
/*!
|
||||||
/**
|
* Creates quadratic or linear quadrangle
|
||||||
* Special function for creation quadratic quadrangle
|
|
||||||
*/
|
*/
|
||||||
SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1,
|
SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1,
|
||||||
const SMDS_MeshNode* n2,
|
const SMDS_MeshNode* n2,
|
||||||
@ -215,9 +177,8 @@ public:
|
|||||||
const SMDS_MeshNode* n4,
|
const SMDS_MeshNode* n4,
|
||||||
const int id = 0,
|
const int id = 0,
|
||||||
const bool force3d = false);
|
const bool force3d = false);
|
||||||
|
/*!
|
||||||
/**
|
* Creates quadratic or linear tetraahedron
|
||||||
* Special function for creation quadratic tetraahedron
|
|
||||||
*/
|
*/
|
||||||
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
|
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
|
||||||
const SMDS_MeshNode* n2,
|
const SMDS_MeshNode* n2,
|
||||||
@ -225,10 +186,8 @@ public:
|
|||||||
const SMDS_MeshNode* n4,
|
const SMDS_MeshNode* n4,
|
||||||
const int id = 0,
|
const int id = 0,
|
||||||
const bool force3d = true);
|
const bool force3d = true);
|
||||||
|
/*!
|
||||||
|
* Creates quadratic or linear pyramid
|
||||||
/**
|
|
||||||
* Special function for creation quadratic pyramid
|
|
||||||
*/
|
*/
|
||||||
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
|
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
|
||||||
const SMDS_MeshNode* n2,
|
const SMDS_MeshNode* n2,
|
||||||
@ -237,9 +196,8 @@ public:
|
|||||||
const SMDS_MeshNode* n5,
|
const SMDS_MeshNode* n5,
|
||||||
const int id = 0,
|
const int id = 0,
|
||||||
const bool force3d = true);
|
const bool force3d = true);
|
||||||
|
/*!
|
||||||
/**
|
* Creates quadratic or linear pentahedron
|
||||||
* Special function for creation quadratic pentahedron
|
|
||||||
*/
|
*/
|
||||||
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
|
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
|
||||||
const SMDS_MeshNode* n2,
|
const SMDS_MeshNode* n2,
|
||||||
@ -249,9 +207,8 @@ public:
|
|||||||
const SMDS_MeshNode* n6,
|
const SMDS_MeshNode* n6,
|
||||||
const int id = 0,
|
const int id = 0,
|
||||||
const bool force3d = true);
|
const bool force3d = true);
|
||||||
|
/*!
|
||||||
/**
|
* Creates quadratic or linear hexahedron
|
||||||
* Special function for creation quadratic hexahedron
|
|
||||||
*/
|
*/
|
||||||
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
|
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
|
||||||
const SMDS_MeshNode* n2,
|
const SMDS_MeshNode* n2,
|
||||||
@ -263,45 +220,26 @@ public:
|
|||||||
const SMDS_MeshNode* n8,
|
const SMDS_MeshNode* n8,
|
||||||
const int id = 0,
|
const int id = 0,
|
||||||
bool force3d = true);
|
bool force3d = true);
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Set order of elements to create
|
* \brief Return U of the given node on the edge
|
||||||
* \param theBuildQuadratic - to build quadratic or not
|
|
||||||
*
|
|
||||||
* To be used for quadratic elements creation without preceding
|
|
||||||
* IsQuadraticSubMesh() or AddQuadraticEdge() call
|
|
||||||
*/
|
*/
|
||||||
void SetKeyIsQuadratic(const bool theBuildQuadratic)
|
double GetNodeU(const TopoDS_Edge& theEdge,
|
||||||
{ myCreateQuadratic = theBuildQuadratic; }
|
const SMDS_MeshNode* theNode);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Return myCreateQuadratic flag
|
* \brief Return node UV on face
|
||||||
* \retval bool - myCreateQuadratic value
|
* \param inFaceNode - a node of element being created located inside a face
|
||||||
*/
|
*/
|
||||||
bool GetIsQuadratic() const { return myCreateQuadratic; }
|
gp_XY GetNodeUV(const TopoDS_Face& F,
|
||||||
|
const SMDS_MeshNode* n,
|
||||||
|
const SMDS_MeshNode* inFaceNode=0) const;
|
||||||
/*!
|
/*!
|
||||||
* \brief Set shape to make elements on
|
* \brief Check if inFaceNode argument is necessary for call GetNodeUV(F,..)
|
||||||
* \param subShape, subShapeID - shape or its ID (==SMESHDS_Mesh::ShapeToIndex(shape))
|
* \retval bool - return true if the face is periodic
|
||||||
*/
|
|
||||||
void SetSubShape(const int subShapeID);
|
|
||||||
void SetSubShape(const TopoDS_Shape& subShape);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Return shape or its ID, on which created elements are added
|
|
||||||
* \retval int - shape index in SMESHDS
|
|
||||||
*
|
*
|
||||||
* Shape is set by calling either IsQuadraticSubMesh() or SetSubShape()
|
* if F is Null, answer about subshape set through IsQuadraticSubMesh() or
|
||||||
|
* SetSubShape()
|
||||||
*/
|
*/
|
||||||
int GetSubShapeID() const { return myShapeID; }
|
bool GetNodeUVneedInFaceNode(const TopoDS_Face& F = TopoDS_Face()) const;
|
||||||
/*!
|
|
||||||
* \brief Return shape or its ID, on which created elements are added
|
|
||||||
* \retval TopoDS_Shape - shape
|
|
||||||
*
|
|
||||||
* Shape is set by calling either IsQuadraticSubMesh() or SetSubShape()
|
|
||||||
*/
|
|
||||||
TopoDS_Shape GetSubShape() const { return myShape; }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Check if shape is a seam edge or it's vertex
|
* \brief Check if shape is a seam edge or it's vertex
|
||||||
@ -321,21 +259,42 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool IsSeamShape(const TopoDS_Shape& subShape) const
|
bool IsSeamShape(const TopoDS_Shape& subShape) const
|
||||||
{ return IsSeamShape( GetMeshDS()->ShapeToIndex( subShape )); }
|
{ return IsSeamShape( GetMeshDS()->ShapeToIndex( subShape )); }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
|
* \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
|
||||||
* has a seam edge
|
* has a seam edge
|
||||||
* \retval bool - true if it has
|
* \retval bool - true if it has
|
||||||
*/
|
*/
|
||||||
bool HasSeam() const { return !mySeamShapeIds.empty(); }
|
bool HasSeam() const { return !mySeamShapeIds.empty(); }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Return index of periodic parametric direction of a closed face
|
* \brief Return index of periodic parametric direction of a closed face
|
||||||
* \retval int - 1 for U, 2 for V direction
|
* \retval int - 1 for U, 2 for V direction
|
||||||
*/
|
*/
|
||||||
int GetPeriodicIndex() const { return myParIndex; }
|
int GetPeriodicIndex() const { return myParIndex; }
|
||||||
|
|
||||||
protected:
|
/**
|
||||||
|
* Special function for search or creation medium node
|
||||||
|
*/
|
||||||
|
const SMDS_MeshNode* GetMediumNode(const SMDS_MeshNode* n1,
|
||||||
|
const SMDS_MeshNode* n2,
|
||||||
|
const bool force3d);
|
||||||
|
/*!
|
||||||
|
* Auxilary function for filling myNLinkNodeMap
|
||||||
|
*/
|
||||||
|
void AddNLinkNode(const SMDS_MeshNode* n1,
|
||||||
|
const SMDS_MeshNode* n2,
|
||||||
|
const SMDS_MeshNode* n12);
|
||||||
|
/**
|
||||||
|
* Auxilary function for filling myNLinkNodeMap
|
||||||
|
*/
|
||||||
|
void AddNLinkNodeMap(const NLinkNodeMap& aMap)
|
||||||
|
{ myNLinkNodeMap.insert(aMap.begin(), aMap.end()); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns myNLinkNodeMap
|
||||||
|
*/
|
||||||
|
const NLinkNodeMap& GetNLinkNodeMap() const { return myNLinkNodeMap; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Select UV on either of 2 pcurves of a seam edge, closest to the given UV
|
* \brief Select UV on either of 2 pcurves of a seam edge, closest to the given UV
|
||||||
@ -347,20 +306,23 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void* myMesh;
|
// Forbiden copy constructor
|
||||||
|
SMESH_MesherHelper (const SMESH_MesherHelper& theOther) {};
|
||||||
int myShapeID;
|
|
||||||
|
|
||||||
// Key for creation quadratic faces
|
|
||||||
bool myCreateQuadratic;
|
|
||||||
|
|
||||||
// special map for using during creation quadratic faces
|
// special map for using during creation quadratic faces
|
||||||
NLinkNodeMap myNLinkNodeMap;
|
NLinkNodeMap myNLinkNodeMap;
|
||||||
|
|
||||||
std::set< int > mySeamShapeIds;
|
std::set< int > mySeamShapeIds;
|
||||||
double myPar1, myPar2; // bounds of a closed periodic surface
|
double myPar1, myPar2; // bounds of a closed periodic surface
|
||||||
int myParIndex; // bounds' index (1-U, 2-V)
|
int myParIndex; // bounds' index (1-U, 2-V)
|
||||||
|
|
||||||
TopoDS_Shape myShape;
|
TopoDS_Shape myShape;
|
||||||
|
SMESH_Mesh* myMesh;
|
||||||
|
int myShapeID;
|
||||||
|
|
||||||
|
// to create quadratic elements
|
||||||
|
bool myCreateQuadratic;
|
||||||
|
bool mySetElemOnShape;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user