]> Creatis software - clitk.git/blobdiff - vv/vvToolBaseBase.h
Debug RTStruct conversion with empty struc
[clitk.git] / vv / vvToolBaseBase.h
index 9e4382eb0ad078cb54ad089694ac11c4fd460b7f..9c76bb125bfbd4aba518bda40e903ce3e1b2ee77 100644 (file)
@@ -1,39 +1,51 @@
 /*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
 
-  Program:   vv
-  Module:    $RCSfile: vvToolBaseBase.h,v $
-  Language:  C++
-  Date:      $Date: 2010/02/24 11:49:57 $
-  Version:   $Revision: 1.1 $
-  Author :   David Sarrut (david.sarrut@creatis.insa-lyon.fr)
+  Authors belong to: 
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
+  - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
-  Copyright (C) 2008
-  Léon Bérard cancer center  http://oncora1.lyon.fnclcc.fr
-  CREATIS                    http://www.creatis.insa-lyon.fr
+  This software is distributed WITHOUT ANY WARRANTY; without even
+  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+  PURPOSE.  See the copyright notices for more information.
 
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation, version 3 of the License.
+  It is distributed under dual licence
 
-  This program 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 General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-  =========================================================================*/
+  - BSD        See included LICENSE.txt file
+  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
 
 #ifndef VVTOOLBASEBASE_H
 #define VVTOOLBASEBASE_H
 
+#include <algorithm>
 #include "vvMainWindowBase.h"
+#include "vvToolCreatorBase.h"
+class QXmlStreamWriter;
+class QXmlStreamReader;
 
 //------------------------------------------------------------------------------
 class vvToolBaseBase {
+public:
+  virtual ~vvToolBaseBase() { 
+    std::vector<vvToolBaseBase*> & v = mCreator->GetListOfTool();
+    v.erase(std::find(v.begin(), v.end(), this));
+  };
+#if __cplusplus > 199711L
+  virtual void SaveState(std::shared_ptr<QXmlStreamWriter> & m_XmlWriter);
+#else
+  virtual void SaveState(std::auto_ptr<QXmlStreamWriter> & m_XmlWriter);
+#endif
+  virtual void InitializeNewTool(bool ReadStateFlag);   
+  void SetCreator(vvToolCreatorBase * m) { mCreator = m; }
+  void SetXmlReader(QXmlStreamReader * r, int index) { m_XmlReader = r; mImageIndex = index;}  
+
 protected:
   vvMainWindowBase * mMainWindowBase;
+  QXmlStreamReader * m_XmlReader;
+  vvToolCreatorBase * mCreator;
+  int mImageIndex;
 };
 //------------------------------------------------------------------------------
 #endif