0020575: EDF 1162 SMESH: Mesh is displayed in "Nodes" mode after compute

This commit is contained in:
dmv 2009-11-05 15:06:10 +00:00
parent 61d2e99a72
commit 3ba3d8a91d
4 changed files with 18 additions and 1 deletions

View File

@ -520,6 +520,19 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
return true;
}
//=================================================================================
// function : IsValid
// purpose : Return true if there are some entities
//=================================================================================
bool SMESH_VisualObjDef::IsValid() const
{
return GetNbEntities(SMDSAbs_Node) > 0 ||
GetNbEntities(SMDSAbs_0DElement) > 0 ||
GetNbEntities(SMDSAbs_Edge) > 0 ||
GetNbEntities(SMDSAbs_Face) > 0 ||
GetNbEntities(SMDSAbs_Volume) > 0 ;
}
/*
Class : SMESH_MeshObj
Description : Class for visualisation of mesh

View File

@ -65,6 +65,7 @@ public:
const int theEdgeNum,
int& theNodeId1,
int& theNodeId2 ) const = 0;
virtual bool IsValid() const = 0;
virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;

View File

@ -69,6 +69,8 @@ public:
virtual bool IsNodePrs() const = 0;
virtual SMDS_Mesh* GetMesh() const = 0;
virtual bool IsValid() const;
virtual bool GetEdgeNodes( const int theElemId,
const int theEdgeNum,
int& theNodeId1,

View File

@ -712,7 +712,8 @@ namespace SMESH
_PTR(Study) aDocument = aStudy->studyDS();
// Pass non-visual objects (hypotheses, etc.), return true in this case
CORBA::Long anId = aDocument->StudyId();
if (TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry))
TVisualObjPtr aVisualObj;
if ( (aVisualObj = GetVisualObj(anId,theEntry)) && aVisualObj->IsValid())
{
if ((anActor = CreateActor(aDocument,theEntry,true))) {
bool needFitAll = noSmeshActors(theWnd); // fit for the first object only