//purpose :
//=======================================================================
SMESHDS_Mesh::SMESHDS_Mesh(int theMeshID, bool theIsEmbeddedMode):
+ myMeshID(theMeshID),
myIsEmbeddedMode(theIsEmbeddedMode),
- myMeshID(theMeshID)
+ myCurSubID(-1)
{
myScript = new SMESHDS_Script(theIsEmbeddedMode);
+ myCurSubMesh = 0;
}
//=======================================================================
// Rm from sub-mesh
// Node should belong to only one sub-mesh
- subMesh->RemoveNode(n);
+ if( subMesh )
+ subMesh->RemoveNode(n);
SMDS_Mesh::RemoveFreeElement(n);
}
// Rm from sub-mesh
// Element should belong to only one sub-mesh
- subMesh->RemoveElement(elt);
+ if( subMesh )
+ subMesh->RemoveElement(elt);
SMDS_Mesh::RemoveFreeElement(elt);
}
void SMESHDS_Mesh::SetNodeInVolume(SMDS_MeshNode * aNode,
const TopoDS_Shell & S)
{
- add( aNode, getSubmesh(S) );
+ if ( add( aNode, getSubmesh(S) ))
+ const_cast<SMDS_Position*>( aNode->GetPosition().get() )->SetShapeId( myCurSubID );
}
//=======================================================================
//function : SetNodeOnVolume
void SMESHDS_Mesh::SetNodeInVolume(SMDS_MeshNode * aNode,
const TopoDS_Solid & S)
{
- add( aNode, getSubmesh(S) );
+ if ( add( aNode, getSubmesh(S) ))
+ const_cast<SMDS_Position*>( aNode->GetPosition().get() )->SetShapeId( myCurSubID );
}
//=======================================================================
//=======================================================================
void SMESHDS_Mesh::SetNodeInVolume(const SMDS_MeshNode* aNode, int Index)
{
- add( aNode, getSubmesh( Index ));
+ if ( add( aNode, getSubmesh( Index )))
+ const_cast<SMDS_Position*>( aNode->GetPosition().get() )->SetShapeId( Index );
}
//=======================================================================