Ejemplo n.º 1
0
        public static void Bunny(Model model)
        {
            ReadFile readFile = new ReadFile(MainWindow.GetAssetsPath() + "Bunny.eye");

            readFile.DoWork();

            // scales file contents by 100
            foreach (Entity entity in readFile.Entities)
            {
                entity.Scale(100, 100, 100);
            }

            readFile.AddToScene(model);

            if (model.Entities.Count > 0 && model.Entities[0] is FastPointCloud)
            {
                FastPointCloud fpc = (FastPointCloud)model.Entities[0];

                fpc.Rotate(Math.PI / 2, Vector3D.AxisX, Point3D.Origin);

                model.Entities.Regen();

                model.ZoomFit();

                BallPivoting bp = new BallPivoting(fpc);

                model.StartWork(bp);
            }
        }
Ejemplo n.º 2
0
        //private void Model1_MouseDoubleClick(object sender, MouseEventArgs e)
        //{
        //    if(model1.ObjectManipulator.Visible)
        //    {
        //        model1.ObjectManipulator.Apply();
        //        model1.Entities.Regen();
        //        model1.Invalidate();
        //    }
        //    else
        //    {
        //        // 마우스 아래에 있는 뭔가(객체, 라벨등..)을 찾음.
        //        var something = model1.GetItemUnderMouseCursor(e.Location);

        //        // 뭔가의 아이템이 객체라면?
        //        if(something.Item is Entity)
        //        {
        //            // 객체 리스트에 뭔가의 아이템을 객체로 변환해서 추가
        //            var entities = new List<Entity>();
        //            Entity ent = something.Item as Entity;
        //            entities.Add(ent);

        //            // 기본 변형정보
        //            Transformation trans = new Transformation();
        //            trans.Identity();

        //            // 객체 편집 도구를 활성화
        //            model1.ObjectManipulator.Enable(trans, true, entities);
        //        }
        //    }
        //}

        private void Model1_WorkCompleted(object sender, WorkCompletedEventArgs e)
        {
            if (e.WorkUnit is ReadFile)
            {
                ReadFile rf = e.WorkUnit as ReadFile;
                rf.AddToScene(model1);
            }
        }
Ejemplo n.º 3
0
        private void AddToScene(ReadFile rfa)
        {
            RegenOptions ro = new RegenOptions();

            ro.Async = AsyncRegen;

            rfa.AddToScene(model1, ro);

            _skipZoomFit = rfa.FileSerializer.FileBody.Camera != null;

            if (!AsyncRegen)
            {
                EnableButtonsAndRefresh();
            }
        }