Example #1
0
        public void Add(GeoPoint2D pnt, System.Drawing.Color color, string debugHint)
        {
            Point point = Point.Construct();

            point.Location = new GeoPoint(pnt);
            point.Symbol   = PointSymbol.Circle;
            ColorDef cd = new ColorDef(color.Name, color);

            point.ColorDef = cd;
            StringProperty sp = new StringProperty(debugHint, "Debug.Hint");

            point.UserData.Add("Debug", sp);
            toShow.Add(point);
        }
Example #2
0
        public void Add(GeoPoint pnt, System.Drawing.Color color, int debugHint)
        {
            Point point = Point.Construct();

            point.Location = pnt;
            point.Symbol   = PointSymbol.Circle;
            ColorDef cd = new ColorDef(color.Name, color);

            point.ColorDef = cd;
            IntegerProperty ip = new IntegerProperty(debugHint, "Debug.Hint");

            point.UserData.Add("Debug", ip);
            toShow.Add(point);
        }
Example #3
0
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            IDebugForm form = CF.DebugForm;
            Model      m    = form.Model;

            GeoPoint p   = (GeoPoint)objectProvider.GetObject();
            Point    pnt = Point.Construct();

            pnt.Location = p;
            pnt.Symbol   = PointSymbol.Cross;
            VisualizerHelper.AssertColor(pnt);
            m.Add(pnt);

            form.ShowDialog(windowService);
        }
        public Shell GetInsidePart()
        {
            closedBorder.Flatten();
            if (!closedBorder.IsClosed)
            {
                Line l = Line.Construct();
                l.SetTwoPoints(closedBorder.EndPoint, closedBorder.StartPoint);
                closedBorder.Add(l);
            }
            vertexToFace = new Face[closedBorder.CurveCount];
            for (int i = 0; i < closedBorder.CurveCount; i++)
            {
                Face fc = FindClosestFace(closedBorder.Curve(i).StartPoint);
                if (fc == null)
                {
                    throw new SplitShellWithCurvesException();
                }
                vertexToFace[i] = fc;
            }
            all2DCurves  = new Dictionary <Face, List <ICurve2D> >();
            splitedEdges = new Dictionary <Edge, List <double> >();
            for (int i = 0; i < vertexToFace.Length; i++)
            {
                InsertCurve(i);
            }
            // jetzt die Faces beschneiden und eine neue Shell bauen
            Vertex[] vertices = shell.Vertices;
            outsideVertices = new Set <Vertex>();
            for (int i = 0; i < vertices.Length; i++)
            {   // wenn der Vertex eine Außenkante hat, dann gilt er als außenliegend
                Edge[] vedges = vertices[i].Edges;
                for (int j = 0; j < vedges.Length; j++)
                {
                    if (vedges[j].SecondaryFace == null)
                    {
                        FollowVertex(vertices[j]);
                    }
                }
            }
#if DEBUG
            DebuggerContainer dc = new DebuggerContainer();
            foreach (Vertex vtx in outsideVertices)
            {
                Point pnt = Point.Construct();
                pnt.Location = vtx.Position;
                pnt.Symbol   = PointSymbol.Circle;
                dc.Add(pnt, vtx.GetHashCode());
            }
#endif
            // alle Faces, die aufgesplitted werden müssen:
            Set <Face> splittedFaces = new Set <Face>();
            foreach (Edge edge in splitedEdges.Keys)
            {
                splittedFaces.Add(edge.PrimaryFace);
                if (edge.SecondaryFace != null)
                {
                    splittedFaces.Add(edge.SecondaryFace);
                }
            }
            resultingFaces = new List <Face>();
            for (int i = 0; i < shell.Faces.Length; i++)
            {
                Face face = shell.Faces[i];
                if (splittedFaces.Contains(face))
                {
                    AddSplittedFace(face);
                }
                else
                {
                    if (!outsideVertices.Contains(face.Vertices[0]))
                    {
                        resultingFaces.Add(face.Clone() as Face);
                    }
                }
            }
            GeoObjectList res = Make3D.SewFacesAndShells(new GeoObjectList(resultingFaces.ToArray()));
            if (res.Count == 1)
            {
                return(res[0] as Shell);
            }
            return(null);
        }