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
const int theEdgeNum,
int& theNodeId1,
int& theNodeId2 ) const = 0;
+ virtual bool IsValid() const = 0;
virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
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,
_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