예제 #1
0
        public override void OnFace(TopoShape face)
        {
            ++nShapeCount;
            nodeStack.Peek().Nodes.Add(String.Format("{0}", nShapeCount), String.Format("Face {0}", nShapeCount));

            SceneNode node = renderView.ShowGeometry(face, nShapeCount);

            node.SetFaceStyle(faceStyle);

            GeomSurface gs = new GeomSurface();

            gs.Initialize(face);
            if (gs.IsUClosed() || gs.IsVClosed())
            {
                //SceneNode node = renderView.ShowGeometry(face, nShapeCount);
                //node.SetFaceStyle(faceStyle);
                WireClassifier wc = new WireClassifier();
                if (!wc.Initialize(face))
                {
                    return;
                }

                var holes = wc.GetInnerWires();
                for (int ii = 0, len = holes.Size(); ii < len; ++ii)
                {
                    var holeEdge = holes.GetAt(ii);
                    ++nShapeCount;
                    var holeNode = renderView.ShowGeometry(holeEdge, nShapeCount);
                    holeNode.SetLineStyle(holeStyle);
                }
            }



            //var outer = wc.GetOuterWire();
            //TopoExplor te = new TopoExplor();
            //var edges = te.ExplorEdges(outer);
            //for (int ii = 0, len = edges.Size(); ii < len; ++ii)
            //{
            //    var edge = edges.GetAt(ii);
            //    GeomCurve curve = new GeomCurve();
            //    curve.Initialize(edge);
            //    if (curve.IsClosed())
            //    {
            //        var holeNode = renderView.ShowGeometry(edge, ++nShapeCount);
            //        holeNode.SetLineStyle(holeStyle);
            //    }
            //}
        }