コード例 #1
0
    //#region Access Functions
    ///// <summary>
    ///// Adds modifier to the list and will set it's generator property. Also will initialize the modifier.
    ///// </summary>
    ///// <param name="modifier">Modifier that needs to be added</param>
    //public void AddModifier(AnnotationModifier modifier)
    //{
    //    modifier.Generator = this;
    //    modifier.Initialize();
    //    modifiers.Add(modifier);
    //}
    ///// <summary>
    ///// Removes modifier to the list. Also will destroy the modifier.
    ///// </summary>
    ///// <param name="modifier">Modifier that needs to be removed</param>
    //public void RemoveModifier(AnnotationModifier modifier)
    //{
    //    modifier.Destroy();
    //    modifiers.Remove(modifier);
    //}
    ///// <summary>
    ///// Adds verifier to the list and will set it's generator property. Also will initialize the verifier.
    ///// </summary>
    ///// <param name="verifier">Verifier that needs to be added</param>
    //public void AddVerifier(AnnotationVerifier verifier)
    //{
    //    verifier.Generator = this;
    //    verifier.Initialize();
    //    verifiers.Add(verifier);
    //}
    ///// <summary>
    ///// Removes verifier to the list. Also will destroy the verifier.
    ///// </summary>
    ///// <param name="verifier">Verifier that needs to be removed</param>
    //public void RemoveVerifier(AnnotationVerifier verifier)
    //{
    //    verifier.Destroy();
    //    verifiers.Remove(verifier);
    //}
    //#endregion Access functions

    private void Awake()
    {
        StandardCamera = GetComponentInChildren <AnnotationCamera>();
        if (!StandardCamera)
        {
            Debug.LogError("No annotation OutputCamera detected... Please add annotation camera as child of the annotation generator");
        }

        OutputCamera = StandardCamera;

        if (!outputTextureTemplate)
        {
            Debug.LogError("No outputTextureTemplate found... Please add a Render Texture as template for the annotation generator");
        }

        Segmentation = GetComponent <AnnotationSegmentation>(); //Not necessary but could be important for some situations

        // Getting the annotation exporter script
        Exporter = new AnnotationExporter();

        // Getting the annotation exporter script
        // ObjectManager = GetComponent<AnnotationObjectManager>();
        // if (!ObjectManager)
        //    Debug.LogError("No annotation object manager found for the annotation generator");

        Logger = new Logger(new AnnotationGeneratorLogHandler(gameObject.name));
    }
コード例 #2
0
ファイル: AnnotationStore.cs プロジェクト: xiangzhi/psi
 /// <summary>
 /// Writes the specified stream to a Annotation store.
 /// </summary>
 /// <typeparam name="TIn">The type of messages in the stream.</typeparam>
 /// <param name="source">The source stream to write.</param>
 /// <param name="name">The name of the persisted stream.</param>
 /// <param name="writer">The store writer, created by e.g. <see cref="Create(Pipeline, string, string, AnnotatedEventDefinition, bool)"/>.</param>
 /// <param name="deliveryPolicy">An optional delivery policy.</param>
 /// <returns>The input stream.</returns>
 public static IProducer <TIn> Write <TIn>(this IProducer <TIn> source, string name, AnnotationExporter writer, DeliveryPolicy <TIn> deliveryPolicy = null)
 {
     writer.Write(source.Out, name, deliveryPolicy);
     return(source);
 }