mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-15 01:58:35 +05:00
Fix crash during preview
This commit is contained in:
parent
beabd65174
commit
779adc8fa5
@ -464,21 +464,25 @@ SMESH::MeshPreviewStruct* SMESH_MeshEditor_i::GetPreviewData()
|
|||||||
typedef map<int, int> TNodesMap;
|
typedef map<int, int> TNodesMap;
|
||||||
TNodesMap nodesMap;
|
TNodesMap nodesMap;
|
||||||
|
|
||||||
TPreviewMesh * aPreviewMesh = dynamic_cast< TPreviewMesh* >( myEditor.GetMesh() );
|
|
||||||
SMDSAbs_ElementType previewType = aPreviewMesh->myPreviewType;
|
|
||||||
|
|
||||||
SMESHDS_Mesh* aMeshDS = myEditor.GetMeshDS();
|
SMESHDS_Mesh* aMeshDS = myEditor.GetMeshDS();
|
||||||
int nbEdges = aMeshDS->NbEdges();
|
int nbEdges = aMeshDS->NbEdges();
|
||||||
int nbFaces = aMeshDS->NbFaces();
|
int nbFaces = aMeshDS->NbFaces();
|
||||||
int nbVolum = aMeshDS->NbVolumes();
|
int nbVolum = aMeshDS->NbVolumes();
|
||||||
switch ( previewType ) {
|
|
||||||
case SMDSAbs_Edge : nbFaces = nbVolum = 0; break;
|
|
||||||
case SMDSAbs_Face : nbEdges = nbVolum = 0; break;
|
|
||||||
case SMDSAbs_Volume: nbEdges = nbFaces = 0; break;
|
|
||||||
default:;
|
|
||||||
}
|
|
||||||
myPreviewData = new SMESH::MeshPreviewStruct();
|
myPreviewData = new SMESH::MeshPreviewStruct();
|
||||||
myPreviewData->nodesXYZ.length(aMeshDS->NbNodes());
|
myPreviewData->nodesXYZ.length(aMeshDS->NbNodes());
|
||||||
|
|
||||||
|
TPreviewMesh * aPreviewMesh = dynamic_cast< TPreviewMesh* >( myEditor.GetMesh() );
|
||||||
|
SMDSAbs_ElementType previewType = SMDSAbs_All;
|
||||||
|
if (aPreviewMesh) {
|
||||||
|
previewType = aPreviewMesh->myPreviewType;
|
||||||
|
switch ( previewType ) {
|
||||||
|
case SMDSAbs_Edge : nbFaces = nbVolum = 0; break;
|
||||||
|
case SMDSAbs_Face : nbEdges = nbVolum = 0; break;
|
||||||
|
case SMDSAbs_Volume: nbEdges = nbFaces = 0; break;
|
||||||
|
default:;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
myPreviewData->elementTypes.length(nbEdges + nbFaces + nbVolum);
|
myPreviewData->elementTypes.length(nbEdges + nbFaces + nbVolum);
|
||||||
int i = 0, j = 0;
|
int i = 0, j = 0;
|
||||||
SMDS_ElemIteratorPtr itMeshElems = aMeshDS->elementsIterator();
|
SMDS_ElemIteratorPtr itMeshElems = aMeshDS->elementsIterator();
|
||||||
|
Loading…
Reference in New Issue
Block a user