Salome HOME
PR: display submeshes and groups
[modules/smesh.git] / src / OBJECT / SMESH_ObjectDef.h
index 7c8ba5480cc66de3e84f1b82c43033909f8a0c8f..f136c3714289f4a8a02fc5e354a9fb0b401a8fa8 100644 (file)
@@ -1,31 +1,30 @@
-//  SMESH OBJECT : interactive object for SMESH visualization
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SMESH OBJECT : interactive object for SMESH visualization
 //  File   : SMESH_Object.h
 //  Author : Nicolas REJNERI
 //  Module : SMESH
 //  $Header$
-
+//
 #ifndef SMESH_OBJECTDEF_H
 #define SMESH_OBJECTDEF_H
 
@@ -62,6 +61,7 @@ public:
   virtual                   ~SMESH_VisualObjDef();
   
   virtual bool              Update( int theIsClear = true ) = 0;
+  virtual bool              NulData() {return 0; };
   virtual void              UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
   virtual int               GetElemDimension( const int theObjId ) = 0;
 
@@ -70,12 +70,14 @@ 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,
                                           int&      theNodeId2 ) const;
 
-  virtual vtkUnstructuredGrid* GetUnstructuredGrid() { return myGrid; }
+  virtual vtkUnstructuredGrid* GetUnstructuredGrid();
   
   virtual vtkIdType         GetNodeObjId( int theVTKID );
   virtual vtkIdType         GetNodeVTKId( int theObjID );
@@ -85,16 +87,17 @@ public:
 protected:
 
   void                      createPoints( vtkPoints* );
-  void                      buildPrs();
+  void                      buildPrs(bool buildGrid = false);
   void                      buildNodePrs();
   void                      buildElemPrs();
   
-private:                                   
+//private:
 
   TMapOfIds                 mySMDS2VTKNodes;
   TMapOfIds                 myVTK2SMDSNodes;
   TMapOfIds                 mySMDS2VTKElems;
   TMapOfIds                 myVTK2SMDSElems;
+  bool                      myLocalGrid;
 
   vtkUnstructuredGrid*      myGrid;
 };
@@ -113,6 +116,7 @@ public:
   virtual                   ~SMESH_MeshObj();
   
   virtual bool              Update( int theIsClear = true );
+  virtual bool              NulData();
   
   virtual int               GetNbEntities( const SMDSAbs_ElementType) const;
   virtual int               GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
@@ -127,6 +131,7 @@ public:
 
 protected:
   SMESH_Client              myClient;
+  vtkUnstructuredGrid*      myEmptyGrid;
 };
 
 
@@ -169,6 +174,8 @@ public:
   virtual int               GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
   virtual bool              IsNodePrs() const;
 
+  virtual SMDSAbs_ElementType GetElementType() const;
+
 private:
 
   SMESH::SMESH_GroupBase_var    myGroupServer;