Exemple #1
0
        private bool FinalOutlinContainseRefOutline(
            Wall toCheckdWall, Element originalSupporter, List <Element> loopSupporterList,
            out List <Element> remainList)
        {
            // Get outline of the ref volumn of the selected wall
            BoundingBoxXYZ ibb        = toCheckdWall.get_BoundingBox(_auxiliary3DView);
            double         offset     = UnitUtils.Convert(20, DisplayUnitType.DUT_CENTIMETERS, DisplayUnitType.DUT_DECIMAL_FEET);
            XYZ            newMin     = new XYZ(ibb.Min.X, ibb.Min.Y, ibb.Min.Z - DISTENCE_CONTINUOUS_SUPPORTER);
            XYZ            newMax     = new XYZ(ibb.Max.X, ibb.Max.Y, ibb.Min.Z);
            Outline        refOutline = new Outline(newMin, newMax);

            BoundingBoxXYZ originalSupporterBB      = originalSupporter.get_BoundingBox(_auxiliary3DView);
            Outline        orignialSupporterOutline = new Outline(originalSupporterBB.Min, originalSupporterBB.Max);
            Outline        finalOutline             = orignialSupporterOutline;

            remainList = new List <Element>();

            foreach (Element supporter in loopSupporterList)
            {
                BoundingBoxXYZ bb = supporter.get_BoundingBox(_auxiliary3DView);
                Outline        supporterOutline = new Outline(bb.Min, bb.Max);

                if (finalOutline.Intersects(supporterOutline, DISTENCE_CONTINUOUS_SUPPORTER))
                {
                    if (!supporterOutline.Equals(finalOutline))
                    {
                        finalOutline.AddPoint(bb.Min);
                        finalOutline.AddPoint(bb.Max);
                    }
                }
                else
                {
                    remainList.Add(supporter);
                }
            }

            return(finalOutline.ContainsOtherOutline(refOutline, TOLERENCE_CONTAINED_BY_SUPPORTER));
        }