GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoTraceEditingWidget.cxx
Go to the documentation of this file.
1 /*=========================================================================
2  Authors: The GoFigure Dev. Team.
3  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
4 
5  Copyright (c) 2009-11, President and Fellows of Harvard College.
6  All rights reserved.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  Redistributions of source code must retain the above copyright notice,
12  this list of conditions and the following disclaimer.
13  Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16  Neither the name of the President and Fellows of Harvard College
17  nor the names of its contributors may be used to endorse or promote
18  products derived from this software without specific prior written
19  permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
25  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 =========================================================================*/
34 #include "QGoTraceEditingWidget.h"
35 #include "QGoModesManagerWidget.h"
37 #include <QPushButton>
38 
40  std::string iTraceName,std::vector<QString> iVectChannels,
41  QStringList iListTimePoints, QWidget *iParent)
42 {
43  this->Initialize(iVectChannels, iListTimePoints, iParent);
44  this->setWindowTitle(tr("%1 Editing").arg(iTraceName.c_str()));
45 }
46 //-------------------------------------------------------------------------
47 
48 //-------------------------------------------------------------------------
50 {
51 }
52 //-------------------------------------------------------------------------
53 
54 //-------------------------------------------------------------------------
55 void QGoTraceEditingWidget::Initialize(std::vector<QString> iVectChannels,
56  QStringList iListTimePoints, QWidget *iParent)
57 {
58  this->m_ListTimePoints = iListTimePoints;
60  iVectChannels, iListTimePoints, this);
61 
62  this->m_VLayout = new QVBoxLayout;
63 
65  this->setLayout(this->m_VLayout);
66  this->m_VLayout->setSizeConstraint(QLayout::SetFixedSize);
67 }
68 //-------------------------------------------------------------------------
69 
70 //-------------------------------------------------------------------------
72  std::string iModeName, QWidget* iModeWidget, bool ModeNeedSeeds)
73 {
74  QWidget* ModeWidget = new QWidget;
75  if (iModeWidget != 0)
76  {
77  ModeWidget = iModeWidget;
78  }
79  this->m_ModeEditingWidget->AddWidgetWithModeName(iModeName, ModeWidget,
80  ModeNeedSeeds);
81 }
82 //-------------------------------------------------------------------------
83 
84 //-------------------------------------------------------------------------
86  bool ModeNeedSeeds)
87 {
88  this->m_ModeEditingWidget->AddWidgetWithModeName(iAlgoModeWidget->GetModeName(),
89  iAlgoModeWidget, ModeNeedSeeds);
90 }
91 //-------------------------------------------------------------------------
92 
93 //-------------------------------------------------------------------------
95 {
96  this->m_ModeEditingWidget = iModeWidget;
98 
100  SIGNAL (SetSeedInteractorBehaviour(bool) ),
101  this,
102  SIGNAL (SetSeedInteractorBehaviour(bool) ) );
103 
105  SIGNAL(ResetClicked() ),
106  this,
107  SIGNAL(ResetClicked() ) );
108 }
109 //-------------------------------------------------------------------------
110 
111 //-------------------------------------------------------------------------
113 {
114  delete this->m_ModeEditingWidget;
115  this->SetModesManager(iModeWidget);
116 }
117 //-------------------------------------------------------------------------
118 
119 //-------------------------------------------------------------------------
121  QGoAlgorithmWidget* iAlgoWidget)
122 {
124 }
125 //-------------------------------------------------------------------------
126 
127 //-------------------------------------------------------------------------
129  QGoAlgorithmWidget* iAlgoWidget)
130 {
132 }
133 //-------------------------------------------------------------------------
134 
135 //-------------------------------------------------------------------------
137  QStringList iListTimePoint, bool ModeNeedSeeds)
138 {
140  iListTimePoint, ModeNeedSeeds);
141 }
142 //-------------------------------------------------------------------------
143 
144 //-------------------------------------------------------------------------
146 {
148 }
149 //-------------------------------------------------------------------------
150 
151 //-------------------------------------------------------------------------
153 {
155 }
156 //-------------------------------------------------------------------------
157 
158 //-------------------------------------------------------------------------
160 {
161  return this->m_ModeEditingWidget->GetIsInvertedOn();
162 }
163 //-------------------------------------------------------------------------
164 
165 //-------------------------------------------------------------------------
167  {
168  if (IsVisible)
169  {
171  }
172  else
173  {
174  emit SetSeedInteractorBehaviour(false);
175  }
176  }
177  //-------------------------------------------------------------------------
178 
179 //-------------------------------------------------------------------------
181  {
183  }
184  //-------------------------------------------------------------------------
185 
186 //-------------------------------------------------------------------------
188  QHash<QString, QColor> iListTimePoints,
189  int iChannelNumber)
190  {
192  iListTimePoints, iChannelNumber);
193  }
194  //-------------------------------------------------------------------------
195 
196 //-------------------------------------------------------------------------
198 {
199  return this->m_ModeEditingWidget->GetCurrentModeName();
200 }