// Copyright (C) 2019 by Joseph Mirabel, LAAS-CNRS.
//
// This file is part of the hpp-corbaserver.
//
// This software is provided "as is" without warranty of any kind,
// either expressed or implied, including but not limited to the
// implied warranties of fitness for a particular purpose.
//
// See the COPYING file for more information.

#ifndef HPP_CORE_STEERING_METHODS_IDL
#define HPP_CORE_STEERING_METHODS_IDL
#include <hpp/common.idl>

#include <hpp/core_idl/paths.idl>
#include <hpp/core_idl/_constraints.idl>

module hpp
{
  module core_idl {

  interface SteeringMethod
  {
    HPP_EXPOSE_MEMORY_DEALLOCATION(Error)

    Path call (in floatSeq q1, in floatSeq q2) raises (Error);
    //-> operator()

    void setConstraints (in ConstraintSet constraints) raises (Error);
    //-> constraints

    // The return type should be ConstraintSet. At the moment, this causes a bug
    // because because the implementation does not know this inherits from Constraint
    Constraint getConstraints () raises (Error);
    //-> constraints
  }; // interface SteeringMethod

  module steeringMethod_idl {

    interface SplineBernstein3 : SteeringMethod {
      Path steer(in floatSeq q1, in intSeq order1, in floatSeqSeq derivatives1,
                 in floatSeq q2, in intSeq order2, in floatSeqSeq derivatives2,
                 in float length)
        raises (Error);

      Path steerSE3(in floatSeq q1, in intSeq order1, in floatSeqSeq derivatives1,
                    in floatSeq q2, in intSeq order2, in floatSeqSeq derivatives2,
                    in float length)
        raises (Error);
      //*    hpp::core::vector_t _q1 = hpp::corbaServer::floatSeqToVector (q1);
      //*    std::vector<int> _order1 = hpp::corbaServer::intSeqToVector (order1);
      //*    hpp::core::matrix_t _derivatives1 = hpp::corbaServer::floatSeqSeqToMatrix (derivatives1);
      //*    hpp::core::vector_t _q2 = hpp::corbaServer::floatSeqToVector (q2);
      //*    std::vector<int> _order2 = hpp::corbaServer::intSeqToVector (order2);
      //*    hpp::core::matrix_t _derivatives2 = hpp::corbaServer::floatSeqSeqToMatrix (derivatives2);
      //*    hpp::core::PathPtr_t __return__ (getT()->steer (_q1, _order1, _derivatives1, _q2, _order2, _derivatives2, length, true));
      //*
      //*    return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Path,hpp::core_impl::Path>(server_, __return__)._retn();

    };

    interface SplineBernstein5 : SteeringMethod {
      Path steer(in floatSeq q1, in intSeq order1, in floatSeqSeq derivatives1,
                 in floatSeq q2, in intSeq order2, in floatSeqSeq derivatives2,
                 in float length)
        raises (Error);

      Path steerSE3(in floatSeq q1, in intSeq order1, in floatSeqSeq derivatives1,
                    in floatSeq q2, in intSeq order2, in floatSeqSeq derivatives2,
                    in float length)
        raises (Error);
      //*    hpp::core::vector_t _q1 = hpp::corbaServer::floatSeqToVector (q1);
      //*    std::vector<int> _order1 = hpp::corbaServer::intSeqToVector (order1);
      //*    hpp::core::matrix_t _derivatives1 = hpp::corbaServer::floatSeqSeqToMatrix (derivatives1);
      //*    hpp::core::vector_t _q2 = hpp::corbaServer::floatSeqToVector (q2);
      //*    std::vector<int> _order2 = hpp::corbaServer::intSeqToVector (order2);
      //*    hpp::core::matrix_t _derivatives2 = hpp::corbaServer::floatSeqSeqToMatrix (derivatives2);
      //*    hpp::core::PathPtr_t __return__ (getT()->steer (_q1, _order1, _derivatives1, _q2, _order2, _derivatives2, length, true));
      //*
      //*    return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Path,hpp::core_impl::Path>(server_, __return__)._retn();
    };

  }; // module steeringMethod

  }; // module core
}; // module hpp
//* #include <hpp/corbaserver/steering-method.hh>
//* #include <hpp/core/steering-method.hh>
//* #include <hpp/core_idl/paths.hh>
//* #include <hpp/core_idl/_constraints.hh>

#endif // HPP_CORE_STEERING_METHODS_IDL
