Ejemplo n.º 1
0
        private void ShowOriginalLocation(int index, VIZCore3D.NET.Data.Object3DProperty prop, VIZCore3D.NET.Data.Vector3D v)
        {
            List <Color> color = new List <Color>();

            color.Add(Color.FromArgb(10, 255, 0, 0));
            color.Add(Color.FromArgb(10, 0, 255, 0));
            color.Add(Color.FromArgb(10, 0, 0, 255));

            vizcore3d.SelectionBox.Add(prop.GetBoundBox(), color[index], Color.FromArgb(100, 255, 255, 255), "");

            VIZCore3D.NET.Data.Vertex3DItemCollection items = new VIZCore3D.NET.Data.Vertex3DItemCollection();
            items.Add(prop.CenterPoint);
            items.Add(prop.CenterPoint + v.ToVertex3D());

            vizcore3d.ShapeDrawing.AddLine(
                new List <Data.Vertex3DItemCollection>()
            {
                items
            }
                , 0
                , Color.Red
                , 5.0f
                , true
                );
        }
Ejemplo n.º 2
0
        private void btnGeometryProperty_Click(object sender, EventArgs e)
        {
            if (node == null)
            {
                return;
            }

            VIZCore3D.NET.Data.Object3DProperty prop = node.GetGeometryProperty();

            propertyGrid.SelectedObject = prop;
        }
Ejemplo n.º 3
0
        private void btnDisassembly_Click(object sender, EventArgs e)
        {
            bool showOriginalLocation = ckShowOriginalLocation.Checked;

            List <VIZCore3D.NET.Data.Node> stage4 = vizcore3d.Object3D.Find.QuickSearch(new List <string>()
            {
                "STAGE_4"
            }, false, true, false, false, true, false);

            VIZCore3D.NET.Data.Vector3D         v4    = new VIZCore3D.NET.Data.Vector3D(0, 5000, 0);
            VIZCore3D.NET.Data.Object3DProperty prop4 = vizcore3d.Object3D.GeometryProperty.FromNode(stage4[0], false);
            vizcore3d.Object3D.Transform.Move(stage4, v4);
            System.Threading.Thread.Sleep(500);
            if (showOriginalLocation == true)
            {
                ShowOriginalLocation(0, prop4, v4);
            }
            System.Threading.Thread.Sleep(200);

            List <VIZCore3D.NET.Data.Node> stage2 = vizcore3d.Object3D.Find.QuickSearch(new List <string>()
            {
                "STAGE_2"
            }, false, true, false, false, true, false);

            VIZCore3D.NET.Data.Vector3D         v2    = new VIZCore3D.NET.Data.Vector3D(-5000, 0, 0);
            VIZCore3D.NET.Data.Object3DProperty prop2 = vizcore3d.Object3D.GeometryProperty.FromNode(stage2[0], false);
            vizcore3d.Object3D.Transform.Move(stage2, v2);
            System.Threading.Thread.Sleep(500);
            if (showOriginalLocation == true)
            {
                ShowOriginalLocation(1, prop2, v2);
            }
            System.Threading.Thread.Sleep(200);

            List <VIZCore3D.NET.Data.Node> stage3 = vizcore3d.Object3D.Find.QuickSearch(new List <string>()
            {
                "STAGE_3"
            }, false, true, false, false, true, false);

            VIZCore3D.NET.Data.Vector3D         v3    = new VIZCore3D.NET.Data.Vector3D(8000, 0, 0);
            VIZCore3D.NET.Data.Object3DProperty prop3 = vizcore3d.Object3D.GeometryProperty.FromNode(stage3[0], false);
            vizcore3d.Object3D.Transform.Move(stage3, v3);
            System.Threading.Thread.Sleep(500);
            if (showOriginalLocation == true)
            {
                ShowOriginalLocation(2, prop3, v3);
            }

            vizcore3d.View.FitToView();
        }
Ejemplo n.º 4
0
        private void AddNote()
        {
            VIZCore3D.NET.Data.NoteStyle style = vizcore3d.Review.Note.GetStyle();

            List <string> keys = Blocks.Keys.ToList();

            for (int i = 0; i < keys.Count; i++)
            {
                VIZCore3D.NET.Data.Node node = Blocks[keys[i]];

                VIZCore3D.NET.Data.Object3DProperty prop =
                    vizcore3d.Object3D.GeometryProperty.FromIndex(node.Index);

                vizcore3d.Review.Note.AddNote3D(node.NodeName, prop.CenterPoint);
            }
        }
Ejemplo n.º 5
0
        private void btnGetCenter_Click(object sender, EventArgs e)
        {
            List <VIZCore3D.NET.Data.Node> items = vizcore3d.Object3D.FromFilter(Data.Object3dFilter.SELECTED_TOP);

            if (items.Count == 0)
            {
                return;
            }

            VIZCore3D.NET.Data.Object3DProperty prop =
                vizcore3d.Object3D.GeometryProperty.FromNode(items[0], false);

            txtWorldX.Text = prop.CenterPoint.X.ToString();
            txtWorldY.Text = prop.CenterPoint.Y.ToString();
            txtWorldZ.Text = prop.CenterPoint.Z.ToString();
        }
Ejemplo n.º 6
0
        private void MoveAxisY(string block, float length, int ratio)
        {
            if (Blocks.ContainsKey(block) == false)
            {
                return;
            }

            VIZCore3D.NET.Data.Node node = Blocks[block];

            VIZCore3D.NET.Data.Object3DProperty prop =
                vizcore3d.Object3D.GeometryProperty.FromNode(node);

            float minZ = prop.GetBoundBox().MinZ;

            vizcore3d.Object3D.Transform.Move(new List <VIZCore3D.NET.Data.Node>()
            {
                node
            }, 0.0f, length * ratio, -minZ);
        }
