예제 #1
0
 public static void RemoveFrom(Graphics.IView view)
 {
     view.SceneGraph.CameraScenes
     .Where(scene => scene is CompassScene)
     .ForEach(scene => ((CompassScene)scene).View = null);
     view.SceneGraph.CameraScenes.RemoveAll(scene => scene is CompassScene);
 }
예제 #2
0
 public static void RemoveFrom(Graphics.IView view)
 {
     view.SceneGraph.ForgroundScenes
     .Where(scene => scene is RulerScene)
     .ForEach(scene => ((RulerScene)scene).View = null);
     view.SceneGraph.ForgroundScenes.RemoveAll(scene => scene is RulerScene);
 }
예제 #3
0
 public static void PutTo(Graphics.IView view)
 {
     if (!view.SceneGraph.ForgroundScenes.Any(scene => scene is RulerScene))
     {
         view.SceneGraph.ForgroundScenes.Add(new RulerScene {
             View = view
         });
     }
 }
예제 #4
0
 public static void PutTo(Graphics.IView view)
 {
     if (!view.SceneGraph.CameraScenes.Any(scene => scene is CompassScene))
     {
         var scene = new CompassScene {
             View = view
         };
         view.SceneGraph.CameraScenes.Add(scene);
         scene.FixPos();
     }
 }
예제 #5
0
        protected void AddView(Graphics.IView view)
        {
            var setting = ViewSetting.Get(_docviews);

            if (setting.ShowCompass)
            {
                CompassScene.PutTo(view);                     // コンパス
            }
            if (setting.ShowRuler)
            {
                RulerScene.PutTo(view);                       // ルーラー
            }
            _docviews.AddView(view, this.ViewSetting.CreateViewOperation(() => _contextMenuFactory()));
        }
예제 #6
0
        IEnumerator <Ctrl.IOperation> DragPlane(Graphics.IView view, MouseEventArgs e)
        {
            var plane  = this.GetQuadPlanes()[_highlightIndex];
            var sphere = _docviews.WorldDocumentScene.BoundingSphere;
            var range  = new Hisui.Geom.Range(-sphere.Radius, sphere.Radius);
            var z0     = range.ParamToValue(this.Position);

            var eyeshot1 = view.Camera.GetEyeshotLine(e.Location);
            var y1       = GetIntersection(plane, eyeshot1).y;

            var up = new Ctrl.LButtonUp(view.Events);

            up.MouseMove += (ss, ee) =>
            {
                var eyeshot2 = view.Camera.GetEyeshotLine(ee.Location);
                var z        = z0 + GetIntersection(plane, eyeshot2).y - y1;
                this.Position = range.ValueToParam(z);
                view.Invalidate();
            };
            yield return(up);

            view.Invalidate();
        }
예제 #7
0
 protected void AddView(Graphics.IView view, int[] targetPath)
 {
     this.AddView(view);
     _docviews.ActiveViewTargetPath = targetPath;
 }