GOFIGURE2
0.9.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
Code
GUI
lib
TraceEditing
QGoContourManualSegmentation.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 "
QGoContourManualSegmentation.h
"
35
36
#include "
QGoContourManualSegmentationWidget.h
"
37
#include "
QGoManualSegmentationSettingsDialog.h
"
38
39
//--------------------------------------------------------------------------
40
QGoContourManualSegmentation::QGoContourManualSegmentation
(
QWidget
*iParent) :
41
QObject
(iParent),
42
m_LinesWidth(2.),
43
m_LinesColor(Qt::magenta),
44
m_NodesColor(Qt::yellow),
45
m_ActiveNodesColor(Qt::cyan),
46
m_ReeditMode(false)
47
{
48
m_ContourSegmentationWidget
=
new
QGoContourManualSegmentationWidget
(iParent);
49
50
QObject::connect
(
51
m_ContourSegmentationWidget
, SIGNAL( UpdateContourRepresentationProperties() ),
52
this
, SLOT(
GenerateContourRepresentationProperties
() ) );
53
54
QObject::connect
(
55
m_ContourSegmentationWidget
, SIGNAL( ValidatePressed() ),
56
this
, SIGNAL(
validateContour
() ) );
57
58
QObject::connect
(
59
m_ContourSegmentationWidget
, SIGNAL( ReinitializePressed() ),
60
this
, SIGNAL(
reinitializeContour
() ) );
61
}
62
63
//--------------------------------------------------------------------------
64
65
//--------------------------------------------------------------------------
66
QGoContourManualSegmentation::
67
~QGoContourManualSegmentation
()
68
{
69
}
70
71
//--------------------------------------------------------------------------
72
73
//--------------------------------------------------------------------------
74
QWidget
*
75
QGoContourManualSegmentation::getWidget
()
76
{
77
return
m_ContourSegmentationWidget
;
78
}
79
80
//--------------------------------------------------------------------------
81
82
//--------------------------------------------------------------------------
83
void
84
QGoContourManualSegmentation::GenerateContourRepresentationProperties
(
bool
iModified)
85
{
86
bool
haschanged = iModified;
87
88
double
temp =
m_ContourSegmentationWidget
->
m_SettingsDialog
->
GetLineWidth
();
89
90
if
(
m_LinesWidth
!= temp )
91
{
92
m_LinesWidth
= temp;
93
haschanged =
true
;
94
}
95
96
QColor
temp_color =
m_ContourSegmentationWidget
->
m_SettingsDialog
->
GetLineColor
();
97
98
if
(
m_LinesColor
!= temp_color )
99
{
100
m_LinesColor
= temp_color;
101
haschanged =
true
;
102
}
103
104
temp_color =
m_ContourSegmentationWidget
->
m_SettingsDialog
->
GetNodeColor
();
105
106
if
(
m_NodesColor
!= temp_color )
107
{
108
m_NodesColor
= temp_color;
109
haschanged =
true
;
110
}
111
temp_color =
m_ContourSegmentationWidget
->
m_SettingsDialog
->
GetActivatedNodeColor
();
112
113
if
(
m_ActiveNodesColor
!= temp_color )
114
{
115
m_ActiveNodesColor
= temp_color;
116
haschanged =
true
;
117
}
118
119
if
( haschanged )
120
{
121
emit
changeContourRepresentationProperty
(
122
static_cast< float >(
m_LinesWidth
),
123
m_LinesColor
,
124
m_NodesColor
,
125
m_ActiveNodesColor
);
126
}
127
}
128
129
//--------------------------------------------------------------------------
130
131
//--------------------------------------------------------------------------
132
void
133
QGoContourManualSegmentation::SetReeditMode
(
bool
iReeditMode)
134
{
135
m_ReeditMode
= iReeditMode;
136
}
137
138
//--------------------------------------------------------------------------
139
140
//--------------------------------------------------------------------------
141
bool
142
QGoContourManualSegmentation::GetReeditMode
()
143
{
144
return
m_ReeditMode
;
145
}
146
147
//--------------------------------------------------------------------------
Generated on Mon May 27 2013 08:47:30 for GOFIGURE2 by
1.8.1.2