///
/// JHybridFaceSpec.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#include "JHybridFaceSpec.hpp"

// Forward declaration of `Landmarks` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { struct Landmarks; }
// Forward declaration of `Point` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { struct Point; }
// Forward declaration of `Contours` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { struct Contours; }
// Forward declaration of `Bounds` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { struct Bounds; }

#include "Landmarks.hpp"
#include <optional>
#include "JLandmarks.hpp"
#include "Point.hpp"
#include "JPoint.hpp"
#include "Contours.hpp"
#include "JContours.hpp"
#include <vector>
#include "Bounds.hpp"
#include "JBounds.hpp"

namespace margelo::nitro::camera::facedetector {

  std::shared_ptr<JHybridFaceSpec> JHybridFaceSpec::JavaPart::getJHybridFaceSpec() {
    auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
    auto castHybridObject = std::dynamic_pointer_cast<JHybridFaceSpec>(hybridObject);
    if (castHybridObject == nullptr) [[unlikely]] {
      throw std::runtime_error("Failed to downcast JHybridObject to JHybridFaceSpec!");
    }
    return castHybridObject;
  }

  jni::local_ref<JHybridFaceSpec::CxxPart::jhybriddata> JHybridFaceSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
    return makeCxxInstance(jThis);
  }

  std::shared_ptr<JHybridObject> JHybridFaceSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
    auto castJavaPart = jni::dynamic_ref_cast<JHybridFaceSpec::JavaPart>(javaPart);
    if (castJavaPart == nullptr) [[unlikely]] {
      throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridFaceSpec::JavaPart!");
    }
    return std::make_shared<JHybridFaceSpec>(castJavaPart);
  }

  void JHybridFaceSpec::CxxPart::registerNatives() {
    registerHybrid({
      makeNativeMethod("initHybrid", JHybridFaceSpec::CxxPart::initHybrid),
    });
  }

  // Properties
  std::optional<Landmarks> JHybridFaceSpec::getLandmarks() {
    static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JLandmarks>()>("getLandmarks");
    auto __result = method(_javaPart);
    return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
  }
  std::optional<Contours> JHybridFaceSpec::getContours() {
    static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JContours>()>("getContours");
    auto __result = method(_javaPart);
    return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
  }
  Bounds JHybridFaceSpec::getBounds() {
    static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JBounds>()>("getBounds");
    auto __result = method(_javaPart);
    return __result->toCpp();
  }
  std::optional<double> JHybridFaceSpec::getLeftEyeOpenProbability() {
    static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getLeftEyeOpenProbability");
    auto __result = method(_javaPart);
    return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
  }
  std::optional<double> JHybridFaceSpec::getRightEyeOpenProbability() {
    static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getRightEyeOpenProbability");
    auto __result = method(_javaPart);
    return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
  }
  std::optional<double> JHybridFaceSpec::getSmilingProbability() {
    static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getSmilingProbability");
    auto __result = method(_javaPart);
    return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
  }
  std::optional<double> JHybridFaceSpec::getTrackingId() {
    static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getTrackingId");
    auto __result = method(_javaPart);
    return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
  }
  double JHybridFaceSpec::getPitchAngle() {
    static const auto method = _javaPart->javaClassStatic()->getMethod<double()>("getPitchAngle");
    auto __result = method(_javaPart);
    return __result;
  }
  double JHybridFaceSpec::getRollAngle() {
    static const auto method = _javaPart->javaClassStatic()->getMethod<double()>("getRollAngle");
    auto __result = method(_javaPart);
    return __result;
  }
  double JHybridFaceSpec::getYawAngle() {
    static const auto method = _javaPart->javaClassStatic()->getMethod<double()>("getYawAngle");
    auto __result = method(_javaPart);
    return __result;
  }

  // Methods
  

} // namespace margelo::nitro::camera::facedetector
