Пример #1
0
 public float[] GetSmoothBorders()
 {
     if (smoothBorderTess == null)
     {
         return(smoothBorderTess = SmoothBorderBuilder.BuildSmoothBorders(coordXYs, out borderTriangleStripCount));
     }
     return(smoothBorderTess);
 }
Пример #2
0
 internal void CreateSmoothBorderTessSegment(VBOStream ownerVBOStream,
                                             SmoothBorderBuilder smoothBorderBuilder)
 {
     //
     float[] smoothBorderTess = GetSmoothBorders(smoothBorderBuilder);
     _smoothBorderVboSeg = ownerVBOStream.CreateSegment(smoothBorderTess, BorderTriangleStripCount, 4);
     //
 }
Пример #3
0
        int _borderTriangleStripCount;                            //for smoothborder
        public float[] GetSmoothBorders(SmoothBorderBuilder smoothBorderBuilder)
        {
            //return existing result if not null
            //or create a newone if the old result is not exist

            return(_smoothBorderTess ??
                   (_smoothBorderTess =
                        smoothBorderBuilder.BuildSmoothBorders(_figures, IsClosedFigure, out _borderTriangleStripCount)));
        }
Пример #4
0
            internal void CreateGraphicsPathForMultiPartRenderVx(
                MultiPartPolygon multipartPolygon,
                MultiPartTessResult multipartTessResult,
                TessTool tessTool,
                SmoothBorderBuilder borderBuilder)
            {
                //a multipart polygon contains a  list of  expand coord (x,y) set.

                List <float[]> expandCoordsList = multipartPolygon.expandCoordsList;
                List <int[]>   endPointList     = multipartPolygon.contourEndPoints;


                int listCount = expandCoordsList.Count;

                for (int i = 0; i < listCount; ++i)
                {
                    //expand x,y
                    float[] expandCoords = expandCoordsList[i];
                    int[]   endPoints    = endPointList[i];
                    //area
                    int localVertexCount;

                    tessTool.TessAndAddToMultiPartResult(expandCoords,
                                                         endPoints,
                                                         multipartTessResult,
                                                         out localVertexCount);

                    //borders
                    //build smooth border
                    int m = endPoints.Length;
                    int latest_endPoint = 0;
                    multipartTessResult.BeginBorderPart();
                    for (int n = 0; n < m; ++n)
                    {
                        int endPoint = endPoints[n];                     //'x' , not include 'y'
                        int len      = (endPoint - latest_endPoint) + 1; //so len we add +1 for 'y'
                        int borderTriangleStripCount;
                        //expand coords for draw array
                        float[] smoothBorderXYs = borderBuilder.BuildSmoothBorders(expandCoords, latest_endPoint, len, out borderTriangleStripCount);
                        latest_endPoint += len + 2;
                        multipartTessResult.AddSmoothBorders(smoothBorderXYs, borderTriangleStripCount);
                    }
                    multipartTessResult.EndBorderPart();
                }
            }
Пример #5
0
        //-------------------------------------------------------------------------------

        public void DrawRect(float x, float y, float w, float h)
        {
            switch (this.SmoothMode)
            {
            case CanvasSmoothMode.Smooth:
            {
                int     borderTriAngleCount;
                float[] triangles = SmoothBorderBuilder.BuildSmoothBorders(
                    CreatePolyLineRectCoords(x, y, w, h), out borderTriAngleCount);
                smoothLineShader.DrawTriangleStrips(triangles, borderTriAngleCount);
            }
            break;

            default:
            {
            }
            break;
            }
        }
Пример #6
0
 //
 //----------------------------------------------------
 //
 internal float[] GetSmoothBorders(SmoothBorderBuilder smoothBorderBuilder)
 {
     return((_figure != null) ?
            _figure.GetSmoothBorders(smoothBorderBuilder) :
            _figures.GetSmoothBorders(smoothBorderBuilder));
 }