From 12b0b74d43b7d93eee82ae6fa3dced499cd8a1f6 Mon Sep 17 00:00:00 2001 From: KT Date: Tue, 19 Oct 2021 14:03:28 -0500 Subject: Publish a4 --- dev/a4-dance/rotation_bounds.cc | 64 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 dev/a4-dance/rotation_bounds.cc (limited to 'dev/a4-dance/rotation_bounds.cc') diff --git a/dev/a4-dance/rotation_bounds.cc b/dev/a4-dance/rotation_bounds.cc new file mode 100644 index 0000000..a83b1ce --- /dev/null +++ b/dev/a4-dance/rotation_bounds.cc @@ -0,0 +1,64 @@ +#include "rotation_bounds.h" +#include + +RotationBounds::RotationBounds() { + dofRX = false; + dofRY = false; + dofRZ = false; + minRX = 0; + maxRX = 0; + minRY = 0; + maxRY = 0; + minRZ = 0; + maxRZ = 0; + dofs = 0; +} + +void RotationBounds::setdof(bool rx, bool ry, bool rz) { + dofRX = rx; + dofRY = ry; + dofRZ = rz; + dofs = rx + ry + rz; +} + +void RotationBounds::setR(int index, float min, float max) { + if (index > dofs) { + std::abort(); // Trying to set past the max index. + } + if (index == 0) { + if (dofRX) { + minRX = min; + maxRX = max; + } else if (dofRY) { + minRY = min; + maxRY = max; + } else if (dofRZ) { + minRZ = min; + maxRZ = max; + } else { + abort(); + } + } else if (index == 1) { + if (dofRX && dofRY) { + minRY = min; + maxRY = max; + } else if (dofRX && dofRZ) { + minRZ = min; + maxRZ = max; + } else if (dofRY && dofRZ) { + minRZ = min; + maxRZ = max; + } else { + abort(); + } + } else if (index == 2) { + if (dofRX && dofRY && dofRZ) { + minRZ = min; + maxRZ = max; + } else { + abort(); + } + } else { + abort(); + } +} \ No newline at end of file -- cgit v1.2.3