Exemplo n.º 1
0
        private void RemoveRelationClick(object sender, EventArgs e)
        {
            if (!(structureSelected is Edge))
            {
                return;
            }

            var edge = structureSelected as Edge;

            if (edge.UnderlyingPolygon == null)
            {
                return;
            }

            edge.UnderlyingPolygon.RemoveRelation(edge);
            Update();
            polygonManager.Update();
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 private void UpdateAll(object sender, EventArgs a)
 {
     hierarchyController.Update();
     polygonManager.Update();
 }