Esempio n. 1
0
        public void ModifyOpeningOfSelectedPolygon(ZoneOpeningVis _zovToModify, Point3D _p1, Point3D _p2, float _jambHeight, float _clearHeight)
        {
            if (_zovToModify == null)
            {
                return;
            }

            int n = this.SelectedPolygon.Polygon_Coords.Count;

            if (_zovToModify.IndInOwner < 0 || _zovToModify.IndInOwner > (n - 1))
            {
                return;
            }

            Point3D vert = this.SelectedPolygon.Polygon_Coords[_zovToModify.IndInOwner];
            float   distFromPrevVertex        = (_p1.ToVector3() - vert.ToVector3()).Length();
            float   lengthAlongPolygonSegment = (_p2.ToVector3() - _p1.ToVector3()).Length();

            bool success = this.SelectedPolygon.ModifyOpeningDimensions(_zovToModify.IDInOwner, distFromPrevVertex, lengthAlongPolygonSegment, _jambHeight, _clearHeight);

            if (success)
            {
                this.OpeningsOfSelectedPolygon = this.SelectedPolygon.ExtractOpeningsForDisplay();
            }
        }
Esempio n. 2
0
        public void RemoveOpeningFromSelectedPolygon(ZoneOpeningVis _zovToRemove)
        {
            if (_zovToRemove == null)
            {
                return;
            }

            bool success = this.SelectedPolygon.RemoveOpening(_zovToRemove.IDInOwner);

            if (success)
            {
                this.OpeningsOfSelectedPolygon = this.SelectedPolygon.ExtractOpeningsForDisplay();
            }
        }
Esempio n. 3
0
        public void SelectOpening(ZoneOpeningVis _zov)
        {
            if (this.OpeningsOfSelectedPolygon == null || this.OpeningsOfSelectedPolygon.Count < 1)
            {
                return;
            }

            foreach (var opening in this.OpeningsOfSelectedPolygon)
            {
                if (_zov == null || _zov.ID != opening.ID)
                {
                    opening.IsSelected = false;
                }
                else
                {
                    opening.IsSelected = true;
                }
            }
        }