Mod: [skip ci] implementation classes don't inherit from UI classes any more
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <QCheckBox>
|
||||
# include <QLineEdit>
|
||||
# include <QMenu>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#include <Gui/TaskView/TaskView.h>
|
||||
#include <Gui/TaskView/TaskDialog.h>
|
||||
#include "ui_TaskOrthoViews.h"
|
||||
#include <Base/BoundBox.h>
|
||||
|
||||
#include <gp_Ax2.hxx>
|
||||
@@ -36,9 +35,9 @@
|
||||
|
||||
|
||||
|
||||
class Ui_TaskOrthoViews;
|
||||
|
||||
namespace DrawingGui {
|
||||
class Ui_TaskOrthoViews;
|
||||
|
||||
|
||||
class orthoview
|
||||
|
||||
@@ -26,16 +26,18 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "Gui/Application.h"
|
||||
#include "DlgSettingsFemCcxImp.h"
|
||||
#include "ui_DlgSettingsFemCcx.h"
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemCcxImp::DlgSettingsFemCcxImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemCcxImp)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DlgSettingsFemCcxImp::~DlgSettingsFemCcxImp()
|
||||
@@ -47,62 +49,62 @@ void DlgSettingsFemCcxImp::saveSettings()
|
||||
{
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Mod/Fem/Ccx");
|
||||
hGrp->SetInt("Solver", cmb_solver->currentIndex());
|
||||
hGrp->SetInt("AnalysisType", cb_analysis_type->currentIndex());
|
||||
hGrp->SetInt("Solver", ui->cmb_solver->currentIndex());
|
||||
hGrp->SetInt("AnalysisType", ui->cb_analysis_type->currentIndex());
|
||||
|
||||
sb_ccx_numcpu->onSave(); //Number of CPUs
|
||||
cmb_solver->onSave();
|
||||
cb_ccx_non_lin_geom->onSave();
|
||||
cb_use_iterations_param->onSave();
|
||||
ui->sb_ccx_numcpu->onSave(); //Number of CPUs
|
||||
ui->cmb_solver->onSave();
|
||||
ui->cb_ccx_non_lin_geom->onSave();
|
||||
ui->cb_use_iterations_param->onSave();
|
||||
|
||||
cb_static->onSave();
|
||||
sb_ccx_max_iterations->onSave(); //Max number of iterations
|
||||
dsb_ccx_initial_time_step->onSave(); //Initial time step
|
||||
dsb_ccx_analysis_time->onSave(); //Analysis time
|
||||
ui->cb_static->onSave();
|
||||
ui->sb_ccx_max_iterations->onSave(); //Max number of iterations
|
||||
ui->dsb_ccx_initial_time_step->onSave(); //Initial time step
|
||||
ui->dsb_ccx_analysis_time->onSave(); //Analysis time
|
||||
|
||||
cb_analysis_type->onSave();
|
||||
cb_BeamShellOutput->onSave(); //Beam shell output 3d or 2d
|
||||
sb_eigenmode_number->onSave();
|
||||
dsb_eigenmode_high_limit->onSave();
|
||||
dsb_eigenmode_low_limit->onSave();
|
||||
ui->cb_analysis_type->onSave();
|
||||
ui->cb_BeamShellOutput->onSave(); //Beam shell output 3d or 2d
|
||||
ui->sb_eigenmode_number->onSave();
|
||||
ui->dsb_eigenmode_high_limit->onSave();
|
||||
ui->dsb_eigenmode_low_limit->onSave();
|
||||
|
||||
cb_int_editor->onSave();
|
||||
fc_ext_editor->onSave();
|
||||
cb_ccx_binary_std->onSave();
|
||||
fc_ccx_binary_path->onSave();
|
||||
cb_split_inp_writer->onSave();
|
||||
ui->cb_int_editor->onSave();
|
||||
ui->fc_ext_editor->onSave();
|
||||
ui->cb_ccx_binary_std->onSave();
|
||||
ui->fc_ccx_binary_path->onSave();
|
||||
ui->cb_split_inp_writer->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsFemCcxImp::loadSettings()
|
||||
{
|
||||
sb_ccx_numcpu->onRestore(); //Number of CPUs
|
||||
cmb_solver->onRestore();
|
||||
cb_ccx_non_lin_geom->onRestore();
|
||||
cb_use_iterations_param->onRestore();
|
||||
ui->sb_ccx_numcpu->onRestore(); //Number of CPUs
|
||||
ui->cmb_solver->onRestore();
|
||||
ui->cb_ccx_non_lin_geom->onRestore();
|
||||
ui->cb_use_iterations_param->onRestore();
|
||||
|
||||
cb_static->onRestore();
|
||||
sb_ccx_max_iterations->onRestore(); //Max number of iterations
|
||||
dsb_ccx_initial_time_step->onRestore(); //Initial time step
|
||||
dsb_ccx_analysis_time->onRestore(); //Analysis time
|
||||
ui->cb_static->onRestore();
|
||||
ui->sb_ccx_max_iterations->onRestore(); //Max number of iterations
|
||||
ui->dsb_ccx_initial_time_step->onRestore(); //Initial time step
|
||||
ui->dsb_ccx_analysis_time->onRestore(); //Analysis time
|
||||
|
||||
cb_analysis_type->onRestore();
|
||||
cb_BeamShellOutput->onRestore(); //Beam shell output 3d or 2d
|
||||
sb_eigenmode_number->onRestore();
|
||||
dsb_eigenmode_high_limit->onRestore();
|
||||
dsb_eigenmode_low_limit->onRestore();
|
||||
ui->cb_analysis_type->onRestore();
|
||||
ui->cb_BeamShellOutput->onRestore(); //Beam shell output 3d or 2d
|
||||
ui->sb_eigenmode_number->onRestore();
|
||||
ui->dsb_eigenmode_high_limit->onRestore();
|
||||
ui->dsb_eigenmode_low_limit->onRestore();
|
||||
|
||||
cb_int_editor->onRestore();
|
||||
fc_ext_editor->onRestore();
|
||||
cb_ccx_binary_std->onRestore();
|
||||
fc_ccx_binary_path->onRestore();
|
||||
cb_split_inp_writer->onRestore();
|
||||
ui->cb_int_editor->onRestore();
|
||||
ui->fc_ext_editor->onRestore();
|
||||
ui->cb_ccx_binary_std->onRestore();
|
||||
ui->fc_ccx_binary_path->onRestore();
|
||||
ui->cb_split_inp_writer->onRestore();
|
||||
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Mod/Fem/Ccx");
|
||||
int index = hGrp->GetInt("Solver", 0);
|
||||
if (index > -1) cmb_solver->setCurrentIndex(index);
|
||||
if (index > -1) ui->cmb_solver->setCurrentIndex(index);
|
||||
index = hGrp->GetInt("AnalysisType", 0);
|
||||
if (index > -1) cb_analysis_type->setCurrentIndex(index);
|
||||
if (index > -1) ui->cb_analysis_type->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,9 +113,9 @@ void DlgSettingsFemCcxImp::loadSettings()
|
||||
void DlgSettingsFemCcxImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
int c_index = cb_analysis_type->currentIndex();
|
||||
retranslateUi(this);
|
||||
cb_analysis_type->setCurrentIndex(c_index);
|
||||
int c_index = ui->cb_analysis_type->currentIndex();
|
||||
ui->retranslateUi(this);
|
||||
ui->cb_analysis_type->setCurrentIndex(c_index);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
#ifndef FEMGUI_DLGSETTINGSFEMCCXIMP_H
|
||||
#define FEMGUI_DLGSETTINGSFEMCCXIMP_H
|
||||
|
||||
#include "ui_DlgSettingsFemCcx.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
namespace FemGui {
|
||||
|
||||
class DlgSettingsFemCcxImp : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsFemCcxImp
|
||||
class Ui_DlgSettingsFemCcxImp;
|
||||
class DlgSettingsFemCcxImp : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -44,6 +44,9 @@ protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgSettingsFemCcxImp> ui;
|
||||
};
|
||||
|
||||
} // namespace FemGui
|
||||
|
||||
@@ -25,16 +25,18 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "Gui/Application.h"
|
||||
#include "DlgSettingsFemElmerImp.h"
|
||||
#include "ui_DlgSettingsFemElmer.h"
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemElmerImp::DlgSettingsFemElmerImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemElmerImp)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DlgSettingsFemElmerImp::~DlgSettingsFemElmerImp()
|
||||
@@ -44,20 +46,20 @@ DlgSettingsFemElmerImp::~DlgSettingsFemElmerImp()
|
||||
|
||||
void DlgSettingsFemElmerImp::saveSettings()
|
||||
{
|
||||
cb_elmer_binary_std->onSave();
|
||||
fc_elmer_binary_path->onSave();
|
||||
ui->cb_elmer_binary_std->onSave();
|
||||
ui->fc_elmer_binary_path->onSave();
|
||||
|
||||
cb_grid_binary_std->onSave();
|
||||
fc_grid_binary_path->onSave();
|
||||
ui->cb_grid_binary_std->onSave();
|
||||
ui->fc_grid_binary_path->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsFemElmerImp::loadSettings()
|
||||
{
|
||||
cb_elmer_binary_std->onRestore();
|
||||
fc_elmer_binary_path->onRestore();
|
||||
ui->cb_elmer_binary_std->onRestore();
|
||||
ui->fc_elmer_binary_path->onRestore();
|
||||
|
||||
cb_grid_binary_std->onRestore();
|
||||
fc_grid_binary_path->onRestore();
|
||||
ui->cb_grid_binary_std->onRestore();
|
||||
ui->fc_grid_binary_path->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,6 +68,7 @@ void DlgSettingsFemElmerImp::loadSettings()
|
||||
void DlgSettingsFemElmerImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
#ifndef FEMGUI_DLGSETTINGSFEMELMERIMP_H
|
||||
#define FEMGUI_DLGSETTINGSFEMELMERIMP_H
|
||||
|
||||
#include "ui_DlgSettingsFemElmer.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
namespace FemGui {
|
||||
|
||||
class DlgSettingsFemElmerImp : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsFemElmerImp
|
||||
class Ui_DlgSettingsFemElmerImp;
|
||||
class DlgSettingsFemElmerImp : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -43,6 +43,9 @@ protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgSettingsFemElmerImp> ui;
|
||||
};
|
||||
|
||||
} // namespace FemGui
|
||||
|
||||
@@ -25,16 +25,18 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "Gui/Application.h"
|
||||
#include "DlgSettingsFemGeneralImp.h"
|
||||
#include "ui_DlgSettingsFemGeneral.h"
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemGeneralImp::DlgSettingsFemGeneralImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemGeneralImp)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DlgSettingsFemGeneralImp::~DlgSettingsFemGeneralImp()
|
||||
@@ -44,34 +46,32 @@ DlgSettingsFemGeneralImp::~DlgSettingsFemGeneralImp()
|
||||
|
||||
void DlgSettingsFemGeneralImp::saveSettings()
|
||||
{
|
||||
ui->cb_analysis_group_meshing->onSave();
|
||||
|
||||
cb_analysis_group_meshing->onSave();
|
||||
ui->cb_restore_result_dialog->onSave();
|
||||
ui->cb_keep_results_on_rerun->onSave();
|
||||
ui->cb_hide_constraint->onSave();
|
||||
|
||||
cb_restore_result_dialog->onSave();
|
||||
cb_keep_results_on_rerun->onSave();
|
||||
cb_hide_constraint->onSave();
|
||||
|
||||
cb_wd_temp->onSave();
|
||||
cb_wd_beside->onSave();
|
||||
cb_wd_custom->onSave();
|
||||
le_wd_custom->onSave();
|
||||
cb_overwrite_solver_working_directory->onSave();
|
||||
ui->cb_wd_temp->onSave();
|
||||
ui->cb_wd_beside->onSave();
|
||||
ui->cb_wd_custom->onSave();
|
||||
ui->le_wd_custom->onSave();
|
||||
ui->cb_overwrite_solver_working_directory->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsFemGeneralImp::loadSettings()
|
||||
{
|
||||
ui->cb_analysis_group_meshing->onRestore();
|
||||
|
||||
cb_analysis_group_meshing->onRestore();
|
||||
ui->cb_restore_result_dialog->onRestore();
|
||||
ui->cb_keep_results_on_rerun->onRestore();
|
||||
ui->cb_hide_constraint->onRestore();
|
||||
|
||||
cb_restore_result_dialog->onRestore();
|
||||
cb_keep_results_on_rerun->onRestore();
|
||||
cb_hide_constraint->onRestore();
|
||||
|
||||
cb_wd_temp->onRestore();
|
||||
cb_wd_beside->onRestore();
|
||||
cb_wd_custom->onRestore();
|
||||
le_wd_custom->onRestore();
|
||||
cb_overwrite_solver_working_directory->onRestore();
|
||||
ui->cb_wd_temp->onRestore();
|
||||
ui->cb_wd_beside->onRestore();
|
||||
ui->cb_wd_custom->onRestore();
|
||||
ui->le_wd_custom->onRestore();
|
||||
ui->cb_overwrite_solver_working_directory->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,6 +80,7 @@ void DlgSettingsFemGeneralImp::loadSettings()
|
||||
void DlgSettingsFemGeneralImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
#ifndef FEMGUI_DLGSETTINGSFEMGENERALIMP_H
|
||||
#define FEMGUI_DLGSETTINGSFEMGENERALIMP_H
|
||||
|
||||
#include "ui_DlgSettingsFemGeneral.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
namespace FemGui {
|
||||
|
||||
class DlgSettingsFemGeneralImp : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsFemGeneralImp
|
||||
class Ui_DlgSettingsFemGeneralImp;
|
||||
class DlgSettingsFemGeneralImp : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -43,6 +43,9 @@ protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgSettingsFemGeneralImp> ui;
|
||||
};
|
||||
|
||||
} // namespace FemGui
|
||||
|
||||
@@ -25,16 +25,18 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "Gui/Application.h"
|
||||
#include "DlgSettingsFemGmshImp.h"
|
||||
#include "ui_DlgSettingsFemGmsh.h"
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemGmshImp::DlgSettingsFemGmshImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemGmshImp)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DlgSettingsFemGmshImp::~DlgSettingsFemGmshImp()
|
||||
@@ -44,14 +46,14 @@ DlgSettingsFemGmshImp::~DlgSettingsFemGmshImp()
|
||||
|
||||
void DlgSettingsFemGmshImp::saveSettings()
|
||||
{
|
||||
cb_gmsh_binary_std->onSave();
|
||||
fc_gmsh_binary_path->onSave();
|
||||
ui->cb_gmsh_binary_std->onSave();
|
||||
ui->fc_gmsh_binary_path->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsFemGmshImp::loadSettings()
|
||||
{
|
||||
cb_gmsh_binary_std->onRestore();
|
||||
fc_gmsh_binary_path->onRestore();
|
||||
ui->cb_gmsh_binary_std->onRestore();
|
||||
ui->fc_gmsh_binary_path->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,6 +62,7 @@ void DlgSettingsFemGmshImp::loadSettings()
|
||||
void DlgSettingsFemGmshImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
#ifndef FEMGUI_DLGSETTINGSFEMGMSHIMP_H
|
||||
#define FEMGUI_DLGSETTINGSFEMGMSHIMP_H
|
||||
|
||||
#include "ui_DlgSettingsFemGmsh.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
namespace FemGui {
|
||||
|
||||
class DlgSettingsFemGmshImp : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsFemGmshImp
|
||||
class Ui_DlgSettingsFemGmshImp;
|
||||
class DlgSettingsFemGmshImp : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -43,6 +43,9 @@ protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgSettingsFemGmshImp> ui;
|
||||
};
|
||||
|
||||
} // namespace FemGui
|
||||
|
||||
@@ -25,16 +25,18 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "Gui/Application.h"
|
||||
#include "DlgSettingsFemMaterialImp.h"
|
||||
#include "ui_DlgSettingsFemMaterial.h"
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemMaterialImp::DlgSettingsFemMaterialImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemMaterialImp)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DlgSettingsFemMaterialImp::~DlgSettingsFemMaterialImp()
|
||||
@@ -44,22 +46,22 @@ DlgSettingsFemMaterialImp::~DlgSettingsFemMaterialImp()
|
||||
|
||||
void DlgSettingsFemMaterialImp::saveSettings()
|
||||
{
|
||||
cb_use_built_in_materials->onSave();
|
||||
cb_use_mat_from_config_dir->onSave();
|
||||
cb_use_mat_from_custom_dir->onSave();
|
||||
fc_custom_mat_dir->onSave();
|
||||
cb_delete_duplicates->onSave();
|
||||
cb_sort_by_resources->onSave();
|
||||
ui->cb_use_built_in_materials->onSave();
|
||||
ui->cb_use_mat_from_config_dir->onSave();
|
||||
ui->cb_use_mat_from_custom_dir->onSave();
|
||||
ui->fc_custom_mat_dir->onSave();
|
||||
ui->cb_delete_duplicates->onSave();
|
||||
ui->cb_sort_by_resources->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsFemMaterialImp::loadSettings()
|
||||
{
|
||||
cb_use_built_in_materials->onRestore();
|
||||
cb_use_mat_from_config_dir->onRestore();
|
||||
cb_use_mat_from_custom_dir->onRestore();
|
||||
fc_custom_mat_dir->onRestore();
|
||||
cb_delete_duplicates->onRestore();
|
||||
cb_sort_by_resources->onRestore();
|
||||
ui->cb_use_built_in_materials->onRestore();
|
||||
ui->cb_use_mat_from_config_dir->onRestore();
|
||||
ui->cb_use_mat_from_custom_dir->onRestore();
|
||||
ui->fc_custom_mat_dir->onRestore();
|
||||
ui->cb_delete_duplicates->onRestore();
|
||||
ui->cb_sort_by_resources->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,6 +70,7 @@ void DlgSettingsFemMaterialImp::loadSettings()
|
||||
void DlgSettingsFemMaterialImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -26,12 +26,13 @@
|
||||
#ifndef FEMGUI_DLGSETTINGSFEMMATERIALIMP_H
|
||||
#define FEMGUI_DLGSETTINGSFEMMATERIALIMP_H
|
||||
|
||||
#include "ui_DlgSettingsFemMaterial.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
namespace FemGui {
|
||||
class Ui_DlgSettingsFemMaterialImp;
|
||||
|
||||
class DlgSettingsFemMaterialImp : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsFemMaterialImp
|
||||
class DlgSettingsFemMaterialImp : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -43,6 +44,9 @@ protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgSettingsFemMaterialImp> ui;
|
||||
};
|
||||
|
||||
} // namespace FemGui
|
||||
|
||||
@@ -27,14 +27,16 @@
|
||||
|
||||
#include "Gui/Application.h"
|
||||
#include "DlgSettingsFemZ88Imp.h"
|
||||
#include "ui_DlgSettingsFemZ88.h"
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemZ88Imp::DlgSettingsFemZ88Imp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemZ88Imp)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DlgSettingsFemZ88Imp::~DlgSettingsFemZ88Imp()
|
||||
@@ -44,14 +46,14 @@ DlgSettingsFemZ88Imp::~DlgSettingsFemZ88Imp()
|
||||
|
||||
void DlgSettingsFemZ88Imp::saveSettings()
|
||||
{
|
||||
cb_z88_binary_std->onSave();
|
||||
fc_z88_binary_path->onSave();
|
||||
ui->cb_z88_binary_std->onSave();
|
||||
ui->fc_z88_binary_path->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsFemZ88Imp::loadSettings()
|
||||
{
|
||||
cb_z88_binary_std->onRestore();
|
||||
fc_z88_binary_path->onRestore();
|
||||
ui->cb_z88_binary_std->onRestore();
|
||||
ui->fc_z88_binary_path->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,6 +62,7 @@ void DlgSettingsFemZ88Imp::loadSettings()
|
||||
void DlgSettingsFemZ88Imp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -26,12 +26,13 @@
|
||||
#ifndef FEMGUI_DLGSETTINGSFEMZ88IMP_H
|
||||
#define FEMGUI_DLGSETTINGSFEMZ88IMP_H
|
||||
|
||||
#include "ui_DlgSettingsFemZ88.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
namespace FemGui {
|
||||
class Ui_DlgSettingsFemZ88Imp;
|
||||
|
||||
class DlgSettingsFemZ88Imp : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsFemZ88Imp
|
||||
class DlgSettingsFemZ88Imp : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -43,6 +44,9 @@ protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgSettingsFemZ88Imp> ui;
|
||||
};
|
||||
|
||||
} // namespace FemGui
|
||||
|
||||
@@ -26,11 +26,13 @@
|
||||
# ifdef FC_OS_WIN32
|
||||
# include <windows.h>
|
||||
# endif
|
||||
# include <QApplication>
|
||||
# include <qaction.h>
|
||||
# include <qdir.h>
|
||||
# include <qfileinfo.h>
|
||||
# include <qinputdialog.h>
|
||||
# include <qmessagebox.h>
|
||||
# include <QPointer>
|
||||
# include <qstringlist.h>
|
||||
//# include <gts.h>
|
||||
# include <map>
|
||||
@@ -81,7 +83,7 @@ using namespace Mesh;
|
||||
|
||||
// deprecated
|
||||
#if 0
|
||||
DEF_STD_CMD_A(CmdMeshTransform);
|
||||
DEF_STD_CMD_A(CmdMeshTransform)
|
||||
|
||||
CmdMeshTransform::CmdMeshTransform()
|
||||
:Command("Mesh_Transform")
|
||||
@@ -120,7 +122,7 @@ bool CmdMeshTransform::isActive(void)
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
DEF_STD_CMD_A(CmdMeshDemolding);
|
||||
DEF_STD_CMD_A(CmdMeshDemolding)
|
||||
|
||||
CmdMeshDemolding::CmdMeshDemolding()
|
||||
:Command("Mesh_Demolding")
|
||||
@@ -159,7 +161,7 @@ bool CmdMeshDemolding::isActive(void)
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
DEF_STD_CMD_A(CmdMeshToolMesh);
|
||||
DEF_STD_CMD_A(CmdMeshToolMesh)
|
||||
|
||||
CmdMeshToolMesh::CmdMeshToolMesh()
|
||||
:Command("Mesh_ToolMesh")
|
||||
@@ -1526,13 +1528,17 @@ CmdMeshBuildRegularSolid::CmdMeshBuildRegularSolid()
|
||||
|
||||
void CmdMeshBuildRegularSolid::activated(int)
|
||||
{
|
||||
MeshGui::SingleDlgRegularSolidImp::instance()->show();
|
||||
static QPointer<QDialog> dlg = 0;
|
||||
if (!dlg)
|
||||
dlg = new MeshGui::DlgRegularSolidImp(Gui::getMainWindow());
|
||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||
dlg->show();
|
||||
}
|
||||
|
||||
bool CmdMeshBuildRegularSolid::isActive(void)
|
||||
{
|
||||
// Check for the selected mesh feature (all Mesh types)
|
||||
return (!MeshGui::SingleDlgRegularSolidImp::hasInstance())&&hasActiveDocument();
|
||||
return hasActiveDocument();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <Gui/WaitCursor.h>
|
||||
|
||||
#include "DlgRegularSolidImp.h"
|
||||
#include "ui_DlgRegularSolid.h"
|
||||
|
||||
using namespace MeshGui;
|
||||
|
||||
@@ -48,52 +49,53 @@ using namespace MeshGui;
|
||||
|
||||
DlgRegularSolidImp::DlgRegularSolidImp(QWidget* parent, Qt::WindowFlags fl)
|
||||
: QDialog( parent, fl )
|
||||
, ui(new Ui_DlgRegularSolid)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
Gui::Command::doCommand(Gui::Command::Doc, "import Mesh,BuildRegularGeoms");
|
||||
|
||||
// set limits
|
||||
// Box
|
||||
boxLength->setMaximum(DBL_MAX);
|
||||
boxLength->setMinimum(0);
|
||||
boxWidth->setMaximum(DBL_MAX);
|
||||
boxWidth->setMinimum(0);
|
||||
boxHeight->setMaximum(DBL_MAX);
|
||||
boxHeight->setMinimum(0);
|
||||
ui->boxLength->setMaximum(DBL_MAX);
|
||||
ui->boxLength->setMinimum(0);
|
||||
ui->boxWidth->setMaximum(DBL_MAX);
|
||||
ui->boxWidth->setMinimum(0);
|
||||
ui->boxHeight->setMaximum(DBL_MAX);
|
||||
ui->boxHeight->setMinimum(0);
|
||||
// Cylinder
|
||||
cylinderRadius->setMaximum(DBL_MAX);
|
||||
cylinderRadius->setMinimum(0);
|
||||
cylinderLength->setMaximum(DBL_MAX);
|
||||
cylinderLength->setMinimum(0);
|
||||
cylinderEdgeLength->setMaximum(DBL_MAX);
|
||||
cylinderEdgeLength->setMinimum(0);
|
||||
cylinderCount->setMaximum(1000);
|
||||
ui->cylinderRadius->setMaximum(DBL_MAX);
|
||||
ui->cylinderRadius->setMinimum(0);
|
||||
ui->cylinderLength->setMaximum(DBL_MAX);
|
||||
ui->cylinderLength->setMinimum(0);
|
||||
ui->cylinderEdgeLength->setMaximum(DBL_MAX);
|
||||
ui->cylinderEdgeLength->setMinimum(0);
|
||||
ui->cylinderCount->setMaximum(1000);
|
||||
// Cone
|
||||
coneRadius1->setMaximum(DBL_MAX);
|
||||
coneRadius1->setMinimum(0);
|
||||
coneRadius2->setMaximum(DBL_MAX);
|
||||
coneRadius2->setMinimum(0);
|
||||
coneLength->setMaximum(DBL_MAX);
|
||||
coneLength->setMinimum(0);
|
||||
coneEdgeLength->setMaximum(DBL_MAX);
|
||||
coneEdgeLength->setMinimum(0);
|
||||
coneCount->setMaximum(1000);
|
||||
ui->coneRadius1->setMaximum(DBL_MAX);
|
||||
ui->coneRadius1->setMinimum(0);
|
||||
ui->coneRadius2->setMaximum(DBL_MAX);
|
||||
ui->coneRadius2->setMinimum(0);
|
||||
ui->coneLength->setMaximum(DBL_MAX);
|
||||
ui->coneLength->setMinimum(0);
|
||||
ui->coneEdgeLength->setMaximum(DBL_MAX);
|
||||
ui->coneEdgeLength->setMinimum(0);
|
||||
ui->coneCount->setMaximum(1000);
|
||||
// Sphere
|
||||
sphereRadius->setMaximum(DBL_MAX);
|
||||
sphereRadius->setMinimum(0);
|
||||
sphereCount->setMaximum(1000);
|
||||
ui->sphereRadius->setMaximum(DBL_MAX);
|
||||
ui->sphereRadius->setMinimum(0);
|
||||
ui->sphereCount->setMaximum(1000);
|
||||
// Ellipsoid
|
||||
ellipsoidRadius1->setMaximum(DBL_MAX);
|
||||
ellipsoidRadius1->setMinimum(0);
|
||||
ellipsoidRadius2->setMaximum(DBL_MAX);
|
||||
ellipsoidRadius2->setMinimum(0);
|
||||
ellipsoidCount->setMaximum(1000);
|
||||
ui->ellipsoidRadius1->setMaximum(DBL_MAX);
|
||||
ui->ellipsoidRadius1->setMinimum(0);
|
||||
ui->ellipsoidRadius2->setMaximum(DBL_MAX);
|
||||
ui->ellipsoidRadius2->setMinimum(0);
|
||||
ui->ellipsoidCount->setMaximum(1000);
|
||||
// Torus
|
||||
toroidRadius1->setMaximum(DBL_MAX);
|
||||
toroidRadius1->setMinimum(0);
|
||||
toroidRadius2->setMaximum(DBL_MAX);
|
||||
toroidRadius2->setMinimum(0);
|
||||
toroidCount->setMaximum(1000);
|
||||
ui->toroidRadius1->setMaximum(DBL_MAX);
|
||||
ui->toroidRadius1->setMinimum(0);
|
||||
ui->toroidRadius2->setMaximum(DBL_MAX);
|
||||
ui->toroidRadius2->setMinimum(0);
|
||||
ui->toroidCount->setMaximum(1000);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +109,7 @@ DlgRegularSolidImp::~DlgRegularSolidImp()
|
||||
void DlgRegularSolidImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
this->retranslateUi(this);
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
QDialog::changeEvent(e);
|
||||
}
|
||||
@@ -122,10 +124,10 @@ void DlgRegularSolidImp::on_createSolidButton_clicked()
|
||||
QString cmd; std::string name;
|
||||
App::Document* doc = App::GetApplication().getActiveDocument();
|
||||
if (!doc) {
|
||||
QMessageBox::warning(this, tr("Create %1").arg(comboBox1->currentText()), tr("No active document"));
|
||||
QMessageBox::warning(this, tr("Create %1").arg(ui->comboBox1->currentText()), tr("No active document"));
|
||||
return;
|
||||
}
|
||||
if (comboBox1->currentIndex() == 0) { // cube
|
||||
if (ui->comboBox1->currentIndex() == 0) { // cube
|
||||
name = doc->getUniqueObjectName("Cube");
|
||||
cmd = QString(QLatin1String(
|
||||
"App.ActiveDocument.addObject(\"Mesh::Cube\",\"%1\")\n"
|
||||
@@ -133,11 +135,11 @@ void DlgRegularSolidImp::on_createSolidButton_clicked()
|
||||
"App.ActiveDocument.%1.Width=%3\n"
|
||||
"App.ActiveDocument.%1.Height=%4\n"))
|
||||
.arg(QLatin1String(name.c_str()))
|
||||
.arg(boxLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(boxWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(boxHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
.arg(ui->boxLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->boxWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->boxHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
}
|
||||
else if (comboBox1->currentIndex() == 1) { // cylinder
|
||||
else if (ui->comboBox1->currentIndex() == 1) { // cylinder
|
||||
name = doc->getUniqueObjectName("Cylinder");
|
||||
cmd = QString(QLatin1String(
|
||||
"App.ActiveDocument.addObject(\"Mesh::Cylinder\",\"%1\")\n"
|
||||
@@ -147,13 +149,13 @@ void DlgRegularSolidImp::on_createSolidButton_clicked()
|
||||
"App.ActiveDocument.%1.Closed=%5\n"
|
||||
"App.ActiveDocument.%1.Sampling=%6\n"))
|
||||
.arg(QLatin1String(name.c_str()))
|
||||
.arg(cylinderRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(cylinderLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(cylinderEdgeLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(QLatin1String((cylinderClosed->isChecked()?"True":"False")))
|
||||
.arg(cylinderCount->value());
|
||||
.arg(ui->cylinderRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->cylinderLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->cylinderEdgeLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(QLatin1String((ui->cylinderClosed->isChecked()?"True":"False")))
|
||||
.arg(ui->cylinderCount->value());
|
||||
}
|
||||
else if (comboBox1->currentIndex() == 2) { // cone
|
||||
else if (ui->comboBox1->currentIndex() == 2) { // cone
|
||||
name = doc->getUniqueObjectName("Cone");
|
||||
cmd = QString(QLatin1String(
|
||||
"App.ActiveDocument.addObject(\"Mesh::Cone\",\"%1\")\n"
|
||||
@@ -164,24 +166,24 @@ void DlgRegularSolidImp::on_createSolidButton_clicked()
|
||||
"App.ActiveDocument.%1.Closed=%6\n"
|
||||
"App.ActiveDocument.%1.Sampling=%7\n"))
|
||||
.arg(QLatin1String(name.c_str()))
|
||||
.arg(coneRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(coneRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(coneLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(coneEdgeLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(QLatin1String((coneClosed->isChecked()?"True":"False")))
|
||||
.arg(coneCount->value());
|
||||
.arg(ui->coneRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->coneRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->coneLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->coneEdgeLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(QLatin1String((ui->coneClosed->isChecked()?"True":"False")))
|
||||
.arg(ui->coneCount->value());
|
||||
}
|
||||
else if (comboBox1->currentIndex() == 3) { // sphere
|
||||
else if (ui->comboBox1->currentIndex() == 3) { // sphere
|
||||
name = doc->getUniqueObjectName("Sphere");
|
||||
cmd = QString(QLatin1String(
|
||||
"App.ActiveDocument.addObject(\"Mesh::Sphere\",\"%1\")\n"
|
||||
"App.ActiveDocument.%1.Radius=%2\n"
|
||||
"App.ActiveDocument.%1.Sampling=%3\n"))
|
||||
.arg(QLatin1String(name.c_str()))
|
||||
.arg(sphereRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(sphereCount->value());
|
||||
.arg(ui->sphereRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->sphereCount->value());
|
||||
}
|
||||
else if (comboBox1->currentIndex() == 4) { // ellipsoid
|
||||
else if (ui->comboBox1->currentIndex() == 4) { // ellipsoid
|
||||
name = doc->getUniqueObjectName("Ellipsoid");
|
||||
cmd = QString(QLatin1String(
|
||||
"App.ActiveDocument.addObject(\"Mesh::Ellipsoid\",\"%1\")\n"
|
||||
@@ -189,11 +191,11 @@ void DlgRegularSolidImp::on_createSolidButton_clicked()
|
||||
"App.ActiveDocument.%1.Radius2=%3\n"
|
||||
"App.ActiveDocument.%1.Sampling=%4\n"))
|
||||
.arg(QLatin1String(name.c_str()))
|
||||
.arg(ellipsoidRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ellipsoidRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ellipsoidCount->value());
|
||||
.arg(ui->ellipsoidRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->ellipsoidRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->ellipsoidCount->value());
|
||||
}
|
||||
else if (comboBox1->currentIndex() == 5) { // toroid
|
||||
else if (ui->comboBox1->currentIndex() == 5) { // toroid
|
||||
name = doc->getUniqueObjectName("Torus");
|
||||
cmd = QString(QLatin1String(
|
||||
"App.ActiveDocument.addObject(\"Mesh::Torus\",\"%1\")\n"
|
||||
@@ -201,13 +203,13 @@ void DlgRegularSolidImp::on_createSolidButton_clicked()
|
||||
"App.ActiveDocument.%1.Radius2=%3\n"
|
||||
"App.ActiveDocument.%1.Sampling=%4\n"))
|
||||
.arg(QLatin1String(name.c_str()))
|
||||
.arg(toroidRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(toroidRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(toroidCount->value());
|
||||
.arg(ui->toroidRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->toroidRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->toroidCount->value());
|
||||
}
|
||||
|
||||
// Execute the Python block
|
||||
QString solid = tr("Create %1").arg(comboBox1->currentText());
|
||||
QString solid = tr("Create %1").arg(ui->comboBox1->currentText());
|
||||
Gui::Application::Instance->activeDocument()->openCommand(solid.toUtf8());
|
||||
Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toLatin1());
|
||||
Gui::Application::Instance->activeDocument()->commitCommand();
|
||||
@@ -215,55 +217,9 @@ void DlgRegularSolidImp::on_createSolidButton_clicked()
|
||||
Gui::Command::doCommand(Gui::Command::Gui, "Gui.SendMsgToActiveView(\"ViewFit\")");
|
||||
}
|
||||
catch (const Base::PyException& e) {
|
||||
QMessageBox::warning(this, tr("Create %1").arg(comboBox1->currentText()),
|
||||
QMessageBox::warning(this, tr("Create %1").arg(ui->comboBox1->currentText()),
|
||||
QString::fromLatin1(e.what()));
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------
|
||||
|
||||
SingleDlgRegularSolidImp* SingleDlgRegularSolidImp::_instance=0;
|
||||
|
||||
SingleDlgRegularSolidImp* SingleDlgRegularSolidImp::instance()
|
||||
{
|
||||
// not initialized?
|
||||
if(!_instance) {
|
||||
_instance = new SingleDlgRegularSolidImp( Gui::getMainWindow());
|
||||
_instance->setAttribute(Qt::WA_DeleteOnClose);
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
|
||||
void SingleDlgRegularSolidImp::destruct ()
|
||||
{
|
||||
if (_instance != 0) {
|
||||
SingleDlgRegularSolidImp *pTmp = _instance;
|
||||
_instance = 0;
|
||||
delete pTmp;
|
||||
}
|
||||
}
|
||||
|
||||
bool SingleDlgRegularSolidImp::hasInstance()
|
||||
{
|
||||
return _instance != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a SingleDlgRegularSolidImp which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*/
|
||||
SingleDlgRegularSolidImp::SingleDlgRegularSolidImp(QWidget* parent, Qt::WindowFlags fl)
|
||||
: DlgRegularSolidImp(parent, fl)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
SingleDlgRegularSolidImp::~SingleDlgRegularSolidImp()
|
||||
{
|
||||
_instance = 0;
|
||||
}
|
||||
|
||||
#include "moc_DlgRegularSolidImp.cpp"
|
||||
|
||||
@@ -24,10 +24,12 @@
|
||||
#ifndef MESHGUI_DLGREGULARSOLID_IMP_H
|
||||
#define MESHGUI_DLGREGULARSOLID_IMP_H
|
||||
|
||||
#include "ui_DlgRegularSolid.h"
|
||||
#include <QDialog>
|
||||
#include <memory>
|
||||
|
||||
namespace MeshGui {
|
||||
class DlgRegularSolidImp : public QDialog, public Ui_DlgRegularSolid
|
||||
class Ui_DlgRegularSolid;
|
||||
class DlgRegularSolidImp : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -40,25 +42,9 @@ public Q_SLOTS:
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
};
|
||||
|
||||
/**
|
||||
* The SingleDlgRegularSolidImp class creates a single instance.
|
||||
* \author Werner Mayer
|
||||
*/
|
||||
class SingleDlgRegularSolidImp : public DlgRegularSolidImp
|
||||
{
|
||||
protected:
|
||||
SingleDlgRegularSolidImp(QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
~SingleDlgRegularSolidImp();
|
||||
|
||||
public:
|
||||
static SingleDlgRegularSolidImp* instance();
|
||||
static void destruct();
|
||||
static bool hasInstance();
|
||||
|
||||
private:
|
||||
static SingleDlgRegularSolidImp* _instance;
|
||||
std::unique_ptr<Ui_DlgRegularSolid> ui;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "DlgSettingsMeshView.h"
|
||||
#include "ui_DlgSettingsMeshView.h"
|
||||
#include <Gui/PrefWidgets.h>
|
||||
#include <Gui/Window.h>
|
||||
|
||||
using namespace MeshGui;
|
||||
|
||||
@@ -33,10 +35,11 @@ using namespace MeshGui;
|
||||
*/
|
||||
DlgSettingsMeshView::DlgSettingsMeshView(QWidget* parent)
|
||||
: PreferencePage(parent)
|
||||
, ui(new Ui_DlgSettingsMeshView)
|
||||
{
|
||||
this->setupUi(this);
|
||||
labelBackfaceColor->hide();
|
||||
buttonBackfaceColor->hide();
|
||||
ui->setupUi(this);
|
||||
ui->labelBackfaceColor->hide();
|
||||
ui->buttonBackfaceColor->hide();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,15 +52,15 @@ DlgSettingsMeshView::~DlgSettingsMeshView()
|
||||
|
||||
void DlgSettingsMeshView::saveSettings()
|
||||
{
|
||||
checkboxRendering->onSave();
|
||||
checkboxBoundbox->onSave();
|
||||
buttonMeshColor->onSave();
|
||||
buttonLineColor->onSave();
|
||||
buttonBackfaceColor->onSave();
|
||||
spinMeshTransparency->onSave();
|
||||
spinLineTransparency->onSave();
|
||||
checkboxNormal->onSave();
|
||||
spinboxAngle->onSave();
|
||||
ui->checkboxRendering->onSave();
|
||||
ui->checkboxBoundbox->onSave();
|
||||
ui->buttonMeshColor->onSave();
|
||||
ui->buttonLineColor->onSave();
|
||||
ui->buttonBackfaceColor->onSave();
|
||||
ui->spinMeshTransparency->onSave();
|
||||
ui->spinLineTransparency->onSave();
|
||||
ui->checkboxNormal->onSave();
|
||||
ui->spinboxAngle->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsMeshView::loadSettings()
|
||||
@@ -66,16 +69,16 @@ void DlgSettingsMeshView::loadSettings()
|
||||
hGrp = hGrp->GetGroup("View");
|
||||
if (!hGrp->GetBool("EnablePreselection",true) &&
|
||||
!hGrp->GetBool("EnableSelection",true))
|
||||
checkboxBoundbox->setDisabled(true);
|
||||
checkboxRendering->onRestore();
|
||||
checkboxBoundbox->onRestore();
|
||||
buttonMeshColor->onRestore();
|
||||
buttonLineColor->onRestore();
|
||||
buttonBackfaceColor->onRestore();
|
||||
spinMeshTransparency->onRestore();
|
||||
spinLineTransparency->onRestore();
|
||||
checkboxNormal->onRestore();
|
||||
spinboxAngle->onRestore();
|
||||
ui->checkboxBoundbox->setDisabled(true);
|
||||
ui->checkboxRendering->onRestore();
|
||||
ui->checkboxBoundbox->onRestore();
|
||||
ui->buttonMeshColor->onRestore();
|
||||
ui->buttonLineColor->onRestore();
|
||||
ui->buttonBackfaceColor->onRestore();
|
||||
ui->spinMeshTransparency->onRestore();
|
||||
ui->spinLineTransparency->onRestore();
|
||||
ui->checkboxNormal->onRestore();
|
||||
ui->spinboxAngle->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +87,7 @@ void DlgSettingsMeshView::loadSettings()
|
||||
void DlgSettingsMeshView::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
retranslateUi(this);
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -24,28 +24,31 @@
|
||||
#ifndef MESHGUI_DLGSETTINGSMESHVIEW_H
|
||||
#define MESHGUI_DLGSETTINGSMESHVIEW_H
|
||||
|
||||
#include "ui_DlgSettingsMeshView.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
namespace MeshGui {
|
||||
|
||||
class Ui_DlgSettingsMeshView;
|
||||
/**
|
||||
* The DlgSettingsMeshView class implements a preference page to change settings
|
||||
* for display of meshes.
|
||||
* @author Werner Mayer
|
||||
*/
|
||||
class DlgSettingsMeshView : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsMeshView
|
||||
class DlgSettingsMeshView : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgSettingsMeshView(QWidget* parent = 0);
|
||||
DlgSettingsMeshView(QWidget* parent = nullptr);
|
||||
~DlgSettingsMeshView();
|
||||
|
||||
protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgSettingsMeshView> ui;
|
||||
};
|
||||
|
||||
} // namespace Gui
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
|
||||
#include "../App/PartFeature.h"
|
||||
#include <Mod/Part/App/Part2DObject.h>
|
||||
#include "DlgPartImportStepImp.h"
|
||||
#include "DlgBooleanOperation.h"
|
||||
#include "DlgExtrusion.h"
|
||||
#include "DlgRevolution.h"
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <Gui/MainWindow.h>
|
||||
|
||||
#include "DlgPartImportIgesImp.h"
|
||||
#include "ui_DlgPartImportIges.h"
|
||||
|
||||
using namespace PartGui;
|
||||
|
||||
@@ -44,8 +45,9 @@ using namespace PartGui;
|
||||
*/
|
||||
DlgPartImportIgesImp::DlgPartImportIgesImp(QWidget* parent, Qt::WindowFlags fl)
|
||||
: QDialog(parent, fl)
|
||||
, ui(new Ui_DlgPartImportIges)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -71,7 +73,7 @@ void DlgPartImportIgesImp::onChooseFileName()
|
||||
.arg(tr("IGES"),
|
||||
tr("All Files"));
|
||||
if (!fn.isEmpty()) {
|
||||
FileName->setText(fn);
|
||||
ui->FileName->setText(fn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
#ifndef DlgPartImportIgesImp_H
|
||||
#define DlgPartImportIgesImp_H
|
||||
|
||||
#include "ui_DlgPartImportIges.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <memory>
|
||||
|
||||
namespace PartGui {
|
||||
|
||||
class DlgPartImportIgesImp : public QDialog, public Ui_DlgPartImportIges
|
||||
class Ui_DlgPartImportIges;
|
||||
class DlgPartImportIgesImp : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -40,6 +40,8 @@ public Q_SLOTS:
|
||||
virtual void OnApply();
|
||||
virtual void onChooseFileName();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgPartImportIges> ui;
|
||||
};
|
||||
|
||||
} // namespace PartGui
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <Gui/FileDialog.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include "DlgPartImportStepImp.h"
|
||||
#include "ui_DlgPartImportStep.h"
|
||||
|
||||
using namespace PartGui;
|
||||
|
||||
@@ -43,8 +44,9 @@ using namespace PartGui;
|
||||
*/
|
||||
DlgPartImportStepImp::DlgPartImportStepImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog( parent, fl )
|
||||
, ui(new Ui_DlgPartImportStep)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -70,7 +72,7 @@ void DlgPartImportStepImp::onChooseFileName()
|
||||
.arg(tr("STEP"),
|
||||
tr("All Files"));
|
||||
if (!fn.isEmpty()) {
|
||||
FileName->setText(fn);
|
||||
ui->FileName->setText(fn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,12 +23,13 @@
|
||||
#ifndef DlgPartImportStepImp_H
|
||||
#define DlgPartImportStepImp_H
|
||||
|
||||
#include "ui_DlgPartImportStep.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <memory>
|
||||
|
||||
namespace PartGui {
|
||||
class Ui_DlgPartImportStep;
|
||||
|
||||
class DlgPartImportStepImp : public QDialog, public Ui_DlgPartImportStep
|
||||
class DlgPartImportStepImp : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -40,6 +41,8 @@ public Q_SLOTS:
|
||||
virtual void OnApply();
|
||||
virtual void onChooseFileName();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgPartImportStep> ui;
|
||||
};
|
||||
|
||||
} // namespace PartGui
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include "DlgSettingsObjectColor.h"
|
||||
#include "ui_DlgSettingsObjectColor.h"
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
using namespace PartGui;
|
||||
@@ -39,9 +40,10 @@ using namespace PartGui;
|
||||
*/
|
||||
DlgSettingsObjectColor::DlgSettingsObjectColor(QWidget* parent)
|
||||
: PreferencePage(parent)
|
||||
, ui(new Ui_DlgSettingsObjectColor)
|
||||
{
|
||||
this->setupUi(this);
|
||||
this->DefaultShapeColor->setDisabled(this->checkRandomColor->isChecked());
|
||||
ui->setupUi(this);
|
||||
ui->DefaultShapeColor->setDisabled(ui->checkRandomColor->isChecked());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,29 +57,29 @@ DlgSettingsObjectColor::~DlgSettingsObjectColor()
|
||||
void DlgSettingsObjectColor::saveSettings()
|
||||
{
|
||||
// Part
|
||||
DefaultShapeColor->onSave();
|
||||
checkRandomColor->onSave();
|
||||
DefaultShapeLineColor->onSave();
|
||||
DefaultShapeLineWidth->onSave();
|
||||
DefaultShapeVertexColor->onSave();
|
||||
DefaultShapeVertexWidth->onSave();
|
||||
BoundingBoxColor->onSave();
|
||||
ui->DefaultShapeColor->onSave();
|
||||
ui->checkRandomColor->onSave();
|
||||
ui->DefaultShapeLineColor->onSave();
|
||||
ui->DefaultShapeLineWidth->onSave();
|
||||
ui->DefaultShapeVertexColor->onSave();
|
||||
ui->DefaultShapeVertexWidth->onSave();
|
||||
ui->BoundingBoxColor->onSave();
|
||||
// Annotations
|
||||
AnnotationTextColor->onSave();
|
||||
ui->AnnotationTextColor->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsObjectColor::loadSettings()
|
||||
{
|
||||
// Part
|
||||
DefaultShapeColor->onRestore();
|
||||
checkRandomColor->onRestore();
|
||||
DefaultShapeLineColor->onRestore();
|
||||
DefaultShapeLineWidth->onRestore();
|
||||
DefaultShapeVertexColor->onRestore();
|
||||
DefaultShapeVertexWidth->onRestore();
|
||||
BoundingBoxColor->onRestore();
|
||||
ui->DefaultShapeColor->onRestore();
|
||||
ui->checkRandomColor->onRestore();
|
||||
ui->DefaultShapeLineColor->onRestore();
|
||||
ui->DefaultShapeLineWidth->onRestore();
|
||||
ui->DefaultShapeVertexColor->onRestore();
|
||||
ui->DefaultShapeVertexWidth->onRestore();
|
||||
ui->BoundingBoxColor->onRestore();
|
||||
// Annotations
|
||||
AnnotationTextColor->onRestore();
|
||||
ui->AnnotationTextColor->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +88,7 @@ void DlgSettingsObjectColor::loadSettings()
|
||||
void DlgSettingsObjectColor::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
retranslateUi(this);
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -24,17 +24,18 @@
|
||||
#ifndef PARTGUI_DIALOG_DLGSETTINGSOBJECTCOLOR_H
|
||||
#define PARTGUI_DIALOG_DLGSETTINGSOBJECTCOLOR_H
|
||||
|
||||
#include "ui_DlgSettingsObjectColor.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
namespace PartGui {
|
||||
class Ui_DlgSettingsObjectColor;
|
||||
|
||||
/**
|
||||
* The DlgSettingsObjectColor class implements a preference page to change color settings
|
||||
* for data objects.
|
||||
* @author Werner Mayer
|
||||
*/
|
||||
class DlgSettingsObjectColor : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsObjectColor
|
||||
class DlgSettingsObjectColor : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -47,6 +48,9 @@ public:
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgSettingsObjectColor> ui;
|
||||
};
|
||||
|
||||
} // namespace Gui
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#endif
|
||||
|
||||
#include "TaskPrimitiveParameters.h"
|
||||
#include "ui_TaskPrimitiveParameters.h"
|
||||
#include "ViewProviderDatumCS.h"
|
||||
#include <Mod/PartDesign/App/FeaturePrimitive.h>
|
||||
#include <Mod/PartDesign/App/DatumCS.h>
|
||||
@@ -53,58 +54,60 @@
|
||||
using namespace PartDesignGui;
|
||||
|
||||
TaskBoxPrimitives::TaskBoxPrimitives(ViewProviderPrimitive* vp, QWidget* parent)
|
||||
: TaskBox(QPixmap(),tr("Primitive parameters"), true, parent), vp(vp)
|
||||
: TaskBox(QPixmap(),tr("Primitive parameters"), true, parent)
|
||||
, ui(new Ui_DlgPrimitives)
|
||||
, vp(vp)
|
||||
{
|
||||
proxy = new QWidget(this);
|
||||
ui.setupUi(proxy);
|
||||
ui->setupUi(proxy);
|
||||
|
||||
// box
|
||||
ui.boxLength->setMaximum(INT_MAX);
|
||||
ui.boxWidth->setMaximum(INT_MAX);
|
||||
ui.boxHeight->setMaximum(INT_MAX);
|
||||
ui->boxLength->setMaximum(INT_MAX);
|
||||
ui->boxWidth->setMaximum(INT_MAX);
|
||||
ui->boxHeight->setMaximum(INT_MAX);
|
||||
|
||||
// cylinder
|
||||
ui.cylinderRadius->setMaximum(INT_MAX);
|
||||
ui.cylinderHeight->setMaximum(INT_MAX);
|
||||
ui->cylinderRadius->setMaximum(INT_MAX);
|
||||
ui->cylinderHeight->setMaximum(INT_MAX);
|
||||
|
||||
// cone
|
||||
ui.coneRadius1->setMaximum(INT_MAX);
|
||||
ui.coneRadius2->setMaximum(INT_MAX);
|
||||
ui.coneHeight->setMaximum(INT_MAX);
|
||||
ui->coneRadius1->setMaximum(INT_MAX);
|
||||
ui->coneRadius2->setMaximum(INT_MAX);
|
||||
ui->coneHeight->setMaximum(INT_MAX);
|
||||
|
||||
// sphere
|
||||
ui.sphereRadius->setMaximum(INT_MAX);
|
||||
ui->sphereRadius->setMaximum(INT_MAX);
|
||||
|
||||
// ellipsoid
|
||||
ui.ellipsoidRadius1->setMaximum(INT_MAX);
|
||||
ui.ellipsoidRadius2->setMaximum(INT_MAX);
|
||||
ui.ellipsoidRadius3->setMaximum(INT_MAX);
|
||||
ui->ellipsoidRadius1->setMaximum(INT_MAX);
|
||||
ui->ellipsoidRadius2->setMaximum(INT_MAX);
|
||||
ui->ellipsoidRadius3->setMaximum(INT_MAX);
|
||||
|
||||
// torus
|
||||
ui.torusRadius1->setMaximum(INT_MAX);
|
||||
ui.torusRadius2->setMaximum(INT_MAX);
|
||||
ui->torusRadius1->setMaximum(INT_MAX);
|
||||
ui->torusRadius2->setMaximum(INT_MAX);
|
||||
|
||||
// wedge
|
||||
ui.wedgeXmin->setMinimum(INT_MIN);
|
||||
ui.wedgeXmin->setMaximum(INT_MAX);
|
||||
ui.wedgeYmin->setMinimum(INT_MIN);
|
||||
ui.wedgeYmin->setMaximum(INT_MAX);
|
||||
ui.wedgeZmin->setMinimum(INT_MIN);
|
||||
ui.wedgeZmin->setMaximum(INT_MAX);
|
||||
ui.wedgeX2min->setMinimum(INT_MIN);
|
||||
ui.wedgeX2min->setMaximum(INT_MAX);
|
||||
ui.wedgeZ2min->setMinimum(INT_MIN);
|
||||
ui.wedgeZ2min->setMaximum(INT_MAX);
|
||||
ui.wedgeXmax->setMinimum(INT_MIN);
|
||||
ui.wedgeXmax->setMaximum(INT_MAX);
|
||||
ui.wedgeYmax->setMinimum(INT_MIN);
|
||||
ui.wedgeYmax->setMaximum(INT_MAX);
|
||||
ui.wedgeZmax->setMinimum(INT_MIN);
|
||||
ui.wedgeZmax->setMaximum(INT_MAX);
|
||||
ui.wedgeX2max->setMinimum(INT_MIN);
|
||||
ui.wedgeX2max->setMaximum(INT_MAX);
|
||||
ui.wedgeZ2max->setMinimum(INT_MIN);
|
||||
ui.wedgeZ2max->setMaximum(INT_MAX);
|
||||
ui->wedgeXmin->setMinimum(INT_MIN);
|
||||
ui->wedgeXmin->setMaximum(INT_MAX);
|
||||
ui->wedgeYmin->setMinimum(INT_MIN);
|
||||
ui->wedgeYmin->setMaximum(INT_MAX);
|
||||
ui->wedgeZmin->setMinimum(INT_MIN);
|
||||
ui->wedgeZmin->setMaximum(INT_MAX);
|
||||
ui->wedgeX2min->setMinimum(INT_MIN);
|
||||
ui->wedgeX2min->setMaximum(INT_MAX);
|
||||
ui->wedgeZ2min->setMinimum(INT_MIN);
|
||||
ui->wedgeZ2min->setMaximum(INT_MAX);
|
||||
ui->wedgeXmax->setMinimum(INT_MIN);
|
||||
ui->wedgeXmax->setMaximum(INT_MAX);
|
||||
ui->wedgeYmax->setMinimum(INT_MIN);
|
||||
ui->wedgeYmax->setMaximum(INT_MAX);
|
||||
ui->wedgeZmax->setMinimum(INT_MIN);
|
||||
ui->wedgeZmax->setMaximum(INT_MAX);
|
||||
ui->wedgeX2max->setMinimum(INT_MIN);
|
||||
ui->wedgeX2max->setMaximum(INT_MAX);
|
||||
ui->wedgeZ2max->setMinimum(INT_MIN);
|
||||
ui->wedgeZ2max->setMaximum(INT_MAX);
|
||||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
@@ -113,74 +116,74 @@ TaskBoxPrimitives::TaskBoxPrimitives(ViewProviderPrimitive* vp, QWidget* parent)
|
||||
|
||||
case PartDesign::FeaturePrimitive::Box:
|
||||
index = 1;
|
||||
ui.boxLength->setValue(static_cast<PartDesign::Box*>(vp->getObject())->Length.getValue());
|
||||
ui.boxHeight->setValue(static_cast<PartDesign::Box*>(vp->getObject())->Height.getValue());
|
||||
ui.boxWidth->setValue(static_cast<PartDesign::Box*>(vp->getObject())->Width.getValue());
|
||||
ui->boxLength->setValue(static_cast<PartDesign::Box*>(vp->getObject())->Length.getValue());
|
||||
ui->boxHeight->setValue(static_cast<PartDesign::Box*>(vp->getObject())->Height.getValue());
|
||||
ui->boxWidth->setValue(static_cast<PartDesign::Box*>(vp->getObject())->Width.getValue());
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Cylinder:
|
||||
index = 2;
|
||||
ui.cylinderAngle->setValue(static_cast<PartDesign::Cylinder*>(vp->getObject())->Angle.getValue());
|
||||
ui.cylinderHeight->setValue(static_cast<PartDesign::Cylinder*>(vp->getObject())->Height.getValue());
|
||||
ui.cylinderRadius->setValue(static_cast<PartDesign::Cylinder*>(vp->getObject())->Radius.getValue());
|
||||
ui->cylinderAngle->setValue(static_cast<PartDesign::Cylinder*>(vp->getObject())->Angle.getValue());
|
||||
ui->cylinderHeight->setValue(static_cast<PartDesign::Cylinder*>(vp->getObject())->Height.getValue());
|
||||
ui->cylinderRadius->setValue(static_cast<PartDesign::Cylinder*>(vp->getObject())->Radius.getValue());
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Sphere:
|
||||
index = 4;
|
||||
ui.sphereAngle1->setValue(static_cast<PartDesign::Sphere*>(vp->getObject())->Angle1.getValue());
|
||||
ui.sphereAngle2->setValue(static_cast<PartDesign::Sphere*>(vp->getObject())->Angle2.getValue());
|
||||
ui.sphereAngle3->setValue(static_cast<PartDesign::Sphere*>(vp->getObject())->Angle3.getValue());
|
||||
ui.sphereRadius->setValue(static_cast<PartDesign::Sphere*>(vp->getObject())->Radius.getValue());
|
||||
ui->sphereAngle1->setValue(static_cast<PartDesign::Sphere*>(vp->getObject())->Angle1.getValue());
|
||||
ui->sphereAngle2->setValue(static_cast<PartDesign::Sphere*>(vp->getObject())->Angle2.getValue());
|
||||
ui->sphereAngle3->setValue(static_cast<PartDesign::Sphere*>(vp->getObject())->Angle3.getValue());
|
||||
ui->sphereRadius->setValue(static_cast<PartDesign::Sphere*>(vp->getObject())->Radius.getValue());
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Cone:
|
||||
index = 3;
|
||||
ui.coneAngle->setValue(static_cast<PartDesign::Cone*>(vp->getObject())->Angle.getValue());
|
||||
ui.coneHeight->setValue(static_cast<PartDesign::Cone*>(vp->getObject())->Height.getValue());
|
||||
ui.coneRadius1->setValue(static_cast<PartDesign::Cone*>(vp->getObject())->Radius1.getValue());
|
||||
ui.coneRadius2->setValue(static_cast<PartDesign::Cone*>(vp->getObject())->Radius2.getValue());
|
||||
ui->coneAngle->setValue(static_cast<PartDesign::Cone*>(vp->getObject())->Angle.getValue());
|
||||
ui->coneHeight->setValue(static_cast<PartDesign::Cone*>(vp->getObject())->Height.getValue());
|
||||
ui->coneRadius1->setValue(static_cast<PartDesign::Cone*>(vp->getObject())->Radius1.getValue());
|
||||
ui->coneRadius2->setValue(static_cast<PartDesign::Cone*>(vp->getObject())->Radius2.getValue());
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Ellipsoid:
|
||||
index = 5;
|
||||
ui.ellipsoidAngle1->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Angle1.getValue());
|
||||
ui.ellipsoidAngle2->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Angle2.getValue());
|
||||
ui.ellipsoidAngle3->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Angle3.getValue());
|
||||
ui.ellipsoidRadius1->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Radius1.getValue());
|
||||
ui.ellipsoidRadius2->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Radius2.getValue());
|
||||
ui.ellipsoidRadius3->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Radius3.getValue());
|
||||
ui->ellipsoidAngle1->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Angle1.getValue());
|
||||
ui->ellipsoidAngle2->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Angle2.getValue());
|
||||
ui->ellipsoidAngle3->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Angle3.getValue());
|
||||
ui->ellipsoidRadius1->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Radius1.getValue());
|
||||
ui->ellipsoidRadius2->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Radius2.getValue());
|
||||
ui->ellipsoidRadius3->setValue(static_cast<PartDesign::Ellipsoid*>(vp->getObject())->Radius3.getValue());
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Torus:
|
||||
index = 6;
|
||||
ui.torusAngle1->setValue(static_cast<PartDesign::Torus*>(vp->getObject())->Angle1.getValue());
|
||||
ui.torusAngle2->setValue(static_cast<PartDesign::Torus*>(vp->getObject())->Angle2.getValue());
|
||||
ui.torusAngle3->setValue(static_cast<PartDesign::Torus*>(vp->getObject())->Angle3.getValue());
|
||||
ui.torusRadius1->setValue(static_cast<PartDesign::Torus*>(vp->getObject())->Radius1.getValue());
|
||||
ui.torusRadius2->setValue(static_cast<PartDesign::Torus*>(vp->getObject())->Radius2.getValue());
|
||||
ui->torusAngle1->setValue(static_cast<PartDesign::Torus*>(vp->getObject())->Angle1.getValue());
|
||||
ui->torusAngle2->setValue(static_cast<PartDesign::Torus*>(vp->getObject())->Angle2.getValue());
|
||||
ui->torusAngle3->setValue(static_cast<PartDesign::Torus*>(vp->getObject())->Angle3.getValue());
|
||||
ui->torusRadius1->setValue(static_cast<PartDesign::Torus*>(vp->getObject())->Radius1.getValue());
|
||||
ui->torusRadius2->setValue(static_cast<PartDesign::Torus*>(vp->getObject())->Radius2.getValue());
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Prism:
|
||||
index = 7;
|
||||
ui.prismPolygon->setValue(static_cast<PartDesign::Prism*>(vp->getObject())->Polygon.getValue());
|
||||
ui.prismCircumradius->setValue(static_cast<PartDesign::Prism*>(vp->getObject())->Circumradius.getValue());
|
||||
ui.prismHeight->setValue(static_cast<PartDesign::Prism*>(vp->getObject())->Height.getValue());
|
||||
ui->prismPolygon->setValue(static_cast<PartDesign::Prism*>(vp->getObject())->Polygon.getValue());
|
||||
ui->prismCircumradius->setValue(static_cast<PartDesign::Prism*>(vp->getObject())->Circumradius.getValue());
|
||||
ui->prismHeight->setValue(static_cast<PartDesign::Prism*>(vp->getObject())->Height.getValue());
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Wedge:
|
||||
index = 8;
|
||||
ui.wedgeXmax->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Xmax.getValue());
|
||||
ui.wedgeXmin->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Xmin.getValue());
|
||||
ui.wedgeX2max->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->X2max.getValue());
|
||||
ui.wedgeX2min->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->X2min.getValue());
|
||||
ui.wedgeYmax->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Ymax.getValue());
|
||||
ui.wedgeYmin->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Ymin.getValue());
|
||||
ui.wedgeZmax->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Zmax.getValue());
|
||||
ui.wedgeZmin->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Zmin.getValue());
|
||||
ui.wedgeZ2max->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Z2max.getValue());
|
||||
ui.wedgeZ2min->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Z2min.getValue());
|
||||
ui->wedgeXmax->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Xmax.getValue());
|
||||
ui->wedgeXmin->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Xmin.getValue());
|
||||
ui->wedgeX2max->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->X2max.getValue());
|
||||
ui->wedgeX2min->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->X2min.getValue());
|
||||
ui->wedgeYmax->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Ymax.getValue());
|
||||
ui->wedgeYmin->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Ymin.getValue());
|
||||
ui->wedgeZmax->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Zmax.getValue());
|
||||
ui->wedgeZmin->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Zmin.getValue());
|
||||
ui->wedgeZ2max->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Z2max.getValue());
|
||||
ui->wedgeZ2min->setValue(static_cast<PartDesign::Wedge*>(vp->getObject())->Z2min.getValue());
|
||||
break;
|
||||
}
|
||||
|
||||
ui.widgetStack->setCurrentIndex(index);
|
||||
ui.widgetStack->setMinimumSize(ui.widgetStack->widget(index)->minimumSize());
|
||||
for(int i=0; i<ui.widgetStack->count(); ++i) {
|
||||
ui->widgetStack->setCurrentIndex(index);
|
||||
ui->widgetStack->setMinimumSize(ui->widgetStack->widget(index)->minimumSize());
|
||||
for(int i=0; i<ui->widgetStack->count(); ++i) {
|
||||
|
||||
if(i != index)
|
||||
ui.widgetStack->widget(i)->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored));
|
||||
ui->widgetStack->widget(i)->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored));
|
||||
}
|
||||
|
||||
Gui::Document* doc = vp->getDocument();
|
||||
@@ -200,58 +203,58 @@ TaskBoxPrimitives::TaskBoxPrimitives(ViewProviderPrimitive* vp, QWidget* parent)
|
||||
}
|
||||
|
||||
// box
|
||||
connect(ui.boxLength, SIGNAL(valueChanged(double)), this, SLOT(onBoxLengthChanged(double)));
|
||||
connect(ui.boxWidth, SIGNAL(valueChanged(double)), this, SLOT(onBoxWidthChanged(double)));
|
||||
connect(ui.boxHeight, SIGNAL(valueChanged(double)), this, SLOT(onBoxHeightChanged(double)));
|
||||
connect(ui->boxLength, SIGNAL(valueChanged(double)), this, SLOT(onBoxLengthChanged(double)));
|
||||
connect(ui->boxWidth, SIGNAL(valueChanged(double)), this, SLOT(onBoxWidthChanged(double)));
|
||||
connect(ui->boxHeight, SIGNAL(valueChanged(double)), this, SLOT(onBoxHeightChanged(double)));
|
||||
|
||||
// cylinder
|
||||
connect(ui.cylinderRadius, SIGNAL(valueChanged(double)), this, SLOT(onCylinderRadiusChanged(double)));
|
||||
connect(ui.cylinderHeight, SIGNAL(valueChanged(double)), this, SLOT(onCylinderHeightChanged(double)));
|
||||
connect(ui.cylinderAngle, SIGNAL(valueChanged(double)), this, SLOT(onCylinderAngleChanged(double)));
|
||||
connect(ui->cylinderRadius, SIGNAL(valueChanged(double)), this, SLOT(onCylinderRadiusChanged(double)));
|
||||
connect(ui->cylinderHeight, SIGNAL(valueChanged(double)), this, SLOT(onCylinderHeightChanged(double)));
|
||||
connect(ui->cylinderAngle, SIGNAL(valueChanged(double)), this, SLOT(onCylinderAngleChanged(double)));
|
||||
|
||||
// cone
|
||||
connect(ui.coneRadius1, SIGNAL(valueChanged(double)), this, SLOT(onConeRadius1Changed(double)));
|
||||
connect(ui.coneRadius2, SIGNAL(valueChanged(double)), this, SLOT(onConeRadius2Changed(double)));
|
||||
connect(ui.coneAngle, SIGNAL(valueChanged(double)), this, SLOT(onConeAngleChanged(double)));
|
||||
connect(ui.coneHeight, SIGNAL(valueChanged(double)), this, SLOT(onConeHeightChanged(double)));
|
||||
connect(ui->coneRadius1, SIGNAL(valueChanged(double)), this, SLOT(onConeRadius1Changed(double)));
|
||||
connect(ui->coneRadius2, SIGNAL(valueChanged(double)), this, SLOT(onConeRadius2Changed(double)));
|
||||
connect(ui->coneAngle, SIGNAL(valueChanged(double)), this, SLOT(onConeAngleChanged(double)));
|
||||
connect(ui->coneHeight, SIGNAL(valueChanged(double)), this, SLOT(onConeHeightChanged(double)));
|
||||
|
||||
// sphere
|
||||
connect(ui.sphereRadius, SIGNAL(valueChanged(double)), this, SLOT(onSphereRadiusChanged(double)));
|
||||
connect(ui.sphereAngle1, SIGNAL(valueChanged(double)), this, SLOT(onSphereAngle1Changed(double)));
|
||||
connect(ui.sphereAngle2, SIGNAL(valueChanged(double)), this, SLOT(onSphereAngle2Changed(double)));
|
||||
connect(ui.sphereAngle3, SIGNAL(valueChanged(double)), this, SLOT(onSphereAngle3Changed(double)));
|
||||
connect(ui->sphereRadius, SIGNAL(valueChanged(double)), this, SLOT(onSphereRadiusChanged(double)));
|
||||
connect(ui->sphereAngle1, SIGNAL(valueChanged(double)), this, SLOT(onSphereAngle1Changed(double)));
|
||||
connect(ui->sphereAngle2, SIGNAL(valueChanged(double)), this, SLOT(onSphereAngle2Changed(double)));
|
||||
connect(ui->sphereAngle3, SIGNAL(valueChanged(double)), this, SLOT(onSphereAngle3Changed(double)));
|
||||
|
||||
// ellipsoid
|
||||
connect(ui.ellipsoidRadius1, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidRadius1Changed(double)));
|
||||
connect(ui.ellipsoidRadius2, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidRadius2Changed(double)));
|
||||
connect(ui.ellipsoidRadius3, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidRadius3Changed(double)));
|
||||
connect(ui.ellipsoidAngle1, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidAngle1Changed(double)));
|
||||
connect(ui.ellipsoidAngle2, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidAngle2Changed(double)));
|
||||
connect(ui.ellipsoidAngle3, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidAngle3Changed(double)));
|
||||
connect(ui->ellipsoidRadius1, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidRadius1Changed(double)));
|
||||
connect(ui->ellipsoidRadius2, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidRadius2Changed(double)));
|
||||
connect(ui->ellipsoidRadius3, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidRadius3Changed(double)));
|
||||
connect(ui->ellipsoidAngle1, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidAngle1Changed(double)));
|
||||
connect(ui->ellipsoidAngle2, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidAngle2Changed(double)));
|
||||
connect(ui->ellipsoidAngle3, SIGNAL(valueChanged(double)), this, SLOT(onEllipsoidAngle3Changed(double)));
|
||||
|
||||
// torus
|
||||
connect(ui.torusRadius1, SIGNAL(valueChanged(double)), this, SLOT(onTorusRadius1Changed(double)));
|
||||
connect(ui.torusRadius2, SIGNAL(valueChanged(double)), this, SLOT(onTorusRadius2Changed(double)));
|
||||
connect(ui.torusAngle1, SIGNAL(valueChanged(double)), this, SLOT(onTorusAngle1Changed(double)));
|
||||
connect(ui.torusAngle2, SIGNAL(valueChanged(double)), this, SLOT(onTorusAngle2Changed(double)));
|
||||
connect(ui.torusAngle3, SIGNAL(valueChanged(double)), this, SLOT(onTorusAngle3Changed(double)));
|
||||
connect(ui->torusRadius1, SIGNAL(valueChanged(double)), this, SLOT(onTorusRadius1Changed(double)));
|
||||
connect(ui->torusRadius2, SIGNAL(valueChanged(double)), this, SLOT(onTorusRadius2Changed(double)));
|
||||
connect(ui->torusAngle1, SIGNAL(valueChanged(double)), this, SLOT(onTorusAngle1Changed(double)));
|
||||
connect(ui->torusAngle2, SIGNAL(valueChanged(double)), this, SLOT(onTorusAngle2Changed(double)));
|
||||
connect(ui->torusAngle3, SIGNAL(valueChanged(double)), this, SLOT(onTorusAngle3Changed(double)));
|
||||
|
||||
//prism
|
||||
connect(ui.prismCircumradius, SIGNAL(valueChanged(double)), this, SLOT(onPrismCircumradiusChanged(double)));
|
||||
connect(ui.prismHeight, SIGNAL(valueChanged(double)), this, SLOT(onPrismHeightChanged(double)));
|
||||
connect(ui.prismPolygon, SIGNAL(valueChanged(int)), this, SLOT(onPrismPolygonChanged(int)));
|
||||
connect(ui->prismCircumradius, SIGNAL(valueChanged(double)), this, SLOT(onPrismCircumradiusChanged(double)));
|
||||
connect(ui->prismHeight, SIGNAL(valueChanged(double)), this, SLOT(onPrismHeightChanged(double)));
|
||||
connect(ui->prismPolygon, SIGNAL(valueChanged(int)), this, SLOT(onPrismPolygonChanged(int)));
|
||||
|
||||
// wedge
|
||||
connect(ui.wedgeXmax, SIGNAL(valueChanged(double)), this, SLOT(onWedgeXmaxChanged(double)));
|
||||
connect(ui.wedgeXmin, SIGNAL(valueChanged(double)), this, SLOT(onWedgeXinChanged(double)));
|
||||
connect(ui.wedgeYmax, SIGNAL(valueChanged(double)), this, SLOT(onWedgeYmaxChanged(double)));
|
||||
connect(ui.wedgeYmin, SIGNAL(valueChanged(double)), this, SLOT(onWedgeYinChanged(double)));
|
||||
connect(ui.wedgeZmax, SIGNAL(valueChanged(double)), this, SLOT(onWedgeZmaxChanged(double)));
|
||||
connect(ui.wedgeZmin, SIGNAL(valueChanged(double)), this, SLOT(onWedgeZinChanged(double)));
|
||||
connect(ui.wedgeX2max, SIGNAL(valueChanged(double)), this, SLOT(onWedgeX2maxChanged(double)));
|
||||
connect(ui.wedgeX2min, SIGNAL(valueChanged(double)), this, SLOT(onWedgeX2inChanged(double)));
|
||||
connect(ui.wedgeZ2max, SIGNAL(valueChanged(double)), this, SLOT(onWedgeZ2maxChanged(double)));
|
||||
connect(ui.wedgeZ2min, SIGNAL(valueChanged(double)), this, SLOT(onWedgeZ2inChanged(double)));
|
||||
connect(ui->wedgeXmax, SIGNAL(valueChanged(double)), this, SLOT(onWedgeXmaxChanged(double)));
|
||||
connect(ui->wedgeXmin, SIGNAL(valueChanged(double)), this, SLOT(onWedgeXinChanged(double)));
|
||||
connect(ui->wedgeYmax, SIGNAL(valueChanged(double)), this, SLOT(onWedgeYmaxChanged(double)));
|
||||
connect(ui->wedgeYmin, SIGNAL(valueChanged(double)), this, SLOT(onWedgeYinChanged(double)));
|
||||
connect(ui->wedgeZmax, SIGNAL(valueChanged(double)), this, SLOT(onWedgeZmaxChanged(double)));
|
||||
connect(ui->wedgeZmin, SIGNAL(valueChanged(double)), this, SLOT(onWedgeZinChanged(double)));
|
||||
connect(ui->wedgeX2max, SIGNAL(valueChanged(double)), this, SLOT(onWedgeX2maxChanged(double)));
|
||||
connect(ui->wedgeX2min, SIGNAL(valueChanged(double)), this, SLOT(onWedgeX2inChanged(double)));
|
||||
connect(ui->wedgeZ2max, SIGNAL(valueChanged(double)), this, SLOT(onWedgeZ2maxChanged(double)));
|
||||
connect(ui->wedgeZ2min, SIGNAL(valueChanged(double)), this, SLOT(onWedgeZ2inChanged(double)));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -521,16 +524,16 @@ void TaskBoxPrimitives::setPrimitive(App::DocumentObject *obj)
|
||||
if (!doc) {
|
||||
return;
|
||||
}
|
||||
switch(ui.widgetStack->currentIndex()) {
|
||||
switch(ui->widgetStack->currentIndex()) {
|
||||
case 1: // box
|
||||
cmd = QString::fromLatin1(
|
||||
"%1.Length=%2\n"
|
||||
"%1.Width=%3\n"
|
||||
"%1.Height=%4\n")
|
||||
.arg(name)
|
||||
.arg(ui.boxLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.boxWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.boxHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
.arg(ui->boxLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->boxWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->boxHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
break;
|
||||
|
||||
case 2: // cylinder
|
||||
@@ -539,9 +542,9 @@ void TaskBoxPrimitives::setPrimitive(App::DocumentObject *obj)
|
||||
"%1.Height=%3\n"
|
||||
"%1.Angle=%4\n")
|
||||
.arg(name)
|
||||
.arg(ui.cylinderRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.cylinderHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.cylinderAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
.arg(ui->cylinderRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->cylinderHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->cylinderAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
break;
|
||||
|
||||
case 3: // cone
|
||||
@@ -551,10 +554,10 @@ void TaskBoxPrimitives::setPrimitive(App::DocumentObject *obj)
|
||||
"%1.Height=%4\n"
|
||||
"%1.Angle=%5\n")
|
||||
.arg(name)
|
||||
.arg(ui.coneRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.coneRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.coneHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.coneAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
.arg(ui->coneRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->coneRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->coneHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->coneAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
break;
|
||||
|
||||
case 4: // sphere
|
||||
@@ -564,10 +567,10 @@ void TaskBoxPrimitives::setPrimitive(App::DocumentObject *obj)
|
||||
"%1.Angle2=%4\n"
|
||||
"%1.Angle3=%5\n")
|
||||
.arg(name)
|
||||
.arg(ui.sphereRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.sphereAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.sphereAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.sphereAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
.arg(ui->sphereRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->sphereAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->sphereAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->sphereAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
break;
|
||||
case 5: // ellipsoid
|
||||
cmd = QString::fromLatin1(
|
||||
@@ -578,12 +581,12 @@ void TaskBoxPrimitives::setPrimitive(App::DocumentObject *obj)
|
||||
"%1.Angle2=%6\n"
|
||||
"%1.Angle3=%7\n")
|
||||
.arg(name)
|
||||
.arg(ui.ellipsoidRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.ellipsoidRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.ellipsoidRadius3->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.ellipsoidAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.ellipsoidAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.ellipsoidAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
.arg(ui->ellipsoidRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->ellipsoidRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->ellipsoidRadius3->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->ellipsoidAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->ellipsoidAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->ellipsoidAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
break;
|
||||
|
||||
case 6: // torus
|
||||
@@ -594,11 +597,11 @@ void TaskBoxPrimitives::setPrimitive(App::DocumentObject *obj)
|
||||
"%1.Angle2=%5\n"
|
||||
"%1.Angle3=%6\n")
|
||||
.arg(name)
|
||||
.arg(ui.torusRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.torusRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.torusAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.torusAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.torusAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
.arg(ui->torusRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->torusRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->torusAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->torusAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->torusAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
break;
|
||||
case 7: // prism
|
||||
cmd = QString::fromLatin1(
|
||||
@@ -606,9 +609,9 @@ void TaskBoxPrimitives::setPrimitive(App::DocumentObject *obj)
|
||||
"%1.Circumradius=%3\n"
|
||||
"%1.Height=%4\n")
|
||||
.arg(name)
|
||||
.arg(ui.prismPolygon->value())
|
||||
.arg(ui.prismCircumradius->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.prismHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
.arg(ui->prismPolygon->value())
|
||||
.arg(ui->prismCircumradius->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->prismHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
break;
|
||||
case 8: // wedge
|
||||
cmd = QString::fromLatin1(
|
||||
@@ -623,16 +626,16 @@ void TaskBoxPrimitives::setPrimitive(App::DocumentObject *obj)
|
||||
"%1.X2max=%10\n"
|
||||
"%1.Z2max=%11\n")
|
||||
.arg(name)
|
||||
.arg(ui.wedgeXmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.wedgeYmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.wedgeZmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.wedgeX2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.wedgeZ2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.wedgeXmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.wedgeYmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.wedgeZmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.wedgeX2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui.wedgeZ2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
.arg(ui->wedgeXmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->wedgeYmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->wedgeZmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->wedgeX2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->wedgeZ2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->wedgeXmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->wedgeYmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->wedgeZmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->wedgeX2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals())
|
||||
.arg(ui->wedgeZ2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals());
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#ifndef GUI_TASKVIEW_TaskPrimitiveParameters_H
|
||||
#define GUI_TASKVIEW_TaskPrimitiveParameters_H
|
||||
|
||||
#include <memory>
|
||||
#include <Gui/TaskView/TaskView.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/DocumentObserver.h>
|
||||
@@ -34,9 +35,6 @@
|
||||
#include "TaskDatumParameters.h"
|
||||
#include <Mod/PartDesign/App/DatumCS.h>
|
||||
#include <Mod/PartDesign/App/FeaturePrimitive.h>
|
||||
#include "ui_TaskPrimitiveParameters.h"
|
||||
|
||||
class Ui_TaskPrimitiveParameters;
|
||||
|
||||
namespace App {
|
||||
class Property;
|
||||
@@ -47,7 +45,7 @@ class ViewProvider;
|
||||
}
|
||||
|
||||
namespace PartDesignGui {
|
||||
|
||||
class Ui_DlgPrimitives;
|
||||
class TaskBoxPrimitives : public Gui::TaskView::TaskBox,
|
||||
public Gui::DocumentObserver
|
||||
{
|
||||
@@ -105,7 +103,7 @@ private:
|
||||
|
||||
private:
|
||||
QWidget* proxy;
|
||||
Ui_DlgPrimitives ui;
|
||||
std::unique_ptr<Ui_DlgPrimitives> ui;
|
||||
ViewProviderPrimitive* vp;
|
||||
};
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include "DlgSettingsPathColor.h"
|
||||
#include "ui_DlgSettingsPathColor.h"
|
||||
#include <Gui/PrefWidgets.h>
|
||||
#include <Base/Console.h>
|
||||
|
||||
@@ -39,8 +40,9 @@ using namespace PathGui;
|
||||
*/
|
||||
DlgSettingsPathColor::DlgSettingsPathColor(QWidget* parent)
|
||||
: PreferencePage(parent)
|
||||
, ui(new Ui_DlgSettingsPathColor)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,33 +56,33 @@ DlgSettingsPathColor::~DlgSettingsPathColor()
|
||||
void DlgSettingsPathColor::saveSettings()
|
||||
{
|
||||
// Part
|
||||
DefaultNormalPathColor->onSave();
|
||||
DefaultRapidPathColor->onSave();
|
||||
DefaultPathLineWidth->onSave();
|
||||
DefaultPathMarkerColor->onSave();
|
||||
DefaultExtentsColor->onSave();
|
||||
DefaultProbePathColor->onSave();
|
||||
DefaultHighlightPathColor->onSave();
|
||||
DefaultBBoxSelectionColor->onSave();
|
||||
DefaultBBoxNormalColor->onSave();
|
||||
DefaultSelectionStyle->onSave();
|
||||
DefaultTaskPanelLayout->onSave();
|
||||
ui->DefaultNormalPathColor->onSave();
|
||||
ui->DefaultRapidPathColor->onSave();
|
||||
ui->DefaultPathLineWidth->onSave();
|
||||
ui->DefaultPathMarkerColor->onSave();
|
||||
ui->DefaultExtentsColor->onSave();
|
||||
ui->DefaultProbePathColor->onSave();
|
||||
ui->DefaultHighlightPathColor->onSave();
|
||||
ui->DefaultBBoxSelectionColor->onSave();
|
||||
ui->DefaultBBoxNormalColor->onSave();
|
||||
ui->DefaultSelectionStyle->onSave();
|
||||
ui->DefaultTaskPanelLayout->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsPathColor::loadSettings()
|
||||
{
|
||||
// Part
|
||||
DefaultNormalPathColor->onRestore();
|
||||
DefaultRapidPathColor->onRestore();
|
||||
DefaultPathLineWidth->onRestore();
|
||||
DefaultPathMarkerColor->onRestore();
|
||||
DefaultExtentsColor->onRestore();
|
||||
DefaultProbePathColor->onRestore();
|
||||
DefaultHighlightPathColor->onRestore();
|
||||
DefaultBBoxSelectionColor->onRestore();
|
||||
DefaultBBoxNormalColor->onRestore();
|
||||
DefaultSelectionStyle->onRestore();
|
||||
DefaultTaskPanelLayout->onRestore();
|
||||
ui->DefaultNormalPathColor->onRestore();
|
||||
ui->DefaultRapidPathColor->onRestore();
|
||||
ui->DefaultPathLineWidth->onRestore();
|
||||
ui->DefaultPathMarkerColor->onRestore();
|
||||
ui->DefaultExtentsColor->onRestore();
|
||||
ui->DefaultProbePathColor->onRestore();
|
||||
ui->DefaultHighlightPathColor->onRestore();
|
||||
ui->DefaultBBoxSelectionColor->onRestore();
|
||||
ui->DefaultBBoxNormalColor->onRestore();
|
||||
ui->DefaultSelectionStyle->onRestore();
|
||||
ui->DefaultTaskPanelLayout->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +91,7 @@ void DlgSettingsPathColor::loadSettings()
|
||||
void DlgSettingsPathColor::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
retranslateUi(this);
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -24,12 +24,13 @@
|
||||
#ifndef PATHGUI_DIALOG_DLGSETTINGSPATHCOLOR_H
|
||||
#define PATHGUI_DIALOG_DLGSETTINGSPATHCOLOR_H
|
||||
|
||||
#include "ui_DlgSettingsPathColor.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
namespace PathGui {
|
||||
class Ui_DlgSettingsPathColor;
|
||||
|
||||
class DlgSettingsPathColor : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsPathColor
|
||||
class DlgSettingsPathColor : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -42,6 +43,9 @@ public:
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgSettingsPathColor> ui;
|
||||
};
|
||||
|
||||
} // namespace PathGui
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#endif
|
||||
|
||||
#include "DlgPointsReadImp.h"
|
||||
#include "ui_DlgPointsRead.h"
|
||||
|
||||
using namespace PointsGui;
|
||||
|
||||
@@ -32,7 +33,9 @@ using namespace PointsGui;
|
||||
|
||||
DlgPointsReadImp::DlgPointsReadImp(const char *FileName, QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog( parent, fl )
|
||||
, ui(new Ui_DlgPointsRead)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
_FileName = FileName;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,21 +25,24 @@
|
||||
#define POINTSGUI_DLGREADPOINTS_H
|
||||
|
||||
#include <string>
|
||||
#include "ui_DlgPointsRead.h"
|
||||
#include <memory>
|
||||
#include <QDialog>
|
||||
|
||||
namespace PointsGui {
|
||||
class Ui_DlgPointsRead;
|
||||
|
||||
/** The points read dialog
|
||||
*/
|
||||
class DlgPointsReadImp : public QDialog, public Ui_DlgPointsRead
|
||||
class DlgPointsReadImp : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgPointsReadImp(const char *FileName, QWidget* parent = 0, Qt::WindowFlags fl = 0 );
|
||||
DlgPointsReadImp(const char *FileName, QWidget* parent = nullptr, Qt::WindowFlags fl = 0 );
|
||||
~DlgPointsReadImp();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgPointsRead> ui;
|
||||
std::string _FileName;
|
||||
};
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include "DlgSettingsRayImp.h"
|
||||
#include "ui_DlgSettingsRay.h"
|
||||
#include <Gui/PrefWidgets.h>
|
||||
#include <Base/Console.h>
|
||||
|
||||
@@ -40,9 +41,10 @@ using namespace RaytracingGui;
|
||||
*/
|
||||
DlgSettingsRayImp::DlgSettingsRayImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsRay)
|
||||
{
|
||||
this->setupUi(this);
|
||||
prefFileChooser2->setToolTip(tr("The path to the POV-Ray executable, if you want to render from %1").arg(qApp->applicationName()));
|
||||
ui->setupUi(this);
|
||||
ui->prefFileChooser2->setToolTip(tr("The path to the POV-Ray executable, if you want to render from %1").arg(qApp->applicationName()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,32 +57,32 @@ DlgSettingsRayImp::~DlgSettingsRayImp()
|
||||
|
||||
void DlgSettingsRayImp::saveSettings()
|
||||
{
|
||||
prefFileChooser1->onSave();
|
||||
prefFileChooser2->onSave();
|
||||
prefFileChooser3->onSave();
|
||||
prefLineEdit2->onSave();
|
||||
prefLineEdit3->onSave();
|
||||
prefFloatSpinBox1->onSave();
|
||||
prefCheckBox8->onSave();
|
||||
prefCheckBox9->onSave();
|
||||
prefIntSpinBox1->onSave();
|
||||
prefIntSpinBox2->onSave();
|
||||
prefLineEdit1->onSave();
|
||||
ui->prefFileChooser1->onSave();
|
||||
ui->prefFileChooser2->onSave();
|
||||
ui->prefFileChooser3->onSave();
|
||||
ui->prefLineEdit2->onSave();
|
||||
ui->prefLineEdit3->onSave();
|
||||
ui->prefFloatSpinBox1->onSave();
|
||||
ui->prefCheckBox8->onSave();
|
||||
ui->prefCheckBox9->onSave();
|
||||
ui->prefIntSpinBox1->onSave();
|
||||
ui->prefIntSpinBox2->onSave();
|
||||
ui->prefLineEdit1->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsRayImp::loadSettings()
|
||||
{
|
||||
prefFileChooser1->onRestore();
|
||||
prefFileChooser2->onRestore();
|
||||
prefFileChooser3->onRestore();
|
||||
prefLineEdit2->onRestore();
|
||||
prefLineEdit3->onRestore();
|
||||
prefFloatSpinBox1->onRestore();
|
||||
prefCheckBox8->onRestore();
|
||||
prefCheckBox9->onRestore();
|
||||
prefIntSpinBox1->onRestore();
|
||||
prefIntSpinBox2->onRestore();
|
||||
prefLineEdit1->onRestore();
|
||||
ui->prefFileChooser1->onRestore();
|
||||
ui->prefFileChooser2->onRestore();
|
||||
ui->prefFileChooser3->onRestore();
|
||||
ui->prefLineEdit2->onRestore();
|
||||
ui->prefLineEdit3->onRestore();
|
||||
ui->prefFloatSpinBox1->onRestore();
|
||||
ui->prefCheckBox8->onRestore();
|
||||
ui->prefCheckBox9->onRestore();
|
||||
ui->prefIntSpinBox1->onRestore();
|
||||
ui->prefIntSpinBox2->onRestore();
|
||||
ui->prefLineEdit1->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +91,7 @@ void DlgSettingsRayImp::loadSettings()
|
||||
void DlgSettingsRayImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
retranslateUi(this);
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -24,17 +24,18 @@
|
||||
#ifndef RAYTRACINGGUI_DLGSETTINGSRAYIMP_H
|
||||
#define RAYTRACINGGUI_DLGSETTINGSRAYIMP_H
|
||||
|
||||
#include "ui_DlgSettingsRay.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
namespace RaytracingGui {
|
||||
class Ui_DlgSettingsRay;
|
||||
|
||||
/**
|
||||
* The DlgSettings3DViewImp class implements a preference page to change settings
|
||||
* for the Inventor viewer.
|
||||
* \author Jürgen Riegel
|
||||
*/
|
||||
class DlgSettingsRayImp : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsRay
|
||||
class DlgSettingsRayImp : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -46,6 +47,9 @@ protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgSettingsRay> ui;
|
||||
};
|
||||
|
||||
} // namespace RaytracingGui
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include <QTimer>
|
||||
#include "ui_TrajectorySimulate.h"
|
||||
#include "TrajectorySimulate.h"
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/Document.h>
|
||||
@@ -43,50 +44,51 @@ using namespace RobotGui;
|
||||
using namespace Gui;
|
||||
|
||||
TrajectorySimulate::TrajectorySimulate(Robot::RobotObject *pcRobotObject,Robot::TrajectoryObject *pcTrajectoryObject,QWidget *parent)
|
||||
: QDialog( parent),
|
||||
sim(pcTrajectoryObject->Trajectory.getValue(),pcRobotObject->getRobot()),
|
||||
Run(false),
|
||||
block(false),
|
||||
timePos(0.0)
|
||||
: QDialog( parent)
|
||||
, sim(pcTrajectoryObject->Trajectory.getValue(),pcRobotObject->getRobot())
|
||||
, Run(false)
|
||||
, block(false)
|
||||
, timePos(0.0)
|
||||
, ui(new Ui_DlgTrajectorySimulate)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
|
||||
// set Tool
|
||||
sim.Tool = pcRobotObject->Tool.getValue();
|
||||
|
||||
trajectoryTable->setSortingEnabled(false);
|
||||
ui->trajectoryTable->setSortingEnabled(false);
|
||||
|
||||
Robot::Trajectory trac = pcTrajectoryObject->Trajectory.getValue();
|
||||
trajectoryTable->setRowCount(trac.getSize());
|
||||
ui->trajectoryTable->setRowCount(trac.getSize());
|
||||
duration = trac.getDuration();
|
||||
timeSpinBox->setMaximum(duration);
|
||||
ui->timeSpinBox->setMaximum(duration);
|
||||
|
||||
for(unsigned int i=0;i<trac.getSize();i++){
|
||||
Robot::Waypoint pt = trac.getWaypoint(i);
|
||||
switch(pt.Type){
|
||||
case Robot::Waypoint::UNDEF: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("UNDEF")));break;
|
||||
case Robot::Waypoint::CIRC: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("CIRC")));break;
|
||||
case Robot::Waypoint::PTP: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("PTP")));break;
|
||||
case Robot::Waypoint::LINE: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("LIN")));break;
|
||||
default: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("UNDEF")));break;
|
||||
case Robot::Waypoint::UNDEF: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("UNDEF")));break;
|
||||
case Robot::Waypoint::CIRC: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("CIRC")));break;
|
||||
case Robot::Waypoint::PTP: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("PTP")));break;
|
||||
case Robot::Waypoint::LINE: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("LIN")));break;
|
||||
default: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("UNDEF")));break;
|
||||
}
|
||||
trajectoryTable->setItem(i, 1, new QTableWidgetItem(QString::fromUtf8(pt.Name.c_str())));
|
||||
ui->trajectoryTable->setItem(i, 1, new QTableWidgetItem(QString::fromUtf8(pt.Name.c_str())));
|
||||
if(pt.Cont)
|
||||
trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromLatin1("|")));
|
||||
ui->trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromLatin1("|")));
|
||||
else
|
||||
trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromLatin1("-")));
|
||||
trajectoryTable->setItem(i, 3, new QTableWidgetItem(QString::number(pt.Velocity)));
|
||||
trajectoryTable->setItem(i, 4, new QTableWidgetItem(QString::number(pt.Accelaration)));
|
||||
ui->trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromLatin1("-")));
|
||||
ui->trajectoryTable->setItem(i, 3, new QTableWidgetItem(QString::number(pt.Velocity)));
|
||||
ui->trajectoryTable->setItem(i, 4, new QTableWidgetItem(QString::number(pt.Accelaration)));
|
||||
|
||||
}
|
||||
|
||||
QObject::connect(ButtonStepStart ,SIGNAL(clicked()),this,SLOT(start()));
|
||||
QObject::connect(ButtonStepStop ,SIGNAL(clicked()),this,SLOT(stop()));
|
||||
QObject::connect(ButtonStepRun ,SIGNAL(clicked()),this,SLOT(run()));
|
||||
QObject::connect(ButtonStepBack ,SIGNAL(clicked()),this,SLOT(back()));
|
||||
QObject::connect(ButtonStepForward ,SIGNAL(clicked()),this,SLOT(forward()));
|
||||
QObject::connect(ButtonStepEnd ,SIGNAL(clicked()),this,SLOT(end()));
|
||||
QObject::connect(ui->ButtonStepStart ,SIGNAL(clicked()),this,SLOT(start()));
|
||||
QObject::connect(ui->ButtonStepStop ,SIGNAL(clicked()),this,SLOT(stop()));
|
||||
QObject::connect(ui->ButtonStepRun ,SIGNAL(clicked()),this,SLOT(run()));
|
||||
QObject::connect(ui->ButtonStepBack ,SIGNAL(clicked()),this,SLOT(back()));
|
||||
QObject::connect(ui->ButtonStepForward ,SIGNAL(clicked()),this,SLOT(forward()));
|
||||
QObject::connect(ui->ButtonStepEnd ,SIGNAL(clicked()),this,SLOT(end()));
|
||||
|
||||
|
||||
// set up timer
|
||||
@@ -94,8 +96,8 @@ TrajectorySimulate::TrajectorySimulate(Robot::RobotObject *pcRobotObject,Robot::
|
||||
timer->setInterval(100);
|
||||
QObject::connect(timer ,SIGNAL(timeout ()),this,SLOT(timerDone()));
|
||||
|
||||
QObject::connect( timeSpinBox ,SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double)) );
|
||||
QObject::connect( timeSlider ,SIGNAL(valueChanged(int) ), this, SLOT(valueChanged(int)) );
|
||||
QObject::connect(ui->timeSpinBox ,SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double)) );
|
||||
QObject::connect(ui->timeSlider ,SIGNAL(valueChanged(int) ), this, SLOT(valueChanged(int)) );
|
||||
|
||||
// get the view provider
|
||||
ViewProv = static_cast<ViewProviderRobotObject*>(Gui::Application::Instance->activeDocument()->getViewProvider(pcRobotObject) );
|
||||
@@ -116,8 +118,8 @@ void TrajectorySimulate::setTo(void)
|
||||
void TrajectorySimulate::start(void)
|
||||
{
|
||||
timePos = 0.0f;
|
||||
timeSpinBox->setValue(timePos);
|
||||
timeSlider->setValue(int((timePos/duration)*1000));
|
||||
ui->timeSpinBox->setValue(timePos);
|
||||
ui->timeSlider->setValue(int((timePos/duration)*1000));
|
||||
setTo();
|
||||
|
||||
}
|
||||
@@ -140,8 +142,8 @@ void TrajectorySimulate::forward(void)
|
||||
void TrajectorySimulate::end(void)
|
||||
{
|
||||
timePos = duration;
|
||||
timeSpinBox->setValue(timePos);
|
||||
timeSlider->setValue(int((timePos/duration)*1000));
|
||||
ui->timeSpinBox->setValue(timePos);
|
||||
ui->timeSlider->setValue(int((timePos/duration)*1000));
|
||||
setTo();
|
||||
}
|
||||
|
||||
@@ -149,8 +151,8 @@ void TrajectorySimulate::timerDone(void)
|
||||
{
|
||||
if(timePos < duration){
|
||||
timePos += .1f;
|
||||
timeSpinBox->setValue(timePos);
|
||||
timeSlider->setValue(int((timePos/duration)*1000));
|
||||
ui->timeSpinBox->setValue(timePos);
|
||||
ui->timeSlider->setValue(int((timePos/duration)*1000));
|
||||
setTo();
|
||||
timer->start();
|
||||
}else{
|
||||
@@ -164,7 +166,7 @@ void TrajectorySimulate::valueChanged ( int value )
|
||||
if(!block){
|
||||
timePos = duration*(value/1000.0);
|
||||
block=true;
|
||||
timeSpinBox->setValue(timePos);
|
||||
ui->timeSpinBox->setValue(timePos);
|
||||
block=false;
|
||||
setTo();
|
||||
}
|
||||
@@ -175,7 +177,7 @@ void TrajectorySimulate::valueChanged ( double value )
|
||||
if(!block){
|
||||
timePos = value;
|
||||
block=true;
|
||||
timeSlider->setValue(int((timePos/duration)*1000));
|
||||
ui->timeSlider->setValue(int((timePos/duration)*1000));
|
||||
block=false;
|
||||
setTo();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
|
||||
#include <QDialog>
|
||||
#include "ui_TrajectorySimulate.h"
|
||||
#include <memory>
|
||||
|
||||
#include <Mod/Robot/App/RobotObject.h>
|
||||
#include <Mod/Robot/App/Robot6Axis.h>
|
||||
@@ -39,9 +39,9 @@
|
||||
|
||||
namespace RobotGui {
|
||||
|
||||
class Ui_DlgTrajectorySimulate;
|
||||
|
||||
|
||||
class TrajectorySimulate : public QDialog, public Ui_DlgTrajectorySimulate
|
||||
class TrajectorySimulate : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -75,8 +75,9 @@ protected:
|
||||
|
||||
float timePos;
|
||||
float duration;
|
||||
private:
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgTrajectorySimulate> ui;
|
||||
};
|
||||
|
||||
} //namespace PartDesignGui
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "DlgStartPreferencesImp.h"
|
||||
#include "ui_DlgStartPreferences.h"
|
||||
#include <Gui/PrefWidgets.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Gui/Application.h>
|
||||
@@ -35,15 +36,16 @@ using namespace StartGui;
|
||||
*/
|
||||
DlgStartPreferencesImp::DlgStartPreferencesImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgStartPreferences)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
|
||||
// Hide currently unused controls
|
||||
label_12->hide();
|
||||
label_7->hide();
|
||||
colorButton_7->hide();
|
||||
radioButton_1->hide();
|
||||
radioButton_2->hide();
|
||||
ui->label_12->hide();
|
||||
ui->label_7->hide();
|
||||
ui->colorButton_7->hide();
|
||||
ui->radioButton_1->hide();
|
||||
ui->radioButton_2->hide();
|
||||
|
||||
// fills the combo box with all available workbenches
|
||||
// sorted by their menu text
|
||||
@@ -59,17 +61,17 @@ DlgStartPreferencesImp::DlgStartPreferencesImp( QWidget* parent )
|
||||
QString key = QString::fromLatin1("<last>");
|
||||
QString value = QString::fromLatin1("$LastModule");
|
||||
if (px.isNull())
|
||||
AutoloadModuleCombo->addItem(key, QVariant(value));
|
||||
ui->AutoloadModuleCombo->addItem(key, QVariant(value));
|
||||
else
|
||||
AutoloadModuleCombo->addItem(px, key, QVariant(value));
|
||||
ui->AutoloadModuleCombo->addItem(px, key, QVariant(value));
|
||||
}
|
||||
|
||||
for (QMap<QString, QString>::Iterator it = menuText.begin(); it != menuText.end(); ++it) {
|
||||
QPixmap px = Gui::Application::Instance->workbenchIcon(it.value());
|
||||
if (px.isNull())
|
||||
AutoloadModuleCombo->addItem(it.key(), QVariant(it.value()));
|
||||
ui->AutoloadModuleCombo->addItem(it.key(), QVariant(it.value()));
|
||||
else
|
||||
AutoloadModuleCombo->addItem(px, it.key(), QVariant(it.value()));
|
||||
ui->AutoloadModuleCombo->addItem(px, it.key(), QVariant(it.value()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -84,32 +86,32 @@ DlgStartPreferencesImp::~DlgStartPreferencesImp()
|
||||
|
||||
void DlgStartPreferencesImp::saveSettings()
|
||||
{
|
||||
int index = AutoloadModuleCombo->currentIndex();
|
||||
QVariant data = AutoloadModuleCombo->itemData(index);
|
||||
int index = ui->AutoloadModuleCombo->currentIndex();
|
||||
QVariant data = ui->AutoloadModuleCombo->itemData(index);
|
||||
QString startWbName = data.toString();
|
||||
App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Start")->
|
||||
SetASCII("AutoloadModule", startWbName.toLatin1());
|
||||
colorButton_1->onSave();
|
||||
colorButton_2->onSave();
|
||||
colorButton_3->onSave();
|
||||
colorButton_4->onSave();
|
||||
colorButton_5->onSave();
|
||||
colorButton_6->onSave();
|
||||
colorButton_7->onSave();
|
||||
fileChooser_1->onSave();
|
||||
fileChooser_2->onSave();
|
||||
fileChooser_3->onSave();
|
||||
radioButton_1->onSave();
|
||||
radioButton_2->onSave();
|
||||
checkBox->onSave();
|
||||
checkBox_1->onSave();
|
||||
checkBox_2->onSave();
|
||||
checkBox_3->onSave();
|
||||
checkBox_4->onSave();
|
||||
checkBox_5->onSave();
|
||||
checkBox_6->onSave();
|
||||
lineEdit->onSave();
|
||||
spinBox->onSave();
|
||||
ui->colorButton_1->onSave();
|
||||
ui->colorButton_2->onSave();
|
||||
ui->colorButton_3->onSave();
|
||||
ui->colorButton_4->onSave();
|
||||
ui->colorButton_5->onSave();
|
||||
ui->colorButton_6->onSave();
|
||||
ui->colorButton_7->onSave();
|
||||
ui->fileChooser_1->onSave();
|
||||
ui->fileChooser_2->onSave();
|
||||
ui->fileChooser_3->onSave();
|
||||
ui->radioButton_1->onSave();
|
||||
ui->radioButton_2->onSave();
|
||||
ui->checkBox->onSave();
|
||||
ui->checkBox_1->onSave();
|
||||
ui->checkBox_2->onSave();
|
||||
ui->checkBox_3->onSave();
|
||||
ui->checkBox_4->onSave();
|
||||
ui->checkBox_5->onSave();
|
||||
ui->checkBox_6->onSave();
|
||||
ui->lineEdit->onSave();
|
||||
ui->spinBox->onSave();
|
||||
}
|
||||
|
||||
void DlgStartPreferencesImp::loadSettings()
|
||||
@@ -118,28 +120,28 @@ void DlgStartPreferencesImp::loadSettings()
|
||||
start = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Start")->
|
||||
GetASCII("AutoloadModule", start.c_str());
|
||||
QString startWbName = QLatin1String(start.c_str());
|
||||
AutoloadModuleCombo->setCurrentIndex(AutoloadModuleCombo->findData(startWbName));
|
||||
colorButton_1->onRestore();
|
||||
colorButton_2->onRestore();
|
||||
colorButton_3->onRestore();
|
||||
colorButton_4->onRestore();
|
||||
colorButton_5->onRestore();
|
||||
colorButton_6->onRestore();
|
||||
colorButton_7->onRestore();
|
||||
fileChooser_1->onRestore();
|
||||
fileChooser_2->onRestore();
|
||||
fileChooser_3->onRestore();
|
||||
radioButton_1->onRestore();
|
||||
radioButton_2->onRestore();
|
||||
checkBox->onRestore();
|
||||
checkBox_1->onRestore();
|
||||
checkBox_2->onRestore();
|
||||
checkBox_3->onRestore();
|
||||
checkBox_4->onRestore();
|
||||
checkBox_5->onRestore();
|
||||
checkBox_6->onRestore();
|
||||
lineEdit->onRestore();
|
||||
spinBox->onRestore();
|
||||
ui->AutoloadModuleCombo->setCurrentIndex(ui->AutoloadModuleCombo->findData(startWbName));
|
||||
ui->colorButton_1->onRestore();
|
||||
ui->colorButton_2->onRestore();
|
||||
ui->colorButton_3->onRestore();
|
||||
ui->colorButton_4->onRestore();
|
||||
ui->colorButton_5->onRestore();
|
||||
ui->colorButton_6->onRestore();
|
||||
ui->colorButton_7->onRestore();
|
||||
ui->fileChooser_1->onRestore();
|
||||
ui->fileChooser_2->onRestore();
|
||||
ui->fileChooser_3->onRestore();
|
||||
ui->radioButton_1->onRestore();
|
||||
ui->radioButton_2->onRestore();
|
||||
ui->checkBox->onRestore();
|
||||
ui->checkBox_1->onRestore();
|
||||
ui->checkBox_2->onRestore();
|
||||
ui->checkBox_3->onRestore();
|
||||
ui->checkBox_4->onRestore();
|
||||
ui->checkBox_5->onRestore();
|
||||
ui->checkBox_6->onRestore();
|
||||
ui->lineEdit->onRestore();
|
||||
ui->spinBox->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,7 +150,7 @@ void DlgStartPreferencesImp::loadSettings()
|
||||
void DlgStartPreferencesImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
retranslateUi(this);
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
#ifndef STARTGUI_DLGSTARTPREFERENCESIMP_H
|
||||
#define STARTGUI_DLGSTARTPREFERENCESIMP_H
|
||||
|
||||
#include "ui_DlgStartPreferences.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
class Ui_DlgStartPreferences;
|
||||
namespace StartGui {
|
||||
|
||||
class DlgStartPreferencesImp : public Gui::Dialog::PreferencePage, public Ui_DlgStartPreferences
|
||||
class DlgStartPreferencesImp : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -41,6 +41,9 @@ namespace StartGui {
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgStartPreferences> ui;
|
||||
};
|
||||
|
||||
} // namespace StartGui
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <Base/Interpreter.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include "UnitTestImp.h"
|
||||
#include "ui_UnitTest.h"
|
||||
#include "UnitTestPy.h"
|
||||
|
||||
|
||||
@@ -81,20 +82,21 @@ bool UnitTestDialog::hasInstance()
|
||||
*/
|
||||
UnitTestDialog::UnitTestDialog(QWidget* parent, Qt::WindowFlags f)
|
||||
: QDialog(parent, f)
|
||||
, ui(new Ui_UnitTest)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
#if QT_VERSION < 0x050000
|
||||
// As it doesn't seem to be able to change the "Highlight" color for the active colorgroup
|
||||
// we force e.g. the "Motif" style only for the progressbar to change the color to green or red.
|
||||
this->progressBar->setStyle(QStyleFactory::create(QString::fromLatin1("Motif")));
|
||||
ui->progressBar->setStyle(QStyleFactory::create(QString::fromLatin1("Motif")));
|
||||
#endif
|
||||
setProgressColor(QColor(40,210,43)); // a darker green
|
||||
this->progressBar->setAlignment(Qt::AlignCenter);
|
||||
ui->progressBar->setAlignment(Qt::AlignCenter);
|
||||
|
||||
// red items
|
||||
QPalette palette;
|
||||
palette.setColor(treeViewFailure->foregroundRole(), Qt::red);
|
||||
treeViewFailure->setPalette(palette);
|
||||
palette.setColor(ui->treeViewFailure->foregroundRole(), Qt::red);
|
||||
ui->treeViewFailure->setPalette(palette);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,12 +122,12 @@ void UnitTestDialog::setProgressColor(const QColor& col)
|
||||
" background-color: %1;\n"
|
||||
"}"
|
||||
).arg(col.name());
|
||||
this->progressBar->setStyleSheet(qss);
|
||||
ui->progressBar->setStyleSheet(qss);
|
||||
#else
|
||||
QPalette pl = this->progressBar->palette();
|
||||
QPalette pl = ui->progressBar->palette();
|
||||
pl.setColor(QPalette::Active, QPalette::Highlight, col);
|
||||
pl.setColor(QPalette::Inactive, QPalette::Highlight, col);
|
||||
this->progressBar->setPalette(pl);
|
||||
ui->progressBar->setPalette(pl);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -184,7 +186,7 @@ void UnitTestDialog::on_startButton_clicked()
|
||||
{
|
||||
reset();
|
||||
setProgressColor(QColor(40,210,43)); // a darker green
|
||||
this->startButton->setDisabled(true);
|
||||
ui->startButton->setDisabled(true);
|
||||
try {
|
||||
Base::Interpreter().runString(
|
||||
"import qtunittest, gc\n"
|
||||
@@ -202,7 +204,7 @@ void UnitTestDialog::on_startButton_clicked()
|
||||
catch (const Base::Exception& e) {
|
||||
showErrorDialog("Exception", e.what());
|
||||
}
|
||||
this->startButton->setEnabled(true);
|
||||
ui->startButton->setEnabled(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -227,12 +229,12 @@ void UnitTestDialog::reject()
|
||||
*/
|
||||
void UnitTestDialog::reset()
|
||||
{
|
||||
this->progressBar->reset();
|
||||
this->treeViewFailure->clear();
|
||||
this->textLabelRunCt->setText (QString::fromLatin1("<font color=\"#0000ff\">0</font>"));
|
||||
this->textLabelFailCt->setText(QString::fromLatin1("<font color=\"#0000ff\">0</font>"));
|
||||
this->textLabelErrCt->setText (QString::fromLatin1("<font color=\"#0000ff\">0</font>"));
|
||||
this->textLabelRemCt->setText (QString::fromLatin1("<font color=\"#0000ff\">0</font>"));
|
||||
ui->progressBar->reset();
|
||||
ui->treeViewFailure->clear();
|
||||
ui->textLabelRunCt->setText (QString::fromLatin1("<font color=\"#0000ff\">0</font>"));
|
||||
ui->textLabelFailCt->setText(QString::fromLatin1("<font color=\"#0000ff\">0</font>"));
|
||||
ui->textLabelErrCt->setText (QString::fromLatin1("<font color=\"#0000ff\">0</font>"));
|
||||
ui->textLabelRemCt->setText (QString::fromLatin1("<font color=\"#0000ff\">0</font>"));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,13 +242,13 @@ void UnitTestDialog::reset()
|
||||
*/
|
||||
void UnitTestDialog::addUnitTest(const QString& unit)
|
||||
{
|
||||
int ct = this->comboTests->count();
|
||||
int ct = ui->comboTests->count();
|
||||
for (int i=0; i<ct; i++) {
|
||||
if (this->comboTests->itemText(i) == unit)
|
||||
if (ui->comboTests->itemText(i) == unit)
|
||||
return;
|
||||
}
|
||||
|
||||
this->comboTests->addItem(unit);
|
||||
ui->comboTests->addItem(unit);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,9 +257,9 @@ void UnitTestDialog::addUnitTest(const QString& unit)
|
||||
void UnitTestDialog::setUnitTest(const QString& unit)
|
||||
{
|
||||
addUnitTest(unit);
|
||||
for (int i=0; i<this->comboTests->count(); i++) {
|
||||
if (this->comboTests->itemText(i) == unit) {
|
||||
this->comboTests->setCurrentIndex(i);
|
||||
for (int i=0; i<ui->comboTests->count(); i++) {
|
||||
if (ui->comboTests->itemText(i) == unit) {
|
||||
ui->comboTests->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -268,7 +270,7 @@ void UnitTestDialog::setUnitTest(const QString& unit)
|
||||
*/
|
||||
void UnitTestDialog::clearUnitTests()
|
||||
{
|
||||
this->comboTests->clear();
|
||||
ui->comboTests->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -276,7 +278,7 @@ void UnitTestDialog::clearUnitTests()
|
||||
*/
|
||||
QString UnitTestDialog::getUnitTest() const
|
||||
{
|
||||
return this->comboTests->currentText();
|
||||
return ui->comboTests->currentText();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -284,7 +286,7 @@ QString UnitTestDialog::getUnitTest() const
|
||||
*/
|
||||
void UnitTestDialog::setStatusText(const QString& text)
|
||||
{
|
||||
this->textLabelStatus->setText(text);
|
||||
ui->textLabelStatus->setText(text);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -295,14 +297,14 @@ void UnitTestDialog::setStatusText(const QString& text)
|
||||
void UnitTestDialog::setProgressFraction(float fraction, const QString& color)
|
||||
{
|
||||
if (fraction==0.0f) {
|
||||
this->progressBar->setRange(0, 100);
|
||||
ui->progressBar->setRange(0, 100);
|
||||
}
|
||||
else {
|
||||
if (color == QLatin1String("red")) {
|
||||
setProgressColor(Qt::red);
|
||||
}
|
||||
|
||||
this->progressBar->setValue((int)(100*fraction));
|
||||
ui->progressBar->setValue((int)(100*fraction));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +313,7 @@ void UnitTestDialog::setProgressFraction(float fraction, const QString& color)
|
||||
*/
|
||||
void UnitTestDialog::clearErrorList()
|
||||
{
|
||||
this->treeViewFailure->clear();
|
||||
ui->treeViewFailure->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -320,7 +322,7 @@ void UnitTestDialog::clearErrorList()
|
||||
*/
|
||||
void UnitTestDialog::insertError(const QString& failure, const QString& details)
|
||||
{
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem(treeViewFailure);
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem(ui->treeViewFailure);
|
||||
item->setText(0,failure);
|
||||
item->setTextColor(0, Qt::red);
|
||||
item->setData(0, Qt::UserRole, QVariant(details));
|
||||
@@ -331,7 +333,7 @@ void UnitTestDialog::insertError(const QString& failure, const QString& details)
|
||||
*/
|
||||
void UnitTestDialog::setRunCount(int ct)
|
||||
{
|
||||
this->textLabelRunCt->setText(QString::fromLatin1("<font color=\"#0000ff\">%1</font>").arg(ct));
|
||||
ui->textLabelRunCt->setText(QString::fromLatin1("<font color=\"#0000ff\">%1</font>").arg(ct));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -339,7 +341,7 @@ void UnitTestDialog::setRunCount(int ct)
|
||||
*/
|
||||
void UnitTestDialog::setFailCount(int ct)
|
||||
{
|
||||
this->textLabelFailCt->setText(QString::fromLatin1("<font color=\"#0000ff\">%1</font>").arg(ct));
|
||||
ui->textLabelFailCt->setText(QString::fromLatin1("<font color=\"#0000ff\">%1</font>").arg(ct));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,7 +349,7 @@ void UnitTestDialog::setFailCount(int ct)
|
||||
*/
|
||||
void UnitTestDialog::setErrorCount(int ct)
|
||||
{
|
||||
this->textLabelErrCt->setText(QString::fromLatin1("<font color=\"#0000ff\">%1</font>").arg(ct));
|
||||
ui->textLabelErrCt->setText(QString::fromLatin1("<font color=\"#0000ff\">%1</font>").arg(ct));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -355,7 +357,7 @@ void UnitTestDialog::setErrorCount(int ct)
|
||||
*/
|
||||
void UnitTestDialog::setRemainCount(int ct)
|
||||
{
|
||||
this->textLabelRemCt->setText(QString::fromLatin1("<font color=\"#0000ff\">%1</font>").arg(ct));
|
||||
ui->textLabelRemCt->setText(QString::fromLatin1("<font color=\"#0000ff\">%1</font>").arg(ct));
|
||||
}
|
||||
|
||||
#include "moc_UnitTestImp.cpp"
|
||||
|
||||
@@ -24,13 +24,17 @@
|
||||
#ifndef TESTGUI_UNITTESTIMP_H
|
||||
#define TESTGUI_UNITTESTIMP_H
|
||||
|
||||
#include "ui_UnitTest.h"
|
||||
#include <QDialog>
|
||||
#include <memory>
|
||||
|
||||
#include <Base/PyObjectBase.h>
|
||||
|
||||
namespace TestGui {
|
||||
class QTreeWidgetItem;
|
||||
|
||||
class UnitTestDialog : public QDialog, public Ui_UnitTest
|
||||
namespace TestGui {
|
||||
class Ui_UnitTest;
|
||||
|
||||
class UnitTestDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -67,6 +71,7 @@ public Q_SLOTS:
|
||||
void on_startButton_clicked();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_UnitTest> ui;
|
||||
static UnitTestDialog* _instance;
|
||||
};
|
||||
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <QApplication>
|
||||
# include <QEventLoop>
|
||||
#endif
|
||||
|
||||
#include <Base/PyObjectBase.h>
|
||||
#include <Base/Exception.h>
|
||||
|
||||
Reference in New Issue
Block a user