]> Creatis software - clitk.git/commitdiff
Add SaveState and XmlReader capabilities
authorDavid Sarrut <david.sarrut@gmail.com>
Fri, 30 Mar 2012 09:52:01 +0000 (11:52 +0200)
committerDavid Sarrut <david.sarrut@gmail.com>
Fri, 30 Mar 2012 09:52:01 +0000 (11:52 +0200)
vv/vvToolBaseBase.h

index dda5acd678be41707e2ee8c800b467b991d674b9..c763010523bd04afff973974dc092aac823a5ee7 100644 (file)
 #define VVTOOLBASEBASE_H
 
 #include "vvMainWindowBase.h"
+#include "vvToolCreatorBase.h"
+class QXmlStreamWriter;
+class QXmlStreamReader;
 
 //------------------------------------------------------------------------------
 class vvToolBaseBase {
 public:
-  virtual ~vvToolBaseBase() {};
+  virtual ~vvToolBaseBase() { 
+    DD("destrucotr vvToolBaseBase");
+    std::vector<vvToolBaseBase*> & v = mCreator->GetListOfTool();
+    v.erase(std::find(v.begin(), v.end(), this));
+    DD("end dest");
+  };
   
+  virtual void SaveState(std::auto_ptr<QXmlStreamWriter> & m_XmlWriter);
+  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