// Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto.  Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//

#include <OgnTestScatterDatabase.h>
#include <cmath>
#include <vector>

using carb::Double3;

namespace omni
{
namespace graph
{
namespace examples
{

class OgnTestScatter
{
public:
    
    static bool compute(OgnTestScatterDatabase& db)
    {
        /*
        const auto& gatheredPaths = db.inputs.gathered_paths();
        for (const auto& gatheredPath : gatheredPaths)
        {
            std::string gatheredPathStr = db.tokenToString(gatheredPath);
            printf("gather path = %s\n", gatheredPathStr.c_str());
        }*/

        const auto& inputRotations = db.inputs.rotations();
        int count = 0;
        for (const auto& inputRotation : inputRotations)
        {
            // Pretend scan the inputs.  The real scatter node would be writing to the Fabric here with the updated
            // transforms.
            count++;
        }

        // Because we don't have the real scatter node yet, we'll just pluck one element of the calculated rotations
        // and output there in a temporary single output.
        auto& singleRot = db.outputs.single_rotation();
        if (inputRotations.size() > 0)
        {
            singleRot[0] = -90;
            singleRot[1] = inputRotations[0][1];
            singleRot[2] = 0;
        }

		

        return true;
    }
    
};

REGISTER_OGN_NODE()

}
}
}
