aboutsummaryrefslogtreecommitdiff
path: root/NvBlast/tools/ArtistTools/source/BlastPlugin/Window/FractureGeneralPanel.cpp
blob: 1f7068d118a65404c6a91a7532bccc9ae7632d43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "FractureGeneralPanel.h"
#include "ui_FractureGeneralPanel.h"
#include "ProjectParams.h"

FractureGeneralPanel::FractureGeneralPanel(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::FractureGeneralPanel)
{
    ui->setupUi(this);
}

FractureGeneralPanel::~FractureGeneralPanel()
{
    delete ui;
}

void FractureGeneralPanel::updateValues()
{
	BPPFractureGeneral& fractureGeneral = BlastProject::ins().getParams().fracture.general;

	ui->comboBoxFracturePreset->setCurrentIndex(fractureGeneral.fracturePreset);
	ui->comboBoxFractureType->setCurrentIndex(fractureGeneral.fractureType);
	ui->checkBoxAddDepth->setChecked(fractureGeneral.addDepth);
	ui->checkBoxPerChunk->setChecked(fractureGeneral.perChunk);
	ui->checkBoxNewMatID->setChecked(fractureGeneral.newMatID);
	ui->comboBoxApplyMaterial->setCurrentIndex(fractureGeneral.applyMaterial);
}

void FractureGeneralPanel::on_comboBoxFracturePreset_currentIndexChanged(int index)
{
	BPPFractureGeneral& fractureGeneral = BlastProject::ins().getParams().fracture.general;
	fractureGeneral.fracturePreset = index;
}

void FractureGeneralPanel::on_comboBoxFractureType_currentIndexChanged(int index)
{
	BPPFractureGeneral& fractureGeneral = BlastProject::ins().getParams().fracture.general;
	fractureGeneral.fractureType = index;
}

void FractureGeneralPanel::on_checkBoxAddDepth_stateChanged(int arg1)
{
	BPPFractureGeneral& fractureGeneral = BlastProject::ins().getParams().fracture.general;
	fractureGeneral.addDepth = (arg1 != 0 ? true : false);
}

void FractureGeneralPanel::on_checkBoxPerChunk_stateChanged(int arg1)
{
	BPPFractureGeneral& fractureGeneral = BlastProject::ins().getParams().fracture.general;
	fractureGeneral.perChunk = (arg1 != 0 ? true : false);
}

void FractureGeneralPanel::on_checkBoxNewMatID_stateChanged(int arg1)
{
	BPPFractureGeneral& fractureGeneral = BlastProject::ins().getParams().fracture.general;
	fractureGeneral.newMatID = (arg1 != 0 ? true:false);
}

void FractureGeneralPanel::on_comboBoxApplyMaterial_currentIndexChanged(int index)
{
	BPPFractureGeneral& fractureGeneral = BlastProject::ins().getParams().fracture.general;
	fractureGeneral.applyMaterial = index;
}