History

Rename HFMGeometry to HFMModel and adjust related variables

sabrina-shanman committed 8 years ago

Commit cbca77b1 parent 643026a46 files · +550 −550Browse files

Showing the changes to interface/src/ModelPropertiesDialog.cpp (1 of 46 files). Show all

Unified · Split

interface/src/ModelPropertiesDialog.cpp+10−10
@@ -27,11 +27,11 @@ · 26 unmodified lines
2727
2828
2929 ModelPropertiesDialog::ModelPropertiesDialog(FSTReader::ModelType modelType, const QVariantHash& originalMapping,
30− const QString& basePath, const HFMGeometry& geometry) :
30+ const QString& basePath, const HFMModel& model) :
3131 _modelType(modelType),
3232 _originalMapping(originalMapping),
3333 _basePath(basePath),
34−_geometry(geometry)
34+_model(model)
3535 {
3636 setWindowTitle("Set Model Properties");
3737
@@ -108,8 +108,8 @@ QVariantHash ModelPropertiesDialog::getMapping() const { · 70 unmodified lines
108108
109109 // update the joint indices
110110 QVariantHash jointIndices;
111− for (int i = 0; i < _geometry.joints.size(); i++) {
112− jointIndices.insert(_geometry.joints.at(i).name, QString::number(i));
111+ for (int i = 0; i < _model.joints.size(); i++) {
112+ jointIndices.insert(_model.joints.at(i).name, QString::number(i));
113113 }
114114 mapping.insert(JOINT_INDEX_FIELD, jointIndices);
115115
@@ -118,10 +118,10 @@ QVariantHash ModelPropertiesDialog::getMapping() const { · 2 unmodified lines
118118 if (_modelType == FSTReader::ATTACHMENT_MODEL) {
119119 glm::vec3 pivot;
120120 if (_pivotAboutCenter->isChecked()) {
121− pivot = (_geometry.meshExtents.minimum + _geometry.meshExtents.maximum) * 0.5f;
121+ pivot = (_model.meshExtents.minimum + _model.meshExtents.maximum) * 0.5f;
122122
123123 } 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);
125125 }
126126 mapping.insert(TRANSLATION_X_FIELD, -pivot.x * (float)_scale->value() + (float)_translationX->value());
127127 mapping.insert(TRANSLATION_Y_FIELD, -pivot.y * (float)_scale->value() + (float)_translationY->value());
@@ -191,7 +191,7 @@ void ModelPropertiesDialog::reset() { · 63 unmodified lines
191191 }
192192 foreach (const QVariant& joint, _originalMapping.values(FREE_JOINT_FIELD)) {
193193 QString jointName = joint.toString();
194− if (_geometry.jointIndices.contains(jointName)) {
194+ if (_model.jointIndices.contains(jointName)) {
195195 createNewFreeJoint(jointName);
196196 }
197197 }
@@ -249,8 +249,8 @@ QComboBox* ModelPropertiesDialog::createJointBox(bool withNone) const { · 51 unmodified lines
249249 if (withNone) {
250250 box->addItem("(none)");
251251 }
252− foreach (const HFMJoint& joint, _geometry.joints) {
253− if (joint.isSkeletonJoint || !_geometry.hasSkeletonJoints) {
252+ foreach (const HFMJoint& joint, _model.joints) {
253+ if (joint.isSkeletonJoint || !_model.hasSkeletonJoints) {
254254 box->addItem(joint.name);
255255 }
256256 }
@@ -266,7 +266,7 @@ QDoubleSpinBox* ModelPropertiesDialog::createTranslationBox() const { · 9 unmodified lines
266266 }
267267
268268 void ModelPropertiesDialog::insertJointMapping(QVariantHash& joints, const QString& joint, const QString& name) const {
269− if (_geometry.jointIndices.contains(name)) {
269+ if (_model.jointIndices.contains(name)) {
270270 joints.insert(joint, name);
271271 } else {
272272 joints.remove(joint);