コード例 #1
0
        /// <summary>
        /// A very simple collision check between this geometry and the given one.
        /// </summary>
        /// <param name="other">The other geometry.</param>
        /// <param name="otherTransform">The matrix which is used to transform the given geometry bevore checking.</param>
        public bool IntersectsWith(Geometry2DResourceBase other, Matrix3x2 otherTransform)
        {
            this.EnsureNotNullOrDisposed("this");
            other.EnsureNotNullOrDisposed(nameof(other));

            D2D.Geometry geometryThis  = this.GetGeometry();
            D2D.Geometry geometryOther = other.GetGeometry();

            return(geometryThis.Compare(geometryOther, otherTransform.ToDXMatrix(), 1f) != D2D.GeometryRelation.Disjoint);
        }
コード例 #2
0
ファイル: Graphics2D.cs プロジェクト: Alan-Baylis/SeeingSharp
        /// <summary>
        /// Fills the given geometry.
        /// </summary>
        public void FillGeometry(Geometry2DResourceBase geometry, BrushResource brush)
        {
            if (m_renderTarget == null)
            {
                return;
            }

            geometry.EnsureNotNullOrDisposed(nameof(geometry));
            brush.EnsureNotNull(nameof(brush));

            m_renderTarget.FillGeometry(
                geometry.GetGeometry(),
                brush.GetBrush(m_device));
        }
コード例 #3
0
ファイル: Graphics2D.cs プロジェクト: Alan-Baylis/SeeingSharp
        /// <summary>
        /// Draws the given geometry.
        /// </summary>
        public void DrawGeometry(Geometry2DResourceBase geometry, BrushResource brush, float strokeWidth = 1f)
        {
            if (m_renderTarget == null)
            {
                return;
            }

            geometry.EnsureNotNullOrDisposed(nameof(geometry));
            brush.EnsureNotNull(nameof(brush));
            strokeWidth.EnsurePositive(nameof(strokeWidth));

            m_renderTarget.DrawGeometry(
                geometry.GetGeometry(),
                brush.GetBrush(m_device),
                strokeWidth);
        }