예제 #1
0
파일: Hierarchy.cs 프로젝트: Sliwson/gk2019
        public Hierarchy(TreeView treeView, PolygonManager polygonManager, RelationCreator relationCreator)
        {
            this.treeView        = treeView;
            this.polygonManager  = polygonManager;
            this.relationCreator = relationCreator;

            treeView.AfterSelect += ItemSelected;
            treeView.MouseClick  += HierarchyClick;
            treeView.MouseDown   += HierarchyMouseDown;
        }
예제 #2
0
파일: Form1.cs 프로젝트: Sliwson/gk2019
        public Form1()
        {
            InitializeComponent();

            polygonManager = new PolygonManager(canvas, ChangeCursor, ChangeStatusStrip);

            var relationCreator = new RelationCreator(errorLabel, (selectedEdge1, selectedEdge2));

            relationCreator.InitEvents(remove1, remove2, addEqualButton, addPerpendicularButton);

            hierarchyController = new Hierarchy(hierarchy, polygonManager, relationCreator);
            hierarchyController.Update();

            polygonManager.OnStructureChanged += hierarchyController.HandleHierarchyChange;
            polygonManager.Update();

            addEqualButton.Click         += UpdateAll;
            addPerpendicularButton.Click += UpdateAll;

            polygonManager.GetPolygons().Add(Polygon.GetBigSample());
            UpdateAll(this, null);
        }