GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoTransferFunctionDockWidget.cxx
Go to the documentation of this file.
1 
2 /*=========================================================================
3  Authors: The GoFigure Dev. Team.
4  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
5 
6  Copyright (c) 2009-11, President and Fellows of Harvard College.
7  All rights reserved.
8 
9  Redistribution and use in source and binary forms, with or without
10  modification, are permitted provided that the following conditions are met:
11 
12  Redistributions of source code must retain the above copyright notice,
13  this list of conditions and the following disclaimer.
14  Redistributions in binary form must reproduce the above copyright notice,
15  this list of conditions and the following disclaimer in the documentation
16  and/or other materials provided with the distribution.
17  Neither the name of the President and Fellows of Harvard College
18  nor the names of its contributors may be used to endorse or promote
19  products derived from this software without specific prior written
20  permission.
21 
22  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
26  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
28  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
29  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
31  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 =========================================================================*/
35 
37 
39 
42  QGoDockWidget(iParent)
43 {
44  this->setupUi(this);
45 
46  QIcon Navigation;
47  Navigation.addPixmap(QPixmap( QString::fromUtf8(":/fig/transferFunction.png") ),
48  QIcon::Normal, QIcon::Off);
49  this->m_ToggleAction->setIcon(Navigation);
50 }
51 
52 //-------------------------------------------------------------------------
53 
54 //-------------------------------------------------------------------------
57 {
58 }
59 //-------------------------------------------------------------------------
60 
61 //-------------------------------------------------------------------------
62 void
65 {
66  this->tabWidget->addTab(iTF, iName);
67  int nb_index = this->tabWidget->count();
68  this->tabWidget->setCurrentIndex(nb_index);
69  this->tabWidget->setCurrentIndex(0);
70 }
71 //-------------------------------------------------------------------------
72 
73 //-------------------------------------------------------------------------
74 int
77 {
78  return this->tabWidget->currentIndex();
79 }
80 //-------------------------------------------------------------------------
81 
82 //-------------------------------------------------------------------------
83 QWidget*
85 GetWidget(int iIndex)
86 {
87  return this->tabWidget->widget(iIndex);
88 }
89 //-------------------------------------------------------------------------
90 
91 //-------------------------------------------------------------------------
92 void
94 SetCurrentWidget(int iIndex)
95 {
96  return this->tabWidget->setCurrentIndex(iIndex);
97 }
98 //-------------------------------------------------------------------------
99 
100 //-------------------------------------------------------------------------
101 void
104 {
105  int nb_index = this->tabWidget->count();
106  for( int i = nb_index; i>0; i--)
107  {
108  this->tabWidget->removeTab(i-1);
109  }
110 }
111 //-------------------------------------------------------------------------
112 
113 //-------------------------------------------------------------------------
114 int
117 {
118  return this->tabWidget->count();
119 }
120 //-------------------------------------------------------------------------
void setupUi(QWidget *widget)
void setIcon(const QIcon &icon)
QString fromUtf8(const char *str, int size)
void addPixmap(const QPixmap &pixmap, Mode mode, State state)
QAction * m_ToggleAction
Definition: QGoDockWidget.h:58
void AddTransferFunction(QString iName, GoTransferFunctionEditorWidget *iTF)
inherits from Qt QDockWidget.toggle action reimplemented in order the state is saved when changing ta...
Definition: QGoDockWidget.h:47
QGoTransferFunctionDockWidget(QWidget *parent=0)
Constructor.