Esempio n. 1
0
        public void WriteLineWithAssociatedLabelDisplayTest()
        {
            var file  = new IgesFile();
            var line  = new IgesLine();
            var label = new IgesLocation(); // cheating and using an IgesLocation as a fake label type

            line.LabelDisplay = new IgesLabelDisplayAssociativity();
            line.LabelDisplay.LabelPlacements.Add(
                new IgesLabelPlacement(new IgesPerspectiveView(), new IgesPoint(1, 2, 3), new IgesLeader(), 7, label));
            file.Entities.Add(line);
            Assert.True(ReferenceEquals(line, line.LabelDisplay.AssociatedEntity));
            VerifyFileContains(file, @"
     410       1       0       0       0                        00000100D      1
     410       0       0       2       1                                D      2
     214       3       0       0       0                        00000100D      3
     214       0       0       1       1                                D      4
     116       4       0       0       0                        00000000D      5
     116       0       0       1       0                                D      6
     402       5       0       0       0                        00000000D      7
     402       0       0       1       5                                D      8
     110       6       0       0       0                       700000000D      9
     110       0       0       1       0                                D     10
410,0,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0,         1P      1
0.,0.;                                                                 1P      2
214,0,0.,0.,0.,0.,0.;                                                  3P      3
116,0.,0.,0.;                                                          5P      4
402,1,1,1.,2.,3.,3,7,5;                                                7P      5
110,0.,0.,0.,0.,0.,0.;                                                 9P      6
");
        }
Esempio n. 2
0
        public static IgesLocation ToIgesLocation(this Location location)
        {
            var result = new IgesLocation()
            {
                X = location.Point.X,
                Y = location.Point.Y,
                Z = location.Point.Z
            };

            AssignColor(result, location.Color);
            return(result);
        }
Esempio n. 3
0
 public static Location ToLocation(this IgesLocation point)
 {
     return(new Location(new Point(point.X, point.Y, point.Z), GetColor(point), point));
 }