• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IVertexSource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IVertexSource的典型用法代码示例。如果您正苦于以下问题:C# IVertexSource类的具体用法?C# IVertexSource怎么用?C# IVertexSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IVertexSource类属于命名空间,在下文中一共展示了IVertexSource类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: VertexSourceAdapter

 public VertexSourceAdapter(IVertexSource vertexSource, IGenerator generator)
 {
     markers = new null_markers();
     this.VertexSource = vertexSource;
     this.generator = generator;
     m_status = status.initial;
 }
开发者ID:jeske,项目名称:agg-sharp,代码行数:7,代码来源:VertexSourceAdapter.cs


示例2: TriangulateFaces

		public static Mesh TriangulateFaces(IVertexSource vertexSource)
		{
			vertexSource.rewind();
			CachedTesselator teselatedSource = new CachedTesselator();
            VertexSourceToTesselator.SendShapeToTesselator(teselatedSource, vertexSource);

			Mesh extrudedVertexSource = new Mesh();

			int numIndicies = teselatedSource.IndicesCache.Count;

			// build the top first so it will render first when we are translucent
			for (int i = 0; i < numIndicies; i += 3)
			{
				Vector2 v0 = teselatedSource.VerticesCache[teselatedSource.IndicesCache[i + 0].Index].Position;
				Vector2 v1 = teselatedSource.VerticesCache[teselatedSource.IndicesCache[i + 1].Index].Position;
				Vector2 v2 = teselatedSource.VerticesCache[teselatedSource.IndicesCache[i + 2].Index].Position;
				if (v0 == v1 || v1 == v2 || v2 == v0)
				{
					continue;
				}

				Vertex topVertex0 = extrudedVertexSource.CreateVertex(new Vector3(v0, 0));
				Vertex topVertex1 = extrudedVertexSource.CreateVertex(new Vector3(v1, 0));
				Vertex topVertex2 = extrudedVertexSource.CreateVertex(new Vector3(v2, 0));

				extrudedVertexSource.CreateFace(new Vertex[] { topVertex0, topVertex1, topVertex2 });
			}

			return extrudedVertexSource;
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:30,代码来源:VertexSourceToMesh.cs


示例3: ConverterAdaptorVcgen

 ///<summary>
 ///</summary>
 ///<param name="source"></param>
 ///<param name="generator"></param>
 public ConverterAdaptorVcgen(IVertexSource source, IGenerator generator)
 {
     _markers = new NullMarkers();
     _source = source;
     _generator = generator;
     _status = EStatus.Initial;
 }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:11,代码来源:VcGenConverterAdaptor.cs


示例4: Save

 public static void Save(IVertexSource vertexSource, string pathAndFileName, bool oldStyle = true)
 {
     if (oldStyle)
     {
         using (StreamWriter outFile = new StreamWriter(pathAndFileName))
         {
             vertexSource.rewind(0);
             double x;
             double y;
             ShapePath.FlagsAndCommand flagsAndCommand = vertexSource.vertex(out x, out y);
             do
             {
                 outFile.WriteLine("{0}, {1}, {2}", x, y, flagsAndCommand.ToString());
                 flagsAndCommand = vertexSource.vertex(out x, out y);
             }
             while (flagsAndCommand != ShapePath.FlagsAndCommand.CommandStop);
         }
     }
     else
     {
         using (StreamWriter outFile = new StreamWriter(pathAndFileName))
         {
             foreach (VertexData vertexData in vertexSource.Vertices())
             {
                 outFile.WriteLine("{0}, {1}, {2}", vertexData.position.x, vertexData.position.y, vertexData.command.ToString());
             }
         }
     }
 }
开发者ID:jeske,项目名称:agg-sharp,代码行数:29,代码来源:VertexSourceIO.cs


示例5: ConvAdaptorVcgen

 public ConvAdaptorVcgen(IVertexSource source, IGenerator generator)
 {
     this.markers = null;
     // TODO NullMarkers();
     this.source = source;
     this.generator = generator;
     this.status = Status.Initial;
 }
开发者ID:Kintaro,项目名称:Pictor,代码行数:8,代码来源:ConvAdaptorVcgen.cs


示例6: CurveConverter

 public CurveConverter(IVertexSource source)
 {
     m_curve3 = new Curve3();
     m_curve4 = new Curve4();
     m_source=(source);
     m_last_x=(0.0);
     m_last_y=(0.0);
 }
开发者ID:rtownsend,项目名称:MOSA-Project,代码行数:8,代码来源:CurveConverter.cs


示例7: FlattenCurves

		public FlattenCurves(IVertexSource vertexSource)
		{
			m_curve3 = new Curve3();
			m_curve4 = new Curve4();
			VertexSource = vertexSource;
			lastX = (0.0);
			lastY = (0.0);
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:8,代码来源:FlattenCurve.cs


示例8: CheckTestAgainstControl

		private void CheckTestAgainstControl(IVertexSource testVertexSource, string testTypeString)
		{
			// there is an assumtion that we got to save valid vertex lists at least once.
			string controlFileTxt = testTypeString + " Control.Txt";
			string vertexSourceFolder = "ControlVertexSources";
			PathStorage controlVertexSource = new PathStorage();
			if (!Directory.Exists(vertexSourceFolder))
			{
				Directory.CreateDirectory(vertexSourceFolder);
			}
			string controlPathAndFileName = Path.Combine(vertexSourceFolder, controlFileTxt);
			if (File.Exists(controlPathAndFileName))
			{
				VertexSourceIO.Load(controlVertexSource, controlPathAndFileName);

				// this test the old vertex getting code
				{
					string testOldToOldFailPathAndFileName = Path.Combine(vertexSourceFolder, testTypeString + " Test Old Fail.Txt");
					bool testOldToOldIsSameAsControl = controlVertexSource.Equals(testVertexSource, oldStyle: true);
					if (!testOldToOldIsSameAsControl)
					{
						// this VertexSource will be in the current output folder inside of VertexSourceFolder
						VertexSourceIO.Save(testVertexSource, testOldToOldFailPathAndFileName, oldStyle: true);
					}
					else if (File.Exists(testOldToOldFailPathAndFileName))
					{
						// we don't want to have these confounding our results.
						File.Delete(testOldToOldFailPathAndFileName);
					}

					Assert.IsTrue(testOldToOldIsSameAsControl);
				}

				// this test the new vertex generator code
				if (true)
				{
					string testOldToNewFailPathAndFileName = Path.Combine(vertexSourceFolder, testTypeString + " Test New Fail.Txt");
					bool testOldToNewIsSameAsControl = controlVertexSource.Equals(testVertexSource, oldStyle: false);
					if (!testOldToNewIsSameAsControl)
					{
						// this VertexSource will be in the current output folder inside of VertexSourceFolder
						VertexSourceIO.Save(testVertexSource, testOldToNewFailPathAndFileName, oldStyle: false);
					}
					else if (File.Exists(testOldToNewFailPathAndFileName))
					{
						// we don't want to have these confounding our results.
						File.Delete(testOldToNewFailPathAndFileName);
					}

					Assert.IsTrue(testOldToNewIsSameAsControl);
				}
				// If you want to create new control VertexSources select SetNextStatement to inside the else condition to creat them.
			}
			else
			{
				VertexSourceIO.Save(testVertexSource, controlPathAndFileName);
			}
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:58,代码来源:AggDrawingTests.cs


示例9: bounding_rect_single

		public static bool bounding_rect_single(IVertexSource vs, int path_id, ref RectangleDouble rect)
		{
			double x1, y1, x2, y2;
			bool rValue = bounding_rect_single(vs, path_id, out x1, out y1, out x2, out y2);
			rect.Left = x1;
			rect.Bottom = y1;
			rect.Right = x2;
			rect.Top = y2;
			return rValue;
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:10,代码来源:agg_bounding_rect.cs


示例10: BoundingRectSingle

 public static bool BoundingRectSingle(IVertexSource vs, uint path_id, ref RectD rect)
 {
     double x1, y1, x2, y2;
     bool rValue = BoundingRectSingle(vs, path_id, out x1, out y1, out x2, out y2);
     rect.x1 = x1;
     rect.y1 = y1;
     rect.x2 = x2;
     rect.y2 = y2;
     return rValue;
 }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:10,代码来源:BoundingRect.cs


示例11: Render

 public override void Render(IVertexSource vertexSource, int pathIndexToRender, RGBA_Bytes colorBytes)
 {
     m_Rasterizer.reset();
     Affine transform = GetTransform();
     if (!transform.IsIdentity())
     {
         vertexSource = new conv_transform(vertexSource, transform);
     }
     m_Rasterizer.add_path(vertexSource, pathIndexToRender);
     Renderer.RenderSolid(m_DestImage, m_Rasterizer, m_ScanlineCache, colorBytes);
 }
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:11,代码来源:renderer_scanline.cs


示例12: RenderSolidAllPaths

		public void RenderSolidAllPaths(IImageByte destImage,
			IRasterizer ras,
			IScanlineCache sl,
			IVertexSource vs,
			RGBA_Bytes[] color_storage,
			int[] path_id,
			int num_paths)
		{
			for (int i = 0; i < num_paths; i++)
			{
				ras.reset();

				ras.add_path(vs, path_id[i]);

				RenderSolid(destImage, ras, sl, color_storage[i]);
			}
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:17,代码来源:ScanlineRenderer.cs


示例13: SendShapeToTesselator

        public static void SendShapeToTesselator(VertexTesselatorAbstract tesselator, IVertexSource vertexSource)
        {
#if !DEBUG
            try
#endif
            {
                tesselator.BeginPolygon();

                ShapePath.FlagsAndCommand PathAndFlags = 0;
                double x, y;
                bool haveBegunContour = false;
                while (!ShapePath.is_stop(PathAndFlags = vertexSource.vertex(out x, out y)))
                {
                    if (ShapePath.is_close(PathAndFlags)
                        || (haveBegunContour && ShapePath.is_move_to(PathAndFlags)))
                    {
                        tesselator.EndContour();
                        haveBegunContour = false;
                    }

                    if (!ShapePath.is_close(PathAndFlags))
                    {
                        if (!haveBegunContour)
                        {
                            tesselator.BeginContour();
                            haveBegunContour = true;
                        }

                        tesselator.AddVertex(x, y);
                    }
                }

                if (haveBegunContour)
                {
                    tesselator.EndContour();
                }

                tesselator.EndPolygon();
            }
#if !DEBUG
            catch
            {
            }
#endif
        }
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:45,代码来源:VertexSourceToTesselator.cs


示例14: CombinePaths

		private PathStorage CombinePaths(IVertexSource a, IVertexSource b, ClipType clipType)
		{
			List<List<IntPoint>> aPolys = VertexSourceToClipperPolygons.CreatePolygons(a);
			List<List<IntPoint>> bPolys = VertexSourceToClipperPolygons.CreatePolygons(b);

			Clipper clipper = new Clipper();

			clipper.AddPaths(aPolys, PolyType.ptSubject, true);
			clipper.AddPaths(bPolys, PolyType.ptClip, true);

			List<List<IntPoint>> intersectedPolys = new List<List<IntPoint>>();
			clipper.Execute(clipType, intersectedPolys);

			PathStorage output = VertexSourceToClipperPolygons.CreatePathStorage(intersectedPolys);

			output.Add(0, 0, ShapePath.FlagsAndCommand.CommandStop);

			return output;
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:19,代码来源:PolygonClipping.cs


示例15: Render

		public override void Render(IVertexSource vertexSource, int pathIndexToRender, IColorType colorBytes)
		{
			rasterizer.reset();
			Affine transform = GetTransform();
			if (!transform.is_identity())
			{
				vertexSource = new VertexSourceApplyTransform(vertexSource, transform);
			}
			rasterizer.add_path(vertexSource, pathIndexToRender);
			if (destImageByte != null)
			{
				scanlineRenderer.RenderSolid(destImageByte, rasterizer, m_ScanlineCache, colorBytes.GetAsRGBA_Bytes());
				DestImage.MarkImageChanged();
			}
			else
			{
				scanlineRenderer.RenderSolid(destImageFloat, rasterizer, m_ScanlineCache, colorBytes.GetAsRGBA_Floats());
				destImageFloat.MarkImageChanged();
			}
		}
开发者ID:CNCBrasil,项目名称:agg-sharp,代码行数:20,代码来源:ImageGraphics2D.cs


示例16: CreatePolygons

		public static List<List<IntPoint>> CreatePolygons(IVertexSource sourcePath, double scaling = 1000)
		{
			List<List<IntPoint>> allPolys = new List<List<IntPoint>>();
			List<IntPoint> currentPoly = null;
			VertexData last = new VertexData();
			VertexData first = new VertexData();
			bool addedFirst = false;
			foreach (VertexData vertexData in sourcePath.Vertices())
			{
				if (vertexData.IsLineTo)
				{
					if (!addedFirst)
					{
						currentPoly.Add(new IntPoint((long)(last.position.x * scaling), (long)(last.position.y * scaling)));
						addedFirst = true;
						first = last;
					}
					currentPoly.Add(new IntPoint((long)(vertexData.position.x * scaling), (long)(vertexData.position.y * scaling)));
					last = vertexData;
				}
				else
				{
					addedFirst = false;
					currentPoly = new List<IntPoint>();
					allPolys.Add(currentPoly);
					if (vertexData.IsMoveTo)
					{
						last = vertexData;
					}
					else
					{
						last = first;
					}
				}
			}

			return allPolys;
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:38,代码来源:VertexSourceToClipperPolygons.cs


示例17: CombinePaths

		private PathStorage CombinePaths(IVertexSource a, IVertexSource b, ClipType clipType)
		{
			List<List<IntPoint>> aPolys = CreatePolygons(a);
			List<List<IntPoint>> bPolys = CreatePolygons(b);

			Clipper clipper = new Clipper();

			clipper.AddPaths(aPolys, PolyType.ptSubject, true);
			clipper.AddPaths(bPolys, PolyType.ptClip, true);

			List<List<IntPoint>> intersectedPolys = new List<List<IntPoint>>();
			clipper.Execute(clipType, intersectedPolys);

			PathStorage output = new PathStorage();

			foreach (List<IntPoint> polygon in intersectedPolys)
			{
				bool first = true;
				foreach (IntPoint point in polygon)
				{
					if (first)
					{
						output.Add(point.X / 1000.0, point.Y / 1000.0, ShapePath.FlagsAndCommand.CommandMoveTo);
						first = false;
					}
					else
					{
						output.Add(point.X / 1000.0, point.Y / 1000.0, ShapePath.FlagsAndCommand.CommandLineTo);
					}
				}

				output.ClosePolygon();
			}

			output.Add(0, 0, ShapePath.FlagsAndCommand.CommandStop);

			return output;
		}
开发者ID:CNCBrasil,项目名称:agg-sharp,代码行数:38,代码来源:PolygonClipping.cs


示例18: Render

 /// <summary>
 /// 
 /// </summary>
 /// <param name="vertexSource"></param>
 /// <param name="color"></param>
 public void Render(IVertexSource vertexSource, RGBA_Bytes color)
 {
     Render(vertexSource, 0, color);
 }
开发者ID:rtownsend,项目名称:MOSA-Project,代码行数:9,代码来源:ScanlineRenderer.cs


示例19: RenderSolidAllPaths

        //========================================================render_all_paths
        public static void RenderSolidAllPaths(IPixelFormat pixFormat, 
            IRasterizer ras, 
            IScanline sl,
            IVertexSource vs, 
            RGBA_Bytes[] color_storage,
            uint[] path_id,
            uint num_paths)
        {
            for(uint i = 0; i < num_paths; i++)
            {
                ras.Reset();

            #if use_timers
                AddPathTimer.Start();
            #endif
                ras.AddPath(vs, path_id[i]);
            #if use_timers
                AddPathTimer.Stop();
            #endif

            #if use_timers
                RenderSLTimer.Start();
            #endif
                RenderSolid(pixFormat, ras, sl, color_storage[i]);
            #if use_timers
                RenderSLTimer.Stop();
            #endif
            }
        }
开发者ID:rtownsend,项目名称:MOSA-Project,代码行数:30,代码来源:ScanlineRenderer.cs


示例20: Attach

		public void Attach(IVertexSource VertexSource)
		{
			m_VertexSource = VertexSource;
		}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:4,代码来源:TransformConverter.cs



注:本文中的IVertexSource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IVertexType类代码示例发布时间:2022-05-24
下一篇:
C# IVertex类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap