denoiseParameterForm.cpp
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 #include <pcl/apps/point_cloud_editor/denoiseParameterForm.h>
00042 
00043 DenoiseParameterForm::DenoiseParameterForm () : ok_(false)
00044 {
00045   mean_K_line_ = new QLineEdit;
00046   std_dev_mul_thresh_line_ = new QLineEdit;
00047   button_box_ = new QDialogButtonBox;
00048   button_box_->addButton(tr("Cancel"),
00049                          QDialogButtonBox::RejectRole);
00050   button_box_->addButton(tr("OK"),
00051                          QDialogButtonBox::AcceptRole);
00052   connect(button_box_, SIGNAL(accepted()),
00053           this, SLOT(accept()));
00054   connect(button_box_, SIGNAL(rejected()),
00055           this, SLOT(reject()));
00056   layout_ = new QFormLayout;
00057   layout_->addRow(tr("&MeanK:"), mean_K_line_);
00058   layout_->addRow(tr("&Standard deviation threshold:"),
00059                  std_dev_mul_thresh_line_);
00060 
00061   main_layout_ = new QVBoxLayout;
00062   main_layout_->addLayout(layout_);
00063   main_layout_->addWidget(button_box_);
00064   setLayout(main_layout_);
00065   setWindowTitle(tr("Denoise Filter"));
00066 }
00067 
00068 DenoiseParameterForm::~DenoiseParameterForm ()
00069 {
00070   delete mean_K_line_;
00071   delete std_dev_mul_thresh_line_;
00072   delete button_box_;
00073   delete layout_;
00074   delete main_layout_;
00075 }
00076 
00077 void
00078 DenoiseParameterForm::accept ()
00079 {
00080   QString mean_str = mean_K_line_->text();
00081   bool ok;
00082   mean_k_ = mean_str.toFloat(&ok);
00083   // validates the input.
00084   if (!ok)
00085   {
00086     ok_ = false;
00087     return;
00088   }
00089   QString std_dev_str = std_dev_mul_thresh_line_->text();
00090   std_dev_thresh_ = std_dev_str.toFloat(&ok);
00091   if (!ok)
00092   {
00093     ok_ = false;
00094     return;
00095   }
00096   this->done(0);
00097   ok_ = true;
00098 }
00099 
00100 void
00101 DenoiseParameterForm::reject ()
00102 {
00103   ok_ = false;
00104   this->done(0);
00105 }
00106 


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:23:21