예제 #1
0
        protected override void OnContentRendered(EventArgs e)
        {
            string fileName;

#if SETUP
            Version Version;
            string  Product, Title, Company, Edition;

            Environment.GetAssembly(out Product, out Title, out Company, out Version, out Edition);

            fileName = String.Format(@"{0}\Eyeshot {1} {2} Samples\dataset\Assets\AssemblyDemo.eye", System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), Edition, Version.Major);
#else
            fileName = "../../../../../../dataset/Assets/AssemblyDemo.eye";
#endif
            // Model import
            model1.OpenFile(fileName);

            assemblyTreeView1.PopulateTree(model1.Entities);
            // sets selection mode
            model1.ActionMode = actionType.SelectVisibleByPick;

            // sets camera orientation
            model1.SetView(viewType.Isometric);

            // enables Turbo when the scene exceeds 3000 objects
            _maxComplexity = model1.Turbo.MaxComplexity = 3000;

            // Fits the model in the viewport
            model1.ZoomFit();
            model1.Invalidate();

            model1.DisplayMode = displayType.Rendered;

            base.OnContentRendered(e);
        }
예제 #2
0
 protected override void WorkCompleted(Environment model)
 {
     model.Entities.AddRange(whiteEntList, "Default", Color.WhiteSmoke);
     model.Entities.AddRange(darkEntList, "Default", Color.FromArgb(31, 31, 31));
     model.Entities.AddRange(offsetEntList, "Default", Color.DarkGray);
     model.SetView(viewType.Trimetric);
     model.ZoomFit();
 }
예제 #3
0
            protected override void WorkCompleted(Environment model)
            {
                model.Entities.Add(toolPath, "Default", Color.DarkBlue);

                #region Tool symbol definition

                Block b1 = new Block("ballTool");

                Circle c1 = new Circle(0, 0, 0, ballToolRadius);
                Circle c2 = new Circle(0, 0, 50, ballToolRadius);
                Arc    a1 = new Arc(0, 0, 0, ballToolRadius, Math.PI, 2 * Math.PI);
                a1.Rotate(Math.PI / 2, Vector3D.AxisX);
                Arc a2 = (Arc)a1.Clone();
                a2.Rotate(Math.PI / 2, Vector3D.AxisZ);

                Line l1 = new Line(-ballToolRadius, 0, 0, -ballToolRadius, 0, 50);

                b1.Entities.Add(c1);
                b1.Entities.Add(c2);
                b1.Entities.Add(a1);
                b1.Entities.Add(a2);
                b1.Entities.Add(l1);

                LinearPath lp1 = LinearPath.CreateHelix(ballToolRadius, 50, 1, false, .1);
                b1.Entities.Add(lp1);

                b1.Entities.Add(lp1);
                for (int i = 1; i < 4; i++)
                {
                    Line cloneLn = (Line)l1.Clone();
                    cloneLn.Rotate(i * Math.PI / 2, Vector3D.AxisZ);
                    b1.Entities.Add(cloneLn);
                }

                model.Blocks.Add(b1);

                #endregion

                // Adds a reference to the tool symbol
                model.Entities.Add(new BlockReference(toolPath.Vertices[toolPath.Vertices.Length - 1], "ballTool", 1, 1, 1, 0));

                model.ZoomFit();
            }
예제 #4
0
 protected override void  WorkCompleted(Environment model)
 {
     // Avoid the automatic printing
 }