diff options
| author | Bryan Galdrikian <[email protected]> | 2017-02-24 09:32:20 -0800 |
|---|---|---|
| committer | Bryan Galdrikian <[email protected]> | 2017-02-24 09:32:20 -0800 |
| commit | e1bf674c16e3c8472b29574159c789cd3f0c64e0 (patch) | |
| tree | 9f0cfce09c71a2c27ff19589fcad6cd83504477c /tools/ArtistTools/source/BlastPlugin/Window/SupportPanel.cpp | |
| parent | first commit (diff) | |
| download | blast-e1bf674c16e3c8472b29574159c789cd3f0c64e0.tar.xz blast-e1bf674c16e3c8472b29574159c789cd3f0c64e0.zip | |
Updating to [email protected] and [email protected] with a new directory structure.
NvBlast folder is gone, files have been moved to top level directory. README is changed to reflect this.
Diffstat (limited to 'tools/ArtistTools/source/BlastPlugin/Window/SupportPanel.cpp')
| -rw-r--r-- | tools/ArtistTools/source/BlastPlugin/Window/SupportPanel.cpp | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/tools/ArtistTools/source/BlastPlugin/Window/SupportPanel.cpp b/tools/ArtistTools/source/BlastPlugin/Window/SupportPanel.cpp new file mode 100644 index 0000000..424dbb3 --- /dev/null +++ b/tools/ArtistTools/source/BlastPlugin/Window/SupportPanel.cpp @@ -0,0 +1,90 @@ +#include "SupportPanel.h" +#include "ui_SupportPanel.h" + +SupportPanel::SupportPanel(QWidget *parent) : + QWidget(parent), + ui(new Ui::SupportPanel) +{ + ui->setupUi(this); + + _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; + } +} |