Skip to content

Commit

Permalink
Adding more summary comments to MRTK3 types and members (microsoft#11622
Browse files Browse the repository at this point in the history
)

Adding more summary and remark comments to MRTK3 types and members
  • Loading branch information
AMollis authored Jun 15, 2023
1 parent 821f691 commit 7b76b2d
Show file tree
Hide file tree
Showing 34 changed files with 366 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Microsoft.MixedReality.Toolkit.Subsystems
{
/// <summary>
/// A subsystem that enables dictation.
/// A Unity subsystem that enables dictation.
/// </summary>
[Preserve]
public class DictationSubsystem :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class MRTKRayReticleVisual : BaseReticleVisual
private Vector3 reticleNormal;

/// <summary>
/// Determines whether a reticle should appear on all surfaces hit by the interactor or interactables only
/// Determines whether a reticle should appear on all surfaces hit by the interactor or interactables only.
/// </summary>
public ReticleVisibilitySettings VisibilitySettings
{
Expand Down Expand Up @@ -173,9 +173,20 @@ private void LocateTargetHitPoint(SelectEnterEventArgs args)
}
}

/// <summary>
/// An enumeration used to control when a <see cref="Microsoft.MixedReality.Toolkit.Input.MRTKRayReticleVisual">MRTKRayReticleVisual</see>
/// is visible.
/// </summary>
public enum ReticleVisibilitySettings
{
/// <summary>
/// The reticle is only visible when it intersects an interactable object.
/// </summary>
InteractablesOnly,

/// <summary>
/// The reticle is visible anytime it intersects with another object, regardless of it being interactable.
/// </summary>
AllValidSurfaces
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,18 @@ public ControllerAnchorPoint AnchorPoint
[Tooltip("The input action used to toggle between using the default or Secondary Handshape settings.")]
private InputActionReference toggleSecondaryHandshapes;

[Obsolete("Use ChangeNeutralHandshape instead")]
/// <summary>
/// The input action used to toggle between using the default or Secondary Handshape settings.
/// </summary>
/// <remarks>
/// This property is deprecated, use <see cref="ToggleSecondaryHandshapes"/> instead.
/// </remarks>
[Obsolete("This property is deprecated, use ToggleSecondaryHandshapes instead.")]
public InputActionReference ChangeNeutralPose => ToggleSecondaryHandshapes;

/// <summary>
/// The input action used to toggle between using the default or Secondary Handshape settings.
/// </summary>
public InputActionReference ToggleSecondaryHandshapes
{
get => toggleSecondaryHandshapes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// A configuration object for <see cref="Microsoft.MixedReality.Toolkit.Input.SyntheticHandsSubsystem">SyntheticHandsSubsystem</see>.
/// This class defines the Unity input actions that <see cref="Microsoft.MixedReality.Toolkit.Input.SyntheticHandsSubsystem">SyntheticHandsSubsystem</see>
/// uses when simulating articulated hands.
/// </summary>
[CreateAssetMenu(fileName = "MRTKSyntheticHandsConfig.asset", menuName = "MRTK/Subsystems/MRTK Synthetic Hands Config")]
public class SyntheticHandsConfig : BaseSubsystemConfig
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// A Unity subsystem that enables articulated hand simulation.
/// </summary>
[Preserve]
[MRTKSubsystem(
Name = "com.microsoft.mixedreality.synthhands",
Expand All @@ -25,6 +28,10 @@ namespace Microsoft.MixedReality.Toolkit.Input
public class SyntheticHandsSubsystem : HandsSubsystem
{
private SyntheticHandsProvider syntheticProvider;

/// <summary>
/// Get the subsystem provider for this object.
/// </summary>
private SyntheticHandsProvider SyntheticProvider
{
get
Expand Down Expand Up @@ -392,6 +399,10 @@ private static void MirrorJoint(ref HandJointPose pose)
}
}

/// <summary>
/// A subsystem provider for <see cref="SyntheticHandsSubsystem"/> that provides methods for getting and setting
/// the simulated hand poses, as well as methods for obtain hand joint poses.
/// </summary>
[Preserve]
class SyntheticHandsProvider : Provider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ namespace Microsoft.MixedReality.Toolkit.SpatialManipulation
{
/// <summary>
/// Component for setting the min/max scale values for ObjectManipulator
/// or BoundsControl
/// We're looking to rework this system in the future. These existing components will be deprecated then.
/// or BoundsControl.
/// </summary>
/// <remarks>
/// MRTK's constraint system might be redesigned in the near future. When
/// this occurs, the old constraint components will be deprecated.
/// </remarks>
public class FixedDistanceConstraint : TransformConstraint
{
#region Properties
Expand All @@ -27,6 +30,7 @@ public Transform ConstraintTransform
set => constraintTransform = value;
}

/// <inheritdoc />
public override TransformFlags ConstraintType => TransformFlags.Move;

private float distanceAtManipulationStart;
Expand All @@ -35,7 +39,7 @@ public Transform ConstraintTransform

#region MonoBehaviour Methods

public void Start()
private void Start()
{
EnsureConstraintTransform();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
namespace Microsoft.MixedReality.Toolkit.SpatialManipulation
{
/// <summary>
/// Component for fixing the rotation of a manipulated object relative to the user
/// We're looking to rework this system in the future. These existing components will be deprecated then.
/// Component for fixing the rotation of a manipulated object relative to the user.
/// </summary>
/// <remarks>
/// MRTK's constraint system might be redesigned in the near future. When
/// this occurs, the old constraint components will be deprecated.
/// </remarks>
public class FixedRotationToUserConstraint : TransformConstraint
{
#region Properties

/// <inheritdoc />
public override TransformFlags ConstraintType => TransformFlags.Rotate;

private Quaternion startObjectRotationCameraSpace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
namespace Microsoft.MixedReality.Toolkit.SpatialManipulation
{
/// <summary>
/// Component for fixing the rotation of a manipulated object relative to the world
/// We're looking to rework this system in the future. These existing components will be deprecated then.
/// Component for fixing the rotation of a manipulated object relative to the world.
/// </summary>
/// <remarks>
/// MRTK's constraint system might be redesigned in the near future. When
/// this occurs, the old constraint components will be deprecated.
/// </remarks>
public class FixedRotationToWorldConstraint : TransformConstraint
{
#region Properties

/// <inheritdoc />
public override TransformFlags ConstraintType => TransformFlags.Rotate;

#endregion Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ namespace Microsoft.MixedReality.Toolkit.SpatialManipulation
{
/// <summary>
/// Component for setting the min/max scale values for ObjectManipulator
/// or BoundsControl
/// We're looking to rework this system in the future. These existing components will be deprecated then.
/// or BoundsControl.
/// </summary>
/// <remarks>
/// MRTK's constraint system might be redesigned in the near future. When
/// this occurs, the old constraint components will be deprecated.
/// </remarks>
public class MaintainApparentSizeConstraint : TransformConstraint
{
#region Properties

private float initialDist;

/// <inheritdoc />
public override TransformFlags ConstraintType => TransformFlags.Scale;

#endregion Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ namespace Microsoft.MixedReality.Toolkit.SpatialManipulation
{
/// <summary>
/// Component for limiting the translation axes for ObjectManipulator
/// or BoundsControl
/// We're looking to rework this system in the future. These existing components will be deprecated then.
/// or BoundsControl.
/// </summary>
/// <remarks>
/// MRTK's constraint system might be redesigned in the near future. When
/// this occurs, the old constraint components will be deprecated.
/// </remarks>
public class MoveAxisConstraint : TransformConstraint
{
#region Properties
Expand Down Expand Up @@ -41,6 +44,7 @@ public bool UseLocalSpaceForConstraint
set => useLocalSpaceForConstraint = value;
}

/// <inheritdoc />
public override TransformFlags ConstraintType => TransformFlags.Move;

#endregion Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public int ExecutionPriority
/// </summary>
protected MixedRealityTransform InitialWorldPose;

/// <summary>
/// Get flags that describe the type of transformations this constraint applies to.
/// </summary>
public abstract TransformFlags ConstraintType { get; }

#endregion Properties
Expand Down
12 changes: 8 additions & 4 deletions com.microsoft.mrtk.uxcore/Button/BasicPressableButtonVisuals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
namespace Microsoft.MixedReality.Toolkit.UX
{
/// <summary>
/// A simple visuals script to provide a visual layer on top of
/// <see cref="PressableButton"/>.
/// A simple visuals script to provide a visual layer on top of a
/// <see cref="Microsoft.MixedReality.Toolkit.UX.PressableButton">PressableButton</see>.
/// </summary>
[RequireComponent(typeof(PressableButton))]
[ExecuteAlways]
Expand All @@ -17,23 +17,27 @@ public class BasicPressableButtonVisuals : MonoBehaviour
private PressableButton buttonState;

[SerializeField]
[Tooltip("The front plate object that will move with the button displacement.")]
private Transform movingVisuals;

/// <summary>
/// The "front plate" object that will move with the button displacement.
/// </summary>
public Transform MovingVisuals => movingVisuals;

protected void Awake()
private void Awake()
{
buttonState = GetComponent<PressableButton>();
}

protected void LateUpdate()
private void LateUpdate()
{
UpdateMovingVisualsPosition();
}

/// <summary>
/// Update the local position of the specified <see cref="MovingVisuals"/> transform.
/// </summary>
protected virtual void UpdateMovingVisualsPosition()
{
if (movingVisuals != null)
Expand Down
9 changes: 8 additions & 1 deletion com.microsoft.mrtk.uxcore/Button/PressableButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@ public class PressableButton : StatefulInteractable
public bool SmoothSelectedness { get => smoothSelectedness; set => smoothSelectedness = value; }

/// <summary>
/// Enum for defining space of plane distances.
/// An enumeration defining the coordinate space of plane distances.
/// </summary>
public enum SpaceMode
{
/// <summary>
/// The world coordinate space system should be used.
// </summary>
World,

/// <summary>
/// The button's local coordinate space system should be used.
// </summary>
Local
}

Expand Down
8 changes: 7 additions & 1 deletion com.microsoft.mrtk.uxcore/Dialog/Dialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ namespace Microsoft.MixedReality.Toolkit.UX
/// <summary>
/// The Dialog script hydrates and controls the various sub-components
/// of the dialog view.
/// </summary>
/// </summary>
/// <remarks>
/// Dialogs are typically spawned, pooled, and killed
/// by <see cref="Microsoft.MixedReality.Toolkit.UX.DialogPool">DialogPools</see>.
/// Generally, developers should not directly manage or instantiate instances of their dialogs,
/// as it is essential that they are pooled and managed correctly by a pooler.
/// </remarks>
[AddComponentMenu("MRTK/UX/Dialog")]
public class Dialog : MonoBehaviour, IDialog
{
Expand Down
11 changes: 6 additions & 5 deletions com.microsoft.mrtk.uxcore/Dialog/DialogEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ public abstract class BaseDialogEventArgs
}

/// <summary>
/// Button events emit these parameters. For subclassed dialogs
/// with custom buttons or other types of events, return
/// a <see cref="DialogButtonType.Other"/> with some additional
/// context in a subclassed <see cref="DialogButtonEventArgs" type.
/// Event arguments used when buttons in a <see cref="Microsoft.MixedReality.Toolkit.UX.IDialog">IDialog</see>
/// are clicked or activated.
/// </summary>
public class DialogButtonEventArgs : BaseDialogEventArgs
{
Expand All @@ -45,6 +43,10 @@ public class DialogButtonEventArgs : BaseDialogEventArgs
public string ButtonText { get; set; }
}

/// <summary>
/// Event arguments used a <see cref="Microsoft.MixedReality.Toolkit.UX.IDialog">IDialog</see>
/// is dismissed or closed.
/// </summary>
public class DialogDismissedEventArgs : BaseDialogEventArgs
{
/// <summary>
Expand All @@ -53,5 +55,4 @@ public class DialogDismissedEventArgs : BaseDialogEventArgs
/// </summary>
public DialogButtonEventArgs Choice { get; set; }
}

}
9 changes: 5 additions & 4 deletions com.microsoft.mrtk.uxcore/Dialog/DialogPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
namespace Microsoft.MixedReality.Toolkit.UX
{
/// <summary>
/// Spawns dialogs with the requested parameters and manages
/// the lifecycle of the resulting dialog component.
/// Spawns <see cref="Microsoft.MixedReality.Toolkit.UX.IDialog">IDialog</see> with the requested parameters and manages
/// the lifecycle of the resulting <see cref="Microsoft.MixedReality.Toolkit.UX.IDialog">IDialog</see> component.
/// </summary>
[ExecuteAlways]
[AddComponentMenu("MRTK/UX/Dialog Pool")]
Expand All @@ -36,9 +36,10 @@ public enum Policy
}

/// <summary>
/// The default prefab to instantiate when spawning a dialog.
/// The default prefab to instantiate when spawning a dialog. This prefab must
/// contain a <see cref="Microsoft.MixedReality.Toolkit.UX.IDialog">IDialog</see> component.
/// </summary>
[field: SerializeField, Tooltip("The default prefab to instantiate when spawning a dialog.")]
[field: SerializeField, Tooltip("The default prefab to instantiate when spawning a dialog. This prefab must contain a IDialog component.")]
public GameObject DialogPrefab { get; set; }

// Static reference to the dialog instance, if active and spawned.
Expand Down
11 changes: 7 additions & 4 deletions com.microsoft.mrtk.uxcore/Dialog/IDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ public enum DialogButtonType

/// <summary>
/// An IDialog hydrates and controls the various sub-components
/// of the dialog view. IDialogs are spawned, pooled, and killed
/// by DialogPools. Generally, developers should not directly
/// manage or instantiate instances of their dialogs, as it is
/// essential that they are pooled and managed correctly by a pooler.
/// of the dialog view.
/// </summary>
/// <remarks>
/// IDialogs are typically spawned, pooled, and killed
/// by <see cref="Microsoft.MixedReality.Toolkit.UX.DialogPool">DialogPools</see>.
/// Generally, developers should not directly manage or instantiate instances of their dialogs,
/// as it is essential that they are pooled and managed correctly by a pooler.
/// </remarks>
public interface IDialog
{
/// <summary>
Expand Down
Loading

0 comments on commit 7b76b2d

Please sign in to comment.