SALOME - SMESH
SMESH_subMeshEventListener.hxx
Go to the documentation of this file.
00001 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 //  This library is free software; you can redistribute it and/or
00007 //  modify it under the terms of the GNU Lesser General Public
00008 //  License as published by the Free Software Foundation; either
00009 //  version 2.1 of the License.
00010 //
00011 //  This library is distributed in the hope that it will be useful,
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 //  Lesser General Public License for more details.
00015 //
00016 //  You should have received a copy of the GNU Lesser General Public
00017 //  License along with this library; if not, write to the Free Software
00018 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //  SMESH SMESH : implementaion of SMESH idl descriptions
00023 // File      : SMESH_subMeshEventListener.hxx
00024 // Created   : Mon Nov 13 10:45:49 2006
00025 // Author    : Edward AGAPOV (eap)
00026 //
00027 #ifndef SMESH_subMeshEventListener_HeaderFile
00028 #define SMESH_subMeshEventListener_HeaderFile
00029 
00030 #include "SMESH_SMESH.hxx"
00031 
00032 #include <list>
00033 
00034 class  SMESH_subMesh;
00035 class  SMESH_Hypothesis;
00036 struct SMESH_subMeshEventListenerData;
00037 
00038 // ------------------------------------------------------------------
00042 // ------------------------------------------------------------------
00043 
00044 class SMESH_EXPORT SMESH_subMeshEventListener {
00045   bool myIsDeletable; 
00046 public:
00047   SMESH_subMeshEventListener(bool isDeletable):myIsDeletable(isDeletable) {}
00048   bool IsDeletable() const { return myIsDeletable; }
00061   virtual void ProcessEvent(const int          event,
00062                             const int          eventType,
00063                             SMESH_subMesh*     subMesh,
00064                             SMESH_subMeshEventListenerData* data,
00065                             const SMESH_Hypothesis*         hyp = 0);
00066 };
00067 
00068 // ------------------------------------------------------------------
00072 // ------------------------------------------------------------------
00073 
00074 struct SMESH_subMeshEventListenerData
00075 {
00076   bool myIsDeletable; 
00077   int myType;         
00078   std::list<SMESH_subMesh*> mySubMeshes; 
00079                                          // on the one storing this data
00080 public:
00081   SMESH_subMeshEventListenerData(bool isDeletable):myIsDeletable(isDeletable) {}
00082   bool IsDeletable() const { return myIsDeletable; }
00083 
00093   static SMESH_subMeshEventListenerData* MakeData(SMESH_subMesh* dependentSM,
00094                                                   const int      type = 0)
00095   {
00096     SMESH_subMeshEventListenerData* data = new SMESH_subMeshEventListenerData(true);
00097     data->mySubMeshes.push_back( dependentSM );
00098     data->myType = type;
00099     return data;
00100   }
00101 };
00102 
00103 
00104 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines