/**
  *  Instantiate a new ProbeOutputImageDecoder
  *  @param output The source of probedata from which to generate image data.
  */
 public BModeOutputImageDecoder(IProbeOutput output)
 {
     UltrasoundDebug.Assert(null != output, "Null probe output used in constructor", this);
     drawColor    = Color.white;
     probeOutput  = output;
     imageEffects = new List <IImagePostProcessor>();
 }
Ejemplo n.º 2
0
    /// Use this for initialization
    void Start()
    {
#if UNITY_EDITOR
        // Some input validation
        UltrasoundDebug.Assert(NumberOfScanlines > 0,
                               "Number of scanlines should be a positive integer",
                               this, true);
        UltrasoundDebug.Assert(PointsPerScanline > 0,
                               "Points per scanline should be a positive integer",
                               this, true);
        UltrasoundDebug.Assert(ArcSizeInDegrees >= 0 && ArcSizeInDegrees <= 180f,
                               "Arc size should be between 0 and 180 degrees.",
                               this, true);
        UltrasoundDebug.Assert(MinDistance > 0,
                               "Min distance should be greater than 0",
                               this, true);
        UltrasoundDebug.Assert(MaxDistance > 0,
                               "Max distance should be greater than 0",
                               this, true);
        UltrasoundDebug.Assert(MinDistance < MaxDistance,
                               "Min distance should be smaller than max distance",
                               this, true);
#endif

        output     = new HorayProbeOutput(this.gameObject);
        dataSource = new HorayProbe(this.gameObject, output);
    }
Ejemplo n.º 3
0
    /**
     *	Instantiate a new HorayProbe.
     *	@param probe The GameObject that represents the scanning array.
     *	@param output An IProbeOutput to pass information to.
     */
    public HorayProbe(GameObject probe, IProbeOutput output)
    {
#if UNITY_EDITOR
        UltrasoundDebug.Assert(null != probe,
                               "Null probe GameObject passed to HorayProbe constructor.",
                               this);
        UltrasoundDebug.Assert(null != output,
                               "Null IProbeOutput passed to HorayProbe constructor.",
                               this);
        if (null == probe.GetComponent <HorayBehavior>())
        {
            string str =
                "The probe object used to instantiate this class " +
                "does not have the required HorayBehavior script.";
            Debug.LogError(str);
        }
#endif
        this.probeGameObject = probe;
        this.output          = output;
        this.culler          = new HorayOrganCuller();
    }