GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 =========================================================================*/
35 
38 
39 //--------------------------------------------------------------------------
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 {
49 
51  m_ContourSegmentationWidget, SIGNAL( UpdateContourRepresentationProperties() ),
53 
55  m_ContourSegmentationWidget, SIGNAL( ValidatePressed() ),
56  this, SIGNAL( validateContour() ) );
57 
59  m_ContourSegmentationWidget, SIGNAL( ReinitializePressed() ),
60  this, SIGNAL( reinitializeContour() ) );
61 }
62 
63 //--------------------------------------------------------------------------
64 
65 //--------------------------------------------------------------------------
68 {
69 }
70 
71 //--------------------------------------------------------------------------
72 
73 //--------------------------------------------------------------------------
74 QWidget *
76 {
78 }
79 
80 //--------------------------------------------------------------------------
81 
82 //--------------------------------------------------------------------------
83 void
85 {
86  bool haschanged = iModified;
87 
89 
90  if ( m_LinesWidth != temp )
91  {
92  m_LinesWidth = temp;
93  haschanged = true;
94  }
95 
97 
98  if ( m_LinesColor != temp_color )
99  {
100  m_LinesColor = temp_color;
101  haschanged = true;
102  }
103 
105 
106  if ( m_NodesColor != temp_color )
107  {
108  m_NodesColor = temp_color;
109  haschanged = true;
110  }
112 
113  if ( m_ActiveNodesColor != temp_color )
114  {
115  m_ActiveNodesColor = temp_color;
116  haschanged = true;
117  }
118 
119  if ( haschanged )
120  {
122  static_cast< float >( m_LinesWidth ),
123  m_LinesColor,
124  m_NodesColor,
126  }
127 }
128 
129 //--------------------------------------------------------------------------
130 
131 //--------------------------------------------------------------------------
132 void
134 {
135  m_ReeditMode = iReeditMode;
136 }
137 
138 //--------------------------------------------------------------------------
139 
140 //--------------------------------------------------------------------------
141 bool
143 {
144  return m_ReeditMode;
145 }
146 
147 //--------------------------------------------------------------------------
void SetReeditMode(bool iReeditMode)
Set the reedit mode.
QColor GetLineColor() const
Get the color of the line.
bool GetReeditMode()
Get the reedit mode.
void changeContourRepresentationProperty(float iLinewidth, QColor iLinecolor, QColor iNodecolor, QColor iActivenodecolor)
Signal sent if new properties have been generated by GenerateContourRepresentationProperties() ...
QGoContourManualSegmentation(QWidget *parent=0)
Constructor.
void GenerateContourRepresentationProperties(bool iModified=false)
Generate the widget contour properties if it has been modified.
void validateContour()
Signal sent if we click on the &quot;Validate&quot; button in the widget.
QWidget * getWidget()
Get the base widget for the contour manual segmentation.
QGoContourManualSegmentationWidget * m_ContourSegmentationWidget
QColor GetActivatedNodeColor() const
Get the color of the Active Node.
QGoManualSegmentationSettingsDialog * m_SettingsDialog
void reinitializeContour()
Signal sent if we click on the &quot;Reinitialize&quot; button in the widget.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QColor GetNodeColor() const
Get the color of the Node.
Define the manual segmentation widget connections.
double GetLineWidth() const
Get the width of the line.