示例#1
0
        internal override bool TessellateCore(IRenderPackage package)
        {
            if (base.TessellateCore(package))
            {
                return(true);
            }

            Color c = (this.Color == null) ? Color.Yellow : this.Color;

            Point[] vertices = this.Vertices;
            foreach (var item in vertices)
            {
                package.PushLineStripVertex(item.X, item.Y, item.Z);
                package.PushLineStripVertexColor(c.RedValue, c.GreenValue, c.BlueValue, c.AlphaValue);
            }
            //Close the loop
            package.PushLineStripVertex(vertices[0].X, vertices[0].Y, vertices[0].Z);
            package.PushLineStripVertexColor(c.RedValue, c.GreenValue, c.BlueValue, c.AlphaValue);
            package.PushLineStripVertexCount(vertices.Length + 1);
            return(true);
        }
示例#2
0
 public override void Tessellate(IRenderPackage package, double tol, int gridLines)
 {
     InternalEdge.AsCurve().Tessellate()
         .ToList()
         .ForEach(x => package.PushLineStripVertex(x.X, x.Y, x.Z));
 }
示例#3
0
        internal override sealed bool TessellateCore(IRenderPackage package)
        {
            if (base.TessellateCore(package))
                return true;

            DSColor c = (this.Color == null) ? DSColor.Yellow : this.Color;
            int nMaxSamples = 16;
            IPointEntity[] samples = GetSamplePoints(nMaxSamples);

            foreach (var item in samples)
            {
                package.PushLineStripVertex(item.X, item.Y, item.Z);
                package.PushLineStripVertexColor(c.RedValue, c.GreenValue, c.BlueValue, c.AlphaValue);
            }

            int nSamples = samples.Length;
            if (this.IsClosed)
            {
                package.PushLineStripVertex(samples[0].X, samples[0].Y, samples[0].Z);
                package.PushLineStripVertexColor(c.RedValue, c.GreenValue, c.BlueValue, c.AlphaValue);
                ++nSamples;
            }
            package.PushLineStripVertexCount(nSamples);
            return true;
        }
示例#4
0
        internal override bool TessellateCore(IRenderPackage package)
        {
            if (base.TessellateCore(package))
                return true;

            DSColor c = (this.Color == null) ? DSColor.Yellow : this.Color;
            DSPoint[] vertices = this.Vertices;
            foreach (var item in vertices)
            {
                package.PushLineStripVertex(item.X, item.Y, item.Z);
                package.PushLineStripVertexColor(c.RedValue, c.GreenValue, c.BlueValue, c.AlphaValue);
            }
            //Close the loop
            package.PushLineStripVertex(vertices[0].X, vertices[0].Y, vertices[0].Z);
            package.PushLineStripVertexColor(c.RedValue, c.GreenValue, c.BlueValue, c.AlphaValue);
            package.PushLineStripVertexCount(vertices.Length + 1);
            return true;
        }
示例#5
0
        private static void DrawCurve(Autodesk.Revit.DB.Curve curve, IRenderPackage package)
        {
            var pts = curve.Tessellate().ToList();

            for (int i =0; i < pts.Count-1; i++)
            {
                var pt = pts[i];
                var pt1 = pts[i+1];
                package.PushLineStripVertex(pt.X, pt.Y, pt.Z);
                package.PushLineStripVertex(pt1.X, pt1.Y, pt1.Z);
            }
        }