]> Creatis software - cpPlugins.git/blob - appli/PipelineEditor/PipelineEditor.cxx
Visual properties dialog finished.
[cpPlugins.git] / appli / PipelineEditor / PipelineEditor.cxx
1 #include "PipelineEditor.h"
2 #include "ui_PipelineEditor.h"
3
4 #include <QMessageBox>
5
6 #include <cpPlugins/Image.h>
7 #include <cpPipelineEditor/Editor.h>
8
9 #include <vtkImageData.h>
10 #include <vtkPolyData.h>
11 #include <vtkRenderWindowInteractor.h>
12
13 // -------------------------------------------------------------------------
14 PipelineEditor::
15 PipelineEditor( int argc, char* argv[], QApplication* app, QWidget* parent )
16   : Superclass( argc, argv, app, parent ),
17     m_UI( new Ui::PipelineEditor )
18 {
19   // Basic configuration
20   this->m_UI->setupUi( this );
21   this->_Configure(
22     this->m_UI->LoadedPlugins,
23     this->m_UI->Viewer,
24     this->m_UI->Canvas->editor( )
25     );
26
27   // Connect actions to slots
28   this->connect(
29     this->m_UI->ActionBackgroundMPR, SIGNAL( triggered( ) ),
30     this, SLOT( _ActionBackgroundMPR( ) )
31     );
32   this->connect(
33     this->m_UI->ActionBackground3D, SIGNAL( triggered( ) ),
34     this, SLOT( _ActionBackground3D( ) )
35     );
36   this->connect(
37     this->m_UI->ButtonLoadPluginsFile, SIGNAL( clicked( ) ),
38     this, SLOT( _InteractiveLoadPlugins( ) )
39     );
40   this->connect(
41     this->m_UI->ButtonLoadPluginsPath, SIGNAL( clicked( ) ),
42     this, SLOT( _InteractiveLoadPluginsFromPath( ) )
43     );
44   this->connect(
45     this->m_UI->ActionOpenWorkspace, SIGNAL( triggered( ) ),
46     this, SLOT( _InteractiveLoadWorkspace( ) )
47     );
48   this->connect(
49     this->m_UI->ActionSaveWorkspace, SIGNAL( triggered( ) ),
50     this, SLOT( _InteractiveSaveWorkspace( ) )
51     );
52   this->connect(
53     this->m_UI->Canvas->editor( ),
54     SIGNAL( execFilter( const std::string& ) ),
55     this,
56     SLOT( _ExecFilter( const std::string& ) )
57     );
58   this->connect(
59     this->m_UI->Canvas->editor( ),
60     SIGNAL( showFilterOutput( const std::string&, const std::string& ) ),
61     this,
62     SLOT( _ShowFilterOutput( const std::string&, const std::string& ) )
63     );
64   this->connect(
65     this->m_UI->Canvas->editor( ),
66     SIGNAL( hideFilterOutput( const std::string&, const std::string& ) ),
67     this,
68     SLOT( _HideFilterOutput( const std::string&, const std::string& ) )
69     );
70   this->connect(
71     this->m_UI->Canvas->editor( ),
72     SIGNAL( visualPropertiesFilterOutput( const std::string&, const std::string& ) ),
73     this,
74     SLOT( _PropertiesFilterOutput( const std::string&, const std::string& ) )
75     );
76 }
77
78 // -------------------------------------------------------------------------
79 PipelineEditor::
80 ~PipelineEditor( )
81 {
82   delete this->m_UI;
83 }
84
85 // -------------------------------------------------------------------------
86 void PipelineEditor::
87 _ActionBackgroundMPR( )
88 {
89   this->_BackgroundProperties( 4 );
90 }
91
92 // -------------------------------------------------------------------------
93 void PipelineEditor::
94 _ActionBackground3D( )
95 {
96   this->_BackgroundProperties( 3 );
97 }
98
99 // -------------------------------------------------------------------------
100 void PipelineEditor::
101 _ShowFilterOutput(
102   const std::string& filter_name, const std::string& output_name
103   )
104 {
105   this->_ExecFilter( filter_name );
106   this->_ShowData( filter_name, output_name );
107 }
108
109 // -------------------------------------------------------------------------
110 void PipelineEditor::
111 _HideFilterOutput(
112   const std::string& filter_name, const std::string& output_name
113   )
114 {
115   this->_HideData( filter_name, output_name );
116 }
117
118 // -------------------------------------------------------------------------
119 void PipelineEditor::
120 _PropertiesFilterOutput(
121   const std::string& filter_name, const std::string& output_name
122   )
123 {
124   this->_DataProperties( filter_name, output_name );
125 }
126
127 // eof - $RCSfile$