示例#1
0
        private bool isContactedMovingParts()
        {
            List <CLine> listMovingPartLines = new List <CLine>();
            List <CLine> listFixedPartLines  = new List <CLine>();
            List <CLine> listAbsoluteLine    = null;
            CFace        face = null;

            foreach (CNode node in NodeList)
            {
                if (node.GetType().BaseType.Name == "CParts")
                {
                    CParts nodeParts = (CParts)node;

                    face = nodeParts.Face;

                    if (null != face)
                    {
                        listAbsoluteLine = face.AbsoluteLineList;

                        if (nodeParts.MovingPart == EMMoving.MOVING)
                        {
                            /// Moving Part 라인들을 하나의 Line List 에 담는다.
                            foreach (CLine line in listAbsoluteLine)
                            {
                                listMovingPartLines.Add(line);
                            }
                        }
                        else
                        {
                            /// Moving Part 라인들을 하나의 Line List 에 담는다.
                            foreach (CLine line in listAbsoluteLine)
                            {
                                listFixedPartLines.Add(line);
                            }
                        }
                    }
                }
            }

            CShapeTools shapeTools = new CShapeTools();

            for (int i = 0; i < listMovingPartLines.Count - 1; i++)
            {
                for (int j = i + 1; j < listFixedPartLines.Count; j++)
                {
                    if (true == shapeTools.isContacted(listMovingPartLines[i], listFixedPartLines[j]))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
示例#2
0
        public double calcShapeModelArea()
        {
            double dFaceArea = 0;
            double dSumArea = 0;

            CShapeTools shapeTools = new CShapeTools();

            foreach (CDataNode node in m_listDataNode)
            {
                if (node.GetType().BaseType.Name == "CShapeParts")
                {
                    dFaceArea = shapeTools.calcArea(((CShapeParts)node).Face);

                    dSumArea += dFaceArea;
                }
            }

            return dSumArea;
        }
示例#3
0
        private bool isIntersectedAllLines()
        {
            List <CLine> listLineAll      = new List <CLine>();
            List <CLine> listAbsoluteLine = null;
            CFace        face             = null;

            foreach (CNode node in NodeList)
            {
                if (node.GetType().BaseType.Name == "CParts")
                {
                    CParts nodeParts = (CParts)node;

                    face = nodeParts.Face;

                    if (null != face)
                    {
                        listAbsoluteLine = face.AbsoluteLineList;

                        /// 모든 라인들을 하나의 Line List 에 담는다.
                        foreach (CLine line in listAbsoluteLine)
                        {
                            listLineAll.Add(line);
                        }
                    }
                }
            }

            CShapeTools shapeTools = new CShapeTools();

            for (int i = 0; i < listLineAll.Count - 1; i++)
            {
                for (int j = i + 1; j < listLineAll.Count; j++)
                {
                    if (true == shapeTools.isIntersected(listLineAll[i], listLineAll[j]))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }