mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-16 09:20:36 +05:00
0022183: EDF SMESH: Error with ConvertToQuadratic
In AddNode(), throw an exception only if a node is already in an other sub-mesh or its position in myNodes is wrong.
This commit is contained in:
parent
7daf8d6589
commit
0de9672b5e
@ -155,6 +155,7 @@ bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDele
|
|||||||
//function : AddNode
|
//function : AddNode
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void SMESHDS_SubMesh::AddNode(const SMDS_MeshNode * N)
|
void SMESHDS_SubMesh::AddNode(const SMDS_MeshNode * N)
|
||||||
{
|
{
|
||||||
if ( !IsComplexSubmesh() )
|
if ( !IsComplexSubmesh() )
|
||||||
@ -163,17 +164,19 @@ void SMESHDS_SubMesh::AddNode(const SMDS_MeshNode * N)
|
|||||||
int shapeId = N->getshapeId();
|
int shapeId = N->getshapeId();
|
||||||
if ((shapeId > 0) && (idInSubShape >= 0))
|
if ((shapeId > 0) && (idInSubShape >= 0))
|
||||||
{
|
{
|
||||||
// MESSAGE("========== AddNode already belonging to other subShape " << N->GetID());
|
if ( shapeId != myIndex )
|
||||||
// OK for vertex nodes
|
throw SALOME_Exception
|
||||||
throw SALOME_Exception(LOCALIZED("add node in subshape already belonging to a subshape"));
|
(LOCALIZED("a node being in sub-mesh is added to another sub-mesh"));
|
||||||
|
if ( idInSubShape >= NbNodes() || myNodes[ idInSubShape ] != N )
|
||||||
|
throw SALOME_Exception
|
||||||
|
(LOCALIZED("a node with wrong idInSubShape is re-added to the same sub-mesh"));
|
||||||
|
return; // already in
|
||||||
}
|
}
|
||||||
SMDS_MeshNode* node = (SMDS_MeshNode*)(N);
|
SMDS_MeshNode* node = (SMDS_MeshNode*)(N);
|
||||||
node->setShapeId(myIndex);
|
node->setShapeId(myIndex);
|
||||||
node->setIdInShape(myNodes.size());
|
node->setIdInShape(myNodes.size());
|
||||||
myNodes.push_back(N);
|
myNodes.push_back(N);
|
||||||
//MESSAGE("in "<< myIndex << " AddNode " << node->GetID());
|
|
||||||
}
|
}
|
||||||
//MESSAGE("try to add node in a complex submesh " << N->GetID());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user