Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxMemoryTester.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXMEMORYTESTER_H_
13 #define CXMEMORYTESTER_H_
14 
15 #include <QtWidgets>
16 
17 #include <vector>
18 #include "vtkForwardDeclarations.h"
19 #include <boost/shared_ptr.hpp>
20 
21 namespace cx
22 {
23 
24 class MemHolder : public QObject
25 {
26  Q_OBJECT
27 public:
28  struct Block
29  {
30  std::vector<vtkImageDataPtr> mData;
31  };
32 
33  std::vector<Block> mBlocks;
34 public slots:
35  int addBlock();
36  int removeBlock();
37  void generateLeak();
38 private:
40 };
41 
42 class MemoryTester : public QMainWindow
43 {
44  Q_OBJECT
45 public:
46  MemoryTester(QWidget* parent = 0);
48  QToolBar* mToolbar;
49 // QPlainTextEdit* mTextEdit;
50 private slots:
51  void about();
52  void colorCrash();
53 private:
54  void createStatusBar();
55  void addActions();
56  void addToolbar();
57  void addMenu();
58 
59  QAction* mAddMemAction;
60  QAction* mRemoveMemAction;
61  QAction* mLeakAction;
62 
63  QAction* mAction1;
64 // QAction* mAction2;
65 // QAction* mAction3;
66 // QAction* mAction4;
67  QAction* mAboutQtAct;
68  QAction* mAboutAct;
69 
70  QAction* mCrashAct;
71 
72  boost::shared_ptr<MemHolder> mMemory;
73 };
74 
75 
76 } // namespace cx
77 
78 #endif // CXMEMORYTESTER_H_
std::vector< Block > mBlocks
vtkImageDataPtr generateVtkImageData(Eigen::Array3i dim, Vector3D spacing, const unsigned char initValue, int components)
QToolBar * mToolbar
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
std::vector< vtkImageDataPtr > mData
Namespace for all CustusX production code.