Skip to content

Commit

Permalink
Address code quality warnings (2/N: typedef) (#18)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #18

Reviewed By: TuurStuyck

Differential Revision: D58827599

fbshipit-source-id: 5804f471be2e10676f241b53d0f2abcc68bb21a6
  • Loading branch information
jeongseok-meta authored and facebook-github-bot committed Jun 21, 2024
1 parent 2a8875a commit 9a43515
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion momentum/character/parameter_transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ std::tuple<ParameterTransformT<T>, ParameterLimits> subsetParameterTransform(
paramTransformNew.activeJointParams.setConstant(paramTransformOld.numJointParameters(), false);

// Remap the transformation.
typedef typename SparseRowMatrix<T>::Index IndexType;
using IndexType = typename SparseRowMatrix<T>::Index;
std::vector<Eigen::Triplet<T>> tripletsNew;
for (int k = 0; k < paramTransformOld.transform.outerSize(); ++k) {
for (typename SparseRowMatrix<T>::InnerIterator it(paramTransformOld.transform, k); it; ++it) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Eigen::VectorX<T> FullyDifferentiableStateErrorFunctionT<T>::d_gradient_d_input_
// Use automatic differentiation on the gradient function:
if (inputName == "targetPositionWeights") {
Eigen::VectorX<T> result = Eigen::VectorX<T>::Zero(this->skeleton_.joints.size());
typedef ceres::Jet<T, 1> JetType;
using JetType = ceres::Jet<T, 1>;
for (size_t iJoint = 0; iJoint < this->skeleton_.joints.size(); ++iJoint) {
result(iJoint) = calculateGradient_dot<JetType>(
state,
Expand All @@ -195,7 +195,7 @@ Eigen::VectorX<T> FullyDifferentiableStateErrorFunctionT<T>::d_gradient_d_input_
return result;
} else if (inputName == "targetRotationWeights") {
Eigen::VectorX<T> result = Eigen::VectorX<T>::Zero(this->skeleton_.joints.size());
typedef ceres::Jet<T, 1> JetType;
using JetType = ceres::Jet<T, 1>;
for (size_t iJoint = 0; iJoint < this->skeleton_.joints.size(); ++iJoint) {
result(iJoint) = calculateGradient_dot<JetType>(
state,
Expand All @@ -212,7 +212,7 @@ Eigen::VectorX<T> FullyDifferentiableStateErrorFunctionT<T>::d_gradient_d_input_
Eigen::VectorX<T> result = Eigen::VectorX<T>::Zero(8 * this->skeleton_.joints.size());
for (size_t iJoint = 0; iJoint < this->skeleton_.joints.size(); ++iJoint) {
{
typedef ceres::Jet<T, 3> JetType;
using JetType = ceres::Jet<T, 3>;
result.template segment<3>(8 * iJoint + 0) =
calculateGradient_dot<JetType>(
state,
Expand All @@ -225,7 +225,7 @@ Eigen::VectorX<T> FullyDifferentiableStateErrorFunctionT<T>::d_gradient_d_input_
.v;
}
{
typedef ceres::Jet<T, 4> JetType;
using JetType = ceres::Jet<T, 4>;
result.template segment<4>(8 * iJoint + 3) =
calculateGradient_dot<JetType>(
state,
Expand Down
10 changes: 5 additions & 5 deletions momentum/io/openfbx/openfbx_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ template <typename T>
Eigen::Quaternion<T> computeEulerRotation(
const Eigen::Matrix<T, 3, 1>& angles,
ofbx::RotationOrder order) {
typedef Eigen::Matrix<T, 3, 1> VecType;
typedef Eigen::Quaternion<T> QuaternionType;
using VecType = Eigen::Matrix<T, 3, 1>;
using QuaternionType = Eigen::Quaternion<T>;

if (order == ofbx::RotationOrder::SPHERIC_XYZ) {
// in the case of a ball-joint the 3 parameters are simply the xyz parameters of a quaternion
Expand Down Expand Up @@ -193,8 +193,8 @@ static double resolveDoubleProperty(const ofbx::Object& object, const char* name

template <typename VecArray, typename EltType>
VecArray extractPropertyArrayImp(const ofbx::IElementProperty* prop, const char* what) {
typedef typename VecArray::value_type VecType;
typedef typename VecType::Scalar Scalar;
using VecType = typename VecArray::value_type;
using Scalar = typename VecType::Scalar;

const auto nScalar = prop->getCount();
if (nScalar == 0) {
Expand Down Expand Up @@ -578,7 +578,7 @@ void parseSkinnedModel(
// The weights in the FBX file are stored by bone rather than by
// vertex; we will cache them all as (vertex, bone, weight) in
// this array and then sort it to get them in vertex order.
typedef std::tuple<size_t, size_t, double> VertexBoneWithWeight;
using VertexBoneWithWeight = std::tuple<size_t, size_t, double>;
std::vector<VertexBoneWithWeight> weights;
weights.reserve(2 * nVerts);

Expand Down

0 comments on commit 9a43515

Please sign in to comment.