// 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 <OgnTestGatherDatabase.h>
#include <cmath>
#include <vector>

using carb::Double3;

namespace omni
{
namespace graph
{
namespace examples
{

class OgnTestGather
{
public:
    
    static bool compute(OgnTestGatherDatabase& db)
    {
        // This is a temporary node in place to test performance.  It serves no real purpose
        static bool firstTime = true;
        if (firstTime)
        {
            auto inputNameToken = db.inputs.base_name();
            auto inputNumInstance = db.inputs.num_instances();
            std::string inputNameStr = db.tokenToString(inputNameToken);

            db.outputs.rotations.resize(inputNumInstance);
            auto& outputRotations = db.outputs.rotations();
            for (auto& rotation : outputRotations)
            {
                rotation[0] = 7;
                rotation[1] = 8;
                rotation[2] = 9;
            }

            db.outputs.gathered_paths.resize(2);
            auto& outputPaths = db.outputs.gathered_paths();

            std::string str0 = "foo";
            outputPaths[0] = db.stringToToken(str0.c_str());

            std::string str1 = "bar";
            outputPaths[1] = db.stringToToken(str1.c_str());

            printf("input base name =%s\n", inputNameStr.c_str());
            firstTime = false;
        }
		

        return true;
    }
    
};

REGISTER_OGN_NODE()

}
}
}
