ccSectionExtractionSubDlg.cpp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. //##########################################################################
  2. //# #
  3. //# CLOUDCOMPARE #
  4. //# #
  5. //# This program is free software; you can redistribute it and/or modify #
  6. //# it under the terms of the GNU General Public License as published by #
  7. //# the Free Software Foundation; version 2 or later of the License. #
  8. //# #
  9. //# This program is distributed in the hope that it will be useful, #
  10. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  11. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  12. //# GNU General Public License for more details. #
  13. //# #
  14. //# COPYRIGHT: EDF R&D / TELECOM ParisTech (ENST-TSI) #
  15. //# #
  16. //##########################################################################
  17. #include "ccSectionExtractionSubDlg.h"
  18. //system
  19. #include <assert.h>
  20. ccSectionExtractionSubDlg::ccSectionExtractionSubDlg(QWidget* parent/*=nullptr*/)
  21. : QDialog(parent, Qt::Tool)
  22. , Ui::SectionExtractionSubDlg()
  23. {
  24. setupUi(this);
  25. }
  26. void ccSectionExtractionSubDlg::setActiveSectionCount(int count)
  27. {
  28. activeSectionsLabel->setText(QString::number(count));
  29. }
  30. void ccSectionExtractionSubDlg::setSectionThickness(double t)
  31. {
  32. thicknessDoubleSpinBox->setValue(t);
  33. }
  34. double ccSectionExtractionSubDlg::getSectionThickness() const
  35. {
  36. return thicknessDoubleSpinBox->value();
  37. }
  38. double ccSectionExtractionSubDlg::getMaxEdgeLength() const
  39. {
  40. return maxEdgeLengthDoubleSpinBox->value();
  41. }
  42. void ccSectionExtractionSubDlg::setMaxEdgeLength(double l)
  43. {
  44. maxEdgeLengthDoubleSpinBox->setValue(l);
  45. }
  46. bool ccSectionExtractionSubDlg::extractClouds() const
  47. {
  48. return extractCloudsGroupBox->isChecked();
  49. }
  50. void ccSectionExtractionSubDlg::doExtractClouds(bool state)
  51. {
  52. extractCloudsGroupBox->setChecked(state);
  53. }
  54. bool ccSectionExtractionSubDlg::extractEnvelopes() const
  55. {
  56. return extractEnvelopesGroupBox->isChecked();
  57. }
  58. void ccSectionExtractionSubDlg::doExtractEnvelopes(bool state, ccEnvelopeExtractor::EnvelopeType type)
  59. {
  60. extractEnvelopesGroupBox->setChecked(state);
  61. switch(type)
  62. {
  63. case ccEnvelopeExtractor::LOWER:
  64. envelopeTypeComboBox->setCurrentIndex(0);
  65. break;
  66. case ccEnvelopeExtractor::UPPER:
  67. envelopeTypeComboBox->setCurrentIndex(1);
  68. break;
  69. case ccEnvelopeExtractor::FULL:
  70. envelopeTypeComboBox->setCurrentIndex(2);
  71. break;
  72. default:
  73. assert(false);
  74. break;
  75. }
  76. }
  77. bool ccSectionExtractionSubDlg::splitEnvelopes() const
  78. {
  79. return splitEnvelopeCheckBox->isChecked();
  80. }
  81. void ccSectionExtractionSubDlg::doSplitEnvelopes(bool state)
  82. {
  83. splitEnvelopeCheckBox->setChecked(state);
  84. }
  85. bool ccSectionExtractionSubDlg::useMultiPass() const
  86. {
  87. return multiPassCheckBox->isChecked();
  88. }
  89. void ccSectionExtractionSubDlg::doUseMultiPass(bool state)
  90. {
  91. multiPassCheckBox->setChecked(state);
  92. }
  93. ccEnvelopeExtractor::EnvelopeType ccSectionExtractionSubDlg::getEnvelopeType() const
  94. {
  95. switch(envelopeTypeComboBox->currentIndex())
  96. {
  97. case 0:
  98. return ccEnvelopeExtractor::LOWER;
  99. case 1:
  100. return ccEnvelopeExtractor::UPPER;
  101. case 2:
  102. return ccEnvelopeExtractor::FULL;
  103. default:
  104. assert(false);
  105. break;
  106. }
  107. return ccEnvelopeExtractor::FULL;
  108. }
  109. bool ccSectionExtractionSubDlg::visualDebugMode() const
  110. {
  111. return debugModeCheckBox->isChecked();
  112. }