Example #1
0
 private void drawCloud(TSDrg.PointList pointList, ViewBase view, string attributesFile)
 {
     TSDrg.Cloud cloud = new TSDrg.Cloud(view, pointList, new Cloud.CloudAttributes(attributesFile));
     cloud.Attributes.Line.Color = TSDrg.DrawingColors.Red;
     cloud.Insert();
     view.GetDrawing().CommitChanges();
 }
        private static void createClouds(List <TSD.Cloud> input, List <TSD.Cloud> output, TSD.ViewBase inputView, TSD.ViewBase outputView)
        {
            foreach (TSD.Cloud inputPoly in input)
            {
                TSD.PointList pts = new TSD.PointList();

                foreach (T3D.Point pt in inputPoly.Points)
                {
                    T3D.Point temp = __GeometryOperations.applyGlobalOffset(pt);
                    pts.Add(temp);
                }

                bool found = false;
                bool same  = true;
                foreach (TSD.Cloud outputPoly in output)
                {
                    if (outputPoly.Points.Count == pts.Count)
                    {
                        if (outputPoly.Points.Count != 0)
                        {
                            for (int i = 0; i < outputPoly.Points.Count; i++)
                            {
                                T3D.Point oldpt = outputPoly.Points[0];
                                T3D.Point newpt = pts[0];

                                if (__GeometryOperations.compare2Points(oldpt, newpt) == false)
                                {
                                    same = false;
                                    break;
                                }
                            }

                            if (same == true)
                            {
                                found = true;
                                break;
                            }

                            for (int i = 0; i < outputPoly.Points.Count; i++)
                            {
                                T3D.Point oldpt = outputPoly.Points[0];
                                T3D.Point newpt = pts[pts.Count - i - 1];

                                if (__GeometryOperations.compare2Points(oldpt, newpt) == false)
                                {
                                    same = false;
                                    break;
                                }
                            }

                            if (same == true)
                            {
                                found = true;
                                break;
                            }
                        }
                    }
                }

                if (found == false)
                {
                    TSD.Cloud outputLine = new TSD.Cloud(outputView, pts, inputPoly.Attributes);
                    outputLine.Attributes = inputPoly.Attributes;
                    outputLine.Insert();
                }
            }
        }
Example #3
0
        public void addOneObject(TSD.DrawingObject dro)
        {
            if (dro is TSD.Mark)
            {
                TSD.Mark current = dro as TSD.Mark;
                markHandler(current);
            }

            else if (dro is TSD.StraightDimensionSet)
            {
                TSD.StraightDimensionSet current = dro as TSD.StraightDimensionSet;
                _StraightDimentionSet    temp    = new _StraightDimentionSet(current);
                straightDimSets.Add(temp);
            }

            else if (dro is TSD.SectionMark)
            {
                TSD.SectionMark current = dro as TSD.SectionMark;
                _SectionMark    temp    = new _SectionMark(current);
                sectionMarks.Add(temp);
            }

            else if (dro is TSD.DetailMark)
            {
                TSD.DetailMark current = dro as TSD.DetailMark;
                detailMarks.Add(current);
            }

            else if (dro is TSD.Text)
            {
                TSD.Text current = dro as TSD.Text;
                txt.Add(current);
            }

            else if (dro is TSD.Arc)
            {
                TSD.Arc current = dro as TSD.Arc;
                arcs.Add(current);
            }

            else if (dro is TSD.Line)
            {
                TSD.Line current = dro as TSD.Line;
                lines.Add(current);
            }

            else if (dro is TSD.Polyline)
            {
                TSD.Polyline current = dro as TSD.Polyline;
                polylines.Add(current);
            }

            else if (dro is TSD.Circle)
            {
                TSD.Circle current = dro as TSD.Circle;
                circles.Add(current);
            }

            else if (dro is TSD.Cloud)
            {
                TSD.Cloud current = dro as TSD.Cloud;
                clouds.Add(current);
            }

            else if (dro is TSD.Rectangle)
            {
                TSD.Rectangle current = dro as TSD.Rectangle;
                rectangles.Add(current);
            }

            else if (dro is TSD.Polygon)
            {
                TSD.Polygon current = dro as TSD.Polygon;
                polygons.Add(current);
            }

            else if (dro is TSD.TextFile)
            {
                TSD.TextFile current = dro as TSD.TextFile;
                txtFiles.Add(current);
            }

            else if (dro is TSD.DwgObject)
            {
                TSD.DwgObject current = dro as TSD.DwgObject;
                dwgRefs.Add(current);
            }
        }