aboutsummaryrefslogtreecommitdiff
path: root/tools/ArtistTools/source/BlastPlugin/Window/SupportPanel.cpp
blob: 556da33a844027ec17c0354a476bde29ed2aa842 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include "SupportPanel.h"
#include "ui_SupportPanel.h"

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

	//ui->labelHealthMask->setEnabled(false);
	//ui->comboBoxHealthMask->setEnabled(false);
	//ui->btnAddHealthMask->setEnabled(false);
	//ui->btnPen->setEnabled(false);
	//ui->btnRemove->setEnabled(false);

	_selectedBonds.clear();
}

SupportPanel::~SupportPanel()
{
    delete ui;

	_selectedBonds.clear();
}

void SupportPanel::updateValues()
{
	if (_selectedBonds.size() > 0)
	{
		BPPBond* bond = _selectedBonds[0];

		//ui->comboBoxHealthMask->clear();
		//ui->comboBoxHealthMask->addItem(bond->name.buf);
		ui->spinBoxBondStrength->setValue(bond->support.bondStrength);
		ui->checkBoxEnableJoint->setChecked(bond->support.enableJoint);
	}
	else
	{
		//ui->comboBoxHealthMask->clear();
		//ui->comboBoxHealthMask->addItem("None");
		ui->spinBoxBondStrength->setValue(1.0f);
		ui->checkBoxEnableJoint->setChecked(false);
	}
}

void SupportPanel::dataSelected(std::vector<BlastNode*> selections)
{
	_selectedBonds.clear();

	for (BlastNode* node : selections)
	{
		if (eBond == node->getType())
		{
			BPPBond* bond = static_cast<BPPBond*>(node->getData());
			_selectedBonds.push_back(bond);
		}
	}

	updateValues();
}

void SupportPanel::on_comboBoxHealthMask_currentIndexChanged(int index)
{

}

void SupportPanel::on_btnAddHealthMask_clicked()
{

}

void SupportPanel::on_btnPen_clicked()
{

}

void SupportPanel::on_btnRemove_clicked()
{

}

void SupportPanel::on_spinBoxBondStrength_valueChanged(double arg1)
{
	for (size_t i = 0; i < _selectedBonds.size(); ++i)
	{
		_selectedBonds[i]->support.bondStrength = arg1;
	}
}

void SupportPanel::on_checkBoxEnableJoint_stateChanged(int arg1)
{
	for (size_t i = 0; i < _selectedBonds.size(); ++i)
	{
		_selectedBonds[i]->support.enableJoint = arg1;
	}
}