Ejemplo n.º 7
0
        private void btnGenerateAnimation_Click(object sender, EventArgs e)
        {
            if (vizcore3d.Model.IsOpen() == false)
            {
                return;
            }

            // 모델 데이터 맵핑
            GetNodes();
            ObjectProperty = new Dictionary <int, VIZCore3D.NET.Data.Object3DProperty>();
            Transform      = new Dictionary <int, Data.Vertex3D>();

            vizcore3d.View.EnableAutoFit = false;                                       /* 자동 화면맞춤 비활성 */
            //vizcore3d.View.Projection = VIZCore3D.NET.Data.Projections.Perspective;   /* 원근 뷰 설정 */
            vizcore3d.Animation.UseEffect = false;                                      /* 기본 효과 사용안함 설정 */

            vizcore3d.Animation.Clear();
            vizcore3d.Animation.Add("Animation");

            //vizcore3d.ShowWaitForm();

            vizcore3d.Object3D.Select(Data.Object3dSelectionModes.DESELECT_ALL);
            VIZCore3D.NET.Data.Vertex3D bay = new Data.Vertex3D(83772, -41271, 8664);

            vizcore3d.BeginUpdate();

            foreach (KeyValuePair <int, List <VIZCore3D.NET.Data.Node> > item in Nodes)
            {
                if (item.Key <= 0)
                {
                    continue;
                }

                VIZCore3D.NET.Data.Object3DProperty prop = vizcore3d.Object3D.GeometryProperty.FromNode(Nodes[item.Key], false);

                if (ObjectProperty.ContainsKey(item.Key) == false)
                {
                    ObjectProperty.Add(item.Key, prop);
                }

                VIZCore3D.NET.Data.Vertex3D vec = new Data.Vertex3D(bay.X - prop.CenterPoint.X, bay.Y - prop.CenterPoint.Y, bay.Z - prop.MinPoint.Z);

                vizcore3d.Object3D.Transform.Move(
                    Nodes[item.Key]
                    , bay.X - prop.CenterPoint.X
                    , bay.Y - prop.CenterPoint.Y
                    , bay.Z - prop.MinPoint.Z
                    , false
                    );
                Transform.Add(item.Key, vec);
            }

            foreach (KeyValuePair <int, List <VIZCore3D.NET.Data.Node> > item in Nodes)
            {
                if (item.Key <= 0)
                {
                    continue;
                }

                vizcore3d.Object3D.Show(item.Value, false);
            }

            // 애니메이션 키 추가
            AddKey(true, false, TimeInterval);

            Data.Object3DProperty propCrane = vizcore3d.Object3D.GeometryProperty.FromNode(Nodes[-7]);

            //for (int i = 1; i < 13; i++)
            foreach (KeyValuePair <int, List <VIZCore3D.NET.Data.Node> > item in Nodes)
            {
                if (item.Key <= 0)
                {
                    continue;
                }

                int           i        = item.Key;
                Data.Vertex3D vecTrans = Transform[i];

                // 블록 조회
                vizcore3d.Object3D.Show(Nodes[i], true);

                // 애니메이션 키 추가
                AddKey(true, false, TimeInterval);

                // 크레인 이동 (BAY) : 블록 위치로...
                MoveCrane(true, bay.X, 0.0f, 0.0f);

                // 크레인 호이스트 이동 : 블록 위치로...
                MoveCrane(false, bay.X, bay.Y, 0.0f);

                Data.Object3DProperty propModel = vizcore3d.Object3D.GeometryProperty.FromNode(Nodes[i]);
                float fOffset = propCrane.MinPoint.Z - propModel.MaxPoint.Z - 5000f;
                // 크레인 호이스트 : Bring To Bottom
                DownCrane(false, Nodes[i], fOffset);

                // 블록 : Bring To Top
                UpCrane(true, Nodes[i], fOffset);

                // 블록 : Bring To Center(Y)
                VIZCore3D.NET.Data.Vector3D tran3 = new VIZCore3D.NET.Data.Vector3D(0, -vecTrans.Y, 0);
                vizcore3d.Object3D.Transform.Move(Nodes[i], tran3, false);

                // 크레인 호이스트 이동
                MoveCrane(false, bay.X, ObjectProperty[i].CenterPoint.Y, 0.0f);

                VIZCore3D.NET.Data.Vector3D tran4 = new VIZCore3D.NET.Data.Vector3D(-vecTrans.X, 0, 0);
                vizcore3d.Object3D.Transform.Move(Nodes[i], tran4, false);

                // 크레인 이동 (BAY)
                // 크레인 호이스트 이동
                MoveCrane(true, ObjectProperty[i].CenterPoint.X, 0.0f, 0.0f);

                Data.Object3DProperty propModelO = ObjectProperty[i];
                Data.Object3DProperty propModelC = vizcore3d.Object3D.GeometryProperty.FromNode(Nodes[i]);
                fOffset = propCrane.MinPoint.Z - propModelO.MaxPoint.Z - 5000f;

                // 크레인 호이스트 : Bring To Bottom
                DownCrane(true, Nodes[i], fOffset);

                // 블록 : Bring To Top
                UpCrane(false, null, fOffset);
            }

            AddKey(true, false, TimeInterval);

            vizcore3d.EndUpdate();

            //vizcore3d.CloseWaitForm();

            MessageBox.Show("Animation Created.", "VIZCore3D.NET", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Ejemplo n.º 8
0
        private void backgroundWorkerTurnOver_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            int step = e.ProgressPercentage;

            if (backgroundWorkerTurnOver.CancellationPending == true) return;

            vizcore3d.BeginUpdate();
            vizcore3d.Object3D.Transform.Rotate(BLOCK_NODES, -1, 0, 0, false, false);

            // LUG1 - ROLLER1
            // LUG2 - ROLLER4
            vizcore3d.ShapeDrawing.Clear();
            vizcore3d.ShapeDrawing.DepthTest = true;

            bool find = false;

            if (DisplayAngle == true)
                vizcore3d.Review.Measure.Clear();

            for (int i = 0; i < 7; i++)
            {
                VIZCore3D.NET.Data.Node lug1 = LUG1[i + 1];
                VIZCore3D.NET.Data.Object3DProperty propLug1 = vizcore3d.Object3D.GeometryProperty.FromNode(lug1);

                VIZCore3D.NET.Data.Node roller1 = ROLLER1[i + 1];
                VIZCore3D.NET.Data.Object3DProperty propRoller1 = vizcore3d.Object3D.GeometryProperty.FromNode(roller1);


                VIZCore3D.NET.Data.Node lug2 = LUG2[i + 1];
                VIZCore3D.NET.Data.Object3DProperty propLug2 = vizcore3d.Object3D.GeometryProperty.FromNode(lug2);

                VIZCore3D.NET.Data.Node roller2 = ROLLER4[i + 1];
                VIZCore3D.NET.Data.Object3DProperty propRoller2 = vizcore3d.Object3D.GeometryProperty.FromNode(roller2);

                {
                    List<VIZCore3D.NET.Data.Vertex3DItemCollection> item1 = new List<Data.Vertex3DItemCollection>();
                    VIZCore3D.NET.Data.Vertex3DItemCollection coll1 = new Data.Vertex3DItemCollection();
                    coll1.Add(propLug1.CenterPoint);
                    coll1.Add(propRoller1.CenterPoint);
                    item1.Add(coll1);
                    vizcore3d.ShapeDrawing.AddLine(item1, i, Color.Black, 1, true);
                    //vizcore3d.ShapeDrawing.AddCylinder(item1, i, Color.Black, 10, true);
                }

                {
                    List<VIZCore3D.NET.Data.Vertex3DItemCollection> item2 = new List<Data.Vertex3DItemCollection>();
                    VIZCore3D.NET.Data.Vertex3DItemCollection coll2 = new Data.Vertex3DItemCollection();
                    coll2.Add(propLug2.CenterPoint);
                    coll2.Add(propRoller2.CenterPoint);
                    item2.Add(coll2);
                    vizcore3d.ShapeDrawing.AddLine(item2, i + 7, Color.Black, 1, true);
                    //vizcore3d.ShapeDrawing.AddCylinder(item2, i + 7, Color.Black, 10, true);
                }

                CollisionItem collision1 = new CollisionItem();
                CollisionItem collision2 = new CollisionItem();

                bool find1 = AddCollisionData(step, lug1.NodeName, roller1.NodeName, propLug1.CenterPoint, propRoller1.CenterPoint, "TOB #1", out collision1);
                bool find2 = AddCollisionData(step, lug2.NodeName, roller2.NodeName, propLug2.CenterPoint, propRoller2.CenterPoint, "TOB #2", out collision2);

                if (find1 == true || find2 == true) find = true;

                AddAngle(lug1, propLug1.CenterPoint, propRoller1.CenterPoint, find1 == true ? collision1 : null);
                AddAngle(lug2, propLug2.CenterPoint, propRoller2.CenterPoint, find2 == true ? collision2 : null);
            }

            vizcore3d.EndUpdate();

            if (find == true && StopTurnOver == true) backgroundWorkerTurnOver.CancelAsync();

            Application.DoEvents();
        }
Ejemplo n.º 9
0
        private void btnDisassemblyGhost_Click(object sender, EventArgs e)
        {
            List <VIZCore3D.NET.Data.Node> stage41 = vizcore3d.Object3D.Find.QuickSearch(new List <string>()
            {
                "STAGE_4_1"
            }, false, true, false, false, true, false);

            vizcore3d.Object3D.Color.SetColorAndAlpha(stage41, Color.White, 20);
            List <VIZCore3D.NET.Data.Node> stage4 = vizcore3d.Object3D.Find.QuickSearch(new List <string>()
            {
                "STAGE_4"
            }, false, true, false, false, true, false);

            VIZCore3D.NET.Data.Vector3D         v4    = new VIZCore3D.NET.Data.Vector3D(0, 5000, 0);
            VIZCore3D.NET.Data.Object3DProperty prop4 = vizcore3d.Object3D.GeometryProperty.FromNode(stage4[0], false);
            vizcore3d.Object3D.Transform.Move(stage4, v4);
            System.Threading.Thread.Sleep(500);

            List <VIZCore3D.NET.Data.Node> stage21 = vizcore3d.Object3D.Find.QuickSearch(new List <string>()
            {
                "STAGE_2_1"
            }, false, true, false, false, true, false);

            vizcore3d.Object3D.Color.SetColorAndAlpha(stage21, Color.White, 20);
            List <VIZCore3D.NET.Data.Node> stage2 = vizcore3d.Object3D.Find.QuickSearch(new List <string>()
            {
                "STAGE_2"
            }, false, true, false, false, true, false);

            VIZCore3D.NET.Data.Vector3D         v2    = new VIZCore3D.NET.Data.Vector3D(-5000, 0, 0);
            VIZCore3D.NET.Data.Object3DProperty prop2 = vizcore3d.Object3D.GeometryProperty.FromNode(stage2[0], false);
            vizcore3d.Object3D.Transform.Move(stage2, v2);
            System.Threading.Thread.Sleep(500);

            List <VIZCore3D.NET.Data.Node> stage31 = vizcore3d.Object3D.Find.QuickSearch(new List <string>()
            {
                "STAGE_3_1"
            }, false, true, false, false, true, false);

            vizcore3d.Object3D.Color.SetColorAndAlpha(stage31, Color.White, 20);
            List <VIZCore3D.NET.Data.Node> stage3 = vizcore3d.Object3D.Find.QuickSearch(new List <string>()
            {
                "STAGE_3"
            }, false, true, false, false, true, false);

            VIZCore3D.NET.Data.Vector3D         v3    = new VIZCore3D.NET.Data.Vector3D(8000, 0, 0);
            VIZCore3D.NET.Data.Object3DProperty prop3 = vizcore3d.Object3D.GeometryProperty.FromNode(stage3[0], false);
            vizcore3d.Object3D.Transform.Move(stage3, v3);
            System.Threading.Thread.Sleep(500);

            List <VIZCore3D.NET.Data.Node> stage11 = vizcore3d.Object3D.Find.QuickSearch(new List <string>()
            {
                "STAGE_1_1"
            }, false, true, false, false, true, false);

            vizcore3d.Object3D.Color.SetColorAndAlpha(stage11, Color.White, 20);
            List <VIZCore3D.NET.Data.Node> stage1 = vizcore3d.Object3D.Find.QuickSearch(new List <string>()
            {
                "STAGE_1"
            }, false, true, false, false, true, false);

            VIZCore3D.NET.Data.Vector3D         v1    = new VIZCore3D.NET.Data.Vector3D(0, 0, 5000);
            VIZCore3D.NET.Data.Object3DProperty prop1 = vizcore3d.Object3D.GeometryProperty.FromNode(stage3[0], false);
            vizcore3d.Object3D.Transform.Move(stage1, v1);
            System.Threading.Thread.Sleep(500);

            vizcore3d.View.FitToView();
        }
        public GeometryPropertyDialog(VIZCore3D.NET.Data.Object3DProperty prop)
        {
            InitializeComponent();

            propertyGrid.SelectedObject = prop;
        }