Showing the changes to interface/src/ModelPropertiesDialog.cpp (1 of 46 files). Show all
Unified · Split
| @@ -27,11 +27,11 @@ · 26 unmodified lines | |||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | ModelPropertiesDialog::ModelPropertiesDialog(FSTReader::ModelType modelType, const QVariantHash& originalMapping, | 29 | ModelPropertiesDialog::ModelPropertiesDialog(FSTReader::ModelType modelType, const QVariantHash& originalMapping, |
| 30 | const QString& basePath, const HFMGeometry& geometry) : | 30 | const QString& basePath, const HFMModel& model) : |
| 31 | _modelType(modelType), | 31 | _modelType(modelType), |
| 32 | _originalMapping(originalMapping), | 32 | _originalMapping(originalMapping), |
| 33 | _basePath(basePath), | 33 | _basePath(basePath), |
| 34 | _geometry(geometry) | 34 | _model(model) |
| 35 | { | 35 | { |
| 36 | setWindowTitle("Set Model Properties"); | 36 | setWindowTitle("Set Model Properties"); |
| 37 | 37 | ||
| @@ -108,8 +108,8 @@ QVariantHash ModelPropertiesDialog::getMapping() const { · 70 unmodified lines | |||
| 108 | 108 | ||
| 109 | // update the joint indices | 109 | // update the joint indices |
| 110 | QVariantHash jointIndices; | 110 | QVariantHash jointIndices; |
| 111 | for (int i = 0; i < _geometry.joints.size(); i++) { | 111 | for (int i = 0; i < _model.joints.size(); i++) { |
| 112 | jointIndices.insert(_geometry.joints.at(i).name, QString::number(i)); | 112 | jointIndices.insert(_model.joints.at(i).name, QString::number(i)); |
| 113 | } | 113 | } |
| 114 | mapping.insert(JOINT_INDEX_FIELD, jointIndices); | 114 | mapping.insert(JOINT_INDEX_FIELD, jointIndices); |
| 115 | 115 | ||
| @@ -118,10 +118,10 @@ QVariantHash ModelPropertiesDialog::getMapping() const { · 2 unmodified lines | |||
| 118 | if (_modelType == FSTReader::ATTACHMENT_MODEL) { | 118 | if (_modelType == FSTReader::ATTACHMENT_MODEL) { |
| 119 | glm::vec3 pivot; | 119 | glm::vec3 pivot; |
| 120 | if (_pivotAboutCenter->isChecked()) { | 120 | if (_pivotAboutCenter->isChecked()) { |
| 121 | pivot = (_geometry.meshExtents.minimum + _geometry.meshExtents.maximum) * 0.5f; | 121 | pivot = (_model.meshExtents.minimum + _model.meshExtents.maximum) * 0.5f; |
| 122 | 122 | ||
| 123 | } else if (_pivotJoint->currentIndex() != 0) { | 123 | } else if (_pivotJoint->currentIndex() != 0) { |
| 124 | pivot = extractTranslation(_geometry.joints.at(_pivotJoint->currentIndex() - 1).transform); | 124 | pivot = extractTranslation(_model.joints.at(_pivotJoint->currentIndex() - 1).transform); |
| 125 | } | 125 | } |
| 126 | mapping.insert(TRANSLATION_X_FIELD, -pivot.x * (float)_scale->value() + (float)_translationX->value()); | 126 | mapping.insert(TRANSLATION_X_FIELD, -pivot.x * (float)_scale->value() + (float)_translationX->value()); |
| 127 | mapping.insert(TRANSLATION_Y_FIELD, -pivot.y * (float)_scale->value() + (float)_translationY->value()); | 127 | mapping.insert(TRANSLATION_Y_FIELD, -pivot.y * (float)_scale->value() + (float)_translationY->value()); |
| @@ -191,7 +191,7 @@ void ModelPropertiesDialog::reset() { · 63 unmodified lines | |||
| 191 | } | 191 | } |
| 192 | foreach (const QVariant& joint, _originalMapping.values(FREE_JOINT_FIELD)) { | 192 | foreach (const QVariant& joint, _originalMapping.values(FREE_JOINT_FIELD)) { |
| 193 | QString jointName = joint.toString(); | 193 | QString jointName = joint.toString(); |
| 194 | if (_geometry.jointIndices.contains(jointName)) { | 194 | if (_model.jointIndices.contains(jointName)) { |
| 195 | createNewFreeJoint(jointName); | 195 | createNewFreeJoint(jointName); |
| 196 | } | 196 | } |
| 197 | } | 197 | } |
| @@ -249,8 +249,8 @@ QComboBox* ModelPropertiesDialog::createJointBox(bool withNone) const { · 51 unmodified lines | |||
| 249 | if (withNone) { | 249 | if (withNone) { |
| 250 | box->addItem("(none)"); | 250 | box->addItem("(none)"); |
| 251 | } | 251 | } |
| 252 | foreach (const HFMJoint& joint, _geometry.joints) { | 252 | foreach (const HFMJoint& joint, _model.joints) { |
| 253 | if (joint.isSkeletonJoint || !_geometry.hasSkeletonJoints) { | 253 | if (joint.isSkeletonJoint || !_model.hasSkeletonJoints) { |
| 254 | box->addItem(joint.name); | 254 | box->addItem(joint.name); |
| 255 | } | 255 | } |
| 256 | } | 256 | } |
| @@ -266,7 +266,7 @@ QDoubleSpinBox* ModelPropertiesDialog::createTranslationBox() const { · 9 unmodified lines | |||
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | void ModelPropertiesDialog::insertJointMapping(QVariantHash& joints, const QString& joint, const QString& name) const { | 268 | void ModelPropertiesDialog::insertJointMapping(QVariantHash& joints, const QString& joint, const QString& name) const { |
| 269 | if (_geometry.jointIndices.contains(name)) { | 269 | if (_model.jointIndices.contains(name)) { |
| 270 | joints.insert(joint, name); | 270 | joints.insert(joint, name); |
| 271 | } else { | 271 | } else { |
| 272 | joints.remove(joint); | 272 | joints.remove(joint); |