MEPP2 Project
DialogCompressionValence1.cpp
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published
6 // by the Free Software Foundation; either version 3 of the License,
7 // or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12 #include "ui_DialogCompressionValence1.h"
13 
14 #include <QFileDialog>
15 
19 {
20  ui->setupUi(this);
21  connect(
22  ui->pushButtonBrowse, SIGNAL(clicked()), this, SLOT(selectFilename()));
23 
24  // ---
25 
26  ui->verticalLayout->addWidget(helpButton, 0, Qt::AlignRight);
27  QObject::connect( helpButton, SIGNAL(clicked(bool)), this, SLOT(onHelpTriggered()) );
28 
29  link = "https://liris.cnrs.fr/mepp/doc/nightly/_filter_compression_valence.html";
30 }
34 void
36  const std::string &p3dFilePath,
37  bool with_adaptative_quantization,
38  int quantization_bits,
39  int max_vertices)
40 {
41  Qt::CheckState state = with_adaptative_quantization
42  ? Qt::CheckState::Checked
43  : Qt::CheckState::Unchecked;
44 
45  ui->p3dFilePath->setText(QString::fromStdString(p3dFilePath));
46  ui->with_adaptative_quantization->setCheckState(state);
47  ui->quantization_bits->setText(QString::number(quantization_bits));
48  ui->max_vertices->setText(QString::number(max_vertices));
49 }
51 void
53  std::string &p3dFilePath,
54  bool &with_adaptative_quantization,
55  int &quantization_bits,
56  int &max_vertices)
57 {
58  p3dFilePath = ui->p3dFilePath->text().toStdString();
59  with_adaptative_quantization = ui->with_adaptative_quantization->isChecked();
60  quantization_bits = ui->quantization_bits->text().toUInt();
61  max_vertices = ui->max_vertices->text().toUInt();
62 }
64 void
66 {
67  QString filename =
68  QFileDialog::getSaveFileName(this,
69  tr("Open File"),
70  ui->p3dFilePath->text(),
71  tr("P3D files (*.p3d);;All files (*)"),
72  0,
73  QFileDialog::DontUseNativeDialog);
74 
75  if(!filename.isEmpty())
76  ui->p3dFilePath->setText(filename);
77 }
FEVV::DialogCompressionValence1::ui
Ui::DialogCompressionValence1 * ui
Definition: DialogCompressionValence1.h:46
FEVV::DialogCompressionValence1::getCompressionValenceParams
void getCompressionValenceParams(std::string &p3dFilePath, bool &with_adaptative_quantization, int &quantization_bits, int &max_vertices)
Definition: DialogCompressionValence1.cpp:52
FEVV::DialogCompressionValence1
Definition: DialogCompressionValence1.h:23
FEVV::DialogCompressionValence1::~DialogCompressionValence1
~DialogCompressionValence1()
Definition: DialogCompressionValence1.cpp:32
tr
double tr(double &n)
Truncate a number to 1/1000 (only if BOOLEAN_OPERATIONS_DEBUG is enable)
Definition: boolops_definitions.hpp:127
FEVV::DialogCompressionValence1::setCompressionValenceParams
void setCompressionValenceParams(const std::string &p3dFilePath, bool with_adaptative_quantization, int quantization_bits, int max_verticesdouble)
Definition: DialogCompressionValence1.cpp:35
FEVV::DialogCompressionValence1::onHelpTriggered
void onHelpTriggered()
Definition: DialogCompressionValence1.h:43
FEVV::DialogCompressionValence1::selectFilename
void selectFilename()
Definition: DialogCompressionValence1.cpp:65
FEVV::BasePluginDialogQt::helpButton
QPushButton * helpButton
Definition: BasePluginDialogQt.h:61
FEVV::BasePluginDialogQt::link
QString link
Definition: BasePluginDialogQt.h:63
DialogCompressionValence1.h
Ui
Definition: DialogBooleanOperations1.h:17
FEVV::BasePluginDialogQt
This class is intended to provide a help message to plugins dialogs.
Definition: BasePluginDialogQt.h:29
FEVV::DialogCompressionValence1::DialogCompressionValence1
DialogCompressionValence1(QWidget *parent=0)
Definition: DialogCompressionValence1.cpp:17