]> Creatis software - clitk.git/blob - vv/vvToolBaseBase.h
Debug RTStruct conversion with empty struc
[clitk.git] / vv / vvToolBaseBase.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18
19 #ifndef VVTOOLBASEBASE_H
20 #define VVTOOLBASEBASE_H
21
22 #include <algorithm>
23 #include "vvMainWindowBase.h"
24 #include "vvToolCreatorBase.h"
25 class QXmlStreamWriter;
26 class QXmlStreamReader;
27
28 //------------------------------------------------------------------------------
29 class vvToolBaseBase {
30 public:
31   virtual ~vvToolBaseBase() { 
32     std::vector<vvToolBaseBase*> & v = mCreator->GetListOfTool();
33     v.erase(std::find(v.begin(), v.end(), this));
34   };
35 #if __cplusplus > 199711L
36   virtual void SaveState(std::shared_ptr<QXmlStreamWriter> & m_XmlWriter);
37 #else
38   virtual void SaveState(std::auto_ptr<QXmlStreamWriter> & m_XmlWriter);
39 #endif
40   virtual void InitializeNewTool(bool ReadStateFlag);   
41   void SetCreator(vvToolCreatorBase * m) { mCreator = m; }
42   void SetXmlReader(QXmlStreamReader * r, int index) { m_XmlReader = r; mImageIndex = index;}  
43
44 protected:
45   vvMainWindowBase * mMainWindowBase;
46   QXmlStreamReader * m_XmlReader;
47   vvToolCreatorBase * mCreator;
48   int mImageIndex;
49 };
50 //------------------------------------------------------------------------------
51 #endif
52