コード例 #1
0
 public void DrawEditor(InteractionLayer layer, List <Object3DView> transparentMeshes, DrawEventArgs e, ref bool suppressNormalDraw)
 {
     ImageToPathObject3D.DrawPath(this);
 }
コード例 #2
0
 public void DrawEditor(object sender, DrawEventArgs e)
 {
     ImageToPathObject3D.DrawPath(this);
 }
コード例 #3
0
 public void DrawEditor(Object3DControlsLayer layer, List <Object3DView> transparentMeshes, DrawEventArgs e)
 {
     ImageToPathObject3D.DrawPath(this);
 }
コード例 #4
0
        public override void Load()
        {
            var library = ApplicationController.Instance.Library;

            long index        = DateTime.Now.Ticks;
            var  libraryItems = new List <GeneratorItem>()
            {
                new GeneratorItem(
                    () => "Cube".Localize(),
                    () => CubeObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Pyramid".Localize(),
                    () => PyramidObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Wedge".Localize(),
                    () => WedgeObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Half Wedge".Localize(),
                    () => HalfWedgeObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Text".Localize(),
                    () => TextObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Cylinder".Localize(),
                    () => CylinderObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Cone".Localize(),
                    () => ConeObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Half Cylinder".Localize(),
                    () => HalfCylinderObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Torus".Localize(),
                    () => TorusObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Ring".Localize(),
                    () => RingObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Sphere".Localize(),
                    () => SphereObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Half Sphere".Localize(),
                    () => HalfSphereObject3D.Create())
                {
                    DateCreated = new System.DateTime(index++)
                },
                new GeneratorItem(
                    () => "Image Converter".Localize(),
                    () =>
                {
                    // Build ImageConverter stack
                    var imageObject = new ImageObject3D()
                    {
                        AssetPath = AggContext.StaticData.ToAssetPath(Path.Combine("Images", "mh-logo.png"))
                    };
                    imageObject.Invalidate(new InvalidateArgs(imageObject, InvalidateType.Properties, null));

                    var path = new ImageToPathObject3D();
                    path.Children.Add(imageObject);
                    path.Invalidate(new InvalidateArgs(path, InvalidateType.Properties, null));

                    var smooth = new SmoothPathObject3D();
                    smooth.Children.Add(path);
                    smooth.Invalidate(new InvalidateArgs(smooth, InvalidateType.Properties, null));

                    var extrude = new LinearExtrudeObject3D();
                    extrude.Children.Add(smooth);
                    extrude.Invalidate(new InvalidateArgs(extrude, InvalidateType.Properties, null));

                    var baseObject = new BaseObject3D()
                    {
                        BaseType = BaseTypes.None
                    };
                    baseObject.Children.Add(extrude);
                    baseObject.Invalidate(new InvalidateArgs(baseObject, InvalidateType.Properties, null));

                    return(new ComponentObject3D(new [] { baseObject })
                    {
                        ComponentID = "4D9BD8DB-C544-4294-9C08-4195A409217A",
                        SurfacedEditors = new List <string>
                        {
                            "$.Children<BaseObject3D>.Children<LinearExtrudeObject3D>.Children<SmoothPathObject3D>.Children<ImageToPathObject3D>.Children<ImageObject3D>",
                            "$.Children<BaseObject3D>.Children<LinearExtrudeObject3D>.Height",
                            "$.Children<BaseObject3D>.Children<LinearExtrudeObject3D>.Children<SmoothPathObject3D>.SmoothDistance",
                            "$.Children<BaseObject3D>.Children<LinearExtrudeObject3D>.Children<SmoothPathObject3D>.Children<ImageToPathObject3D>",
                            "$.Children<BaseObject3D>",
                        }
                    });
                })
                {
                    DateCreated = new System.DateTime(index++)
                },
            };

            string title = "Primitive Shapes".Localize();

            foreach (var item in libraryItems)
            {
                item.Category = title;
                Items.Add(item);
            }
        }