37 #include <QColorDialog>
40 #include "vtkOrientedGlyphContourRepresentation.h"
41 #include "vtkContourWidget.h"
42 #include "vtkRenderer.h"
43 #include "vtkRenderWindow.h"
44 #include "vtkProperty.h"
46 #include "vtkPolyData.h"
47 #include "vtkCellArray.h"
51 const double & iWidth,
57 m_LineColor(iLineColor),
58 m_NodeColor(iNodeColor),
59 m_ActivatedNodeColor(iActivatedNodeColor)
65 m_Renderer = vtkSmartPointer< vtkRenderer >::New();
67 vtkRenderWindow *renwin = this->qvtkWidget->GetRenderWindow();
86 m_InitPD = vtkSmartPointer< vtkPolyData >::New();
87 vtkSmartPointer< vtkPoints > points = vtkSmartPointer< vtkPoints >::New();
88 vtkSmartPointer< vtkCellArray > lines = vtkSmartPointer< vtkCellArray >::New();
90 vtkIdType *lineIndices =
new vtkIdType[7];
92 for (
int i = 0; i < 6; i++ )
94 const double angle = 2.0 * vtkMath::Pi() * i / 6.0;
95 points->InsertPoint(static_cast< vtkIdType >( i ), 0.1 * cos(angle),
96 0.1 * sin(angle), 0.0);
97 lineIndices[i] =
static_cast< vtkIdType
>( i );
101 lines->InsertNextCell(7, lineIndices);
102 delete[] lineIndices;
128 delete this->qvtkWidget;
167 tr(
"Select Line Color") );
181 tr(
"Select Node Color") );
195 tr(
"Select Activated Node Color") );
211 settings.
beginGroup(
"ManualSegmentationSettings");
218 && ( !m_LineColor.
isValid() ) && !( m_LineWidth > 0. ) )
222 m_LineColor = Qt::magenta;
223 m_ActivatedNodeColor = Qt::yellow;
245 settings.
beginGroup(
"ManualSegmentationSettings");
QColor GetLineColor() const
Get the color of the line.
void SelectLineColor()
Open a dialog to choose the color of the lines.
QString tr(const char *sourceText, const char *disambiguation, int n)
vtkSmartPointer< vtkContourWidget > m_ContourWidget
void setValue(const QString &key, const QVariant &value)
virtual void WriteSettings()
void SelectNodeColor()
Open a dialog to choose the color of the node.
void SelectActivatedNodeColor()
Open a dialog to choose the color of the activated node.
void SetLineWidth(const double &iWidth)
Set the width of the line.
virtual void ReadSettings()
QColor GetActivatedNodeColor() const
Get the color of the Active Node.
vtkSmartPointer< vtkRenderer > m_Renderer
QColor getColor(const QColor &initial, QWidget *parent, const QString &title, QFlags< QColorDialog::ColorDialogOption > options)
QVariant value(const QString &key, const QVariant &defaultValue) const
vtkSmartPointer< vtkOrientedGlyphContourRepresentation > m_ContourRepresentation
vtkSmartPointer< vtkPolyData > m_InitPD
QGoManualSegmentationSettingsDialog(QWidget *parent=0, const double &iWidth=1., const QColor &iLineColor=Qt::magenta, const QColor &iNodeColor=Qt::cyan, const QColor &iActivatedNodeColor=Qt::yellow)
double toDouble(bool *ok) const
QColor m_ActivatedNodeColor
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.
virtual ~QGoManualSegmentationSettingsDialog()
double GetLineWidth() const
Get the width of the line.
void beginGroup(const QString &prefix)