/// <summary> Creates playback sources. </summary> /// <typeparam name="TPoint"> Type of the point. </typeparam> /// <param name="pointCloudSource"> The point cloud source. </param> /// <param name="pcdPlaybackSource"> The playback source. </param> /// <param name="playbackFolder"> Pathname of the playback folder. </param> internal static void CreatePlaybackSources <TPoint>(out IPointCloudSource <TPoint> pointCloudSource, out IPlaybackSource <PointCloudData <TPoint> > pcdPlaybackSource, string playbackFolder) where TPoint : PointXYZ, new() { if (System.IO.Directory.Exists(playbackFolder)) { ThreadedPlaybackPointCloudSource src; try { src = new ThreadedPlaybackPointCloudSource(playbackFolder); } catch (System.IO.FileNotFoundException) { src = new ThreadedPlaybackPointCloudSource(); } pointCloudSource = src as IPointCloudSource <TPoint>; pcdPlaybackSource = src as IPlaybackSource <PointCloudData <TPoint> >; } else { UnityEngine.Debug.Log("Playback folder did not exist. Creating blank sources."); ThreadedPlaybackPointCloudSource pcdSrc = new ThreadedPlaybackPointCloudSource(); pointCloudSource = pcdSrc as IPointCloudSource <TPoint>; pcdPlaybackSource = pcdSrc as IPlaybackSource <PointCloudData <TPoint> >; } }
/// <summary> Initializes a new instance of the Meta.InteractionEngine class. </summary> /// <param name="handDataSource"> The hand data source. </param> /// <param name="pointCloudSource"> The point cloud source. </param> /// <param name="handConsumerType"> Type of the hand consumer. </param> /// <param name="depthOcclusionTransform"> The transform of the DepthOcclusion object. </param> /// <param name="playbackSource"> The playback source. </param> internal InteractionEngine(IPointCloudSource <PointXYZConfidence> pointCloudSource, string handConsumerType, Transform depthOcclusionTransform, IPlaybackSource <PointCloudData <PointXYZConfidence> > pcdPlaybackSource = null) { _handConsumerType = handConsumerType; _pointCloudSource = pointCloudSource; _handConsumerType = handConsumerType; _pointCloudSource = pointCloudSource; _pointCloudDataValid = false; _pointCloudMetaDataValid = false; this.pcdPlaybackSource = pcdPlaybackSource; }
/// <summary> Creates the sources. </summary> /// <typeparam name="TPoint"> Type of the point. </typeparam> /// <param name="pointCloudSource"> The point cloud source. </param> /// <param name="handConsumerType"> Type of the hand consumer. </param> /// <param name="interactionDataSource"> The interaction data source. </param> /// <param name="playbackFolder"> Pathname of the playback folder. </param> internal static void CreateSources <TPoint>(out IPointCloudSource <TPoint> pointCloudSource, out IPlaybackSource <PointCloudData <TPoint> > pcdPlaybackSource, string handConsumerType, string interactionDataSource, string playbackFolder = "") where TPoint : PointXYZ, new() { switch (interactionDataSource) { case "Playback": CreatePlaybackSources(out pointCloudSource, out pcdPlaybackSource, playbackFolder); break; default: CreateRealdataSources(out pointCloudSource); pcdPlaybackSource = null; break; } }