fw4spl
TransferFunctionEditor.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "uiTF/config.hpp"
10 
11 #include <fwData/Composite.hpp>
12 #include <fwData/TransferFunction.hpp>
13 
14 #include <fwGui/editor/IEditor.hpp>
15 
16 #include <boost/filesystem/path.hpp>
17 
18 #include <QObject>
19 
20 class QComboBox;
21 class QPushButton;
22 class QIcon;
23 
24 namespace uiTF
25 {
26 
62 class UITF_CLASS_API TransferFunctionEditor : public QObject,
64 {
65 Q_OBJECT
66 
67 public:
68 
70 
71 
72  UITF_API TransferFunctionEditor();
73 
75  UITF_API virtual ~TransferFunctionEditor() noexcept;
76 
77 protected:
78 
80  UITF_API virtual void configuring() override;
81 
83  UITF_API virtual void starting() override;
84 
86  UITF_API virtual void updating() override;
87 
89  UITF_API virtual void stopping() override;
90 
92  UITF_API void swapping(const KeyType& key) override;
93 
102  UITF_API virtual KeyConnectionsMap getAutoConnections() const override;
103 
110  UITF_API void initTransferFunctions();
111 
113  UITF_API bool hasTransferFunctionName(const std::string& _sName) const;
114 
117  UITF_API std::string createTransferFunctionName( const std::string& _sBasename ) const;
118 
120  UITF_API void updateTransferFunction();
121 
123  UITF_API void updateTransferFunctionPreset();
124 
125 private Q_SLOTS:
126 
127  void deleteTF();
128  void newTF();
129  void reinitializeTFPool();
130  void renameTF();
131  void importTF();
132  void exportTF();
133  void presetChoice(int index);
134 
135 private:
136 
137  typedef std::vector< ::boost::filesystem::path > PathContainerType;
138 
139  QComboBox* m_pTransferFunctionPreset;
140  QPushButton* m_deleteButton;
141  QPushButton* m_newButton;
142  QPushButton* m_reinitializeButton;
143  QPushButton* m_renameButton;
144  QPushButton* m_importButton;
145  QPushButton* m_exportButton;
146 
147  ::fwData::TransferFunction::sptr m_selectedTF;
148 
150  PathContainerType m_paths;
151 };
152 
153 }
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
Defines the service interface managing the editor service for object.
Definition: IEditor.hpp:25
STL namespace.
Editor to select a transfer function.
Transfert functions editor.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Contains the representation of the data objects used in the framework.