WRAP_CLASS("itk::FastMarchingUpwindGradientImageFilter")

  WRAP_IMAGE_FILTER_REAL(2)

  # General fast marching
  BEGIN_MANAGED_PROPERTY("AlivePoints" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the list of Alive Points representing the initial front.")
    SET(MANAGED_PROPERTY_TYPE      "array< itkLevelSetNode^ >^")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedLevelSetNodeContainer<NativeType::NodeType::PixelType, NativeType::NodeType::SetDimension>( m_PointerToNative->GetAlivePoints() );")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetAlivePoints( itk::ManagedTypes::ToNativeLevelSetNodeContainer<NativeType::NodeType::PixelType, NativeType::NodeType::SetDimension>(value) );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("TrialPoints" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the list of Trial Points representing the initial front.")
    SET(MANAGED_PROPERTY_TYPE      "array< itkLevelSetNode^ >^")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedLevelSetNodeContainer<NativeType::NodeType::PixelType, NativeType::NodeType::SetDimension>( m_PointerToNative->GetTrialPoints() );")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetTrialPoints( itk::ManagedTypes::ToNativeLevelSetNodeContainer<NativeType::NodeType::PixelType, NativeType::NodeType::SetDimension>(value) );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("SpeedConstant" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the Speed Constant. If the Speed Image is NULL, the SpeedConstant value is used for the whole level set. By default, the SpeedConstant is set to 1.0.")
    SET(MANAGED_PROPERTY_TYPE      "double")
    SET(MANAGED_PROPERTY_GET_BODY  "return m_PointerToNative->GetSpeedConstant();")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetSpeedConstant( value );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("NormalizationFactor" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the Normalization Factor for the Speed Image. The values in the Speed Image is divided by this factor. This allows the use of images with integer pixel types to represent the speed.")
    SET(MANAGED_PROPERTY_TYPE      "double")
    SET(MANAGED_PROPERTY_GET_BODY  "return m_PointerToNative->GetNormalizationFactor();")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetNormalizationFactor( value );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("StoppingValue" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the algorithm Stopping Value. The algorithm is terminated when the value of the smallest trial point is greater than the stopping value.")
    SET(MANAGED_PROPERTY_TYPE      "double")
    SET(MANAGED_PROPERTY_GET_BODY  "return m_PointerToNative->GetStoppingValue();")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetStoppingValue( value );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("CollectPoints" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set if the algorithm should collect a container of all nodes which it has visited. Useful for creating Narrowbands for level set algorithms that supports narrow banding.")
    SET(MANAGED_PROPERTY_TYPE      "bool")
    SET(MANAGED_PROPERTY_GET_BODY  "return m_PointerToNative->GetCollectPoints();")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetCollectPoints( value );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("ProcessedPoints" GET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the list of Processed Points, useful for creating Narrowbands.")
    SET(MANAGED_PROPERTY_TYPE      "array< itkLevelSetNode^ >^")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedLevelSetNodeContainer<NativeType::NodeType::PixelType, NativeType::NodeType::SetDimension>( m_PointerToNative->GetProcessedPoints() );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("OverrideOutputInformation" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set if the given output information is used or copied from the input speed image.")
    SET(MANAGED_PROPERTY_TYPE      "bool")
    SET(MANAGED_PROPERTY_GET_BODY  "return m_PointerToNative->GetOverrideOutputInformation();")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetOverrideOutputInformation( value );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("OutputSize" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the size of the output levelset image.")
    SET(MANAGED_PROPERTY_TYPE      "itkSize^")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedSize<NativeType::LevelSetImageType::ImageDimension>( m_PointerToNative->GetOutputSize() );")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetOutputSize(itk::ManagedTypes::ToNativeSize<NativeType::LevelSetImageType::ImageDimension>( value ));")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("OutputSpacing" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the spacing of the output levelset image.")
    SET(MANAGED_PROPERTY_TYPE      "itkSpacing^")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedSpacing<NativeType::LevelSetImageType::ImageDimension>(m_PointerToNative->GetOutputSpacing());")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetOutputSpacing(itk::ManagedTypes::ToNativeSpacing<NativeType::LevelSetImageType::ImageDimension>( value ));")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("OutputOrigin" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the origin of the output levelset image.")
    SET(MANAGED_PROPERTY_TYPE      "itkPoint^")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedPoint<NativeType::LevelSetImageType::ImageDimension>(m_PointerToNative->GetOutputOrigin());")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetOutputOrigin(itk::ManagedTypes::ToNativePoint<NativeType::LevelSetImageType::ImageDimension>( value ));")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("OutputRegion" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the largest possible region of the output levelset image.")
    SET(MANAGED_PROPERTY_TYPE      "itkImageRegion^")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedImageRegion<NativeType::LevelSetImageType::ImageDimension>( m_PointerToNative->GetOutputRegion() );")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetOutputRegion(itk::ManagedTypes::ToNativeImageRegion<NativeType::LevelSetImageType::ImageDimension>( value ));")
  END_MANAGED_PROPERTY()

  # Upwind gradient specific
  BEGIN_MANAGED_PROPERTY("GenerateGradientImage" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set whether the gradient of the Eikonal equation solution should be computed during the fast marching.")
    SET(MANAGED_PROPERTY_TYPE      "bool")
    SET(MANAGED_PROPERTY_GET_BODY  "return m_PointerToNative->GetGenerateGradientImage();")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetGenerateGradientImage( value );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("TargetOffset" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set how long (in terms of arrival times) after targets are reached the front must stop. This is useful to ensure that the level set of target arrival time is smooth.")
    SET(MANAGED_PROPERTY_TYPE      "double")
    SET(MANAGED_PROPERTY_GET_BODY  "return m_PointerToNative->GetTargetOffset();")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetTargetOffset( value );")
  END_MANAGED_PROPERTY()

  SET(body "")
  SET(body "${body}///<summary>A managed enumerated type for the target reached mode.</summary>\n")
  SET(body "${body}\tpublic enum class TargetReachedModeEnum\n")
  SET(body "${body}\t{\n")
  SET(body "${body}\t\tNoTargets = 0,\n")
  SET(body "${body}\t\tOneTarget,\n")
  SET(body "${body}\t\tSomeTargets,\n")
  SET(body "${body}\t\tAllTargets\n")
  SET(body "${body}\t};\n")
  SET(MANAGED_EXTRA_WRAPPER_CONFIG ${body})

  BEGIN_MANAGED_PROPERTY("TargetReachedMode" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set whether the front must stop when the first target has been reached, or some/all targets have been reached.")
    SET(MANAGED_PROPERTY_TYPE      "TargetReachedModeEnum")
    SET(MANAGED_PROPERTY_GET_BODY  "return (TargetReachedModeEnum)m_PointerToNative->GetTargetReachedMode();")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetTargetReachedMode( (int)value );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_METHOD("SetTargetReachedModeToNoTargets")
    SET(MANAGED_METHOD_SUMMARY         "Set the TargetReachedMode to NoTargets.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "void")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetTargetReachedModeToNoTargets( );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetTargetReachedModeToNoTargets( );")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("SetTargetReachedModeToOneTarget")
    SET(MANAGED_METHOD_SUMMARY         "Set the TargetReachedMode to OneTarget.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "void")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetTargetReachedModeToOneTarget( );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetTargetReachedModeToOneTarget( );")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("SetTargetReachedModeToSomeTargets")
    SET(MANAGED_METHOD_SUMMARY         "Set the TargetReachedMode to SomeTargets.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "long numberOfTargets")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetTargetReachedModeToSomeTargets( numberOfTargets );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetTargetReachedModeToSomeTargets( numberOfTargets );")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("SetTargetReachedModeToAllTargets")
    SET(MANAGED_METHOD_SUMMARY         "Set the TargetReachedMode to AllTargets.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "void")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetTargetReachedModeToAllTargets( );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetTargetReachedModeToAllTargets( );")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_PROPERTY("NumberOfTargets" GET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get the number of targets. Only valid after the filter has been updated.")
    SET(MANAGED_PROPERTY_TYPE      "long")
    SET(MANAGED_PROPERTY_GET_BODY  "return m_PointerToNative->GetNumberOfTargets();")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("TargetValue" GET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get the arrival time corresponding to the last reached target. Only valid after the filter has been updated.")
    SET(MANAGED_PROPERTY_TYPE      "double")
    SET(MANAGED_PROPERTY_GET_BODY  "return m_PointerToNative->GetTargetValue();")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("TargetPoints" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the list of Target Points. If a target point is reached, the propagation stops.")
    SET(MANAGED_PROPERTY_TYPE      "array< itkLevelSetNode^ >^")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedLevelSetNodeContainer<NativeType::NodeType::PixelType, NativeType::NodeType::SetDimension>( m_PointerToNative->GetTargetPoints() );")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetTargetPoints( itk::ManagedTypes::ToNativeLevelSetNodeContainer<NativeType::NodeType::PixelType, NativeType::NodeType::SetDimension>(value) );")
  END_MANAGED_PROPERTY()

END_WRAP_CLASS()

