28 #include <QFileDialog>
48 m_mesh(
mesh), m_parent(parent), m_treeWidget(treeWidget), m_renderWindow(window)
52 m_dialog =
new PlanarOptimizationDialog;
59 dialog->activateWindow();
76 QSpinBox* smallRegionRemoval_box =
m_dialog->spinBox_sr;
77 if(state == Qt::Checked)
79 smallRegionRemoval_box->setEnabled(
true);
83 smallRegionRemoval_box->setEnabled(
false);
89 QCheckBox* generateTextures_box =
m_dialog->checkBox_gt;
90 QDoubleSpinBox* lineSegmentThreshold_box =
m_dialog->doubleSpinBox_ls;
91 if(state == Qt::Checked)
93 generateTextures_box->setEnabled(
true);
94 lineSegmentThreshold_box->setEnabled(
true);
98 generateTextures_box->setEnabled(
false);
99 lineSegmentThreshold_box->setEnabled(
false);
105 QSpinBox* planeIterations_box =
m_dialog->spinBox_pi;
106 int planeIterations = planeIterations_box->value();
107 QDoubleSpinBox* normalThreshold_box =
m_dialog->doubleSpinBox_nt;
108 float normalThreshold = (float)normalThreshold_box->value();
109 QSpinBox* minimalPlaneSize_box =
m_dialog->spinBox_mp;
110 int minimalPlaneSize = minimalPlaneSize_box->value();
111 QCheckBox* removeSmallRegions_box =
m_dialog->checkBox_sr;
112 bool removeSmallRegions = removeSmallRegions_box->isChecked();
113 QSpinBox* removeSmallRegionThreshold_box =
m_dialog->spinBox_sr;
114 int removeSmallRegionThreshold = (removeSmallRegions) ? removeSmallRegionThreshold_box->value() : 0;
115 QCheckBox* fillHoles_box =
m_dialog->checkBox_fh;
116 bool fillHoles = fillHoles_box->isChecked();
117 QCheckBox* retesselate_box =
m_dialog->checkBox_rt;
118 bool retesselate = retesselate_box->isChecked();
119 QCheckBox* generateTextures_box =
m_dialog->checkBox_gt;
120 bool generateTextures = generateTextures_box->isChecked();
121 QDoubleSpinBox* lineSegmentThreshold_box =
m_dialog->doubleSpinBox_ls;
122 float lineSegmentThreshold = (float)lineSegmentThreshold_box->value();
144 if (removeSmallRegions && removeSmallRegionThreshold > 0)
160 if (generateTextures)
174 vtkSmartPointer<vtkRenderer> renderer =
m_renderWindow->GetRenderers()->GetFirstRenderer();
175 bridge->addActors(renderer);