示例#1
0
    /**
     *	Helper method to calculate a Vector3 (WorldSpace) from a Projected Position in local space.
     *	@param positionInPlane A Vector2 representing a point in the scanning plane.
     *	@param config The UltrasoundProbeConfiguration object, used for rotation and translation.
     *	@return A 3D point in world space.
     */
    private Vector3 WorldSpaceFromProjectedPosition(Vector2 positionInPlane,
                                                    UltrasoundProbeConfiguration config)
    {
        Vector3 positionInWorldSpace = new Vector3(positionInPlane.x, 0, positionInPlane.y);

        // Apply rotation, using Quaternion's overloaded * operator.
        positionInWorldSpace = config.GetRotation() * positionInWorldSpace;

        positionInWorldSpace += config.GetPosition();
        return(positionInWorldSpace);
    }
    /**
     *  Copy constructor to instantiate a new UltrasoundProbeConfiguration from another.
     *
     *  @param config The other UltrasoundProbeConfiguration object.
     *  @throw ArgumentNullException
     */
    public UltrasoundProbeConfiguration(UltrasoundProbeConfiguration config)
    {
        UltrasoundDebug.Assert(null != config,
                               "Null UltrasoundProbeConfiguration used for copy constructor.",
                               this);
        this.SetPosition(config.GetPosition());
        this.SetRotation(config.GetRotation());

        this.maxDistance       = config.GetMaxScanDistance();
        this.minDistance       = config.GetMinScanDistance();
        this.arcSizeInDegrees  = config.GetArcSizeInDegrees();
        this.pointsPerScanline = config.GetPointsPerScanline();
        this.numberOfScanlines = config.GetNumberOfScanlines();
        this.gain = config.GetGain();
    }