From 1d99057052c82b88764a83f575b7c94409aeb34f Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Fri, 24 Jul 2015 16:08:47 -0700 Subject: [PATCH] Debug printouts in tests. --- tests/rig/src/RigTests.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/rig/src/RigTests.cpp b/tests/rig/src/RigTests.cpp index c5622ac501..74047c0162 100644 --- a/tests/rig/src/RigTests.cpp +++ b/tests/rig/src/RigTests.cpp @@ -104,10 +104,24 @@ void reportJoint(int index, JointState joint) { // Handy for debugging std::cout << " rot:" << safeEulerAngles(joint.getRotation()) << "/" << safeEulerAngles(joint.getRotationInParentFrame()) << "/" << safeEulerAngles(joint.getRotationInBindFrame()) << "\n"; std::cout << "\n"; } - -void RigTests::initialPoseArmsDown() { - for (int i = 0; i < _rig->getJointStateCount(); i++) { - JointState joint = _rig->getJointState(i); +void reportByName(RigPointer rig, const QString& name) { + int jointIndex = rig->indexOfJoint(name); + reportJoint(jointIndex, rig->getJointState(jointIndex)); +} +void reportAll(RigPointer rig) { + for (int i = 0; i < rig->getJointStateCount(); i++) { + JointState joint = rig->getJointState(i); reportJoint(i, joint); } } +void reportSome(RigPointer rig) { + QString names[] = {"Head", "Neck", "RightShoulder", "RightArm", "RightForeArm", "RightHand", "Spine2", "Spine1", "Spine", "Hips", "RightUpLeg", "RightLeg", "RightFoot", "RightToeBase", "RightToe_End"}; + for (auto name : names) { + reportByName(rig, name); + } +} + +void RigTests::initialPoseArmsDown() { + //reportAll(_rig); + reportSome(_rig); +}